/* Viewer for the judge-facing replay, set in the CHART Library composite of
   the heme design system: light chrome on the ink ramp with a dark remap,
   three anchors (near-black, Oxford navy, surface), Google Sans Flex for the
   interface, JetBrains Mono for codes, ids, dates, hashes and counts, and a
   serif reading face for record text and the letter, since those are
   documents. Status is a glyph, a label and a weight in a low-chroma state
   color. Hairlines do the structure. Max radius 8px. */

@import url("https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,wght@6..144,1..1000&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap");

:root {
  --brand: #14181C;
  --brand-hover: #2D3338;
  --heading: #002147;
  --ink-0: #FAFBFC;
  --ink-1: #F2F4F6;
  --ink-2: #E5E8EC;
  --ink-3: #CDD3D9;
  --ink-4: #97A1AB;
  --ink-5: #6B747D;
  --ink-6: #4A525B;
  --ink-7: #2D3338;
  --surface: #FFFFFF;
  --on-brand: #FFFFFF;
  --accent: #002147;
  --accent-soft: #EAEEF4;
  --shadow-card: 0 1px 2px rgba(20, 24, 28, 0.04), 0 1px 1px rgba(20, 24, 28, 0.03);
  /* the deliberate low-chroma semantic set from the CHART Library */
  --state-pass: oklch(0.45 0.11 155);
  --state-blocked: oklch(0.47 0.15 28);
  --state-declined: oklch(0.46 0.09 262);
  --state-failed: oklch(0.52 0.13 65);
  --read: oklch(0.42 0.10 262);
  --font-sans: "Google Sans Flex", "Google Sans", "Inter", "Calibri", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --read-serif: "garamond-premier-pro-subhead", "EB Garamond", "Adobe Garamond Pro", Garamond, Georgia, serif;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --hairline: 0.5px solid var(--ink-2);
  --motion-quick: 120ms;
  --motion-base: 180ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #FAFBFC;
  --brand-hover: #E5E8EC;
  --heading: #B6C6E0;
  --ink-0: #14181C;
  --ink-1: #1B2026;
  --ink-2: #272E36;
  --ink-3: #39424C;
  --ink-4: #6B747D;
  --ink-5: #97A1AB;
  --ink-6: #CDD3D9;
  --ink-7: #EAEDF1;
  --surface: #1B2026;
  --on-brand: #14181C;
  --accent: #B6C6E0;
  --accent-soft: #232B36;
  --shadow-card: none;
  --state-pass: oklch(0.78 0.11 155);
  --state-blocked: oklch(0.76 0.12 28);
  --state-declined: oklch(0.78 0.08 262);
  --state-failed: oklch(0.80 0.12 65);
  --read: oklch(0.78 0.08 262);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink-0);
  color: var(--ink-6);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 450;
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--heading); text-decoration: none; }
a:hover { color: var(--brand); text-decoration: underline; }
button, select { font: inherit; color: inherit; }
h1, h2 { margin: 0; }
h2 { font-size: 13.5px; font-weight: 500; color: var(--ink-7); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; }
.mono, .id, .date, .src, .cid, .num, .stamp, .keys { font-family: var(--font-mono); }
.hidden { display: none; }

/* --- title cards --------------------------------------------------------- */
/* One line at a time, large enough to fill the screen, held for as long as
   it takes to read, then the cards dissolve into the replay. The one
   orchestrated moment on the page; nothing else moves on its own. */
