/* SPDX-License-Identifier: Apache-2.0 */
/* Heddle house look: warm paper and char grounds, one ember accent, hairline strokes, one
   ink-filled primary action. Cal Sans sets everything people read and every control; Paper Mono
   sets code (diffs, paths, symbols, SHAs, keys, hashes, shell commands) and compact record metadata.
   Fonts: Cal Sans and Paper Mono, SIL Open Font License 1.1 (see fonts/). */
@font-face { font-family: "Cal Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/CalSans-Variable.woff2") format("woff2-variations"); }
@font-face { font-family: "Cal Sans"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("/fonts/CalSans-Italic-Variable.woff2") format("woff2-variations"); }
@font-face { font-family: "Paper Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("/fonts/PaperMono-Variable.woff2") format("woff2-variations"); }

:root {
  color-scheme: dark;
  --font-body: "Cal Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Paper Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Char ground (Heddle manual dark). */
  --bg: #0e0c0a; --panel: #1a1714; --panel-strong: #221d18; --surface: #14110e;
  --stroke: rgba(245, 241, 234, 0.1); --stroke-subtle: rgba(245, 241, 234, 0.05);
  --text: #f5f1ea; --muted: rgba(245, 241, 234, 0.55); --faint: #888176;
  /* --accent-deep is the accent as text: the lifted ember holds 5.5:1 and up on every ground. */
  --accent: #cf6a45; --accent-deep: #e89a73; --accent-tint: rgba(207, 106, 69, 0.1);
  --ink-fill: #f5f1ea; --on-ink: #0e0c0a;
  --good: #9cc49a; --good-tint: rgba(156, 196, 154, 0.12);
  /* Rose, not rust: a rust risk sits too close to the terracotta accent to signal danger. */
  --risk: #ea99af; --risk-tint: rgba(234, 153, 175, 0.12);
  --caution: #d9b26a; --caution-tint: rgba(217, 178, 106, 0.12);
  --fiber: #6f685d; --code-bg: #12100d; --hover: rgba(245, 241, 234, 0.04);
  --radius: 6px;
}
:root[data-theme=light] {
  color-scheme: light;
  /* Paper ground (Heddle manual light). */
  --bg: #fdfdfb; --panel: #f7f5ef; --panel-strong: #fbfaf6; --surface: #fdfdfb;
  --stroke: rgba(33, 29, 22, 0.11); --stroke-subtle: rgba(33, 29, 22, 0.07);
  --text: #211d16; --muted: #6a6358; --faint: #756e65;
  --accent: #cf6a45; --accent-deep: #8f4322; --accent-tint: rgba(207, 106, 69, 0.1);
  --ink-fill: #211d16; --on-ink: #fdfdfb;
  --good: #3f6b47; --good-tint: rgba(63, 107, 71, 0.1);
  --risk: #8f1d2f; --risk-tint: rgba(143, 29, 47, 0.08);
  --caution: #7d5f26; --caution-tint: rgba(138, 106, 48, 0.1);
  --fiber: #8a8276; --code-bg: #f2efe7; --hover: rgba(33, 29, 22, 0.04);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font-body); font-optical-sizing: auto; font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
/* Pin Cal Sans to the house letter shape (UI, GEOM 25). Set on every element because the `font`
   shorthand, including the user agent's on form controls, resets font-variation-settings.
   Paper Mono has none of these axes, so code is unaffected. */
*, ::before, ::after { font-variation-settings: "GEOM" 25, "SHRP" 0, "YTAS" 1440 !important; }
a { color: inherit; text-decoration-color: var(--stroke); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3, p { margin: 0; }
p { margin: 8px 0; }
h1 { font-weight: 600; font-size: clamp(26px, 2.5vw, 34px); line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-weight: 600; font-size: 19px; line-height: 1.25; letter-spacing: -0.005em; }
h3 { font-weight: 600; font-size: 15.5px; }
strong, b { font-weight: 600; }

/* Paper Mono sets code and compact record metadata. The shell and reading text use Cal Sans. */
code, pre, kbd, .briefing-target, .briefing .tag { font-family: var(--font-mono); }
/* Code shows every character as typed (no coding ligatures: `===` stays three glyphs in a diff
   under review and in commands people copy); Paper Mono keeps its slashed zero. */
code, pre, kbd { font-size: 12.5px; font-feature-settings: "liga" 0; }
p > code, li > code, span > code, strong > code { font-size: 0.86em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Fragment targets accept focus without outlining the entire section. */
section[tabindex="-1"]:focus { outline: none; }

/* Controls inherit the reading face rather than the user agent's system font. */
button, input, select, textarea { font-family: inherit; }
/* Figures line up in counts, test tallies and diffstats. */
.badge, .count, .check-detail, .candidate-stats, .card-footer, .test-summary, .toolbar { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.count { color: var(--faint); font-size: 12px; font-weight: 400; letter-spacing: 0; margin-left: 6px; }
.separator { color: var(--faint); margin: 0 8px; }
.success-text { color: var(--good); } .error-text { color: var(--risk); } .conflict-text { color: var(--caution); }

/* Buttons: one ink-filled primary, hairline secondaries. */
button, .button { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; font-weight: 600; line-height: 1.3;
  padding: 9px 14px; border-radius: var(--radius); border: 1px solid var(--ink-fill); background: var(--ink-fill); color: var(--on-ink); cursor: pointer; text-decoration: none; }
button:hover, .button:hover { filter: brightness(1.06); }
button:disabled { opacity: 0.45; cursor: default; filter: none; }
button.quiet, .button.quiet { background: transparent; color: var(--text); border-color: var(--stroke); font-weight: 500; }
button.quiet:hover { background: var(--hover); }
button.small { padding: 4px 10px; font-size: 12px; }

input, textarea, select { width: 100%; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 9px 11px; }
textarea { min-height: 96px; resize: vertical; font-size: 15px; line-height: 1.5; }
input[type=radio] { width: auto; accent-color: var(--accent); margin: 0; }
label { display: block; margin: 14px 0; font-size: 13px; font-weight: 500; color: var(--muted); }
label input, label select, label textarea { display: block; margin-top: 6px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 600; color: var(--muted); padding: 0; margin: 14px 0 8px; }

/* Header bar. */
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 28px; border-bottom: 1px solid var(--stroke); background: var(--bg); position: sticky; top: 0; z-index: 2; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: inline-flex; gap: 3px; align-items: stretch; height: 22px; padding: 4px 5px; border-radius: 5px; background: var(--ink-fill); }
.brand-mark i { display: block; width: 3px; background: var(--on-ink); border-radius: 1px; }
.brand-mark i:nth-child(2) { background: var(--accent); }
.wordmark { font-weight: 700; letter-spacing: 0.04em; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 13px; }
nav { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-tint); }

main { max-width: 1320px; margin: 0 auto; padding: 18px 28px 56px; }
.breadcrumb { display: inline-block; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 14px; }
.page-title { margin: 2px 0 10px; max-width: 900px; }
.page-title h1 { margin-top: 4px; }
.page-title > p:not(.eyebrow) { color: var(--muted); font-size: 16px; margin: 4px 0; }

.panel { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 18px 20px; }
.notice { border: 1px solid var(--stroke); background: var(--surface); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; font-size: 14px; }
.notice.error { background: var(--risk-tint); }
.notice.warning { background: var(--caution-tint); }
.notice.landed { background: var(--good-tint); }

/* Badges and provenance tags. */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--stroke); color: var(--muted); white-space: nowrap; }
.badge.pass { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: var(--good-tint); }
.badge.fail, .badge.error { color: var(--risk); border-color: color-mix(in srgb, var(--risk) 40%, transparent); background: var(--risk-tint); }
.badge.skipped, .badge.pending { color: var(--faint); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border: 1px solid var(--stroke); border-radius: 4px; color: var(--muted); }
.tag.dashed, .signature { border: 1px dashed var(--fiber); border-radius: 4px; padding: 1px 7px; }
.signature { display: inline-block; font-size: 12px; color: var(--muted); margin: 6px 0; }
.signature code { font-size: 11.5px; }

/* Board. */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 10px; border-bottom: 1px solid var(--stroke-subtle); margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 22px; align-items: start; }
.task-column { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 14px 16px; }
.column-heading { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.task-column h2 a { text-decoration: none; }
.intent { color: var(--muted); font-size: 15px; margin: 4px 0; }
.reviewed-by { font-size: 12.5px; color: var(--muted); margin: 6px 0 2px; }
.lane-card { border-top: 1px solid var(--stroke-subtle); padding: 10px 2px 8px; line-height: 1.4; }
.lane-card:first-of-type { margin-top: 6px; }
.push-pulse { display: flex; gap: 12px; align-items: center; }
.push-pulse.pulsing .avatar { box-shadow: 0 0 0 3px var(--accent-tint); border-color: var(--accent); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--stroke); font-size: 13px; font-weight: 600; color: var(--text); background: var(--surface); flex: none; }
.lane-card h3 { font-size: 16px; }
.lane-card .muted { margin: 0; font-size: 12.5px; }
.card-status { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.sha { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; display: flex; justify-content: space-between; align-items: baseline; }
.sha code { font-size: 12px; }
.subject { font-size: 15px; margin: 4px 0 2px; }
.card-footer { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.compare-link { width: 100%; margin-top: 14px; }
.why-link { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--accent-deep); }
footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--stroke-subtle); font-size: 13px; color: var(--muted); }

