/* Eclectis (Eli): the design tokens as plain CSS, light and dark. */
:root {
  --background: #f6f2ea;
  --foreground: #1a2332;
  --card: #ffffff;
  --primary: #1e2a3a;
  --primary-foreground: #eef0f4;
  --muted: #eef0f4;
  --muted-foreground: #5a6778;
  --accent: #e4a843;
  --accent-foreground: #141d29;
  --accent-ink: #8a5a0c;
  --destructive: #dc2626;
  --border: #e2e5eb;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --display: "Fraunces", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0c1219;
    --foreground: #eef0f4;
    --card: #141d29;
    --primary: #eef0f4;
    --primary-foreground: #1a2332;
    --muted: #1e2a3a;
    --muted-foreground: #8b95a5;
    --accent-ink: #e4a843;
    --destructive: #ef4444;
    --border: #2d3b50;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-weight: 600; color: var(--foreground); }
.ink { color: var(--accent-ink); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { display: flex; justify-content: flex-end; }

/* Loading: a thin amber bar while any htmx request is in flight. */
#loadbar { position: fixed; inset: 0 0 auto; height: 3px; z-index: 50; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 50% 100%;
  background-repeat: no-repeat; transition: opacity .15s; }
#loadbar.htmx-request { opacity: 1; animation: sweep 0.9s linear infinite; }
@keyframes sweep { from { background-position: -50% 0; } to { background-position: 150% 0; } }
form.htmx-request .vbtn { opacity: .5; }

/* Header */
.topbar { display: flex; align-items: center; justify-content: space-between; max-width: 72rem; margin: 0 auto; padding: 1rem 1rem 0; }
.brand { font: 800 1.1rem var(--display); letter-spacing: -0.01em; }
.dot { color: var(--accent-ink); }
.link-btn { background: none; border: 0; color: var(--muted-foreground); font-size: 13px; }
.link-btn:hover { color: var(--foreground); }
.link-btn.danger:hover { color: var(--destructive, #c0392b); }

/* Page */
.wrap { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.wrap.narrow { max-width: 26rem; }
.title { margin: 0; font: 800 1.875rem/1.2 var(--display); letter-spacing: -0.02em; }
.lede { margin: .25rem 0 0; font-size: 13px; color: var(--muted-foreground); }
.panel { border: 1px solid var(--border); background: color-mix(in srgb, var(--card) 60%, transparent); border-radius: .75rem; padding: .75rem; }
.stack { display: grid; gap: .9rem; margin-top: 1.25rem; padding: 1.25rem; }
.alert { margin: 1.5rem 0 0; border: 1px solid color-mix(in srgb, var(--destructive) 40%, transparent);
  background: color-mix(in srgb, var(--destructive) 5%, transparent); border-radius: .5rem; padding: 1rem 1.25rem; font-size: 14px; }
.stack .alert { margin: 0; }
.notice, .empty { margin-top: 1.5rem; border: 1px solid var(--border); border-radius: .5rem; padding: 1.5rem; font-size: 14px; color: var(--muted-foreground); }
.empty { border-style: dashed; text-align: center; padding: 2.5rem 1.5rem; background: color-mix(in srgb, var(--card) 50%, transparent); }
.ink-link { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.ink-link.small { font-size: 12px; }

/* Filters */
.filters { margin: 1.25rem 0 1rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field > span:first-child { font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
.field.grow { flex: 1 1 100%; }
.input { border: 1px solid var(--border); background: var(--card); color: var(--foreground); border-radius: .375rem; padding: .375rem .75rem; font: inherit; font-size: 14px; min-width: 0; }
.input.mono { font-size: 12px; }
.search { position: relative; display: block; }
.search .input { width: 100%; padding-left: 2rem; }
.search-icon { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted-foreground); pointer-events: none; }
.field.grow-sm { flex: 1 1 12rem; }
select.input { width: 100%; }
.btn { height: 34px; border: 0; border-radius: .375rem; background: var(--primary); color: var(--primary-foreground); padding: 0 1rem; font-size: 14px; font-weight: 500; }
.btn:hover { opacity: .9; }
.group { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; }
.glabel { flex-basis: 100%; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); }
.chips { display: flex; gap: .375rem; max-width: 100%; min-width: 0; overflow-x: auto; padding-bottom: 2px; }
.chip { display: inline-flex; align-items: center; gap: .25rem; flex-shrink: 0; white-space: nowrap; max-width: 16rem; border: 1px solid var(--border);
  background: var(--card); color: var(--muted-foreground); border-radius: 999px; padding: .25rem .65rem; font-size: 12px; transition: border-color .15s, color .15s; }
.chip:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--foreground); }
.chip.on { border-color: var(--foreground); background: var(--foreground); color: var(--background); }
.chip.on.accent { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--foreground); font-weight: 600; }
.divider { display: none; width: 1px; height: 1rem; background: var(--border); margin: 0 .25rem; }
@media (min-width: 640px) {
  .panel.filters { padding: 1rem; }
  .field.grow { flex: 1 1 14rem; }
  .field.grow-sm select { width: 13rem; }
  .glabel { flex-basis: auto; width: 4rem; flex-shrink: 0; }
  .chips { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
  .divider { display: block; }
}

/* Icons */
.icon { width: 1em; height: 1em; flex-shrink: 0; }
.icon.xs { width: 12px; height: 12px; }
.icon.xxs { width: 10px; height: 10px; }
.icon.sm { width: 14px; height: 14px; }

/* Table (md and up) */
.table-wrap { display: none; overflow: hidden; border: 1px solid var(--border); border-radius: .5rem; background: var(--card); }
table.items { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.items thead tr { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 40%, transparent); }
.items th { white-space: nowrap; padding: .5rem .75rem; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.items th a:hover { color: var(--foreground); }
.arrow { margin-left: .25rem; }
.col-source { width: 10rem; } .col-score { width: 12rem; } .col-date { width: 9.5rem; } .col-vote { width: 6.5rem; text-align: right !important; }
.items tbody tr { border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); vertical-align: top; }
.items tbody tr:last-child { border-bottom: 0; }
.items td { padding: .625rem .75rem; }
.items td.source { font-size: 12px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items td.date { white-space: nowrap; font: 12px var(--mono); color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.items td.source a:hover, .meta a:hover { color: var(--foreground); text-decoration: underline; }
tr.top, li.top { background: color-mix(in srgb, var(--accent) 5%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.item-title { font-weight: 500; line-height: 1.35; color: var(--foreground); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a.item-title:hover { text-decoration-line: underline; }

/* Score */
.score { min-width: 0; }
.score-line { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; }
.unjudged { font-size: 12px; font-style: italic; color: var(--muted-foreground); }
.below { font: 14px var(--mono); color: var(--muted-foreground); }
.badge { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid; border-radius: .375rem; padding: 1px 6px; font: 700 12px var(--mono); font-variant-numeric: tabular-nums; }
.badge .words { font: 500 10px var(--sans); letter-spacing: .02em; }
.badge.exceptional { border-color: var(--accent); background: var(--accent); color: var(--accent-foreground); }
.badge.strong { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent-ink); }
.badge.routine { border-color: var(--border); background: var(--muted); color: var(--foreground); }
.flag { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; font-size: 10px; font-weight: 500; color: var(--muted-foreground); }
.flag.accent { border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent-ink); }
.interest { margin-top: 2px; font-size: 11px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Votes */
.votes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .375rem; }
.vbtn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted-foreground); transition: background .15s, border-color .15s, color .15s, transform .1s; }
.vbtn:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--foreground); }
.vbtn:active { transform: scale(.92); }
.vbtn.up[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-foreground); }
.vbtn.down[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); }
.vote-error { flex-basis: 100%; margin: 0; text-align: right; font-size: 11px; color: var(--destructive); }