.intro { position: fixed; inset: 0; z-index: 100; background: var(--ink-0); display: grid; place-items: center; padding: 40px 3vw; opacity: 1; transition: opacity 500ms var(--ease-out); }
.intro[hidden] { display: none; }
.intro.leaving { opacity: 0; pointer-events: none; }
.intro-stage { display: grid; width: 94vw; max-width: none; }
.intro-line { grid-area: 1 / 1; margin: 0; text-align: center; font-family: var(--font-mono); font-weight: 400; font-size: clamp(30px, 4.3vw, 82px); line-height: 1.25; letter-spacing: -0.01em; color: var(--ink-7); opacity: 0; transition: opacity 500ms var(--ease-out); }
.intro-line.show { opacity: 1; transition: none; }
.intro-line:not(.show) { transition: opacity 400ms var(--ease-out); }
/* the cursor: a thin block after the last typed character, blinking while typing */
.intro-line .ch { visibility: hidden; }
.intro-line .ch.on { visibility: visible; }
.intro-line .cursor { display: inline-block; width: 0.55em; height: 1em; margin-left: 0.05em; vertical-align: -0.12em; background: var(--ink-7); animation: cursor 900ms steps(2, start) infinite; }
@keyframes cursor { to { visibility: hidden; } }
.intro.all .intro-stage { gap: 32px; }
.intro.all .intro-line { grid-area: auto; font-size: clamp(24px, 2.4vw, 34px); }
.intro-foot { position: absolute; left: 48px; right: 48px; bottom: 40px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.intro-stamp { font-family: var(--font-mono); font-size: 11px; color: var(--ink-5); }

/* --- top bar: 56px, light, hairline -------------------------------------- */

.bar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 24px;
  align-items: center;
  height: 56px;
  padding: 0 24px;
  border-bottom: var(--hairline);
  background: var(--ink-0);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; }
.brand-name { font-size: 17px; font-weight: 500; letter-spacing: -0.005em; color: var(--brand); }
.brand-sub { color: var(--ink-5); font-size: 12.5px; font-weight: 500; }
.tabs { display: flex; height: 56px; }
.tab {
  height: 56px; padding: 0 14px;
  border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--ink-5);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background var(--motion-quick), color var(--motion-quick);
}
.tab:hover { background: var(--ink-1); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.pickers { display: flex; gap: 14px; justify-content: flex-end; min-width: 0; }
.picker { display: flex; align-items: center; gap: 8px; color: var(--ink-5); font-size: 12.5px; font-weight: 500; }
select {
  height: 32px;
  background: var(--surface);
  border: var(--hairline);
  border-radius: var(--radius-md);
  padding: 0 8px;
  max-width: 340px;
  color: var(--ink-7);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color var(--motion-quick);
}
select:hover { border-color: var(--ink-3); }
.transport { display: flex; align-items: center; gap: 6px; }
.btn {
  height: 32px;
  border: var(--hairline);
  background: var(--surface);
  color: var(--ink-6);
  border-radius: var(--radius-md);
  padding: 0 10px;
  min-width: 32px;
  font-size: 12.5px;
  font-weight: 450;
  cursor: pointer;
  transition: background var(--motion-quick), border-color var(--motion-quick), color var(--motion-quick);
}
.btn:hover { background: var(--ink-1); }
.btn:active { background: var(--ink-2); }
.btn:disabled { color: var(--ink-4); pointer-events: none; }
.btn.primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); min-width: 64px; font-weight: 500; padding: 0 14px; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.speed { max-width: 68px; }

/* --- stage ----------------------------------------------------------------- */

.stage { flex: 1; display: flex; flex-direction: column; padding: 0 24px; min-height: 0; }
.stage[hidden] { display: none; }

/* the case header, laid out like a book header: crumb, title, meta, provenance */
.context { padding: 14px 0 12px; border-bottom: var(--hairline); display: flex; flex-direction: column; gap: 4px; }
.crumb { font-size: 12.5px; color: var(--ink-5); }
.crumb .sep { margin: 0 6px; color: var(--ink-4); }
.ctx-title { font-size: 22px; font-weight: 450; letter-spacing: -0.013em; line-height: 1.15; color: var(--heading); }
.ctx-meta { font-size: 12.5px; color: var(--ink-6); display: flex; flex-wrap: wrap; gap: 0 14px; }
.ctx-meta .mono { color: var(--ink-7); }
.ctx-meta .strong { font-weight: 500; color: var(--ink-7); }
.stamp { font-size: 11px; color: var(--ink-5); display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 2px; }