/* Compare and decide: work on the left, the decision rail on the right. */
.conflict-banner { border: 1px solid color-mix(in srgb, var(--caution) 35%, transparent); background: var(--caution-tint); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 20px; }
.conflict-banner strong { font-size: 13.5px; color: var(--caution); }
.conflict-banner p { margin: 4px 0 0; display: flex; gap: 14px; align-items: baseline; font-size: 13px; color: var(--muted); }
.conflict-banner code { font-size: 12px; color: var(--text); }
.compare-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.compare-main { display: grid; gap: 22px; min-width: 0; }
.rail { display: grid; gap: 16px; position: sticky; top: 72px; }
.candidate-grid { display: grid; grid-template-columns: repeat(var(--candidate-count, 1), minmax(0, 1fr)); gap: 16px; }
.candidate { min-width: 0; }
.candidate-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.candidate-heading h2 { font-size: 22px; margin-top: 2px; }
.candidate-stats { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); border-top: 1px solid var(--stroke-subtle); padding-top: 10px; margin-top: 10px; }
.test-summary { font-size: 12.5px; color: var(--muted); }
.conflict-tag { font-size: 12.5px; color: var(--caution); background: var(--caution-tint); border-radius: 4px; padding: 4px 8px; }
pre { margin: 0; overflow: auto; }
.diff { background: var(--code-bg); border: 1px solid var(--stroke-subtle); border-radius: var(--radius); padding: 10px 0; margin-top: 12px; max-height: 340px; line-height: 1.55; }
.diff code > span { display: block; padding: 0 12px; white-space: pre; }
.diff-add { background: var(--good-tint); color: var(--good); }
.diff-remove { background: var(--risk-tint); color: var(--risk); }
.diff-region { color: var(--accent-deep); }