/* Cards (below md) */
.cards { list-style: none; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: .5rem; background: var(--card); }
.card { display: flex; gap: .75rem; padding: 1rem; border-bottom: 1px solid var(--border); }
.card:last-child { border-bottom: 0; }
.card-body { min-width: 0; flex: 1; }
.card .votes { flex-shrink: 0; align-self: flex-start; padding-top: 2px; }
.meta { margin: .25rem 0 0; font-size: 12px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-score { margin-top: .5rem; }
@media (min-width: 768px) {
  .table-wrap { display: block; }
  .cards { display: none; }
}

/* Pager */
.pager { margin-top: .75rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; font-size: 12px; color: var(--muted-foreground); }
.pages { display: flex; align-items: center; gap: .25rem; }
.pg { border: 1px solid var(--border); background: var(--card); color: var(--foreground); border-radius: .25rem; padding: 1px 10px; }
.pg.on { border-color: var(--foreground); background: var(--foreground); color: var(--background); }
.pg.off { opacity: .4; }
.gap { padding: 0 .25rem; }

/* Nav */
.topbar { gap: 1rem; }
.nav { display: flex; gap: 1rem; margin-left: auto; font-size: 13px; }
.nav a { color: var(--muted-foreground); }
.nav a:hover { color: var(--foreground); }

/* Agent */
.agent-status { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0 1.25rem; padding: .6rem .9rem; border: 1px solid var(--border);
  border-radius: 999px; background: var(--card); width: fit-content; max-width: 100%; font-size: 13px; }
.status-word { font-weight: 600; }
.status-meta { color: var(--muted-foreground); }
.pulse { width: 9px; height: 9px; border-radius: 999px; background: var(--muted-foreground); flex-shrink: 0; }
.pulse.busy { background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: breathe 1.4s ease-out infinite; }
@keyframes breathe { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.wake { margin-top: 1rem; padding: 1.25rem; display: grid; gap: 1rem; justify-items: start; font-size: 14px; }
.agent-grid { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .agent-grid { grid-template-columns: minmax(0, 1fr) 20rem; } }
.section-title { margin: 0 0 .5rem; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); }
.agent-side .section-title { margin-top: 1.25rem; }
.btn.wide { width: 100%; }
.agent-items { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: .5rem; background: var(--card); overflow: hidden; }
.agent-items:empty::before { content: "Nothing judged yet. Eli is getting started…"; display: block; padding: 1.5rem; color: var(--muted-foreground); font-size: 14px; }
.agent-item { display: flex; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); animation: arrive .5s ease-out; }
.agent-item:last-child { border-bottom: 0; }
.agent-item.quiet { opacity: .55; }
.agent-item.top { background: color-mix(in srgb, var(--accent) 6%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.agent-item .badge { min-width: 1.75rem; justify-content: center; align-self: flex-start; margin-top: 1px; }
.badge.low { border-color: var(--border); color: var(--muted-foreground); }
.agent-item-body { min-width: 0; }
.agent-item .meta { display: flex; align-items: center; gap: .4rem; white-space: normal; }
.reason { margin: .3rem 0 0; font-size: 13px; color: var(--foreground); }
@keyframes arrive { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } }
.journal { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; max-height: 22rem; overflow-y: auto; font-size: 13px; }
.journal-line { display: grid; grid-template-columns: 4.2rem 1fr; gap: .4rem; animation: arrive .6s ease-out; border-radius: .25rem; }
.journal-line time { font: 11px var(--mono); color: var(--muted-foreground); padding-top: 2px; }
.memory { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: 12px; color: var(--muted-foreground); }
.memory li { border-left: 2px solid var(--border); padding-left: .5rem; }

/* Taste interview */
.interview { margin: 0 0 1.5rem; padding: 1.25rem; display: grid; gap: .9rem; border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
.interview.invite { grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 720px) { .interview.invite { grid-template-columns: minmax(0, 1fr) auto; } }
.interview.invite p { margin: .25rem 0 0; font-size: 14px; color: var(--muted-foreground); }
.interview-title { margin: 0; font: 800 1.25rem/1.2 var(--display); }
.interview-lede { margin: 0; font-size: 14px; color: var(--muted-foreground); }
.interview-form { display: grid; gap: .75rem; }
.question { margin: 0; border: 1px solid var(--border); border-radius: .5rem; background: var(--card); padding: .85rem 1rem; display: grid; gap: .5rem; min-width: 0; }
.question-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; }
.question-head .meta { margin: 0; }
.question-excerpt { margin: 0; font-size: 13px; color: var(--muted-foreground); line-height: 1.45; }
.question-answers { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.choices { display: flex; gap: .375rem; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-block; border: 1px solid var(--border); border-radius: 999px; padding: .3rem .8rem; font-size: 13px; color: var(--muted-foreground);
  background: var(--card); transition: background .12s, border-color .12s, color .12s, transform .1s; }
.choice:hover span { border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--foreground); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice input:checked + span { transform: scale(1.04); color: var(--foreground); font-weight: 600; }
.choice.up input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-foreground); }
.choice.meh input:checked + span { background: var(--muted); border-color: var(--foreground); }
.choice.down input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.input.why { flex: 1 1 14rem; font-size: 13px; padding: .3rem .7rem; }
.interview-form > .btn { justify-self: start; }
.btn.small { height: 30px; padding: 0 .85rem; font-size: 13px; }

