:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #1d2330; --muted: #646d7e; --line: #e2e5eb;
  --accent: #2155cd; --accent-ink: #ffffff; --ok: #1d7a46; --ok-bg: #e3f4ea; --warn: #9a5b00; --warn-bg: #fff1d6;
  --bad: #b3261e; --bad-bg: #fde7e5; --info-bg: #e8eefc; --ins: #d8f5df; --del: #fbdcdc; --code: #f0f2f5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --card: #1b2029; --text: #e6e9ef; --muted: #98a1b2; --line: #2c3340;
    --accent: #7aa2ff; --accent-ink: #0d1220; --ok: #6fd39a; --ok-bg: #173325; --warn: #f0bb5e; --warn-bg: #3a2d12;
    --bad: #ff8a80; --bad-bg: #3d1a18; --info-bg: #1d2a47; --ins: #1d3b27; --del: #46201f; --code: #232a35;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
main { max-width: 1180px; margin: 0 auto; padding: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.brand span { color: var(--accent); font-weight: 600; }
.top nav { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.who { color: var(--muted); }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 18px; margin: 0 0 10px; } h3 { font-size: 15px; }
h2.inline { display: inline; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card.head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { margin-bottom: 0; } .grid-2 { margin-bottom: 16px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } .head-right { align-items: flex-start; } }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .err { color: var(--bad); }
.stack { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.row { display: flex; gap: 8px; margin: 10px 0; } .row input { flex: 1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 9px; width: 100%; }
textarea { resize: vertical; }
button, .button { font: inherit; font-weight: 500; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 6px; padding: 7px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; font-size: 13px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 6px 6px; }
table.list td { border-bottom: 1px solid var(--line); padding: 7px 6px; vertical-align: top; }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--info-bg); white-space: nowrap; }
.pill.big { font-size: 14px; padding: 3px 12px; }
.pill.approved, .pill.complete, .pill.done, .pill.applied { background: var(--ok-bg); color: var(--ok); }
.pill.changes_requested, .pill.partial, .pill.warn, .pill.flagged, .pill.processing, .pill.revising, .pill.running { background: var(--warn-bg); color: var(--warn); }
.pill.error, .pill.not_applied { background: var(--bad-bg); color: var(--bad); }
.pill.not_started, .pill.pending, .pill.collecting, .pill.queued { background: var(--code); color: var(--muted); }
.flash { padding: 10px 14px; border-radius: 8px; background: var(--info-bg); margin-bottom: 12px; }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.working { display: flex; gap: 12px; align-items: center; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.exports { display: flex; gap: 16px; margin-top: 12px; font-size: 14px; flex-wrap: wrap; }
.top-exports { margin: 0 0 12px; }
details.add { margin-top: 12px; } details summary { cursor: pointer; }
.timeline, .activity { padding-left: 18px; margin: 0; } .timeline li, .activity li { margin-bottom: 8px; }
.activity { list-style: none; padding: 0; max-height: 340px; overflow: auto; font-size: 14px; }
.md table { border-collapse: collapse; margin: 10px 0; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.md th { background: var(--code); }
.md code { background: var(--code); padding: 1px 4px; border-radius: 4px; }
.md h3 { margin-top: 18px; }
.cite { font-size: 12px; color: var(--muted); white-space: nowrap; }
a.ref { text-decoration: none; border-bottom: 1px dotted var(--accent); }
.ev-pop { position: fixed; right: 16px; bottom: 16px; width: min(560px, calc(100vw - 32px)); max-height: 60vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 10; }
.ev-pop pre { white-space: pre-wrap; font: 14px/1.5 system-ui, sans-serif; margin: 8px 0 0; }
.ev-head { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.ev-head span { color: var(--muted); flex: 1; }
.close { border: 0; background: none; font-size: 20px; line-height: 1; padding: 0 4px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 10px 0; flex-wrap: wrap; }
.tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 6px 10px; color: var(--muted); }
.tab.active { border-bottom-color: var(--accent); color: var(--text); }
.diff { white-space: pre-wrap; font-size: 14px; background: var(--bg); padding: 12px; border-radius: 8px; }
.diff ins { background: var(--ins); text-decoration: none; } .diff del { background: var(--del); }
.notes li { margin-bottom: 6px; } q { font-style: italic; }
.decision { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.decision textarea { flex-basis: 100%; }
label.radio { flex-direction: row; align-items: center; gap: 6px; font-weight: 600; }
label.radio input { width: auto; }
.changelog { background: var(--bg); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.document { max-width: 900px; margin: 0 auto 16px; }
.oq { margin-bottom: 12px; }
.quote-btn { flex-basis: 100%; text-align: left; }
.speaker { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); }
.speaker img { width: 160px; border-radius: 6px; flex: none; }
.speaker audio { height: 30px; width: 100%; max-width: 260px; margin-top: 4px; }
@media (max-width: 600px) { .speaker { flex-direction: column; } .speaker img { width: 100%; } }
