/* desk. interface. Blank brand kit: ink on white, one green accent kept for verified and live states,
   Redline for risk only, Outfit and JetBrains Mono, 1px lines, no shadows, no gradients. */

@font-face { font-family: "Outfit"; src: url("fonts/Outfit-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("fonts/Outfit-SemiBold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Medium.ttf") format("truetype"); font-weight: 500 700; font-display: swap; }

:root {
  --ink: #0a0a0a;
  --stone: #1d1d1f;
  --paper: #ffffff;
  --halo: #fafaf7;
  --veil: #f8fafc;
  --line: #e5e7eb;
  --fog: #9ca3af;
  --graphite: #6b7280;
  --cipher: #059669;
  --cipher-text: #047857;
  --cipher-soft: #e7f6ef;
  --redline: #c2410c;
  --redline-soft: #fdeee7;

  --bg: var(--paper);
  --surface: var(--veil);
  --surface-2: var(--halo);
  --text: var(--ink);
  --muted: var(--graphite);
  --border: var(--line);
  --seg-solid: var(--ink);
  --seg-mid: #52525b;
  --seg-weak: #a1a1aa;
  --nav-bg: rgba(255, 255, 255, 0.86);
  --focus: var(--ink);

  --sans: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --r1: 8px;
  --r2: 12px;
  --r3: 20px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --surface: #131315;
    --surface-2: #19191c;
    --text: #f4f4f2;
    --muted: #a1a1aa;
    --border: #2a2a2e;
    --cipher-text: #34d399;
    --cipher-soft: #0d2a20;
    --redline: #fb923c;
    --redline-soft: #2b1608;
    --seg-solid: #f4f4f2;
    --seg-mid: #a1a1aa;
    --seg-weak: #52525b;
    --nav-bg: rgba(10, 10, 10, 0.86);
    --focus: #f4f4f2;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #131315;
  --surface-2: #19191c;
  --text: #f4f4f2;
  --muted: #a1a1aa;
  --border: #2a2a2e;
  --cipher-text: #34d399;
  --cipher-soft: #0d2a20;
  --redline: #fb923c;
  --redline-soft: #2b1608;
  --seg-solid: #f4f4f2;
  --seg-mid: #a1a1aa;
  --seg-weak: #52525b;
  --nav-bg: rgba(10, 10, 10, 0.86);
  --focus: #f4f4f2;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}
h1, h2, h3 { font-weight: 600; letter-spacing: -0.045em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--ink); color: var(--paper); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: var(--r1); z-index: 100; }
.skip:focus { left: 8px; }
.noscript { padding: var(--gutter); }
.pad { padding-top: 64px; }

.mono { font-family: var(--mono); }
.kicker { font-family: var(--mono); font-size: 12px; line-height: 20px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* shell */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.bar-in { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; min-height: 60px; }
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 24px; letter-spacing: -0.04em; text-decoration: none; }
.mark svg { display: block; }
.bar-in > nav { order: 3; flex: 0 0 100%; min-width: 0; margin-bottom: 4px; }
.bar-in > .tools { margin-left: auto; }
.bar-in > .mark { min-height: 60px; }
.nav { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: flex; gap: 6px; align-items: baseline; padding: 8px 10px; border-radius: var(--r1); text-decoration: none; color: var(--muted); font-size: 15px; white-space: nowrap; }
.nav a .n { font-family: var(--mono); font-size: 11px; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: inset 0 -2px 0 var(--text); border-radius: var(--r1) var(--r1) 0 0; }
.tools { display: flex; align-items: center; gap: 10px; margin-left: auto; min-height: 60px; }
.weeks a { margin-right: 14px; white-space: nowrap; display: inline-block; }
.depth { display: inline-block; }
.depth-1 { padding-left: 1.2em; }
.depth-2 { padding-left: 2.4em; }
.depth-3 { padding-left: 3.6em; }
.depth-4 { padding-left: 4.8em; }
.depth-5 { padding-left: 6em; }
.depth-6 { padding-left: 7.2em; }
.weeks a[aria-current="page"] { font-weight: 600; color: var(--text); }
.tools label { font-family: var(--mono); font-size: 12px; color: var(--muted); }
select, .btn {
  font: inherit; font-size: 14px; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r1); padding: 7px 10px; min-height: 36px;
}
select { font-family: var(--mono); font-size: 13px; }
.btn { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { border-color: var(--text); }
.btn.ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
:root[data-theme="dark"] .btn.ink { background: var(--text); color: var(--bg); border-color: var(--text); }
.banner { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.banner-in { max-width: 1240px; margin: 0 auto; padding: 9px var(--gutter); font-size: 14px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.banner.risk { background: var(--redline-soft); }
.banner.risk .kicker { color: var(--redline); }

main:focus, main:focus-visible { outline: none; }
main { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter) 96px; }

/* screen head and sections, with the narrow meta column of the brand kit */
.head { padding: 56px 0 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; border-bottom: 1px solid var(--border); }
.head h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.04; }
.head .lead { font-size: 19px; color: var(--muted); max-width: 62ch; }
.sec { padding: 36px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.sec:last-child { border-bottom: 0; }
.sec > .meta { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); line-height: 22px; margin: 0; }
.sec > .meta .sub { display: block; text-transform: none; letter-spacing: 0; margin-top: 6px; font-size: 12px; line-height: 18px; }
.sec h2 { font-size: 28px; line-height: 1.15; margin-bottom: 14px; }
@media (min-width: 960px) {
  .head, .sec { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .head > .meta { padding-top: 14px; }
}

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); padding: 18px 20px 16px; min-width: 0; }
.stat .label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-size: 38px; line-height: 1.1; font-weight: 600; letter-spacing: -0.035em; margin-top: 10px; overflow-wrap: anywhere; }
.stat .value.risk { color: var(--redline); }
.stat .foot { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* numbers with provenance */
button.num { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help; letter-spacing: inherit; text-align: inherit; border-bottom: 1px dotted var(--muted); }
button.num:hover { border-bottom-color: var(--text); }
.prov {
  position: absolute; z-index: 50; width: min(340px, calc(100vw - 24px));
  background: var(--bg); color: var(--text); border: 1px solid var(--text); border-radius: var(--r2); padding: 14px 16px; font-size: 14px; line-height: 1.45;
}
.prov .kicker { margin-bottom: 6px; display: block; }
.prov dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.prov dt { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding-top: 2px; }
.prov dd { margin: 0; overflow-wrap: anywhere; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; line-height: 20px; }
.pill.live { color: var(--cipher-text); border-color: var(--cipher); background: var(--cipher-soft); }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cipher); }
.pill.risk { color: var(--redline); border-color: var(--redline); background: var(--redline-soft); }
.pill.ink { color: var(--text); border-color: var(--text); }
.pill .ic { font-weight: 500; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r2); }
.tablewrap:focus-visible { outline-offset: 0; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
caption { text-align: left; padding: 0 0 10px; color: var(--muted); font-size: 14px; caption-side: top; }
.tablewrap caption { padding: 12px 16px 0; }
th, td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
td.id { font-family: var(--mono); font-size: 13px; }
tbody tr:hover td { background: var(--surface); }
.maxh { max-height: 420px; overflow: auto; }
.maxh th { position: sticky; top: 0; z-index: 1; }

/* chart and table side by side */
.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1100px) { .pair.wide { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .bar-ink { fill: var(--seg-solid); }
.chart .bar-track { fill: var(--border); }
.sw { display: inline-block; width: 16px; height: 14px; vertical-align: -2px; margin-right: 8px; }
.sw svg { display: block; }
.sw rect { stroke-width: 1; }
.seg-kept { fill: var(--seg-solid); }
.seg-merged { fill: url(#p-merged); stroke: var(--seg-solid); stroke-width: 1; }
.seg-committed { fill: var(--seg-mid); }
.seg-reverted { fill: var(--redline); }
.seg-unlinked { fill: url(#p-unlinked); stroke: var(--seg-weak); stroke-width: 1; }
.pat-line { stroke: var(--seg-solid); stroke-width: 1.4; }
.pat-weak { stroke: var(--seg-weak); stroke-width: 1.2; }
.tl-ordinary { fill: var(--seg-weak); }
.tl-idle { fill: var(--seg-mid); }
.tl-loops { fill: var(--redline); }
.tl-subagents { fill: var(--seg-solid); opacity: 0.55; }
.tl-cache_miss { fill: var(--seg-solid); }

/* horizontal bars as html, so text wraps and zooms */
.hbars { display: grid; gap: 14px; }
.hb { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; }
.hb .name { font-size: 16px; }
.hb .vals { font-family: var(--mono); font-size: 13.5px; text-align: right; white-space: nowrap; }
.hb .track { grid-column: 1 / -1; height: 10px; background: var(--border); border-radius: 2px; overflow: hidden; }
.hb .fill { display: block; height: 100%; background: var(--seg-solid); border-radius: 2px; }

/* cards, notes, states */
.card { border: 1px solid var(--border); border-radius: var(--r2); padding: 20px 22px; background: var(--bg); }
.card.s { background: var(--surface); }
.card h3 { font-size: 20px; margin-bottom: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.note { font-size: 14.5px; color: var(--muted); max-width: 70ch; }
.note + .note { margin-top: 8px; }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.list li { padding-left: 18px; position: relative; max-width: 74ch; }
.list li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 8px; height: 2px; background: var(--muted); }
.state { border: 1px solid var(--border); border-radius: var(--r2); padding: 28px 24px; background: var(--surface); display: grid; gap: 10px; max-width: 720px; }
.state.error { border-color: var(--redline); background: var(--redline-soft); }
.state.error .kicker { color: var(--redline); }
.state .hint { font-family: var(--mono); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.loading { display: grid; gap: 12px; max-width: 520px; }
.skel { height: 14px; border-radius: 4px; background: var(--border); }
.skel.w1 { width: 90%; } .skel.w2 { width: 70%; } .skel.w3 { width: 50%; }
.redact { background: var(--text); color: transparent; border-radius: 2px; user-select: none; }
.fix { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 14px; padding: 16px 0; border-top: 1px solid var(--border); }
.fix:first-child { border-top: 0; padding-top: 0; }
.fix .idx { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 3px; }
.fix .saving { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 4px; }
pre.src { margin: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r1); overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; max-height: 320px; }
.controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.controls label { font-family: var(--mono); font-size: 12px; color: var(--muted); display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 100%; }
.controls select { max-width: 100%; min-width: 0; }
.rule { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 10px 0; border-top: 1px solid var(--border); align-items: baseline; }
.rule:first-child { border-top: 0; }
.rule .id { font-family: var(--mono); font-size: 13px; }
.rule .pill { justify-self: start; }
.rule .what { color: var(--muted); font-size: 15px; grid-column: 2; }
.bigverdict { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -0.035em; }
.bigverdict.pass { color: var(--cipher-text); }
.bigverdict.fail { color: var(--redline); }
.kv { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: 8px 20px; margin: 0; }
.kv dt { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; padding-top: 3px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.footnote { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.footnote .barmark { width: 40px; height: 6px; background: var(--text); display: inline-block; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .bar-in { flex-wrap: wrap; gap: 6px 12px; padding-top: 8px; padding-bottom: 4px; }
  .bar-in > nav { order: 3; flex-basis: 100%; }
  .bar-in > .mark, .tools { min-height: 0; }
  .nav { margin: 0 -4px; }
  .tools { gap: 8px; }
  .tools label { display: none; }
  .head { padding: 36px 0 28px; }
  .sec { padding: 28px 0; }
  .stat .value { font-size: 32px; }
  th, td { padding: 9px 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .hb .fill { transition: width 0.25s ease-out; }
}

.askbox { flex: 1; min-width: 240px; font: inherit; font-size: 17px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r1); background: var(--bg); color: var(--text); min-height: 44px; }
.traceline { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

.nav a .n { display: none; }
.chart .band { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.chart .ln-primary { fill: none; stroke: var(--seg-solid); stroke-width: 2.4; }
.chart .ln-control { fill: none; stroke: var(--seg-mid); stroke-width: 1.6; stroke-dasharray: 5 4; }
.chart .rule-risk { stroke: var(--redline); stroke-width: 1.5; stroke-dasharray: 3 3; }
.keyline { display: inline-block; width: 28px; height: 0; border-top: 2.4px solid var(--seg-solid); vertical-align: middle; margin-right: 8px; }
.keyline.dash { border-top: 1.6px dashed var(--seg-mid); }
th.num { font-size: 11.5px; }
body { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.note { margin-top: 12px; }
.note:first-child, .head .note { margin-top: 0; }
input[type="checkbox"] { accent-color: var(--text); width: 15px; height: 15px; margin: 0; }
.controls label { line-height: 1.5; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.legend .keyline { margin-right: 0; }
.legend .keyline.dash { margin-left: 14px; }
.legend span:last-child { margin-left: 14px; }
.chart text.rl { paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
@media (max-width: 720px) {
  .nav { flex-wrap: wrap; overflow: visible; }
}
@media (min-width: 720px) { .cards.pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* On a phone a table becomes a stack of rows: each cell carries its column name, so no column is hidden. */
@media (max-width: 720px) {
  .tablewrap { overflow: visible; border: 0; border-radius: 0; }
  .tablewrap.maxh { max-height: none; overflow: visible; }
  .tablewrap table, .tablewrap tbody, .tablewrap tr, .tablewrap td { display: block; width: 100%; }
  .tablewrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tablewrap caption { display: block; padding: 0 0 8px; }
  .tablewrap tr { border: 1px solid var(--border); border-radius: var(--r2); padding: 6px 14px; margin-bottom: 10px; background: var(--bg); }
  .tablewrap td { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: 4px 12px; border: 0; padding: 7px 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .tablewrap td::before { content: attr(data-label); font: 11.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
  .tablewrap td.num { text-align: left; white-space: normal; }
  .tablewrap td + td { border-top: 1px solid var(--border); }
}

/* On a narrow screen the header wraps to several rows. Kept at the top it would cover a third of the screen and could hide the control a keyboard has just moved to, so it scrolls away. */
@media (max-width: 520px) {
  .bar { position: static; }
}

/* A command or a name inside a sentence. */
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; overflow-wrap: anywhere; }
pre code { background: none; border: 0; padding: 0; }
/* The theme switch says what it is, and whether it is on. */
.btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
/* A second line inside a table cell. */
.cellnote { display: block; margin-top: 4px; font-size: 14px; line-height: 1.4; color: var(--muted); font-weight: 400; white-space: normal; max-width: 36ch; }

/* A first-time reader of the sample: what this is and where to look first. */
.orient { display: grid; gap: 18px; margin: 4px 0 28px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); }
.orient p { margin: 6px 0 0; max-width: 72ch; line-height: 1.5; }
.orient-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.orient-steps li { display: grid; gap: 2px; align-content: start; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r1); }
.orient-steps a { font-weight: 600; }
.orient-steps span { color: var(--muted); font-size: 14px; line-height: 1.35; }
@media (max-width: 900px) { .orient-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .orient-steps { grid-template-columns: 1fr; } }