.proposals { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.proposal { border: 1px solid var(--border); border-radius: .5rem; background: var(--card); padding: .85rem 1rem; display: grid; gap: .35rem; animation: arrive .5s ease-out; }
.proposal p { margin: 0; }
.proposal .op { justify-self: start; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; border-radius: 999px; padding: 2px 8px;
  border: 1px solid var(--border); color: var(--muted-foreground); }
.proposal .op.add { border-color: var(--accent); color: var(--accent-ink); }
.proposal .op.note { border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent-ink); }
.proposal .op.drop { border-color: var(--destructive); color: var(--destructive); }
.proposal-text { font-weight: 600; }
.proposal .was { font-size: 12px; color: var(--muted-foreground); text-decoration: line-through; }
.proposal.drop .proposal-text, .proposal:has(.op.drop) .proposal-text { text-decoration: line-through; }
.rationale { font-size: 13px; }
.evidence { font-size: 12px; color: var(--muted-foreground); }
.proposal-actions { display: flex; align-items: center; gap: .75rem; margin-top: .2rem; }
.decided { font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.proposal.accepted { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.proposal.rejected { opacity: .55; }

.flag.reaction.up { border-color: var(--accent); color: var(--accent-ink); }
.flag.reaction.down { border-color: var(--primary); color: var(--foreground); }
.memory.notes li { border-left-color: var(--accent); color: var(--foreground); }

/* Agent vs engine */
.compare-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.compare-stats { margin: 0 0 1rem; font-size: 13px; color: var(--muted-foreground); }
.compare-grid { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
@media (min-width: 900px) { .compare-grid { grid-template-columns: 1fr 1fr; } }
.top-list .agent-items { min-height: 4rem; }
.agent-item.shared { box-shadow: inset 3px 0 0 var(--accent); }
.empty.small { margin: 0; padding: 1rem; font-size: 13px; }
.verdict { margin: 0 0 1.5rem; padding: 1rem 1.25rem; display: grid; gap: .75rem; align-items: center; border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
@media (min-width: 720px) { .verdict { grid-template-columns: minmax(0, 1fr) auto; } }
.verdict .chip { font-size: 13px; padding: .35rem .9rem; cursor: pointer; }
.disagreement { align-items: flex-start; }
.dual { display: grid; grid-template-columns: auto auto; gap: .25rem .4rem; align-items: center; flex-shrink: 0; min-width: 6.5rem; }
.dual-label { font: 600 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); }
.journal-title { margin-top: 1.75rem; }
.journal.compact { max-height: 12rem; }
.fineprint { margin-top: 1rem; font-size: 11px; color: var(--muted-foreground); }
.compare-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

/* Live touches */
.num.bump { animation: bump .9s ease-out; border-radius: 3px; }
@keyframes bump { 0% { background: var(--accent); color: var(--accent-foreground); } 100% { background: transparent; } }
.progress { position: relative; display: inline-flex; align-items: center; width: 7.5rem; height: 18px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 70%, transparent); transition: width .6s ease; }
.progress-label { position: relative; width: 100%; text-align: center; font: 600 11px var(--mono); }
button[data-busy]:disabled { opacity: .75; cursor: progress; }
button[data-busy]:disabled { font-size: 0; }
button[data-busy]:disabled::after { content: attr(data-busy); font-size: 14px; }
.link-btn[data-busy]:disabled::after { font-size: 13px; }

/* Front door */
.landing { padding-top: 3rem; }
.title.big { font-size: clamp(2.2rem, 8vw, 3.2rem); }
.landing .lede { font-size: 16px; line-height: 1.55; margin-top: .75rem; }
.paths { display: grid; gap: .75rem; margin-top: 2rem; }
.path { display: grid; gap: .15rem; padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--card);
  transition: transform .12s, border-color .12s, box-shadow .12s; }
.path:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 6px 20px -12px rgb(0 0 0 / .35); }
.path.primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.path-title { font: 800 1.2rem/1.2 var(--display); }
.path-sub { font-size: 14px; opacity: .8; }
.path.primary .path-sub { opacity: .85; }
.input.about { width: 100%; resize: vertical; min-height: 9rem; line-height: 1.5; }

/* iPhone: 16px inputs (Safari zooms into anything smaller), roomier taps, no sideways scroll */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  .input, select.input, textarea.input, .input.why, .input.mono { font-size: 16px; }
  .btn { min-height: 44px; }
  .vbtn { width: 2.5rem; height: 2.5rem; }
  .choice span { padding: .55rem 1rem; font-size: 15px; }
  .chip { padding: .4rem .8rem; font-size: 13px; }
  .topbar { flex-wrap: wrap; row-gap: .4rem; }
  .nav { gap: .9rem; }
  .agent-status { border-radius: .75rem; }
  .verdict .choices { display: grid; grid-template-columns: 1fr; }
  .verdict .chip { justify-content: center; padding: .6rem 1rem; }
  .compare-controls { align-items: stretch; }
  .compare-actions { justify-content: space-between; width: 100%; }
  .dual { min-width: 5.5rem; }
  .proposal-actions .btn.small { min-height: 40px; padding: 0 1.1rem; }
  .journal { max-height: none; }
}
/* Grid columns may not grow to fit one-line labels (interest, meta) on narrow screens. */
.agent-grid { grid-template-columns: minmax(0, 1fr); }
.agent-grid > *, .compare-grid > * { min-width: 0; }
@media (min-width: 900px) { .agent-grid { grid-template-columns: minmax(0, 1fr) 20rem; } .compare-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Swipe to vote, thumbs buttons, hide low scores */
.agent-item.swipeable { display: block; padding: 0; position: relative; overflow: hidden; touch-action: pan-y; }
.swipe-card { position: relative; z-index: 1; display: flex; gap: .75rem; padding: .85rem 1rem; background: var(--card); }
.agent-item.top { box-shadow: none; }
.agent-item.top .swipe-card { background: color-mix(in srgb, var(--accent) 6%, var(--card)); box-shadow: inset 3px 0 0 var(--accent); }
.agent-item.quiet { opacity: 1; }
.agent-item.quiet .swipe-card { opacity: .55; }
.agent-item.voted-up .swipe-card { box-shadow: inset 3px 0 0 var(--accent); }
.agent-item.voted-down .swipe-card { opacity: .6; }
.swipe-hint { position: absolute; inset: 0; display: flex; align-items: center; gap: .45rem; padding: 0 1.25rem; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .12s; }
.swipe-hint.more { background: var(--accent); color: var(--accent-foreground); justify-content: flex-start; }
.swipe-hint.less { background: var(--primary); color: var(--primary-foreground); justify-content: flex-end; }
.dir-more .swipe-hint.more, .dir-less .swipe-hint.less { opacity: .55; }
.dir-more.go .swipe-hint.more, .dir-less.go .swipe-hint.less { opacity: 1; }
.item-votes { display: flex; flex-direction: column; gap: .35rem; margin-left: auto; flex-shrink: 0; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.list-head .section-title { margin: 0; }
.filter-toggle { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--border); background: var(--card); border-radius: 999px;
  padding: .3rem .75rem; font-size: 12px; color: var(--muted-foreground); }
.filter-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--foreground); }
.filter-count { font-family: var(--mono); font-size: 11px; color: var(--muted-foreground); }
.hide-low .agent-item.quiet { display: none; }
@media (max-width: 640px) { .filter-toggle { min-height: 36px; } }