.panels {
  flex: 1;
  display: grid;
  grid-template-columns: 5fr 6fr 7fr;
  gap: 0;
  min-height: 0;
  border-left: var(--hairline);
  border-right: var(--hairline);
}
.panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  min-height: 0;
  overflow: hidden;
  border-right: var(--hairline);
  transition: box-shadow var(--motion-base) var(--ease-out);
}
.panel:last-child { border-right: 0; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: var(--hairline);
  background: var(--ink-0);
}
.panel-meta { color: var(--ink-5); font-size: 11px; font-family: var(--font-mono); white-space: nowrap; }
.panel ol, .panel ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
.panel ol { flex: 1; }

/* --- chart index: outline rows, serif when opened -------------------------- */

.entry {
  padding: 6px 16px 6px 14px;
  border-left: 2px solid transparent;
  border-bottom: var(--hairline);
  color: var(--ink-4);
  transition: color var(--motion-base) var(--ease-out), background var(--motion-base) var(--ease-out), border-color var(--motion-base) var(--ease-out);
}
.entry .head { display: flex; gap: 10px; font-size: 11px; font-weight: 500; align-items: baseline; }
.entry .id { min-width: 60px; }
.entry .date { color: inherit; }
.entry .line { font-size: 12.5px; line-height: 1.4; margin-top: 1px; }
.entry .full {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--motion-base) var(--ease-out);
}
.entry .full > div { overflow: hidden; }
.entry .full p { margin: 6px 0 2px; font-family: var(--read-serif); font-size: 15px; line-height: 1.5; color: var(--ink-7); }
.entry[data-state="read"] { color: var(--ink-5); border-left-color: var(--read); }
.entry[data-state="read"] .line, .entry[data-state="open"] .line { color: var(--ink-7); }
.entry[data-state="open"] { color: var(--ink-5); background: var(--accent-soft); border-left-color: var(--read); }
.entry[data-state="open"] .full { grid-template-rows: 1fr; }
.entry[data-state="open"] .line { display: none; }
.entry .tag { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: 450; color: var(--ink-5); }
.entry .tag.live { color: var(--state-declined); font-weight: 500; }

/* --- criteria: role glyph, text, warrant quotes ---------------------------- */

.criterion {
  padding: 9px 16px;
  border-bottom: var(--hairline);
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 6px 10px;
  transition: background var(--motion-base) var(--ease-out);
}
.criterion .box {
  width: 14px; height: 20px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  transition: color var(--motion-quick);
}
.criterion[data-status="verified"] .box { color: var(--state-pass); font-weight: 500; }
.criterion[data-status="unverified"] .box { color: var(--state-blocked); font-weight: 500; }
.criterion[data-status="unverified"] { background: var(--ink-1); }
.criterion .text { font-size: 13px; line-height: 1.45; color: var(--ink-7); }
.criterion .cid { color: var(--ink-5); font-size: 10.5px; margin-right: 8px; }
.criterion .evidence { grid-column: 2; display: flex; flex-direction: column; gap: 6px; }
.quote {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 5px 10px;
  background: color-mix(in oklab, var(--state-pass) 10%, transparent);
  box-shadow: inset 0 -1.5px 0 var(--state-pass);
  border-radius: var(--radius-sm);
  font-family: var(--read-serif);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-7);
  animation: arrive var(--motion-base) var(--ease-out);
}
.quote[data-status="refuted"], .quote[data-status="unresolved"], .quote[data-status="error"] {
  background: color-mix(in oklab, var(--state-blocked) 12%, transparent);
  box-shadow: inset 0 -1.5px 0 var(--state-blocked);
}
.quote .src { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-5); white-space: nowrap; align-self: start; }
.quote .why { grid-column: 1 / -1; font-family: var(--font-sans); font-size: 11px; font-weight: 500; color: var(--state-blocked); }
.criterion .none { grid-column: 2; font-size: 12.5px; font-weight: 500; color: var(--state-blocked); }