/* Discussion: people and agents in Cal Sans, keys and code in mono. */
.discussion h2 { margin-bottom: 6px; }
.turn { border-top: 1px solid var(--stroke-subtle); padding: 16px 0 12px; }
.turn-heading { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.turn-heading strong { font-size: 14px; }
.rich-text p { margin: 8px 0; font-size: 15.5px; }
.rich-text ul, .review-body ul { margin: 8px 0; padding-left: 20px; }
.rich-text code, .review-body code, .reviewer code { background: var(--code-bg); border: 1px solid var(--stroke-subtle); border-radius: 3px; padding: 0 4px; }
.turn-code { background: var(--code-bg); border: 1px solid var(--stroke-subtle); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; }
.review-body > p { font-size: 15.5px; }
.verdicts { list-style: none; padding: 0 !important; }
.verdicts li { padding: 8px 0; border-top: 1px dashed var(--stroke-subtle); }
.verdict { font-size: 12px; font-weight: 500; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--stroke); margin-right: 6px; }
.verdict.approve { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.verdict.concerns { color: var(--caution); border-color: color-mix(in srgb, var(--caution) 40%, transparent); }
.verdict-notes { display: block; color: var(--muted); font-size: 15px; margin-top: 4px; }
.discussion form { border-top: 1px solid var(--stroke); margin-top: 8px; padding-top: 4px; }

/* Decision rail. */
.decision h2 { font-size: 22px; margin: 4px 0; }
.decision > .muted { font-size: 14px; font-style: italic; }
.radio-choice { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin: 6px 0; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
.radio-choice:has(input:checked) { border-color: var(--ink-fill); box-shadow: inset 0 0 0 1px var(--ink-fill); }
.land-button { width: 100%; margin-top: 4px; padding: 11px 14px; }
.checks ul { list-style: none; margin: 8px 0 0; padding: 0; }
.check { display: grid; grid-template-columns: 16px auto 1fr; gap: 4px 8px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--stroke-subtle); font-size: 13.5px; }
.check .tag { grid-column: 2 / -1; justify-self: start; }
.check-mark { color: var(--faint); } .check.pass .check-mark { color: var(--good); } .check.fail .check-mark, .check.error .check-mark { color: var(--risk); }
.check-detail { color: var(--muted); font-size: 12.5px; }
.reviewer h2 { font-size: 19px; margin: 4px 0 6px; }
.reviewer > div > p:not(.eyebrow) { font-size: 15px; }
.reviewer ul { list-style: none; padding: 0; margin: 10px 0 0; }
.reviewer li { border-top: 1px dashed var(--stroke-subtle); padding: 8px 0; }
.reviewer li strong { font-size: 13.5px; }
.reviewer li p { font-size: 14.5px; color: var(--muted); margin: 4px 0 0; }

/* Why. */
.why-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: 22px; }
/* The narrative is the decision note as Git stores it, but people read it: Cal Sans, wrapped. */
.narrative pre { font-family: var(--font-body); font-size: 14.5px; font-feature-settings: normal; }
.narrative pre code { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.narrative-lines { background: var(--code-bg); border: 1px solid var(--stroke-subtle); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; font-size: 14.5px; line-height: 1.6; }
.narrative-lines .line { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.6em; }
.narrative-lines code { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.narrative-lines .proof { margin: 1px 0 3px; }
.narrative-lines .proof summary { cursor: pointer; color: var(--muted); font-size: 13px; white-space: pre-wrap; list-style-position: inside; }
.narrative-lines .proof summary::marker { color: var(--faint); }
.narrative-lines .proof-body { display: block; margin: 6px 0 8px 18px; font-size: 11.5px; color: var(--faint); white-space: pre-wrap; overflow-wrap: anywhere; }
.narrative pre, .git-instructions pre, .verification pre { background: var(--code-bg); border: 1px solid var(--stroke-subtle); border-radius: var(--radius); padding: 14px; margin: 12px 0; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.verification ul { padding-left: 18px; font-size: 14px; }
.login form, main > form.panel { max-width: 460px; }

@media (max-width: 1000px) { .compare-layout, .why-layout { grid-template-columns: 1fr; } .rail { position: static; } .candidate-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.reviewer .muted { font-size: 14px; font-style: italic; }
/* Context carried forward from earlier decisions. */
.briefed { margin: 6px 0 0; }
.context-supplied .briefing { margin-top: 10px; }
.briefing-target { font-size: 12px; color: var(--muted); }
.context-supplied .muted { font-style: italic; font-size: 14px; }
/* Combined with main: a candidate behind main, merged by Heddle, tested in the isolated sandbox. */
.combined-line { font-size: 12.5px; margin: 6px 0 0; color: var(--muted); }
.combined-line strong { font-weight: 600; }
.combined-pass strong, .combined-panel.combined-pass .combined-result strong { color: var(--good); }
.combined-fail strong, .combined-panel.combined-fail .combined-result strong { color: var(--risk); }
.combined-conflict strong, .combined-panel.combined-conflict .combined-result strong { color: var(--caution); }
.combined-panel { border: 1px solid var(--stroke-subtle); border-radius: 6px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
.combined-panel.combined-fail { border-color: var(--risk); }
.combined-panel.combined-conflict { border-color: var(--caution); background: var(--caution-tint); }
.combined-panel ul { margin: 4px 0 8px; padding-left: 18px; }
.combined-excerpt { max-height: 240px; overflow: auto; font-size: 12px; white-space: pre-wrap; }
.check.combined.pass .check-mark { color: var(--good); } .check.combined.fail .check-mark { color: var(--risk); } .check.combined.conflict .check-mark { color: var(--caution); }

/* Decision and briefing tags retain spacing and wrap within the decision rail. */
.notice .tag { margin-left: 4px; max-width: 100%; overflow-wrap: anywhere; }

/* Captures share one time scale across every lane. */
.captures { margin-top: 20px; scroll-margin-top: 24px; }
.captures-heading, .capture-navigation { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.capture-timeline { margin: 24px 0; }
.capture-axis, .capture-track { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; }
.capture-axis { color: var(--muted); font-size: 12px; height: 32px; }
.capture-axis > div { position: relative; }
.capture-axis time { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.capture-track { min-height: 62px; align-items: center; border-top: 1px solid var(--stroke-subtle); }
.capture-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.capture-track-line { position: relative; height: 36px; background: linear-gradient(var(--stroke), var(--stroke)) center / 100% 1px no-repeat; }
.capture-span { position: absolute; top: 14px; height: 8px; border-radius: 4px; background: var(--accent); opacity: .4; }
.capture-working { position: absolute; top: 11px; height: 14px; min-width: 6px; border-radius: 7px; background: var(--accent); opacity: .14; }
button.capture-dot { position: absolute; top: 4px; width: 28px; height: 28px; padding: 0; transform: translateX(-50%); border: 0; border-radius: 50%; background: transparent; justify-content: center; }
button.capture-dot::after { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent-deep); background: var(--panel); }
button.capture-dot[aria-pressed=true]::after { background: var(--accent-deep); width: 16px; height: 16px; }
.capture-waiting { position: absolute; top: 6px; left: 3%; background: var(--panel); padding: 0 8px; }
.capture-detail { border-top: 1px solid var(--stroke); padding-top: 16px; }
.capture-detail h3 { font-size: 18px; }
.capture-metadata { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 13px; }
.semantic-changes { max-height: 240px; overflow-y: auto; padding: 0 20px; font-size: 15px; }
.semantic-changes li { margin: 5px 0; }
@media (max-width: 700px) {
  .capture-axis, .capture-track { grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
  .capture-label .tag { font-size: 10px; }
  .capture-axis time { font-size: 10px; }
  .captures-heading { flex-wrap: wrap; }
}

/* Dashboard and spool shell, drawn from the task's visual references. */
:root {
  --panel: #14120f;
  --accent-tint: color-mix(in oklab, #cf6a45 9%, transparent);
  --radius-card: 14px; --radius-surface: 18px; --radius-large: 22px;
  --dur-base: 200ms; --ease-base: cubic-bezier(0.2,0.8,0.2,1);
  --space-1: 2px; --space-2: 4px; --space-3: 6px; --space-4: 8px; --space-5: 10px;
}
:root[data-theme=light] {
  --panel: oklab(0.9806 -0.0004 0.0057);
  --stroke: oklab(0.233 0.002 0.014 / 0.066);
  --stroke-subtle: oklab(0.233 0.002 0.014 / 0.066);
  --accent-strong: #a7512c;
  --code-bg: color-mix(in oklab, var(--text) 5%, var(--bg));
}
button, .button, a { transition: background-color var(--dur-base) var(--ease-base), border-color var(--dur-base) var(--ease-base); }
header { height: 68px; padding: 10px 24px; background: var(--panel); }
.brand-mark { height: 32px; padding: 7px 8px; border-radius: 8px; }
.wordmark { font-size: 16px; letter-spacing: -0.01em; }
.brand-sub { padding-left: 8px; border-left: 1px solid var(--stroke); font-size: 14px; }
header nav { flex-shrink: 0; }
.app-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr) 320px; align-items: start; gap: var(--space-5); max-width: none; margin: 0; padding: var(--space-5) var(--space-5) 0; }
.page-centre { min-width: 0; padding: 18px 2px 40px; }
.rail-card { position: sticky; top: 78px; min-width: 0; min-height: calc(100dvh - 78px); max-height: calc(100dvh - 78px); overflow-y: auto; scrollbar-width: thin; background: var(--panel); border: 1px solid var(--stroke); border-radius: 8px; padding: 16px; }
.rail-title { font-size: 17px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 18px; }
.rail-card > section + section { margin-top: 30px; }
.left-rail { padding: 16px 12px 24px; }
.left-rail .rail-title { margin-left: 4px; }
.rail-note { color: var(--muted); font-size: 13px; margin: 30px 6px 0; }
.view-list { display: grid; gap: 2px; }
.view-row { width: 100%; border: 0; border-radius: 3px; padding: 8px 10px; background: transparent; color: var(--text); font-size: 14px; font-weight: 500; text-align: left; gap: 8px; }
.view-row:hover { background: var(--hover); filter: none; }
.view-row[aria-pressed=true] { background: var(--accent-tint); font-weight: 600; }
.view-row .count { font-size: 14px; color: var(--muted); }
.view-row[aria-pressed=true] .count { color: var(--accent-deep); }
.facts { display: grid; gap: 12px; margin: 0; font-size: 14px; line-height: 1.4; }
.facts > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 10px; }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; margin: 0; overflow-wrap: anywhere; max-width: 170px; }
.facts code { font-size: 12px; }
.facts a { color: var(--accent-deep); text-decoration: none; }
.app-shell .page-title { margin: 0 0 24px; }
.app-shell .page-title h1 { font-size: 45px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; margin: 0; overflow-wrap: anywhere; }
.app-shell .page-title .date-line { color: var(--muted); font-size: 14px; margin: 6px 0 2px; }
.app-shell .page-title .path-line { font-size: 13px; margin: 12px 0 14px; color: var(--muted); overflow-wrap: anywhere; }
.path-line code { font-size: 13px; }
.app-shell .page-title .intent { font-size: 15px; margin: 0; color: var(--muted); }
.app-shell .toolbar { margin: 0 0 24px; padding: 0; border: 0; color: var(--text); font-size: 14px; }
.app-shell h2 { font-size: 20px; }
.app-shell .rail-title { font-size: 17px; }
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.task-group > h2 { margin-bottom: 12px; }
.task-column { padding: 14px 12px; border: 0; border-radius: 3px; background: var(--panel); margin-bottom: 10px; }
.task-column.needs-decision { background: var(--accent-tint); }
.task-row-heading { display: flex; align-items: flex-start; gap: 12px; }
.task-row-heading > div { flex: 1; min-width: 0; }
.task-row-heading h3 { font-size: 16px; line-height: 1.35; }
.task-row-heading h3 a { text-decoration: none; overflow-wrap: anywhere; }
.task-row-heading .intent { font-size: 14px; line-height: 1.4; margin: 4px 0 0; }
.task-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 4px; flex: none; color: var(--accent-deep); background: var(--accent-tint); }
.task-status { color: var(--accent-deep); font-size: 12px; line-height: 1.4; text-align: right; max-width: 130px; }
.column-heading { margin: 8px 0 0 40px; font-size: 12px; }
.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 8px 20px; margin-top: 10px; }
.lane-card { min-width: 0; margin: 0 !important; padding: 12px 0 8px; border-top: 1px solid var(--stroke); }
.lane-card .push-pulse { gap: 10px; }
.lane-card .push-pulse > div { min-width: 0; }
.lane-card h3 { font-size: 15px; }
.lane-card .subject { font-size: 14px; }
.lane-card .card-status { flex-wrap: wrap; gap: 6px; }
.lane-card .sha { flex-wrap: wrap; gap: 4px; }
.lane-card .card-footer { flex-wrap: wrap; gap: 6px; }
.lane-card .badge { white-space: normal; }
.compare-link { width: auto; margin-top: 10px; padding: 6px 10px; border: 0; background: transparent; color: var(--accent-deep); font-size: 13px; }
.compare-link:hover { background: var(--hover); }
.why-link { margin: 0 10px; }
.empty-state { color: var(--muted); font-size: 14px; margin: 0; }
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; font-size: 14px; }
.activity-list li > div { min-width: 0; }
.activity-list a { text-decoration: none; }
.activity-list .muted { font-size: 12px; }
.activity-dot { width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.activity-list p { margin: 3px 0 0; line-height: 1.4; }
.activity-path code { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.activity-list .muted code { font-size: 11.5px; }
.tree-project { display: flex; justify-content: space-between; text-decoration: none; font-size: 14px; font-weight: 600; margin: 0 2px 10px; }
.tree-project .count { font-size: 13px; }
.task-tree { display: grid; gap: 2px; margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--stroke); }
.task-tree a { display: block; padding: 10px 12px; border-radius: 2px; text-decoration: none; min-width: 0; }
.task-tree a:hover { background: var(--hover); }
.task-tree a[aria-current=page] { background: var(--accent-tint); }
.tree-label { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.tree-status { color: var(--muted); }
.task-tree .muted { display: block; font-size: 12px; margin-top: 3px; }
.rail-back { display: block; font-size: 13px; color: var(--muted); text-decoration: none; margin: 28px 4px 0; }
.task-tabs { position: sticky; top: 68px; z-index: 1; display: flex; gap: 26px; padding: 0 12px; margin-bottom: 20px; background: var(--bg); border-bottom: 1px solid var(--stroke); }
.task-tabs a { display: block; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 0; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.task-tabs a[aria-current=location] { color: var(--text); font-weight: 600; border-color: var(--accent); }
.compare-main { gap: 28px; }
.section-title { margin-bottom: 16px; }
.candidates-section, #captures, #discussion, #context { scroll-margin-top: 128px; }
.candidate-grid { gap: 12px; grid-template-columns: repeat(min(2, var(--candidate-count)), minmax(0, 1fr)); }
.candidate.panel { padding: 14px; background: transparent; border-radius: var(--radius-card); }
.candidate-heading { flex-wrap: wrap; gap: 8px; }
.candidate-heading h2 { font-size: 20px; margin: 0; }
.candidate-heading .eyebrow { display: none; }
.candidate > .muted { margin: 4px 0; }
.candidate .subject { font-size: 14px; margin: 6px 0 2px; }
.candidate .test-summary { margin: 4px 0; }
.spool .conflict-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 8px 10px; margin-bottom: 18px; font-size: 12px; }
.spool .conflict-banner p { margin: 0; font-size: 12px; }
.candidate .badge { white-space: normal; }
.candidate .signature { max-width: 100%; overflow-wrap: anywhere; margin: 8px 0 0; border: 0; padding: 0; font-size: 11.5px; }
.candidate-stats { flex-wrap: wrap; gap: 4px; padding-top: 6px; margin-top: 8px; margin-bottom: 6px; }
.candidate .diff { max-height: 280px; }
.candidates-section > .reviewer { margin-top: 20px; }
.spool .rail { display: block; }
.right-rail .panel { padding: 0; border: 0; border-radius: 0; background: transparent; }
.right-rail .decision { margin-top: 24px; }
.right-rail .decision > .eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.right-rail .decision h2 { font-size: 17px; margin: 4px 0; }
.right-rail .decision > .muted { font-size: 13px; font-style: normal; }
.right-rail label { font-size: 13px; margin: 8px 0; }
.right-rail legend { font-size: 12px; letter-spacing: 0; text-transform: none; margin: 10px 0 6px; }
.right-rail .facts { gap: 10px; }
.right-rail textarea { min-height: 72px; font-size: 13px; }
.right-rail .radio-choice { grid-template-columns: auto 1fr auto; padding: 8px 10px; gap: 4px 8px; margin: 6px 0; }
.radio-choice .badge { grid-column: auto; justify-self: start; font-size: 11.5px; white-space: normal; }
.radio-choice:has(input:checked) { border-color: var(--accent); box-shadow: none; background: var(--accent-tint); }
.right-rail .land-button { position: sticky; bottom: 0; z-index: 1; margin-top: 10px; box-shadow: 0 -8px 12px var(--panel); }
.right-rail .land-button:disabled { opacity: 1; background: var(--panel-strong); color: var(--muted); border-color: var(--stroke); }
.mobile-decision-link { display: none; }
.spool .checks { margin-top: 28px; }
.checks .check { grid-template-columns: 16px minmax(0, 1fr); }
.checks .check-detail { grid-column: 2; }
.spool .captures, .spool .discussion, .spool .context-supplied, .spool .reviewer { background: transparent; border: 0; border-top: 1px solid var(--stroke); border-radius: 0; padding: 20px 0 0; margin-top: 0; }
.capture-axis, .capture-track { grid-template-columns: 130px minmax(0, 1fr); gap: 12px; }
.capture-navigation button { font-size: 12px; padding: 7px 10px; }
.capture-axis time:first-child { transform: none; }
.capture-axis time:last-child { transform: translateX(-100%); }
.context-supplied h2 { margin-bottom: 12px; }
@media (max-width: 1359px) {
  .app-shell { grid-template-columns: 240px minmax(0, 1fr) 280px; }
  .right-rail { padding: 16px 14px; }
  .task-status { max-width: 100px; }
}
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .right-rail { grid-column: 2; min-height: auto; max-height: none; position: static; margin-bottom: 10px; }
  .left-rail { grid-row: 1 / 3; }
  .page-centre { padding-bottom: 20px; }
  .candidate-grid { grid-template-columns: repeat(min(2, var(--candidate-count)), minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  header { position: static; height: auto; min-height: 60px; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .wordmark { display: none; }
  .brand-sub { padding: 0; border: 0; }
  header nav { gap: 10px; font-size: 12px; }
  header nav .quiet { padding: 6px 8px; font-size: 12px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .left-rail { grid-row: auto; position: static; min-height: auto; max-height: none; padding: 12px; }
  .left-rail .rail-title { margin-bottom: 12px; }
  .view-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .rail-note, .rail-back { display: none; }
  .task-tree { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .right-rail { grid-column: 1; }
  .mobile-decision-link { display: inline-block; margin: 0 0 20px; color: var(--accent-deep); font-size: 13px; text-decoration: none; }
  #decision { scroll-margin-top: 60px; }
  .page-centre { padding: 14px 4px; }
  .app-shell .page-title h1 { font-size: 36px; }
  .task-tabs { top: 0; gap: 20px; padding: 0; }
  .task-tabs a { font-size: 13px; }
  .candidate-grid { grid-template-columns: minmax(0, 1fr); }
  .task-row-heading { flex-wrap: wrap; gap: 8px; }
  .task-status { margin-left: 36px; max-width: none; text-align: left; }
  .app-shell .toolbar { flex-wrap: wrap; }
  .capture-axis, .capture-track { grid-template-columns: 90px minmax(0, 1fr); gap: 8px; }
  .captures-heading { flex-wrap: wrap; }
  .candidates-section, #captures, #discussion, #context { scroll-margin-top: 60px; }
  .app-shell footer { margin-top: 28px; }
}

/* Discussion threads: a shared byline, paper bubbles, and signed turns. */
.discussion-heading { display: flex; align-items: center; gap: 12px; }
.discussion-heading h2 { margin: 0; }
.discussion-title { font: 12px/1.5 var(--font-mono); color: var(--muted); margin: 6px 0 10px; }
.discussion-status { font: 11px/1.4 var(--font-mono); border: 1px solid var(--stroke); border-radius: 20px; padding: 1px 8px; color: var(--accent-deep); }
.discussion-status.resolved { color: var(--good); border-color: color-mix(in oklab, var(--good) 35%, transparent); }
.anchor-chip { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 3px 8px; border: 1px solid var(--stroke); border-radius: 4px; font: 12px/1.5 var(--font-mono); color: var(--muted); background: var(--panel); max-width: 100%; overflow-wrap: anywhere; }
.anchor-chip code { font-size: inherit; }
.symbol-chip { color: var(--accent-deep); font: 12px/1.5 var(--font-mono); overflow-wrap: anywhere; }
.discussion-thread { display: grid; gap: 14px; margin: 20px 0; }
.discussion .turn { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 9px; padding: 0; border: 0; }
.turn-avatar { width: 26px; height: 26px; grid-row: 1 / 3; font: 12px var(--font-mono); background: var(--hover); color: var(--muted); border: 0; }
.turn-human .turn-avatar { color: var(--accent-deep); background: var(--accent-tint); }
.turn-heading { grid-column: 2; justify-content: flex-start; gap: 7px; flex-wrap: wrap; margin-bottom: 4px; font: 12px/1.5 var(--font-mono); }
.turn-heading strong { font-size: 12px; font-weight: 600; }
.turn-heading time { color: var(--muted); font-size: 11px; }
.turn-role { color: var(--muted); border: 1px solid var(--stroke); border-radius: 20px; padding: 0 6px; font-size: 10px; }
.turn-content { grid-column: 2; min-width: 0; max-width: 62ch; }
.turn-bubble { border: 1px solid var(--stroke); border-radius: 4px 12px 12px 12px; padding: 8px 12px; overflow-wrap: anywhere; }
.turn-agent .turn-bubble, .turn-reviewer .turn-bubble { border-style: dashed; background: transparent; }
.turn-human .turn-bubble { background: var(--accent-tint); border-color: color-mix(in oklab, var(--accent) 30%, var(--stroke)); }
.turn-bubble .rich-text > :first-child { margin-top: 0; }
.turn-bubble .rich-text > :last-child { margin-bottom: 0; }
.turn-bubble .rich-text p { font-size: 15px; }
.turn-bubble .signature { border: 0; padding: 0; margin: 5px 0 0; font-size: 10px; }
.turn-bubble .signature code { font-size: 10px; }
.turn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; }
.turn-actions .muted { font-size: 11px; }
button.turn-reply { border: 0; padding: 2px 0; font-size: 11px; color: var(--muted); }
.discussion .turn-grouped { margin-top: -10px; }
.discussion form { margin-top: 18px; }

/* Annotation cards share the same structure with a recorded decision's Reason. */
:root { --kind-constraint: #ba9aca; --kind-invariant: #9cc49a; --kind-rationale: #e89a73; }
:root[data-theme=light] { --kind-constraint: #80539c; --kind-invariant: #3f6b47; --kind-rationale: #8f4322; }
.annotation-card { --kind-color: var(--accent-deep); background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-surface); overflow: hidden; margin: 12px 0; }
.annotation-constraint { --kind-color: var(--kind-constraint); }
.annotation-invariant { --kind-color: var(--kind-invariant); }
.annotation-rationale { --kind-color: var(--kind-rationale); }
.annotation-heading { display: flex; align-items: center; gap: 9px; padding: 12px 20px; border-bottom: 1px solid var(--stroke); font: 12px/1.4 var(--font-mono); }
.kind-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--kind-color); flex: none; }
.annotation-note { padding: 16px 20px 18px; }
.annotation-target { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; font: 12px/1.5 var(--font-mono); margin-bottom: 10px; overflow-wrap: anywhere; }
.annotation-target .briefing-target { color: var(--text); font-weight: 600; }
.annotation-target .anchor-chip { padding: 0; border: 0; background: transparent; flex-direction: row-reverse; }
.annotation-scope { color: var(--muted); }
.annotation-note .rich-text p { font-size: 15.5px; line-height: 1.6; margin: 0 0 12px; }
.annotation-note .rich-text code { color: var(--accent-deep); background: var(--accent-tint); border: 0; }
.annotation-footer { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 8px; margin-top: 16px; font: 11px/1.5 var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.annotation-footer .tag { font: inherit; margin: 0; }
.briefing-hash { margin-left: auto; padding: 1px 7px; border: 1px solid var(--stroke); border-radius: 4px; font-size: 11px; }
.briefing-lane { font: 12px/1.5 var(--font-mono); margin: 20px 0 8px; }
.notice.landed .annotation-card, .publication-pending .annotation-card { margin: 12px 0; }
.narrative > .annotation-card { margin: 16px 0 20px; }

/* Reviews retain the recommendation, then give each candidate a verdict and a quote. */
.reviewer-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.reviewer-model { font: 11px/1.5 var(--font-mono); color: var(--muted); padding: 1px 7px; border: 1px solid var(--stroke); border-radius: 4px; overflow-wrap: anywhere; }
.reviewer-summary { margin: 14px 0; }
.reviewer-summary h3 { font-size: 15px; }
.reviewer .reviewer-summary .muted { font-style: normal; }
.review-rows { list-style: none; padding: 0; margin: 0; }
.review-row { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid var(--stroke); }
.review-glyph { font: 14px/1.6 var(--font-mono); color: var(--accent-deep); }
.review-approve .review-glyph { color: var(--good); }
.review-agent { font: 600 12px/1.6 var(--font-mono); }
.review-row blockquote { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 3px 0 0; }
.review-row blockquote::before { content: '“'; }
.review-row blockquote::after { content: '”'; }

/* Signed capture facts follow the compact key–value attribution card. */
.attribution-card { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-surface); padding: 14px 20px; margin: 14px 0 18px; max-width: 62ch; }
.attribution-card > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--stroke); }
.attribution-card > div:last-child { border: 0; }
.attribution-card dt { color: var(--muted); font: 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.attribution-card dd { margin: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.attribution-card code { font-size: 12px; }
.attribution-signature { color: var(--accent-deep); }
.attribution-card .test-summary { font-size: 13px; }
@media (max-width: 760px) {
  .annotation-heading { padding: 10px 14px; }
  .annotation-note { padding: 12px 14px; }
  .attribution-card { padding: 10px 14px; }
  .attribution-card > div { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
}