/* Swipe, take two: solid cards (no see-through smears), quiet arrivals, a lifted card while dragging */
.agent-item.swipeable { animation: none; }
.agent-item.swipeable.new { animation: arrive .5s ease-out; }
.agent-item.quiet .swipe-card, .agent-item.voted-down .swipe-card { opacity: 1; }
.agent-item.quiet .swipe-card .item-title, .agent-item.quiet .swipe-card .reason, .agent-item.voted-down .swipe-card .item-title { color: var(--muted-foreground); }
.agent-item.quiet .swipe-card .badge { opacity: .7; }
.swipe-card { transform: translate3d(0,0,0); backface-visibility: hidden; }
.swiping .swipe-card { will-change: transform; box-shadow: 0 8px 22px -12px rgb(0 0 0 / .45); }
.swiping .swipe-hint { transition: none; }
.dir-more .swipe-hint.more, .dir-less .swipe-hint.less { opacity: calc(.25 + .75 * var(--p, 0)); }
.dir-more .swipe-hint.less, .dir-less .swipe-hint.more { opacity: 0; }
.swipe-hint .icon { transform: scale(calc(.85 + .3 * var(--p, 0))); transition: transform .08s; }
.go .swipe-hint .icon { transform: scale(1.2); }
.agent-item.just-voted .swipe-card { animation: stamp .45s ease-out; }
@keyframes stamp { 0% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 3px 0 0 var(--accent); } }
.agent-item.voted-down.just-voted .swipe-card { animation: none; }
.filter-line { margin: 0; font-size: 12px; color: var(--muted-foreground); text-align: right; }
.filter-label { font-variant-numeric: tabular-nums; }
.filter-action { background: none; border: 0; padding: .3rem 0 .3rem .25rem; font-size: 12px; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* Header: brand left, a plain hamburger right */
.topbar { flex-wrap: nowrap; align-items: center; }
.menu { position: relative; margin-left: auto; }
.menu-button { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; border-radius: .5rem; cursor: pointer; color: var(--foreground); }
.menu-button::-webkit-details-marker { display: none; }
.menu-button:hover { background: color-mix(in srgb, var(--muted) 70%, transparent); }
.bars { display: grid; gap: 4px; width: 20px; }
.bars span { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
.menu[open] .bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu[open] .bars span:nth-child(2) { opacity: 0; }
.menu[open] .bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu-panel { position: absolute; right: -4px; top: calc(100% + 6px); z-index: 40; min-width: 13rem; display: grid; padding: .35rem; border: 1px solid var(--border);
  border-radius: .75rem; background: var(--card); box-shadow: 0 14px 34px -14px rgb(0 0 0 / .4); animation: menu-in .14s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu-panel a, .menu-panel button { display: block; width: 100%; text-align: left; padding: .7rem .8rem; border: 0; border-radius: .5rem; background: none; font: inherit; font-size: 15px; color: var(--foreground); }
.menu-panel a:hover, .menu-panel button:hover { background: var(--muted); }
.menu-panel form { margin: .25rem 0 0; padding-top: .25rem; border-top: 1px solid var(--border); }
.menu-panel button { color: var(--muted-foreground); }
/* Jump links land with breathing room. */
#journal, #memory, #feeds { scroll-margin-top: 1rem; }
.journal, #memory .section-title { scroll-margin-top: 1rem; }

/* The greeting, and asking for a name once */
.hello-ask { display: grid; gap: .6rem; }
.name-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.name-form label { display: grid; gap: .25rem; flex: 1 1 14rem; font-size: 12px; color: var(--muted-foreground); }

/* Daily note */
.delivery-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.input.hour { width: auto; padding-right: 1.5rem; }
.delivery-line { margin: 0 0 .5rem; font-size: 13px; }
.delivery-actions { display: flex; gap: 1rem; margin-top: .5rem; }
.delivery-flash { margin: 0 0 .5rem; font-size: 13px; color: var(--accent-ink); font-weight: 600; }
#delivery { scroll-margin-top: 1rem; }
.agent-side #delivery .section-title { margin-top: 1.25rem; }
.texts { margin-top: .9rem; padding-top: .75rem; border-top: 1px dashed var(--border); }
.input.code { width: 7.5rem; letter-spacing: .3em; font-family: var(--mono); }

/* Daily note: a settings card */
.settings { border: 1px solid var(--border); border-radius: .75rem; background: var(--card); overflow: hidden; }
.settings-flash { margin: 0; padding: .6rem .9rem; font-size: 13px; font-weight: 600; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 10%, var(--card)); border-bottom: 1px solid var(--border); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 52px; padding: .5rem .9rem; border-bottom: 1px solid var(--border); }
.setting-label { display: grid; gap: 1px; font-size: 14px; font-weight: 500; min-width: 0; }
.setting-label small { font-size: 12px; font-weight: 400; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setting .input.hour { padding: .3rem 1.6rem .3rem .6rem; font-size: 14px; min-height: 0; }
.setting-form { display: flex; gap: .5rem; padding: .6rem .9rem; border-bottom: 1px solid var(--border); }
.setting-form .input { flex: 1; min-width: 0; }
.setting-form .input.code { flex: 0 0 8rem; }
.setting-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; padding: .6rem .9rem; font-size: 12px; color: var(--muted-foreground); }
.setting-links { display: flex; gap: .9rem; }
.setting-links .link-btn { padding: 0; font-size: 12px; }
.switch { position: relative; flex-shrink: 0; width: 46px; height: 28px; border: 0; border-radius: 999px; background: var(--muted); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; transition: background .18s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .18s; }
.switch[aria-checked="true"] { background: var(--accent); box-shadow: none; }
.switch[aria-checked="true"] .knob { transform: translateX(18px); }
.switch.htmx-request { opacity: .6; }
@media (max-width: 640px) {
  .setting .input.hour, .setting-form .input { font-size: 16px; }
  .setting-links .link-btn, .setting-foot { font-size: 13px; }
}

/* One-column Eli page; the rest lives on its own pages */
.stories { margin-top: .25rem; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1rem 0 1.25rem; }
.status-row .agent-status { margin: 0; }
.wrap.narrow-wide { max-width: 44rem; }
.back { display: inline-block; margin-bottom: .75rem; font-size: 13px; color: var(--muted-foreground); }
.back:hover { color: var(--foreground); }
.journal.full { max-height: none; gap: .65rem; font-size: 14px; }
.journal.full .journal-line { grid-template-columns: 4.8rem 1fr; }
.feed-list { list-style: none; margin: 1rem 0 0; padding: 0; border: 1px solid var(--border); border-radius: .75rem; background: var(--card); overflow: hidden; }
.feed-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .75rem; padding: .75rem .9rem; border-bottom: 1px solid var(--border); }
.feed-list li:last-child { border-bottom: 0; }
.feed-title { font-weight: 500; }
.feed-host { font-size: 12px; color: var(--muted-foreground); }
#memory .memory { font-size: 15px; gap: .6rem; color: var(--foreground); }
#memory .memory li { padding: .1rem 0 .1rem .7rem; }
.wrap.narrow-wide #delivery { margin-top: 1rem; }

/* "Show all" / "Show only top scores" as a real button */
.filter-line { display: flex; align-items: center; gap: .6rem; }
.filter-action { border: 1px solid var(--border); background: var(--card); color: var(--foreground); border-radius: 999px; padding: .35rem .85rem;
  font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s; }
.filter-action:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
@media (max-width: 640px) { .filter-action { min-height: 36px; padding: .4rem .9rem; } .list-head { flex-wrap: wrap; } }
.menu-who { margin: 0 0 .25rem; padding: .55rem .8rem .65rem; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted-foreground); display: grid; gap: 1px; }
.menu-who span { font-size: 13px; color: var(--foreground); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Read: done with it */
.hide-low .agent-item.read { display: none; }
.agent-item.read .swipe-card .item-title { color: var(--muted-foreground); font-weight: 400; }
.readbtn[aria-pressed="true"] { border-color: var(--foreground); background: var(--foreground); color: var(--background); }
.filter-line { flex-wrap: wrap; justify-content: flex-end; }
.filter-action[hidden] { display: none; }

/* Home, take three: greeting, one quiet status line, one slim next step, tabs */
#hello { margin-bottom: .2rem; }
.name-ask { margin-top: .35rem; font-size: 13px; }
.name-ask summary { list-style: none; display: inline; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.name-ask summary::-webkit-details-marker { display: none; }
.name-ask[open] summary { display: none; }
.name-ask .name-form { margin-top: .25rem; }
.name-ask .input { flex: 1 1 12rem; }

.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin: .5rem 0 1.25rem; font-size: 13px; color: var(--muted-foreground); }
.status-line .pulse { width: 8px; height: 8px; }
.check-now { border: 0; background: none; padding: .25rem 0; font: inherit; font-size: 13px; color: var(--accent-ink); cursor: pointer; }
.check-now:hover { text-decoration: underline; text-underline-offset: 2px; }
.check-now:disabled { opacity: .5; }

.next-step { display: flex; align-items: stretch; margin: 0 0 1.25rem; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: .75rem;
  background: color-mix(in srgb, var(--accent) 7%, var(--card)); overflow: hidden; }
.next-go { flex: 1; display: block; text-align: left; border: 0; background: none; padding: .8rem 1rem; font: inherit; font-size: 14px; color: var(--foreground); cursor: pointer; }
.next-go strong { font-weight: 600; }
.next-go:hover { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.next-x { border: 0; border-left: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); background: none; padding: 0 1rem; font-size: 14px; color: var(--muted-foreground); cursor: pointer; }
.next-x:hover { color: var(--foreground); }

.tabs { display: flex; gap: .25rem; margin: 0 0 .75rem; padding: .25rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { flex-shrink: 0; border: 0; background: none; border-radius: 999px; padding: .45rem .9rem; font: inherit; font-size: 13px; color: var(--muted-foreground); cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--foreground); color: var(--background); font-weight: 600; }
.tab-count { margin-left: .2rem; font-family: var(--mono); font-size: 11px; opacity: .75; }
.view-worth .agent-item.quiet, .view-worth .agent-item.read, .view-unread .agent-item.read, .view-liked .agent-item:not(.voted-up) { display: none; }
.view-liked { display: flex; flex-direction: column; }
.agent-items.none-shown { display: none; }
.tab .icon { vertical-align: -2px; }
.liked-empty { margin: 0; padding: 2rem 1rem; text-align: center; font-size: 15px; color: var(--muted-foreground); border: 1px dashed var(--border); border-radius: .75rem; }
.liked-empty .icon { vertical-align: -2px; }
.caught-up { margin: 0; padding: 2rem 1rem; text-align: center; font-size: 15px; color: var(--muted-foreground); border: 1px dashed var(--border); border-radius: .75rem; }
.list-foot { margin: .9rem 0 0; text-align: center; font-size: 13px; color: var(--muted-foreground); }
.list-foot .filter-action { margin-left: .35rem; }
.tab .short { display: none; }
@media (max-width: 640px) { .tabs { width: 100%; justify-content: space-between; } .tab { flex: 1; padding: .55rem .3rem; } .tab .long { display: none; } .tab .short { display: inline; } }

/* What Eli knows: readable blocks, edits, and talking to Eli */
.tell { margin: 1.25rem 0 1.75rem; padding: 1rem; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: .75rem; background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
.tell-form { display: grid; gap: .6rem; }
.tell-label { font: 800 1.15rem/1.2 var(--display); }
.tell-form textarea { width: 100%; resize: vertical; line-height: 1.5; }
.tell-form .btn { justify-self: start; }
.eli-says { margin: .9rem 0 0; padding: .75rem .9rem; border-radius: .6rem; background: var(--card); border: 1px solid var(--border); font-size: 15px; line-height: 1.55; animation: arrive .6s ease-out; }
.eli-name { display: block; margin-bottom: .2rem; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); }
#memory .section-title { margin: 1.5rem 0 .6rem; }
.knowns { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.known { padding: .85rem 1rem .7rem; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: .6rem; background: var(--card); }
.knowns.notes .known { border-left-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.known-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--foreground); }
.known-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .25rem 1rem; margin-top: .45rem; font-size: 12px; }
.known-actions .link-btn { padding: 0; font-size: 12px; }
.known-edit summary { list-style: none; cursor: pointer; color: var(--accent-ink); }
.known-edit summary::-webkit-details-marker { display: none; }
.known-edit[open] { flex-basis: 100%; }
.known-edit[open] summary { margin-bottom: .4rem; }
.known-form { display: grid; gap: .5rem; }
.known-form textarea { width: 100%; line-height: 1.5; font-size: 15px; }
.known-form .btn { justify-self: start; }
@media (max-width: 640px) { .known-text, .eli-says { font-size: 16px; } .known-actions, .known-actions .link-btn { font-size: 13px; } }

