/* 124A Review Hub — "architect's field notebook": warm paper, ink, canal green, brick for attention. */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/vendor/fonts/fraunces-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 100 900; font-display: swap; src: url('/vendor/fonts/fraunces-latin-wght-italic.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: italic; font-weight: 400; font-display: swap; src: url('/vendor/fonts/atkinson-hyperlegible-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); }

:root {
  --paper: #f3eee4;
  --paper-2: #e9e2d4;
  --surface: #fffdf8;
  --surface-2: #f6f1e7;
  --ink: #1c1a16;
  --ink-2: #4a463f;
  --muted: #776f63;
  --line: #d9d0c1;
  --line-strong: #b8ad9a;
  --accent: #14695a;
  --accent-ink: #f6fbf9;
  --accent-soft: #dcebe5;
  --brick: #b5452b;
  --brick-soft: #f4ded6;
  --ochre: #9c6f0c;
  --ochre-soft: #f2e6c6;
  --moss: #4c7a2a;
  --moss-soft: #e1ecd5;
  --p0: #8f1d1d;
  --p1: #b5452b;
  --p2: #14695a;
  --p3: #776f63;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 10px 28px -16px rgba(40, 30, 10, .35);
  --shadow-lift: 0 2px 4px rgba(40, 30, 10, .06), 0 16px 36px -14px rgba(40, 30, 10, .4);
  --nav-h: 62px;
  --top-h: 56px;
  --tap: 44px;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --bg: var(--paper);
  --text: var(--ink);
  --danger: var(--brick);
  --warn: var(--ochre);
  --ok: var(--moss);
  --font: var(--font-body);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171512;
    --paper-2: #100f0c;
    --surface: #201d18;
    --surface-2: #29251f;
    --ink: #efe9dd;
    --ink-2: #cdc5b6;
    --muted: #9a9284;
    --line: #36312a;
    --line-strong: #4d463c;
    --accent: #4fb89f;
    --accent-ink: #0c1b17;
    --accent-soft: #1c3a33;
    --brick: #e2735a;
    --brick-soft: #3d221b;
    --ochre: #d9a83a;
    --ochre-soft: #3a3016;
    --moss: #8fc063;
    --moss-soft: #22321a;
    --p0: #ff8a80;
    --p1: #e2735a;
    --p2: #4fb89f;
    --p3: #9a9284;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -16px rgba(0, 0, 0, .8);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 16px 36px -14px rgba(0, 0, 0, .9);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--paper); padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); font-variant-numeric: tabular-nums; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.85rem; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .6rem; }
h2 { font-family: var(--font-body); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 1.6rem 0 .6rem; display: flex; align-items: center; gap: 10px; }
h2::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin: .8rem 0 .35rem; letter-spacing: -.005em; }
p { margin: .4rem 0; }
small, .muted { color: var(--muted); }
.loading { padding: 2rem; text-align: center; color: var(--muted); font-style: italic; font-family: var(--font-display); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* Controls */
button, .btn { font: inherit; font-weight: 700; font-size: .95rem; min-height: var(--tap); padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s, border-color .15s; }
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--ink-2); }
button:active, .btn:active { transform: translateY(0); box-shadow: none; }
button:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
button.danger { color: var(--brick); border-color: var(--brick); }
button.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
button.ghost:hover { background: var(--surface-2); box-shadow: none; }
button.small { min-height: 36px; padding: 0 12px; font-size: .85rem; }
button.icon { min-width: var(--tap); padding: 0; }
button.active, .chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
input, textarea, select { font: inherit; min-height: var(--tap); padding: 9px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
label { display: block; font-weight: 700; font-size: .9rem; margin: .7rem 0 .3rem; color: var(--ink-2); }
label small { font-weight: 400; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.wrap { padding: 14px 14px 24px; max-width: 1080px; margin: 0 auto; }
@media (min-width: 800px) { .wrap { padding: 28px 28px 48px; } }
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Page-load rhythm */
@media (prefers-reduced-motion: no-preference) {
  .wrap > * { animation: rise .45s var(--ease) both; }
  .wrap > *:nth-child(2) { animation-delay: .04s; }
  .wrap > *:nth-child(3) { animation-delay: .08s; }
  .wrap > *:nth-child(4) { animation-delay: .12s; }
  .wrap > *:nth-child(5) { animation-delay: .16s; }
  .wrap > *:nth-child(n+6) { animation-delay: .2s; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* Masthead */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 0 14px; display: flex; align-items: center; gap: 12px; min-height: var(--top-h); }
.brand { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); white-space: nowrap; flex: none; }
.brand-no { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 1.55rem; letter-spacing: -.02em; color: var(--accent); line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 1.02rem; letter-spacing: .01em; }
.topnav { display: none; }
.status-pills { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; min-width: 0; }
.status-pills .badge { max-width: 52vw; }
.status-pills .sm { display: none; }
@media (max-width: 799px) {
  .status-pills .lg { display: none; }
  .status-pills .sm { display: inline; }
  /* Settings is only reachable from here on a phone, so it shrinks instead of hiding.
     Keeping it a real tap target matters more than the two characters of width. */
  .status-pills .user-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 32px; padding: 0 8px; }
  .status-pills .conn { width: 12px; height: 12px; padding: 0; border-radius: 50%; overflow: hidden; }
  .status-pills .conn::before { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: currentColor; }
}
@media (max-width: 420px) { .brand-name { display: none; } }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; line-height: 1.2; }
.badge.ok { color: var(--moss); background: var(--moss-soft); border-color: transparent; }
.badge.warn { color: var(--ochre); background: var(--ochre-soft); border-color: transparent; }
.badge.danger { color: var(--brick); background: var(--brick-soft); border-color: transparent; }
.badge.p0 { color: #fff; background: var(--p0); border-color: var(--p0); }
.badge.p1 { color: var(--p1); background: var(--brick-soft); border-color: transparent; }
.badge.p2 { color: var(--p2); background: var(--accent-soft); border-color: transparent; }
.badge.p3 { color: var(--p3); }
.badge.count { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.badge.pulse::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.status-pills a.badge { text-decoration: none; }

/* Navigation */
nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -8px 24px -18px rgba(0, 0, 0, .35); }
nav.bottom a { flex: 1; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .02em; position: relative; transition: color .15s; }
nav.bottom a .ic { width: 22px; height: 22px; transition: transform .2s var(--ease); }
nav.bottom a.active { color: var(--accent); }
nav.bottom a.active .ic { transform: translateY(-1px); }
nav.bottom a.active::after { content: ""; position: absolute; top: 6px; width: 28px; height: 3px; border-radius: 3px; background: var(--accent); }
nav.bottom a .n { position: absolute; top: 5px; left: calc(50% + 6px); font-size: .68rem; padding: 1px 6px; min-width: 18px; justify-content: center; }
@media (min-width: 800px) {
  body { padding-bottom: 0; }
  nav.bottom { display: none; }
  .topbar { padding: 0 28px; gap: 28px; }
  .topnav { display: flex; gap: 2px; align-self: stretch; }
  .topnav a { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: .92rem; border-bottom: 3px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; position: relative; }
  .topnav a:hover { color: var(--ink); }
  .topnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
  .topnav a .n { margin-left: 2px; }
}

/* Cards and lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 10px; }
.card h3 { margin-top: 0; }
.list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.item-card { display: block; text-decoration: none; color: inherit; position: relative; padding-left: 20px; transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.item-card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 3px 3px 0; background: var(--line-strong); }
.item-card.p0::before { background: var(--p0); }
.item-card.p1::before { background: var(--p1); }
.item-card.p2::before { background: var(--p2); }
.item-card.p3::before { background: var(--line-strong); }
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.item-card .item-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.item-card .title { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; line-height: 1.25; letter-spacing: -.005em; }
.item-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.card.unread .title::before, .item-card.unread .title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; box-shadow: 0 0 0 3px var(--accent-soft); }
.tag-id { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .78rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; letter-spacing: .02em; }
.row-card { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.row-card .item-card { min-width: 0; width: 100%; }
@media (min-width: 800px) { .row-card { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; } }
.empty { padding: 2rem 1.2rem; text-align: center; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); font-family: var(--font-display); font-style: italic; font-size: 1.05rem; }
.filters { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; margin: 10px 0; padding: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
@media (min-width: 800px) { .filters { flex-wrap: wrap; overflow: visible; } }
.chip { min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: .86rem; font-weight: 700; white-space: nowrap; flex: none; }
.error { color: var(--brick); font-weight: 700; }
.notice { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin: 8px 0; }
.notice.warn { border-left: 4px solid var(--ochre); }
.notice.danger { border-left: 4px solid var(--brick); }
.notice.ok { border-left: 4px solid var(--moss); }

/* Thread */
.thread-head .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.thread-head h1 { font-size: 1.7rem; }
.crumb { font-size: .86rem; font-weight: 700; color: var(--muted); }
.crumb a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.crumb a:hover { color: var(--accent); }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.body-text code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.comment { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ochre-soft); color: var(--ochre); font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); letter-spacing: .02em; }
.comment.agent .avatar { background: var(--accent-soft); color: var(--accent); }
.comment.system .avatar { background: var(--surface-2); color: var(--muted); }
.comment .who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.comment .who b { font-size: .95rem; }
.comment .actions { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.comment.deleted .body-text { opacity: .6; font-style: italic; }
.comment.note { padding: 8px 0; }
.comment.note .avatar { width: 28px; height: 28px; font-size: .72rem; margin-left: 3px; }
.note-card { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 4px; }
.note-card .note-kind { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: var(--muted); margin-right: 2px; }
.note-card .arrow { color: var(--muted); font-weight: 700; }
.note-card .quote { flex-basis: 100%; margin: 4px 0 0; padding: 2px 10px; border-left: 3px solid var(--line-strong); color: var(--ink-2); font-style: italic; }
.note-card .note-link { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.note-card .note-link:hover { text-decoration: underline; }
.note-card .thumbs.mini { flex-basis: 100%; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); margin: 4px 0 0; }
.note-card .label { text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; font-weight: 800; padding: 2px 7px; border-radius: 5px; background: var(--surface); color: var(--ink-2); }
.note-card .label.improvement { color: var(--moss); background: var(--moss-soft); }
.note-card .label.setback { color: var(--brick); background: var(--brick-soft); }
.note-card .label.test_result { color: var(--accent); background: var(--accent-soft); }
.note-card .label.decision { color: var(--ochre); background: var(--ochre-soft); }
.new-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 4px 0 8px; }
.new-divider::before, .new-divider::after { content: ""; flex: 1; border-top: 2px solid var(--accent); }
.history { font-size: .85rem; color: var(--muted); padding-left: 1.2rem; }
.history li { margin: 3px 0; }
details > summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
details.card > summary { list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.card[open] > summary::before { transform: rotate(90deg); }

/* Composer */
.composer { position: sticky; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; padding: 8px 10px; margin-top: 14px; z-index: 10; box-shadow: var(--shadow-lift); }
@media (min-width: 800px) { .composer { bottom: 14px; } }
.composer .composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; height: 44px; border: 0; background: transparent; padding: 10px 8px; box-shadow: none; transition: height .18s var(--ease); flex: 1; }
.composer.open textarea, .composer textarea:not(:placeholder-shown) { height: 100px; }
.composer textarea:focus { box-shadow: none; }
.composer .send { min-width: 44px; padding: 0 14px; }
.composer .send .lg { display: none; }
.composer .tools { display: none; gap: 4px; align-items: center; padding: 4px 2px 0; flex-wrap: wrap; }
.composer.open .tools, .composer:has(textarea:not(:placeholder-shown)) .tools, .composer:has(.attach-list:not(:empty)) .tools { display: flex; }
@media (min-width: 800px) { .composer .send .lg { display: inline; } .composer .tools { display: flex; } }
.composer .attach-list:empty, .composer .context:empty { display: none; }
.composer .attach-list { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.composer .attach-list img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.composer .context { font-size: .82rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 2px 8px 0; }
.composer button.primary { border-radius: 999px; padding: 0 20px; }
.pending-note { font-size: .84rem; color: var(--ochre); padding: 0 8px; }

/* Media */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0; }
.thumbs a, .thumbs button, .thumbs > span { display: block; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); padding: 0; min-height: 0; transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.thumbs button:hover { transform: scale(1.03); box-shadow: var(--shadow); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .tag { position: absolute; left: 6px; bottom: 6px; font-size: .68rem; font-weight: 700; letter-spacing: .04em; background: rgba(20, 18, 14, .72); color: #fff; padding: 2px 7px; border-radius: 5px; backdrop-filter: blur(4px); }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: .9rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.thumbs .file-chip { aspect-ratio: auto; }

/* Questions */
.question { border-left: 4px solid var(--ochre); }
.question.answered { border-left-color: var(--moss); }
.choices { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.choices button { justify-content: flex-start; text-align: left; border-radius: 12px; }
.choices button.chosen { border-color: var(--moss); color: var(--moss); background: var(--moss-soft); }
.answers { padding-left: 1.1rem; }
.answers li { margin: 4px 0; }

/* Review viewer */
.pair { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .pair.side { grid-template-columns: 1fr 1fr; } }
.pair figure { margin: 0; background: var(--paper-2); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.pair figcaption { font-size: .84rem; padding: 8px 10px; display: flex; justify-content: space-between; gap: 6px; align-items: center; background: var(--surface); }
.stage { position: relative; background: #17150f; touch-action: none; overflow: hidden; cursor: zoom-in; }
.stage img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; min-height: 0; padding: 2px 7px; border-radius: 10px 10px 10px 0; background: var(--accent); color: #fff; border: 2px solid #fff; font-size: .78rem; font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.pin.pending { background: var(--ochre); }
.pin.rect { transform: none; background: transparent; border: 2px solid var(--accent); border-radius: 4px; box-shadow: none; color: transparent; }
.decision-bar { display: flex; gap: 0; margin: 10px 0; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.decision-bar button { flex: 1; border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: none; }
.decision-bar button + button { border-left: 1px solid var(--line); }
.decision-bar button:hover { background: var(--surface-2); transform: none; box-shadow: none; }
.decision-bar button.chosen { font-weight: 800; }
.decision-bar .looks_right.chosen { background: var(--moss-soft); color: var(--moss); }
.decision-bar .needs_changes.chosen { background: var(--brick-soft); color: var(--brick); }
.decision-bar .unsure.chosen { background: var(--ochre-soft); color: var(--ochre); }
.rev-nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; }
.rev-nav .btn.small { border-radius: 999px; font-family: ui-monospace, Consolas, monospace; }

dialog.viewer { border: 0; padding: 0; margin: 0; width: 100%; height: 100dvh; max-width: 100%; max-height: 100dvh; inset: 0; background: #000; color: #fff; }
dialog.viewer::backdrop { background: #000; }
dialog.viewer .vbar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; gap: 6px; padding: 8px; align-items: center; background: linear-gradient(rgba(0, 0, 0, .85), transparent); flex-wrap: wrap; }
dialog.viewer .vbar button, dialog.viewer .vbar .btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); box-shadow: none; }
dialog.viewer .vbar button.active { background: var(--accent); border-color: var(--accent); }
dialog.viewer .vstage { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
dialog.viewer .vstage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; }
dialog.viewer .vstage .pins { transform-origin: 0 0; }
dialog.viewer .vhint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: .84rem; color: #ddd; pointer-events: none; }
dialog.viewer video { max-width: 100%; max-height: 100%; }
dialog.plain { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); max-width: 480px; width: 92vw; }
dialog.plain::backdrop { background: rgba(20, 16, 10, .45); backdrop-filter: blur(3px); }

/* Feed */
.update-card .label { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.update-card .label.improvement { color: var(--moss); background: var(--moss-soft); }
.update-card .label.setback { color: var(--brick); background: var(--brick-soft); }
.update-card .label.test_result { color: var(--accent); background: var(--accent-soft); }
.update-card .label.decision { color: var(--ochre); background: var(--ochre-soft); }
.update-card.item-card::before { background: var(--line-strong); }
.update-card.setback::before { background: var(--brick); }
.update-card.improvement::before { background: var(--moss); }
.update-card.test_result::before { background: var(--accent); }
.update-card.decision::before { background: var(--ochre); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .92rem; margin: 6px 0; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Verification table */
table.verify { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.verify th, table.verify td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.verify th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.state-asserted { color: var(--moss); font-weight: 700; }
.state-not_applicable { color: var(--muted); }
.state-pending { color: var(--ochre); }

/* Settings, misc */
.session-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px; z-index: 50; font-size: .92rem; font-weight: 700; max-width: 92vw; box-shadow: var(--shadow-lift); animation: toast-in .25s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 800px) { .toast { bottom: 24px; } }
.login { max-width: 440px; margin: 10vh auto 0; padding: 28px; }
.login .brand-no { font-size: 2.6rem; }
.login .brand-name { font-size: 1.3rem; }
.model-box { position: relative; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); min-height: 240px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.model-box canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.hero-count { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; color: var(--ink-2); margin: 0 0 .5rem; }
.hero-count b { color: var(--ink); font-weight: 800; }
.summary-strip { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Agents, addressing and assignment */
.badge.to { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); border-color: transparent; }
.to-row { display: none; gap: 6px; align-items: center; flex-wrap: wrap; padding: 2px 6px 4px; }
.composer.open .to-row, .composer:has(textarea:not(:placeholder-shown)) .to-row, .composer:has(.attach-list:not(:empty)) .to-row { display: flex; }
@media (min-width: 800px) { .composer .to-row { display: flex; } }
.chip.small { min-height: 30px; padding: 0 10px; font-size: .8rem; }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.agent-card .agent-row { display: flex; gap: 12px; align-items: flex-start; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--surface-2); color: var(--ink-2); flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar.active { box-shadow: 0 0 0 3px var(--moss-soft); color: var(--moss); }
.agent-main { flex: 1; min-width: 0; }
.agent-card .working { margin: 6px 0 0; }
.agents-strip { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.agent-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: inherit; text-decoration: none; min-height: 32px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.active { background: var(--ok); box-shadow: 0 0 0 3px var(--moss-soft); }
.dot.idle { background: var(--ok); opacity: .6; }
.dot.paused { background: var(--warn); }
.agent-pill .dot { margin-right: 6px; }
ul.activity { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
dialog.sheet { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px; max-width: 420px; width: calc(100vw - 32px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .35); }

/* Compact To: dropdown and attachment controls outside the composer */
.to-row { padding: 0 6px 4px; }
.to-select { flex: 1; min-width: 0; max-width: 100%; min-height: 34px; padding: 0 8px; font-size: .85rem; border-radius: 10px; }
.attach-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0 0; }
.attach-controls .attach-list { display: flex; gap: 6px; flex-wrap: wrap; }
.attach-controls .attach-list:empty { display: none; }
.attach-controls .attach-list img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* Priority chips at intake */
.chip.prio { border-left: 4px solid var(--line-strong); }
.chip.prio.p0 { border-left-color: var(--p0); }
.chip.prio.p1 { border-left-color: var(--p1); }
.chip.prio.p2 { border-left-color: var(--p2); }
.chip.prio.p3 { border-left-color: var(--p3); }
.chip.prio small { opacity: .7; font-weight: 400; }
.chip.prio.active small { opacity: .85; }

/* Project mark: the icon, or a monogram tile in the project's accent until it has one */
.project-mark { border-radius: var(--radius-sm); object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.project-mark.mono { background: var(--project-accent, var(--accent)); color: var(--accent-ink); font-weight: 700; font-size: 11px; letter-spacing: .02em; text-transform: uppercase; }
.project-mark.empty { background: var(--line); }
.brand.project-switch { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px; min-height: var(--tap); color: inherit; font: inherit; cursor: pointer; position: relative; }
/* A dot means a different project needs you, so "is anything on fire elsewhere" is
   answerable without leaving the tab you are on. */
.brand.project-switch.elsewhere::after { content: ''; position: absolute; top: 2px; left: 26px; width: 9px; height: 9px; border-radius: 50%; background: var(--p0); border: 2px solid var(--paper); }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(28, 26, 22, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 60; }
.sheet { background: var(--surface); width: min(520px, 100%); border-radius: var(--radius) var(--radius) 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 80vh; overflow: auto; box-shadow: var(--shadow-lift); }
.sheet h2 { margin: 0 0 12px; font-size: 18px; }
.switch-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.switch-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--paper); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.switch-row.active { border-color: var(--accent); background: var(--accent-soft); }
.switch-name { flex: 1; font-weight: 600; }
.btn.wide { width: 100%; justify-content: center; }

.badge.project-chip { background: var(--project-accent, var(--accent)); color: var(--accent-ink); font-weight: 600; border-color: transparent; }

.chip.project-chip-btn { display: inline-flex; align-items: center; gap: 6px; }

/* Inbox scope: everything across projects, or just the one in the header */
.scope-switch { gap: 6px; margin: 0 0 4px; }
.scope-switch .chip { display: inline-flex; align-items: center; gap: 6px; }
