/* ChicDaisy Content Engine dashboard. Layout: fixed sidebar on desktop, top bar + slide-down nav on phones. */
:root {
  --bg: #f4f6f6;
  --surface: #ffffff;
  --fg: #172120;
  --muted: #5a6865;
  --line: #dbe2e0;
  --accent: #2f6f4e;
  --accent-fg: #ffffff;
  --accent-soft: #e3f0e8;
  --daisy: #f6c343;
  --good: #1f7a3d;
  --good-soft: #e3f3e8;
  --warn: #9a5b00;
  --warn-soft: #fbf0dc;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1514; --surface: #162020; --fg: #e3ebe9; --muted: #98a9a4; --line: #283533;
    --accent: #7fc8a0; --accent-fg: #0d1f16; --accent-soft: #19301f;
    --good: #6fd08f; --good-soft: #15291c; --warn: #f0b25a; --warn-soft: #2e2414; --bad: #ff8a80; --bad-soft: #331917;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; padding: 0 10px; color: var(--fg); text-decoration: none; }
.brand .logo { flex: none; }
.brand small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--fg); text-decoration: none; }
.nav a:hover { background: var(--bg); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav { gap: 12px; }
.nav-group { display: grid; gap: 2px; }
.nav-group + .nav-group { border-top: 1px solid var(--line); padding-top: 12px; }
/* Section labels in the logo's colors: green text with a daisy-yellow dot, so they don't read as links */
.nav-heading { display: flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); padding: 0 10px 4px; }
.nav-heading::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--daisy); box-shadow: 0 0 0 2px var(--accent-soft); flex: none; }
.nav .badge { min-width: 1.5em; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: .75rem; font-weight: 700; text-align: center; }
.sidebar .foot { margin-top: auto; display: grid; gap: 6px; padding: 0 10px; font-size: .9rem; }
.sidebar .foot a { color: var(--muted); text-decoration: none; }
.sidebar .foot a:hover { color: var(--fg); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-align: left; }
.linkbtn:hover { color: var(--fg); }

.topbar { display: none; }
main.content { padding: 32px 40px 64px; max-width: 1100px; min-width: 0; }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .shell.open .sidebar { display: flex; }
  .topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
  .topbar .brand { padding: 0; }
  main.content { padding: 20px 16px 48px; }
}

/* Type */
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
.lede { color: var(--muted); margin: 0 0 24px; max-width: 65ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .88em; }

/* Pieces */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card p:last-child { margin-bottom: 0; }
.stack { display: grid; gap: 16px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

.statusrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.statusrow:last-child { border-bottom: 0; }

.notice { padding: 12px 14px; border-radius: 6px; margin: 0 0 16px; }
.notice.error { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--good-soft); color: var(--good); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.list th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.tablewrap { overflow-x: auto; }

/* Forms */
form.stack { max-width: 420px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=password] { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); width: 100%; }
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.btn { font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 6px; border: 1px solid transparent; background: var(--accent); color: var(--accent-fg); cursor: pointer; justify-self: start; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 380px; }
.login .brand { padding: 0; margin-bottom: 18px; display: block; }
.login form.stack { max-width: none; }
.login .btn { justify-self: stretch; }