/* Feeds: watch a site */
.watch-form { margin: 1.25rem 0 1.5rem; padding: 1rem; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: .75rem; background: color-mix(in srgb, var(--accent) 5%, var(--card)); display: grid; gap: .6rem; }
.watch-row { display: flex; gap: .5rem; }
.watch-row .input { flex: 1; min-width: 0; }
.watch-flash { margin: 0; font-size: 14px; color: var(--destructive); }
.watch-flash.ok { color: var(--accent-ink); font-weight: 600; }
.feed-list li { align-items: center; }
.feed-main { display: grid; gap: 1px; min-width: 0; }
.feed-main .feed-title { overflow: hidden; text-overflow: ellipsis; }
.feed-list .link-btn { flex-shrink: 0; padding: 0; font-size: 12px; }
@media (max-width: 640px) { .feed-list .link-btn { font-size: 13px; } }

/* What Eli reads */
.reads-section { margin: 1.5rem 0 2rem; }
.reads-title { margin: 0; font: 800 1.35rem/1.2 var(--display); }
.reads-help { margin: .25rem 0 .75rem; font-size: 14px; color: var(--muted-foreground); }
.reads-section .watch-row { margin-bottom: .6rem; }
.reads-section .watch-flash { margin: 0 0 .6rem; }
.topic-chips { list-style: none; margin: .25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.topic-chip { display: inline-flex; align-items: center; gap: .15rem; padding: .3rem .35rem .3rem .8rem; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 999px; background: color-mix(in srgb, var(--accent) 8%, var(--card)); font-size: 14px; }
.topic-chip button { border: 0; background: none; width: 26px; height: 26px; border-radius: 999px; color: var(--muted-foreground); cursor: pointer; font-size: 12px; }
.topic-chip button:hover { background: var(--muted); color: var(--foreground); }
.link-btn.suggest { padding: .25rem 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; font-size: 14px; }
.via { margin: 2px 0 0; font-size: 11px; color: var(--muted-foreground); font-style: italic; }
.menu-panel a[aria-current="page"] { font-weight: 600; }
.menu-panel a[aria-current="page"]::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: .45rem; border-radius: 999px; background: var(--accent); vertical-align: middle; }
/* Tags never break; long source names give way instead. */
.flag { white-space: nowrap; flex-shrink: 0; }
.agent-item .meta { flex-wrap: wrap; row-gap: .25rem; }
.meta-source { min-width: 0; }
.next-go.two-line { display: grid; gap: .15rem; }
.next-go.two-line strong { font: 800 1.05rem/1.25 var(--display); }
.next-go.two-line > span { font-size: 13px; color: var(--muted-foreground); }
.working-notes { margin-top: 2rem; }