/* the advisor beside the criterion: a named opinion on whether the quotes satisfy it */
.criterion .advice { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 12px; color: var(--ink-6); padding-top: 2px; animation: arrive var(--motion-base) var(--ease-out); }
.criterion .advice-tag { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-5); border: var(--hairline); border-radius: var(--radius-sm); padding: 0 6px; height: 18px; display: inline-flex; align-items: center; white-space: nowrap; }
.criterion .advice-verdict { font-family: var(--font-mono); font-size: 11px; font-weight: 500; white-space: nowrap; }
.criterion .advice[data-verdict="supports"] .advice-verdict { color: var(--state-pass); }
.criterion .advice[data-verdict="partial"] .advice-verdict { color: var(--state-failed); }
.criterion .advice[data-verdict="silent"] .advice-verdict { color: var(--state-blocked); }
.criterion .advice-why { flex-basis: 100%; color: var(--ink-6); }

.lookups { border-top: var(--hairline); flex: 0 0 auto; background: var(--ink-0); }
.lookups:empty { display: none; }
.lookups li { padding: 8px 16px; font-size: 12px; color: var(--ink-6); display: flex; gap: 10px; align-items: baseline; }
.lookups .live-tag {
  display: inline-flex; align-items: center; height: 20px;
  border: var(--hairline); color: var(--state-declined);
  padding: 0 7px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; white-space: nowrap;
}

/* --- draft: a reading column with the gate's stamps ----------------------- */

.sentence {
  padding: 10px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  animation: arrive var(--motion-base) var(--ease-out);
}
.sentence .text {
  font-family: var(--read-serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-7);
  max-width: 66ch;
  background: color-mix(in oklab, var(--state-pass) 8%, transparent);
  box-decoration-break: clone;
  padding: 0 2px;
  border-radius: var(--radius-sm);
}
.sentence .stamp {
  align-self: start;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--state-pass);
  white-space: nowrap;
}
.sentence[data-status="refuted"] .text, .sentence[data-status="unresolved"] .text, .sentence[data-status="error"] .text {
  background: color-mix(in oklab, var(--state-blocked) 18%, transparent);
  box-shadow: inset 0 -1.5px 0 var(--state-blocked);
}
.sentence[data-status="refuted"] .stamp, .sentence[data-status="unresolved"] .stamp, .sentence[data-status="error"] .stamp { color: var(--state-blocked); }
/* needs-citation: true as far as the chart goes, cited to the wrong entry; held back, and told which entry to add */
.sentence[data-status="needs-citation"] .text { background: color-mix(in oklab, var(--state-failed) 16%, transparent); box-shadow: inset 0 -1.5px 0 var(--state-failed); }
.sentence[data-status="needs-citation"] .stamp { color: var(--state-failed); }
.sentence[data-status="needs-citation"] .why.bad, .sentence[data-status="needs-citation"] .why.bad b { color: var(--state-failed); }
.sentence.named { background: var(--ink-1); }
.sentence .why { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-5); }
.sentence .why b { font-weight: 500; color: var(--ink-6); }
.sentence .why q { font-family: var(--read-serif); font-size: 12.5px; color: var(--ink-6); }
.sentence .why.bad, .sentence .why.bad b { color: var(--state-blocked); }

.empty { color: var(--ink-4); font-size: 12.5px; padding: 16px 20px; margin: 0; }
.empty[hidden] { display: none; }