/* M1: setup pages */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between h1, .row-between h2 { margin-bottom: 0; }
.crumbs { margin: 0 0 6px; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.small { font-size: .85rem; }
.mt { margin-top: 12px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 0; }
a.linkcard { display: block; color: inherit; text-decoration: none; }
a.linkcard:hover { border-color: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 20px; margin: 14px 0; }
.facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.facts dd { margin: 2px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
details.inline > summary { list-style: none; }
details.inline > summary::-webkit-details-marker { display: none; }
details.inline[open] { flex-basis: 100%; }
details.inline[open] form { margin-top: 12px; }
details > summary { cursor: pointer; }

form.stack.wide, .style-form { max-width: none; }
textarea, select, input[type=time], input[type=number] { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); width: 100%; }
textarea { resize: vertical; line-height: 1.45; }
textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[type=color] { width: 100%; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
label .hint { display: block; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px 16px; align-items: end; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 6px; font-weight: 400; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice.disabled { opacity: .5; cursor: not-allowed; }
.choice input { margin-top: 4px; }
.choice strong { display: block; }
.card > h2 + label, .card form > h2 { margin-top: 8px; }

.style-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 12px; }
.style-form { display: grid; gap: 14px; align-content: start; }
@media (max-width: 1000px) { .style-layout { grid-template-columns: minmax(0, 1fr); } }
.slides { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.slides a { flex: 0 0 min(70%, 260px); scroll-snap-align: start; }
.slides img { display: block; width: 100%; border-radius: 6px; border: 1px solid var(--line); }

.htmx-indicator { display: none; }
.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { display: block; }

/* Spend card */
.spend-figures { display: flex; gap: 28px; margin: 6px 0 14px; flex-wrap: wrap; }
.spend-figures > div { display: grid; }
.big { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
progress.budget { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 999px; background: var(--bg); overflow: hidden; }
progress.budget::-webkit-progress-bar { background: var(--bg); border-radius: 999px; }
progress.budget::-webkit-progress-value { background: var(--good); border-radius: 999px; }
progress.budget::-moz-progress-bar { background: var(--good); border-radius: 999px; }
progress.budget.warn::-webkit-progress-value { background: var(--warn); }
progress.budget.warn::-moz-progress-bar { background: var(--warn); }
progress.budget.over::-webkit-progress-value { background: var(--bad); }
progress.budget.over::-moz-progress-bar { background: var(--bad); }
table.list.compact th, table.list.compact td { padding: 7px 6px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.inline-form label { font-weight: 600; font-size: .9rem; }
.inline-form input[type=number] { width: 110px; }

/* Topics page: expandable topic with a table of its streams */
details.topic > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; list-style: none; }
details.topic > summary::-webkit-details-marker { display: none; }
.topic-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 1.05rem; }
.topic-title::before { content: "▸"; color: var(--muted); transition: transform .15s; display: inline-block; }
details.topic[open] .topic-title::before { transform: rotate(90deg); }
details.topic[open] > summary { margin-bottom: 12px; }
table.streams td { vertical-align: top; }
table.streams td:first-child { white-space: nowrap; }
table.streams td:nth-child(3) { min-width: 240px; }
table.streams .clamp { margin: 0; }
@media (prefers-reduced-motion: reduce) { .topic-title::before { transition: none; } }

/* Help button + pop-up */
main.content { position: relative; }
.help-launch { position: absolute; top: 28px; right: 40px; padding: 6px 14px; }
main.content > h1:first-of-type, main.content > .crumbs + h1, main.content > .crumbs + .row-between { padding-right: 90px; }
@media (max-width: 820px) { .help-launch { top: 16px; right: 16px; } }
.help-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(85vh, 900px); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.help-dialog::backdrop { background: rgba(10, 18, 17, .55); backdrop-filter: blur(2px); }
.help-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
.help-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.help-body { padding: 8px 24px 24px; overflow-y: auto; max-height: calc(min(85vh, 900px) - 60px); }
.help-body h2 { font-size: 1.3rem; margin: 14px 0 8px; }
.help-body h3 { font-size: 1rem; margin: 20px 0 6px; }
.help-body p, .help-body li { max-width: 68ch; }
.help-body ul, .help-body ol { padding-left: 1.3em; display: grid; gap: 6px; }
.help-body code, .guide code { font-family: var(--mono); font-size: .85em; background: var(--bg); padding: 1px 5px; border-radius: 4px; word-break: break-word; }
.help-foot { margin-top: 20px; }
details.guide { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 10px 0; background: var(--surface); }
details.guide > summary { font-weight: 600; color: var(--accent); }
details.guide[open] > summary { margin-bottom: 8px; }
details.guide ol, details.guide ul { padding-left: 1.3em; display: grid; gap: 8px; }

/* Posts */
table.posts td { vertical-align: middle; }
.thumbcell { width: 64px; }
.thumb { display: block; width: 52px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.thumb.empty { background: var(--bg); }
.error-text { color: var(--bad); }
.plainlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.big-slides a { flex-basis: min(80%, 340px); }
.caption { white-space: pre-line; max-width: 65ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .85rem; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.sources { padding-left: 1.2em; display: grid; gap: 8px; }
.sources li { overflow-wrap: anywhere; }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* Post editing */
.actionbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actionbar form { display: contents; }
a.btn { text-decoration: none; display: inline-block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 400; font-size: .9rem; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
fieldset.slide-edit { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 10px; }
fieldset.slide-edit legend { padding: 0 6px; margin: 0; }
fieldset.slide-edit.new { border-style: dashed; }
.working { border-color: var(--warn); }
.wide-card { grid-column: 1 / -1; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 600; padding: 10px 16px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--fg); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* The post carousel; in the "Edit manually" tab its slides become selectable */
#carousel .slide-pick { position: relative; display: block; flex: 0 0 min(75%, 300px); border: 3px solid transparent; border-radius: 9px; scroll-snap-align: start; }
#carousel .slide-pick img { display: block; width: 100%; border-radius: 6px; border: 1px solid var(--line); }
#carousel.selectable .slide-pick { cursor: pointer; }
#carousel.selectable .slide-pick.selected { border-color: var(--accent); }
.slide-num { position: absolute; top: 8px; left: 8px; font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--fg); }
#carousel .slide-pick.add { aspect-ratio: 4 / 5; display: grid; place-items: center; border: 2px dashed var(--line); color: var(--muted); font-weight: 600; text-decoration: none; }
#carousel .slide-pick.add.selected { border-color: var(--accent); color: var(--accent); }

/* Stream page */
details.advanced { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
details.advanced[open] > summary { margin-bottom: 10px; }
details.advanced .grid2 { margin-bottom: 12px; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px 18px; margin-bottom: 10px; }
.statgrid > div { display: grid; }
.small-btn { padding: 4px 10px; font-size: .85rem; }
tr.muted td { color: var(--muted); }
table.streams td.num, table.streams th.num { text-align: right; font-variant-numeric: tabular-nums; }

.published { border-color: var(--good); background: var(--good-soft); }

/* Profile picture */
.logo-block { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.logo-art { display: flex; gap: 14px; align-items: center; }
.logo-circle { width: 140px; height: 140px; border-radius: 50%; display: block; border: 1px solid var(--line); object-fit: cover; }
.logo-circle.empty { display: grid; place-items: center; background: var(--bg); color: var(--muted); font-size: .85rem; }
.logo-square { width: 110px; height: 110px; display: block; border-radius: 6px; border: 1px solid var(--line); }
.logo-side h3 { margin-top: 0; }
@media (max-width: 700px) { .logo-block { grid-template-columns: minmax(0, 1fr); } }

/* AI summary */
.pills { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.assess-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 900px) { .assess-grid { grid-template-columns: minmax(0, 1fr); } }
.assess-grid h3 { margin-top: 0; display: flex; gap: 8px; align-items: center; }
.score { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.score .pill { margin-left: 8px; align-self: center; }
.issues { padding-left: 1.1em; display: grid; gap: 10px; }

/* Trends */
.suggestion { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-top: 12px; }
.suggestion h3 { margin: 0; }
.suggestion p { margin: 6px 0; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.theme { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.theme p { margin: 6px 0; }

/* Charts (single series, theme tokens) */
figure.chart { margin: 8px 0 0; }
figure.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); }
.chart .end { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: default; }
.chart .endlabel { fill: var(--fg); font: 600 12px var(--font); font-variant-numeric: tabular-nums; }
.indexbar { vertical-align: middle; }
.indexbar .track { fill: var(--bg); }
.indexbar .above { fill: var(--accent); }
.indexbar .below { fill: var(--muted); }
.indexbar .typical { stroke: var(--fg); stroke-width: 1.5; }
table.perf td { vertical-align: middle; }

/* Alerts and summary */
.alerts { display: grid; gap: 8px; margin: 0 0 18px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; text-decoration: none; color: var(--fg); border: 1px solid var(--line); background: var(--surface); }
.alert.critical { border-color: var(--bad); background: var(--bad-soft); }
.alert.warning { border-color: var(--warn); background: var(--warn-soft); }
.alert:hover { filter: brightness(0.98); }
.alert-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--surface); background: var(--muted); }
.alert.critical .alert-icon { background: var(--bad); }
.alert.warning .alert-icon { background: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.summary .headline { font-size: 1.15rem; font-weight: 600; margin: 4px 0 12px; max-width: 70ch; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 8px 28px; }
.summary-grid h3 { margin: 4px 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.summary-grid ul, .summary-grid ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }

/* Home layout: one column of full-width sections, then two equal-height cards */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.two-col > .card { display: flex; flex-direction: column; gap: 12px; }
.two-col > .card > * { margin: 0; }
.card > h2:first-child, .card > .row-between:first-child { margin-bottom: 10px; }
.two-col > .card > h2:first-child, .two-col > .card > .row-between:first-child { margin-bottom: 0; }
.stack > .alerts { margin: 0; }
.lede + .stack { margin-top: 0; }

/* Look packs, looks table, profile grid preview */
.packs { border: 0; padding: 0; margin: 0; }
.packs legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.pack-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pack { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.pack .btn { align-self: flex-start; margin-top: auto; }
.swatches { display: flex; height: 18px; border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.swatches span { flex: 1; }
.looks-table input[type="text"] { min-width: 8em; }
.looks-table input[type="color"] { width: 44px; min-width: 44px; padding: 2px; }
.ig-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; max-width: 420px; }
.ig-grid figure { margin: 0; }
.ig-grid img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.ig-grid figcaption { font-size: 0.7rem; color: var(--muted); padding: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Stream page: collapsible sections with a one-line summary; posts page */
details.section > summary { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; list-style: none; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary h2 { margin: 0; font-size: 1.2rem; }
details.section > summary h2::before { content: "▸"; color: var(--muted); display: inline-block; width: 1.1em; transition: transform .15s; }
details.section[open] > summary h2::before { transform: rotate(90deg); }
details.section[open] > summary { margin-bottom: 14px; }
details.section > summary .hint { flex: 1 1 260px; min-width: 0; }
.time-edit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.time-edit input { font: inherit; font-size: .85rem; padding: 4px 6px; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }

.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 4px 0 8px; }
.filter-bar label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.filter-bar select { min-width: 240px; max-width: 100%; }

/* Keep last: anything marked hidden stays hidden, even when a layout rule (display: grid/flex) also matches it. */
[hidden] { display: none !important; }