/* Daily note sample */
.sample-link { margin: 1rem 0 0; font-size: 13px; color: var(--muted-foreground); }
.sample { margin-top: 1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--card); overflow: hidden; }
.sample-meta { margin: 0; padding: .55rem .9rem; border-bottom: 1px solid var(--border); font-size: 14px; }
.sample-meta span { display: inline-block; width: 4.5rem; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); }
.sample-meta.subject { font-weight: 600; }
.sample-frame { display: block; width: 100%; height: 900px; border: 0; background: #f6f2ea; }
.sample-cta { margin: 1.25rem 0 0; }
/* About you: the facts, before the taste */
.about-you { margin: 1.25rem 0; }
.about-you .setting { flex-wrap: wrap; }
.about-you .setting-label small { white-space: normal; overflow: visible; font-size: 14px; color: var(--foreground); }
.about-you .known-edit { font-size: 13px; }
.about-you .known-edit[open] { flex-basis: 100%; }
.about-form { display: flex; gap: .5rem; margin-top: .4rem; }
.about-form .input { flex: 1; min-width: 0; }
.about-link { font-size: 13px; padding: 0; color: var(--accent-ink); }

/* /admin */
.funnel-strip { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.25rem; }
.funnel-step { display: grid; gap: 1px; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: .6rem; background: var(--card); font-size: 12px; color: var(--muted-foreground); }
.funnel-step .num { font-size: 18px; color: var(--foreground); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: .75rem; background: var(--card); }
.admin-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.admin-table th { text-align: left; padding: .5rem .6rem; font-size: 11px; font-weight: 600; color: var(--muted-foreground); border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th.step, .admin-table td.step { text-align: center; }
.admin-table td.step { color: var(--border); font-size: 14px; }
.admin-table td.step.on { color: var(--accent); }
.admin-who { display: block; font-weight: 600; }
.admin-email { display: block; font-size: 12px; color: var(--muted-foreground); }
.admin-meta { display: block; font-size: 11px; color: var(--muted-foreground); margin-top: 2px; }

/* Feedback: a pill in the corner for feedback accounts, a page for everyone */
  font-size: 13px; font-weight: 600; box-shadow: 0 8px 22px -10px rgb(0 0 0 / .5); }
  border-radius: .9rem; background: var(--card); box-shadow: 0 18px 40px -16px rgb(0 0 0 / .45); animation: menu-in .14s ease-out; }
.fb-body { display: grid; gap: .6rem; }
.fb-title { margin: 0; font: 800 1.05rem/1.2 var(--display); }
.fb-body textarea { width: 100%; resize: vertical; line-height: 1.5; }
.fb-body .btn { justify-self: start; }
.fb-thanks { margin: 0; font-size: 15px; font-weight: 600; color: var(--accent-ink); }
.fb-page { margin-top: 1rem; padding: 1rem; }
.menu-plan { display: block; margin-top: .2rem; font-size: 11px; font-style: normal; color: var(--accent-ink); }
.menu-sep { height: 1px; margin: .25rem .35rem; background: var(--border); }