/* the result header: the state in mono, equal weight for every state */
.verdict { margin: 0; padding: 12px 20px; border-bottom: var(--hairline); background: var(--ink-0); animation: arrive var(--motion-base) var(--ease-out); }
.verdict[hidden] { display: none; }
.verdict .state { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.verdict .state-name { font-family: var(--font-mono); font-size: 20px; font-weight: 500; letter-spacing: 0.02em; }
.verdict .state-head { font-size: 13px; color: var(--ink-6); }
.verdict[data-verdict="pass"] .state-name { color: var(--state-pass); }
.verdict[data-verdict="blocked"] .state-name { color: var(--state-blocked); }
.verdict[data-verdict="declined"] .state-name { color: var(--state-declined); }
.verdict[data-verdict="error"] .state-name { color: var(--state-failed); }
.verdict .reason { font-family: var(--font-mono); font-size: 11px; color: var(--ink-6); margin-top: 4px; }
.verdict[data-verdict="declined"] .reason { font-family: var(--read-serif); font-size: 15px; color: var(--ink-7); max-width: 66ch; }
.stage[data-verdict="blocked"] .draft { box-shadow: inset 0 0 0 1px var(--state-blocked); }

/* --- counters: mono value over caption ------------------------------------- */

.counters {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 12px 0 14px;
  border-top: var(--hairline);
}
.counter { display: flex; flex-direction: column; gap: 1px; }
.counter .num { font-family: var(--font-mono); font-size: 17px; font-weight: 500; line-height: 1.2; color: var(--ink-7); }
.counter .lbl { color: var(--ink-5); font-size: 11px; font-weight: 500; }
.progress { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: transparent; }
.progress-fill { height: 100%; width: 0; background: var(--brand); transition: width var(--motion-base) linear; }

/* --- scoreboard ------------------------------------------------------------ */

.board { flex: 1; padding: 24px 32px; max-width: 1600px; width: 100%; margin: 0 auto; }
.board[hidden] { display: none; }
.board-head { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: baseline; margin-bottom: 20px; }
.board h2 { font-size: 22px; font-weight: 450; letter-spacing: -0.013em; line-height: 1.15; color: var(--heading); }
.board-sub { color: var(--ink-5); max-width: 80ch; margin: 0; font-size: 12.5px; }
.board table { width: 100%; border-collapse: collapse; background: var(--surface); border: var(--hairline); }
.board th, .board td { padding: 8px 12px; text-align: right; border-bottom: var(--hairline); white-space: nowrap; font-size: 13px; }
.board tr:last-child td { border-bottom: 0; }
.board th { color: var(--ink-5); font-weight: 500; font-size: 11px; letter-spacing: 0.01em; text-transform: uppercase; background: var(--ink-0); white-space: normal; vertical-align: bottom; max-width: 11ch; line-height: 1.3; }
.board th:first-child { max-width: none; }
.board th:first-child, .board td:first-child { text-align: left; }
.board td { color: var(--ink-6); font-family: var(--font-mono); font-size: 12.5px; }
.board td:first-child { width: 100%; color: var(--ink-7); font-weight: 500; font-family: var(--font-sans); font-size: 13.5px; }
.board td.strong { color: var(--state-pass); font-weight: 500; }
.board td.red { color: var(--state-blocked); font-weight: 500; }
.board td.dim { color: var(--ink-4); }
.board .agentic-tag {
  display: inline-flex; align-items: center; height: 20px;
  margin-left: 8px; padding: 0 7px;
  border: var(--hairline); color: var(--ink-6);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; vertical-align: 2px;
}
.board .note { color: var(--ink-5); font-size: 12px; margin-top: 14px; max-width: 100ch; }

/* --- footer strip: 32px, hairline ------------------------------------------ */

.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  min-height: 32px;
  padding: 6px 24px;
  border-top: var(--hairline);
  color: var(--ink-5);
  font-size: 11.5px;
  background: var(--ink-0);
}
.foot a { margin-left: 8px; }
.foot .keys { white-space: nowrap; font-size: 10.5px; color: var(--ink-4); }

@keyframes arrive { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .intro-line .cursor { display: none; }
  .intro-line .ch { visibility: visible; }
}
@media (max-width: 1100px) {
  .bar { grid-template-columns: 1fr 1fr; height: auto; padding: 8px 16px; gap: 8px 16px; }
  .tabs { height: 40px; } .tab { height: 40px; }
  .panels { grid-template-columns: 1fr; }
  .panel { border-right: 0; border-bottom: var(--hairline); }
  .stage { padding: 0 16px; }
  .counters { grid-template-columns: repeat(2, 1fr); }
}