/* Help */
.help-list { margin-top: 1.25rem; display: grid; gap: .5rem; }
.help-q { border: 1px solid var(--border); border-radius: .6rem; background: var(--card); padding: .1rem .9rem; }
.help-q summary { cursor: pointer; padding: .7rem 0; font-weight: 600; font-size: 15px; list-style: none; }
.help-q summary::-webkit-details-marker { display: none; }
.help-q summary::after { content: "+"; float: right; color: var(--muted-foreground); }
.help-q[open] summary::after { content: "–"; }
.help-q p { margin: 0 0 .85rem; font-size: 15px; line-height: 1.55; color: var(--foreground); }

/* /admin additions */
.plan-badge { display: inline-block; margin-left: .3rem; padding: 0 6px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent-ink); font: 600 10px var(--mono); vertical-align: middle; }
.plan-form { margin-top: .25rem; }
.plan-form .link-btn { padding: 0; font-size: 11px; }
.admin-fb-title { margin-top: 2rem; }
.admin-feedback { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .6rem; }
.admin-feedback li { padding: .75rem .9rem; border: 1px solid var(--border); border-radius: .6rem; background: var(--card); }
.admin-fb-meta { margin: 0 0 .3rem; font-size: 12px; color: var(--muted-foreground); }
.admin-fb-body { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
body:has(.fb) .wrap { padding-bottom: 5.5rem; }

/* /admin: personal invites */
.admin-invite { margin: 1rem 0 1.5rem; padding: 1rem; border: 1px solid var(--border); border-radius: .5rem; background: var(--card); }
.invite-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.invite-form label { font-weight: 600; font-size: 14px; margin-right: .25rem; }
.invite-form .input { flex: 1 1 14rem; }
.invite-form .invite-note { flex-basis: 100%; resize: vertical; }
.invite-form .invite-from { flex: 0 1 8rem; }
.invite-send { display: inline-flex; align-items: center; gap: .35rem; font-size: 13px; font-weight: 500 !important; }
.invite-made p { margin: .75rem 0 .4rem; font-size: 14px; }
.invite-link { width: 100%; }
.admin-invite .form-error { margin: .5rem 0 0; font-size: 13px; color: var(--destructive); }
.invite-copy { display: flex; gap: .5rem; }
.invite-copy .invite-link { flex: 1 1 auto; width: auto; }

/* /admin: cost per reader */
.admin-spend { margin: 1rem 0 0; padding: .9rem 1.1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--card); }
.admin-spend-big { display: flex; align-items: baseline; gap: .6rem; margin: 0; color: var(--muted-foreground); }
.admin-spend-big .num { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 28px; font-weight: 600; color: var(--accent-ink); }
.admin-spend-sub { margin: .35rem 0 0; font-size: 13px; color: var(--muted-foreground); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .admin-spend-big .num { color: var(--accent); } }
:root[data-theme="dark"] .admin-spend-big .num { color: var(--accent); }

/* The chat with Eli: a face in the corner, one thread behind it. */
.chat { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; }
.chat-fab { list-style: none; position: relative; display: block; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; cursor: pointer; box-shadow: 0 6px 18px rgba(20, 29, 41, .28); transition: transform .15s ease; }
.chat-fab::-webkit-details-marker { display: none; }
.chat-fab:hover { transform: scale(1.06); }
.chat-fab .eli-face { display: block; }
.chat-new { display: none; position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--destructive); border: 2px solid var(--background); }
.chat.has-new:not([open]) .chat-new { display: block; }
.chat-panel { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(84px + env(safe-area-inset-bottom)); width: min(24rem, calc(100vw - 32px)); height: min(36rem, calc(100dvh - 120px)); display: flex; flex-direction: column; overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 18px 48px rgba(20, 29, 41, .22); }
.chat-head { display: flex; align-items: center; gap: .65rem; padding: .7rem .8rem .7rem .9rem; border-bottom: 1px solid var(--border); }
.chat-head .eli-face { flex-shrink: 0; border-radius: 50%; }
.chat-who { flex: 1; min-width: 0; margin: 0; display: grid; line-height: 1.25; }
.chat-who strong { font: 800 17px/1.2 var(--display); }
.chat-who span { font-size: 12px; color: var(--muted-foreground); }
.chat-close { border: 0; background: none; color: var(--muted-foreground); padding: .4rem; border-radius: .5rem; display: grid; }
.chat-close:hover { color: var(--foreground); background: var(--muted); }
.chat-thread { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 1rem .9rem; display: flex; flex-direction: column; gap: .55rem; background: var(--background); overscroll-behavior: contain; }
.msg { max-width: 84%; min-width: 0; }
.msg.me { align-self: flex-end; }
.msg.eli { align-self: flex-start; }
.msg-body { margin: 0; padding: .55rem .8rem; border-radius: 1rem; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me .msg-body { background: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: .3rem; }
.msg.eli .msg-body { background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: .3rem; }
.msg.daily .msg-body { background: color-mix(in srgb, var(--accent) 14%, var(--card)); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.msg-kicker { display: block; margin-bottom: .1rem; font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.msg.daily .msg-body, .msg.nudge .msg-body { font-weight: 500; }
.msg-stories { display: grid; gap: .4rem; margin-top: .4rem; }
.story-card { display: flex; align-items: center; gap: .25rem; padding: .35rem .35rem .35rem .55rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--card); }
.story-card.voted-up { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.story-link { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: .55rem; padding: .15rem 0; }
.story-link .score { flex-shrink: 0; min-width: 1.6rem; padding: .05rem .3rem; border-radius: .35rem; text-align: center; font: 600 12px var(--mono); background: color-mix(in srgb, var(--accent) 18%, var(--card)); color: var(--accent-ink); }
.story-link .score.top { background: var(--accent); color: var(--accent-foreground); }
.story-text { min-width: 0; display: grid; gap: .05rem; }
.story-title { font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.story-link:hover .story-title { text-decoration: underline; }
.story-source { font-size: 11.5px; color: var(--muted-foreground); }
.story-votes { display: flex; flex-shrink: 0; }
.story-vote { border: 0; background: none; color: var(--muted-foreground); padding: .4rem; border-radius: .5rem; display: grid; }
.story-vote:hover { background: var(--muted); color: var(--foreground); }
.story-vote[aria-pressed="true"].up { background: var(--accent); color: var(--accent-foreground); border-radius: 50%; }
.story-vote[aria-pressed="true"].down { background: var(--foreground); color: var(--background); border-radius: 50%; }
.msg.eli:has(.msg-stories) { max-width: 92%; }
.msg-meta { margin: .2rem .45rem 0; font-size: 11px; color: var(--muted-foreground); }
.msg.me .msg-meta { text-align: right; }
.msg.hello .msg-meta { display: none; }
.chat-typing { margin: 0; padding: .35rem 1rem; font-size: 12.5px; color: var(--muted-foreground); background: var(--background); }
.chat-typing .dots span { animation: chat-dot 1.2s infinite; }
.chat-typing .dots span:nth-child(2) { animation-delay: .15s; }
.chat-typing .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }
.chat-form { display: flex; align-items: flex-end; gap: .5rem; padding: .6rem; border-top: 1px solid var(--border); }
.chat-form textarea { flex: 1; min-width: 0; resize: none; min-height: 2.6rem; max-height: 8rem; line-height: 1.4; }
.chat-form .chat-send { flex-shrink: 0; width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.chat-fb { display: block; padding: 0 .9rem .7rem; font-size: 12px; color: var(--muted-foreground); text-decoration: underline; }
@media (max-width: 640px) {
  .chat-panel { inset: 0; width: auto; height: auto; border: 0; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .chat[open] .chat-fab { visibility: hidden; }
}
/* Eli's face (the owl): blinks now and then; while a reply is on its way the pupils scan like it's reading. */
.eli-face .f-bg { fill: #1e2a3a; }
.eli-face .f-amber { fill: var(--accent); }
.eli-face .f-tufts { stroke: var(--accent); }
.eli-face .f-ink { fill: #141d29; }
.eli-face .f-glint { fill: #ffffff; }
.eli-face .blink { animation: face-blink 5.2s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes face-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
.chat:has(#chat-typing:not([hidden])) .eli-face .look { animation: face-read 1.6s ease-in-out infinite; }
@keyframes face-read { 0% { transform: translate(-3px, -1px); } 45% { transform: translate(3px, -1px); } 50% { transform: translate(-3px, 2px); } 95% { transform: translate(3px, 2px); } 100% { transform: translate(-3px, -1px); } }
@media (prefers-color-scheme: dark) { .eli-face .f-bg { fill: #26354a; } }
@media (prefers-reduced-motion: reduce) { .eli-face *, .chat-typing .dots span { animation: none !important; } }
#live { padding-bottom: 5.5rem; } /* room under the last thing on a page for the chat button */

/* A new reader's first conversation: the owl and the thread as the whole page. */
.onboard-stage { max-width: 40rem; margin: 0 auto; height: calc(100dvh - 64px); display: flex; flex-direction: column; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: env(safe-area-inset-bottom); }
.stage-head { display: flex; align-items: center; gap: .8rem; padding: .5rem 0 1rem; }
.stage-head .eli-face { border-radius: 50%; flex-shrink: 0; box-shadow: 0 6px 18px rgba(20, 29, 41, .2); }
.stage-who { flex: 1; min-width: 0; }
.stage-who h1 { margin: 0; font: 800 28px/1.1 var(--display); }
.stage-who p { margin: .1rem 0 0; font-size: 13px; color: var(--muted-foreground); }
.stage-skip { display: none; border: 0; background: none; font-size: 13px; color: var(--muted-foreground); text-decoration: underline; padding: .3rem; }
.stage-thread { background: none; padding: .25rem 0 1rem; }
.stage-thread .msg-body { font-size: 15.5px; }
.onboard-stage .chat-typing { background: none; padding: .3rem 0; }
.stage-form { padding: .75rem 0; border-top: 1px solid var(--border); }
.onboard-stage:has(#chat-typing:not([hidden])) .eli-face .look { animation: face-read 1.6s ease-in-out infinite; }
.msg.progress .msg-body { font-size: 14px; color: var(--muted-foreground); background: none; border-style: dashed; }
.msg-choices { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.choice { border: 1px solid var(--border); background: var(--card); color: var(--foreground); border-radius: 999px; padding: .4rem .8rem; font-size: 13.5px; line-height: 1.2; }
.choice:hover { border-color: var(--accent); }
.choice.fill.on { background: color-mix(in srgb, var(--accent) 18%, var(--card)); border-color: var(--accent); }
.msg-choices.answers .choice { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); font-weight: 600; }
.msg-choices.answers .choice:first-child { background: var(--accent); color: var(--accent-foreground); border-color: var(--accent); }
.chat-thread > .msg:not(:last-child) .msg-choices:not(:has(.choice.link)) { display: none; }
/* A link in the thread (Keep Eli): stays usable after later messages. */
.msg-choices .choice.link { display: inline-flex; align-items: center; text-decoration: none; background: var(--accent); color: var(--accent-foreground); border-color: var(--accent); font-weight: 600; }
.onboard-stage:has(.msg.progress) .stage-skip { display: inline-block; }
.invite-personal { display: grid; gap: .5rem; margin: .5rem 0 1rem; }
.invite-personal textarea { width: 100%; resize: vertical; }
.invite-personal .btn { justify-self: start; }

/* Public legal pages and the texting notice */
.legal h2 { margin: 1.6rem 0 .4rem; font: 800 19px/1.25 var(--display); }
.legal p, .legal li { max-width: 68ch; line-height: 1.6; }
.legal ul, .legal ol { padding-left: 1.2rem; display: grid; gap: .35rem; }
.legal a { color: var(--accent-ink); text-decoration: underline; }
.legal-updated { margin: 0 0 .3rem; font: 500 12px var(--mono); color: var(--muted-foreground); }
.legal-links { margin-top: 2.5rem; font-size: 13px; color: var(--muted-foreground); }
.consent-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; margin: 1.2rem 0; }
.consent-shots figure { margin: 0; display: grid; gap: .4rem; }
.consent-shots img { width: 100%; border: 1px solid var(--border); border-radius: .75rem; }
.consent-shots figcaption { font-size: 13px; color: var(--muted-foreground); }
.phone-form { flex-wrap: wrap; }
.sms-consent { flex-basis: 100%; margin: .35rem 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted-foreground); }
.sms-consent a { color: inherit; text-decoration: underline; }
.path-form { display: contents; }
button.path { font: inherit; text-align: left; cursor: pointer; width: 100%; }
.password-signin { margin-top: 1.5rem; }
.password-signin summary { cursor: pointer; font-size: 14px; color: var(--muted-foreground, inherit); }
.password-signin form { margin-top: .75rem; }

a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--foreground); border: 1px solid var(--border); }
.plan-badge.billing-active { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.plan-badge.billing-past_due, .plan-badge.billing-lapsed { background: color-mix(in srgb, #c0392b 18%, transparent); }
