/* Agent Customs page styles.
   Layout: one section per screen inside one .wrap, on a 12-column grid with equal edges, text on
   the left and pictures on the right. Headings use weight 500; labels use sentence case.
   Motion: ease-out curves, interface motion under 300 ms, feedback on press, and hover effects on
   fine pointers only. There is one live effect (the hero background), one scroll effect (the
   hidden sentence) and one diagram loop. No third-party code. */

@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/InstrumentSerif-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---- Palettes (60-30-10) ------------------------------------------------------------- */
/* Forest is the default. --c3-ink is the accent made dark enough to read on --c2 (the light
   band), at least 4.5:1; on the dark ground the accent itself is used. */
:root { --c1: #0c1d18; --c2: #ece4d3; --c3: #c8f03c; --on-c3: #0c1d18; --c3-ink: #3d6b0a; }
:root[data-palette="terracotta"] { --c1: #0f1012; --c2: #f0eee9; --c3: #e2673d; --on-c3: #0f1012; --c3-ink: #b5461f; }
:root[data-palette="navy"] { --c1: #0a1430; --c2: #eef0f2; --c3: #ff6f59; --on-c3: #0a1430; --c3-ink: #bf3a26; }
:root[data-palette="espresso"] { --c1: #1b1310; --c2: #f3ece2; --c3: #3a54f0; --on-c3: #ffffff; --c3-ink: #3a54f0; }

:root {
  color-scheme: dark;
  --ok: #8fd1a6;
  --caution: #e9c46a;
  --warn: #f0a35e;
  --bad: #f2665a;
  --info: color-mix(in oklab, var(--c2) 62%, var(--c1));
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
  /* Layout: gutter, section padding, the one wrap. */
  --gut: 80px;
  --padt: 120px;
  --padb: 72px;
  --r: 20px;
}
:root, .on-dark {
  --tint: var(--c2);
  --ink: var(--c2);
  --ink-2: color-mix(in oklab, var(--c2) 84%, var(--c1));
  --muted: color-mix(in oklab, var(--c2) 68%, var(--c1));
  --faint: color-mix(in oklab, var(--c2) 56%, var(--c1));
  --line: color-mix(in oklab, var(--c2) 10%, transparent);
  --line-2: color-mix(in oklab, var(--c2) 18%, transparent);
  --well: color-mix(in oklab, var(--c1) 70%, #000);
  --surface: color-mix(in oklab, var(--c2) 4%, var(--c1));
  --accent: var(--c3);
  color: var(--ink);
}
.on-light {
  --accent: var(--c3-ink);
  --tint: var(--c1);
  --ink: var(--c1);
  --ink-2: color-mix(in oklab, var(--c1) 86%, var(--c2));
  --muted: color-mix(in oklab, var(--c1) 70%, var(--c2));
  --faint: color-mix(in oklab, var(--c1) 60%, var(--c2));
  --line: color-mix(in oklab, var(--c1) 12%, transparent);
  --line-2: color-mix(in oklab, var(--c1) 22%, transparent);
  color: var(--ink);
}

/* ---- Base and browser surfaces --------------------------------------------------------- */
* { box-sizing: border-box; }
html { background: var(--c1); scrollbar-color: color-mix(in oklab, var(--c2) 24%, transparent) transparent; }
body { margin: 0; color: var(--ink); background: var(--c1); font: 400 16px/1.625 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 500; text-wrap: balance; }
h1 em, h2 em, h3 em, .close-line em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: var(--accent); }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ink); }
code, pre { font-family: var(--mono); }
code { font-size: .9em; overflow-wrap: anywhere; }
::selection { background: var(--c3); color: var(--on-c3); }
input, textarea { caret-color: var(--c3); }
:focus-visible { outline: 2px solid var(--c3); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
/* While the page comes back from the officer's Save and start (see the head of index.html). */
.returning body { visibility: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: -999px; top: 12px; z-index: 50; background: var(--c2); color: var(--c1); padding: 10px 14px; border-radius: 10px; }
.skip:focus { left: 16px; }
.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
svg use { pointer-events: none; }

/* ---- Layout: one wrap, one section per screen -------------------------------------- */
.wrap { width: min(100% - 2 * var(--gut), 1280px); margin-inline: auto; position: relative; z-index: 1; }
main > section, footer.closing { position: relative; isolation: isolate; min-height: 100svh; padding: var(--padt) 0 var(--padb); }
/* The desk is a tool, not a screen: its section is as tall as the window in it. */
#workspace { min-height: 0; }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head h2, .moment-head h2, .guard h2 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.06; letter-spacing: -.03em; }
.section-sub { margin-top: 18px; max-width: 52ch; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; color: var(--muted); }
.section-sub code { color: var(--ink-2); }

/* ---- Glass: only where something moves behind it (the nav and the replay window) ---- */
.glass { position: relative; isolation: isolate;
  background: linear-gradient(180deg, color-mix(in oklab, var(--tint) 9%, transparent), color-mix(in oklab, var(--tint) 3%, transparent));
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 1px 0 color-mix(in oklab, var(--c2) 10%, transparent) inset, 0 24px 60px -24px rgba(0, 0, 0, .7); }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: linear-gradient(150deg, color-mix(in oklab, var(--tint) 42%, transparent), color-mix(in oklab, var(--tint) 6%, transparent) 30%, color-mix(in oklab, var(--tint) 3%, transparent) 65%, color-mix(in oklab, var(--tint) 18%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.liquid-ok .liquid { -webkit-backdrop-filter: blur(4px) saturate(160%); backdrop-filter: url(#liquid-glass) blur(4px) saturate(160%) brightness(1.04); }

/* ---- Controls: one button pair, one link look, one arrow -------------------------- */
button, .button { font: 500 15px/1 var(--sans); letter-spacing: -.005em; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); background: transparent;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
button:disabled { opacity: .45; cursor: not-allowed; }
button svg, .button svg, .text-link svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 150ms var(--ease-out); }
.primary { color: var(--on-c3); background: var(--c3); }
.ghost { border-color: var(--line-2); }
.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.danger { border-color: color-mix(in oklab, var(--bad) 45%, transparent); color: var(--bad); }
button:active:not(:disabled), .button:active { transform: translateY(1px) scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .primary:hover:not(:disabled) { background: color-mix(in oklab, var(--c3) 86%, var(--c2)); transform: translateY(-1px); }
  .ghost:hover:not(:disabled) { background: color-mix(in oklab, var(--tint) 7%, transparent); border-color: color-mix(in oklab, var(--tint) 32%, transparent); transform: translateY(-1px); }
  .danger:hover { background: color-mix(in oklab, var(--bad) 10%, transparent); }
  .button:hover svg, button:hover svg, .text-link:hover svg { transform: translateX(3px); }
}
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent); font-weight: 500; text-decoration: none; }
.draw { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; padding-bottom: 4px; transition: background-size 150ms var(--ease-out), color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .draw:hover { background-size: 100% 1px; color: var(--ink); } }
input[type="url"], input[type="text"], input[type="password"] { font: 400 15px/1.3 var(--mono); width: 100%; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 12px; color: var(--ink);
  background: color-mix(in oklab, var(--well) 70%, transparent); border: 1px solid var(--line-2); transition: border-color 140ms ease, box-shadow 140ms ease; }
input::placeholder { color: var(--muted); }
input:focus { outline: none; border-color: var(--c3); box-shadow: 0 0 0 3px color-mix(in oklab, var(--c3) 18%, transparent); }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 8px; }
.form-error { color: var(--bad); font-size: 14px; margin-top: 10px; }
.pause-disc { position: absolute; z-index: 5; right: 12px; bottom: 12px; width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%; background: var(--c2); color: var(--c1); }
.pause-disc svg { width: 14px; height: 14px; }

/* ---- Navigation (fixed, on the page's edge lines) ---------------------------------- */
.topbar { position: fixed; z-index: 30; top: 14px; left: 0; right: 0; pointer-events: none; }
.nav { pointer-events: auto; width: min(100% - 2 * var(--gut) + 24px, 1304px); margin-inline: auto; display: flex; align-items: center; gap: 18px; padding: 7px 7px 7px 18px; border-radius: 999px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 500; letter-spacing: -.01em; flex: none; }
.brand-mark { width: 24px; height: 24px; fill: none; stroke: var(--c3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-links { display: flex; gap: 24px; margin-left: auto; margin-right: 8px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; padding: 4px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 150ms var(--ease-out), color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--ink); background-size: 100% 1px; } }
.nav-cta { border-radius: 999px; }
/* The bar keeps a dark base tint so it reads the same over the light band. */
.nav.glass { background: linear-gradient(180deg, color-mix(in oklab, var(--c1) 80%, transparent), color-mix(in oklab, var(--c1) 66%, transparent)); }

/* ---- Screen 1: hero --------------------------------------------------------------- */
.hero { display: flex; align-items: flex-start; padding-bottom: 64px; }
.hero-ground { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(55% 65% at 80% 40%, color-mix(in oklab, var(--c3) 30%, transparent), transparent 70%),
    radial-gradient(45% 55% at 15% 5%, color-mix(in oklab, var(--c2) 8%, transparent), transparent 70%),
    var(--c1); }
.hero-ground canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1200ms ease; }
.hero-ground.ready canvas { opacity: 1; }
.hero-wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: 24px; align-items: start; min-height: calc(100svh - var(--padt) - 64px); }
.hero-facts { grid-column: 1 / -1; grid-row: 2; align-self: end; list-style: none; margin: 48px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; font-size: 14px; color: var(--muted); }
.hero-facts li { display: flex; gap: 10px; align-items: center; }
.hero-facts svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--c3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero-text { grid-column: 1 / span 5; display: grid; gap: 28px; }
.hero h1 { font-size: clamp(38px, 5vw, 72px); line-height: 1.02; letter-spacing: -.035em; color: var(--c2); }
.hero h1 em { display: inline; }
.lead { font-size: clamp(18px, 1.4vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.inspect-form { padding: 6px; border-radius: 16px; background: color-mix(in oklab, var(--c1) 72%, transparent); border: 1px solid var(--line-2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: border-color 140ms ease, box-shadow 140ms ease; }
.inspect-form:focus-within { border-color: var(--c3); box-shadow: 0 0 0 3px color-mix(in oklab, var(--c3) 16%, transparent); }
.inspect-row { display: flex; gap: 6px; }
.inspect-row input { border: 0; background: transparent; }
.inspect-row input:focus { box-shadow: none; }
.inspect-row button { flex: none; }
.inspect-opt { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px 4px; font-size: 13px; font-weight: 400; color: var(--muted); cursor: pointer; }
.inspect-opt input[type="checkbox"] { width: 15px; height: 15px; min-height: 0; margin: 0; accent-color: var(--c3); cursor: pointer; flex: none; }
.inspect-form .form-error { padding: 0 10px 6px; }
.hero-demo { grid-column: 7 / span 6; display: grid; gap: 14px; min-width: 0; }
.hero-pause { right: max(12px, calc((100% - 1280px) / 2)); bottom: 24px; }

/* The replay window */
.demo-frame { overflow: hidden; border-radius: 22px; }
.demo-bar { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); position: relative; z-index: 3; }
.bar-icon { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.demo-url { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-status { font-size: 12.5px; color: var(--muted); white-space: nowrap; transition: color 160ms ease; }
.demo-frame[data-state="running"] .demo-status { color: var(--c3); }
.demo-progress { height: 2px; background: var(--line); position: relative; z-index: 3; }
.demo-progress span { display: block; height: 100%; background: var(--c3); transform-origin: left; transition: opacity 400ms ease; }
.demo-frame[data-state="done"] .demo-progress span { opacity: .35; }
.demo-body { position: relative; z-index: 3; padding: 6px 12px 20px; }
.demo-checks { list-style: none; margin: 0; padding: 0; }
.demo-checks li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 15px; }
.row-kind { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.row-name { font-weight: 500; }
.row-value { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-checks li[data-state="done"] .row-value { color: var(--tone, var(--muted)); }
.row-icon { width: 18px; height: 18px; color: var(--tone, var(--faint)); fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.demo-checks li[data-state="pending"] .row-icon { color: var(--line-2); }
.demo-checks li[data-state="checking"] .row-icon { color: var(--c3); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-result { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; padding: 20px 8px 0; }
.demo-stamp { --tone: var(--bad); color: var(--tone); border: 3px double var(--tone); border-radius: 10px; padding: 10px 12px; max-width: 132px; text-align: center;
  font: 700 12.5px/1.15 var(--mono); letter-spacing: .12em; text-transform: uppercase; transform: rotate(-6deg); filter: url(#ink-soft); }
.demo-stamp[data-tone="ok"] { --tone: var(--ok); } .demo-stamp[data-tone="warn"] { --tone: var(--warn); }
.demo-line { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.demo-quote { font: 400 13px/1.5 var(--mono); color: var(--ink-2); }
.demo-quote[data-kind="quote"][data-tone="bad"] { color: var(--bad); }
.demo-quote[data-kind="quote"][data-tone="warn"] { color: var(--warn); }
.demo-quote[data-kind="note"] { font-family: var(--sans); font-size: 14px; }
.demo-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.demo-picks [data-demo] { min-height: 38px; font-size: 13px; padding: 0 14px; border-radius: 999px; border-color: var(--line-2); color: var(--muted); }
.demo-picks [data-demo][aria-pressed="true"] { color: var(--ink); border-color: color-mix(in oklab, var(--c2) 55%, transparent); }
@media (hover: hover) and (pointer: fine) { .demo-picks [data-demo]:hover { color: var(--ink); } }
.demo-run { margin-left: auto; min-height: 38px; padding: 0 2px; color: var(--c3); font-size: 14px; }

/* Hero entrance, once: words rise from masks, then the lead and form, then the window settles. */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .06em .1em 0; margin: 0 -.06em -.1em 0; }
.w > span { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .rise .w > span { animation: rise-word 700ms var(--ease-enter) both; }
  .rise .w:nth-of-type(2) > span { animation-delay: 30ms; } .rise .w:nth-of-type(3) > span { animation-delay: 60ms; }
  .rise .w:nth-of-type(4) > span { animation-delay: 90ms; } .rise .w:nth-of-type(5) > span { animation-delay: 120ms; }
  .rise em .w:nth-of-type(1) > span { animation-delay: 160ms; } .rise em .w:nth-of-type(2) > span { animation-delay: 200ms; }
  .rise em .w:nth-of-type(3) > span { animation-delay: 240ms; }
  .fade-up { animation: fade-up 520ms var(--ease-enter) both; animation-delay: var(--d, 0ms); }
  .settle { animation: settle 900ms var(--ease-enter) both; animation-delay: 120ms; }
}
@keyframes rise-word { from { transform: translateY(105%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes settle { from { transform: scale(.98); } }
@keyframes fade { from { opacity: 0; } }

/* ---- Screen 2: the hidden sentence ------------------------------------------------ */
.moment { display: flex; align-items: flex-start; view-timeline: --decode block; }
.moment-wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.moment-head { grid-column: 1 / span 5; }
.decode { grid-column: 7 / span 6; display: grid; gap: 14px; }
/* Two cards: the line people see, and the layer only a model reads. */
.decode-seen, .decode-hidden { margin: 0; border-radius: 20px; padding: 22px 26px 26px; border: 1px solid var(--line-2); }
.decode-seen { font-size: clamp(21px, 1.9vw, 26px); line-height: 1.4; letter-spacing: -.015em; color: var(--ink); background: color-mix(in oklab, var(--c2) 4%, transparent); }
.decode-hidden { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.55; letter-spacing: -.01em; color: var(--bad);
  background: color-mix(in oklab, var(--bad) 7%, transparent); border-color: color-mix(in oklab, var(--bad) 28%, transparent); }
.decode-label { display: block; font: 500 13px/1.4 var(--sans); color: var(--muted); margin-bottom: 10px; letter-spacing: 0; }
.decode-hidden .decode-label { color: color-mix(in oklab, var(--bad) 72%, var(--c2)); }
.dw-code { font: 500 .88em var(--mono); letter-spacing: -.02em; }
/* The finished state: every hidden word in plain sight. The scroll only takes it there,
   from invisible ink to red, word by word. */
.dw { color: var(--bad); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .dw { animation: light linear both; animation-timeline: --decode; animation-range: entry calc(8% + var(--i) * 2.2%) entry calc(14% + var(--i) * 2.2%); }
  }
}
@keyframes light { from { color: color-mix(in oklab, var(--c2) 14%, transparent); } to { color: var(--bad); } }

/* ---- Screen 3: the inspection desk ------------------------------------------------- */
.desk-window { display: flex; flex-direction: column; padding: 8px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .8); }
.tabs { position: relative; flex: none; display: flex; gap: 2px; padding: 4px; margin: 6px 6px 0; border-radius: 14px; background: color-mix(in oklab, var(--well) 70%, transparent); width: fit-content; max-width: calc(100% - 12px); overflow-x: auto; scrollbar-width: none; }
.tabs-highlight { position: absolute; top: 0; left: 0; height: 100%; width: var(--tabs-w, 100%); background: var(--c2); clip-path: inset(4px 100% 4px 0 round 10px); pointer-events: none; }
.tabs.ready .tabs-highlight { transition: clip-path 260ms var(--ease-in-out); }
.tabs [role="tab"] { position: relative; min-height: 38px; font-size: 14px; padding: 0 16px; border-radius: 10px; color: var(--muted); white-space: nowrap; transition: color 260ms var(--ease-in-out), transform 160ms var(--ease-out); }
.tabs [role="tab"][aria-selected="true"] { color: var(--c1); }
.tabs:not(.ready) [role="tab"][aria-selected="true"] { background: var(--c2); }
@media (hover: hover) and (pointer: fine) { .tabs [role="tab"]:not([aria-selected="true"]):hover { color: var(--ink); } }
.count { font: 500 11px/1 var(--sans); font-variant-numeric: tabular-nums; padding: 3px 6px; border-radius: 999px; background: var(--c3); color: var(--on-c3); }
.count.pop { animation: pop 240ms var(--ease-out); }
@keyframes pop { from { transform: scale(.75); opacity: .4; } }
.panel { padding: 20px 14px 14px; }
.panel-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; padding: 0 6px 16px; }
.panel-bar-label { font-size: 13px; color: var(--muted); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 34px; font-size: 13px; padding: 0 12px; border-radius: 999px; border-color: var(--line-2); color: var(--ink-2); gap: 7px; }
@media (hover: hover) and (pointer: fine) { .chips button:hover { color: var(--ink); border-color: color-mix(in oklab, var(--c2) 40%, transparent); } }
.chips small { display: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--info)); flex: none; display: inline-block; }
.tone-ok { --tone: var(--ok); } .tone-caution { --tone: var(--caution); } .tone-warn { --tone: var(--warn); } .tone-bad { --tone: var(--bad); } .tone-info { --tone: var(--info); }
.panel-head { max-width: 640px; padding: 0 6px; margin-bottom: 20px; }
.panel-head h3, .empty-state h3 { font-size: clamp(22px, 2vw, 28px); letter-spacing: -.025em; margin-bottom: 6px; }
.panel-head p, .empty-state p { color: var(--muted); font-size: 15px; }
.empty-state { display: grid; place-content: center; text-align: center; gap: 4px; padding: 28px 24px 36px; }
.empty-state p { max-width: 42ch; margin: 0 auto; }

/* Report */
.report { overflow: hidden; outline: none; border-radius: 18px; border: 1px solid var(--line); background: color-mix(in oklab, var(--well) 28%, transparent); }
.report.busy { opacity: .55; transition: opacity 160ms ease; }
.report-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; padding: 26px; border-bottom: 1px solid var(--line); align-items: center; }
.report-head h2 { font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -.03em; margin-bottom: 6px; overflow-wrap: anywhere; }
.report-url { font: 400 13px/1.4 var(--mono); color: var(--muted); margin-bottom: 14px; overflow-wrap: anywhere; }
.report-summary { margin-bottom: 16px; font-size: 16px; color: var(--ink-2); max-width: 70ch; }
.receipt-line { margin: -6px 0 16px; padding: 8px 12px; max-width: 70ch; font-size: 14px; border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--tone, var(--muted)) 45%, transparent); background: color-mix(in oklab, var(--tone, var(--muted)) 9%, transparent); }
/* A valid signature says who stamped it, not that the network is safe, so it stays neutral. */
.receipt-line[data-state="warn"] { --tone: var(--warn); }
.receipt-line[data-state="bad"] { --tone: var(--bad); }
.receipt-line a { color: inherit; text-decoration-color: var(--tone, var(--muted)); text-underline-offset: 3px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.facts div { display: flex; gap: 6px; min-width: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts .mono { font-family: var(--mono); }
.stamp { --tone: var(--ok); width: 176px; aspect-ratio: 1.3; display: grid; place-content: center; text-align: center; color: var(--tone);
  border: 4px double var(--tone); border-radius: 14px; rotate: -7deg; padding: 12px; font-family: var(--mono); text-transform: uppercase; position: relative;
  filter: url(#ink); background: color-mix(in oklab, var(--tone) 7%, transparent); }
.stamp::after { content: ""; position: absolute; inset: 6px; border: 1.5px solid var(--tone); border-radius: 8px; opacity: .6; }
.stamp strong { font-size: 19px; line-height: 1.02; letter-spacing: .08em; font-weight: 700; }
.stamp small { font-size: 10px; letter-spacing: .16em; margin-top: 8px; opacity: .85; line-height: 1.5; }
.stamp small span { display: block; }
.stamp.tone-ok { --tone: var(--ok); } .stamp.tone-caution { --tone: var(--caution); } .stamp.tone-warn { --tone: var(--warn); } .stamp.tone-bad { --tone: var(--bad); }
.stamp.animate { animation: stamp-in 320ms var(--ease-out) both; }
@keyframes stamp-in { from { opacity: 0; scale: 1.3; rotate: -13deg; } to { opacity: 1; scale: 1; rotate: -7deg; } }
.lights { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.light { padding: 14px 16px; border-right: 1px solid var(--line); min-width: 0; }
.light:last-child { border-right: 0; }
.light .name { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.light .value { font-weight: 500; margin-top: 6px; font-size: 15px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.report-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.report-main { padding: 24px 26px; border-right: 1px solid var(--line); min-width: 0; }
.report-side { padding: 24px 26px; min-width: 0; }
.report h3 { font-size: 15px; font-weight: 500; letter-spacing: -.01em; margin-bottom: 14px; }
.report-block + .report-block { margin-top: 28px; }
.none { color: var(--muted); font-size: 14px; }
.finding { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 8px; overflow: hidden; }
.finding[open] { border-color: var(--line-2); }
.finding summary { cursor: pointer; padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; list-style: none; }
.finding summary::-webkit-details-marker { display: none; }
.finding summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); rotate: 45deg; translate: 0 -2px; transition: rotate 160ms var(--ease-out), translate 160ms var(--ease-out); }
.finding[open] summary::after { rotate: 225deg; translate: 0 2px; }
.finding .ftitle { font-weight: 500; flex: 1 1 220px; min-width: 0; }
.finding .where { color: var(--muted); font: 400 12px/1.3 var(--mono); overflow-wrap: anywhere; }
.finding-body { padding: 0 16px 16px; font-size: 14px; color: var(--ink-2); }
.finding-body p { margin: 6px 0; }
.finding-body .label { font-size: 13px; font-weight: 500; color: var(--muted); display: block; margin-top: 14px; }
.evidence { background: color-mix(in oklab, var(--well) 75%, transparent); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.hidden-text { background: color-mix(in oklab, var(--bad) 9%, transparent); border: 1px solid color-mix(in oklab, var(--bad) 40%, transparent); color: var(--bad); border-radius: 10px; padding: 10px 12px; margin: 6px 0 0; font: 400 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.finding.stagger { animation: rise-row 240ms var(--ease-out) both; animation-delay: var(--sd, 0ms); }
.light.stagger { animation: fade 240ms ease both; animation-delay: var(--sd, 0ms); }
@keyframes rise-row { from { opacity: 0; transform: translateY(6px); } }
.pill { display: inline-block; font: 500 12px/1 var(--sans); padding: 5px 9px; border-radius: 7px; white-space: nowrap;
  color: var(--tone); background: color-mix(in oklab, var(--tone) 12%, transparent); border: 1px solid color-mix(in oklab, var(--tone) 40%, transparent); }
.pill::first-letter { text-transform: uppercase; }
.sev-critical { --tone: var(--bad); } .sev-high { --tone: var(--warn); } .sev-medium { --tone: var(--caution); } .sev-low { --tone: var(--info); } .sev-info { --tone: var(--info); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.checks .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--tone); fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.checks .sec { color: var(--muted); font: 400 12px/1 var(--mono); }
.checks .cdetail { color: var(--muted); font-size: 13px; display: block; overflow-wrap: anywhere; }
.checks .cfix { font-size: 13px; display: block; color: var(--ink-2); }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 10px 0; }
.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stops li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.stops .host { font: 500 13px/1.4 var(--mono); overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { font-size: 12px; padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.tag.no { color: var(--bad); border-color: color-mix(in oklab, var(--bad) 40%, transparent); }
.conditions { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.conditions li::marker { color: var(--c3); }
.trifecta-alert h3 { color: var(--warn); }
.trifecta-path { margin-top: 8px; padding: 8px 10px; border-radius: 8px; font: 500 12px/1.45 var(--mono); color: var(--warn); background: color-mix(in oklab, var(--warn) 10%, transparent); border: 1px solid color-mix(in oklab, var(--warn) 38%, transparent); overflow-wrap: anywhere; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 26px; border-top: 1px solid var(--line); align-items: center; }
.report-actions .spacer { flex: 1; }
.toast { font-size: 13px; color: var(--ok); }
.cert-trigger {
  --seal-gold: #dfbf6e;
  gap: 7px; padding: 0 15px 0 12px; font-weight: 600; letter-spacing: .01em; color: #f8ecd0;
  border: 1px solid color-mix(in oklab, var(--seal-gold) 65%, transparent);
  background: linear-gradient(135deg, color-mix(in oklab, var(--seal-gold) 22%, var(--c1)), color-mix(in oklab, var(--ok) 15%, var(--c1)));
  box-shadow: 0 1px 0 rgba(255, 245, 214, .18) inset, 0 8px 18px -8px rgba(0, 0, 0, .65);
}
.cert-trigger.is-hold {
  --seal-gold: var(--warn); color: var(--ink);
  background: linear-gradient(135deg, color-mix(in oklab, var(--warn) 18%, var(--c1)), color-mix(in oklab, var(--c2) 6%, var(--c1)));
}
.cert-trigger.is-denied {
  --seal-gold: var(--bad); color: var(--ink);
  background: linear-gradient(135deg, color-mix(in oklab, var(--bad) 20%, var(--c1)), color-mix(in oklab, var(--c2) 6%, var(--c1)));
}
.cert-trigger .cert-seal-ico { width: 16px; height: 16px; stroke: var(--seal-gold); stroke-width: 1.9; }
.cert-trigger.is-cleared .cert-seal-ico circle { fill: color-mix(in oklab, var(--seal-gold) 20%, transparent); }

/* Certificate preview dialog + clean PDF print mode */
.cert-dialog { margin: auto; padding: 0; border: 1px solid var(--line-2); border-radius: 20px; width: min(96vw, 1020px); max-height: 92svh; background: var(--c1); color: var(--ink); box-shadow: 0 36px 90px -20px rgba(0, 0, 0, .82); overflow: hidden; }
.cert-dialog::backdrop { background: rgba(4, 12, 9, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.cert-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: 92svh; }
.cert-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.cert-head-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; min-width: 0; }
.cert-head h3 { font-size: 18px; letter-spacing: -.015em; }
.cert-stage { padding: 18px 22px; overflow: auto; background: color-mix(in oklab, var(--well) 70%, transparent); display: grid; place-items: center; }
.cert-stage-frame { position: relative; width: 100%; max-width: 960px; }
.cert-preview-img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 18px 44px -18px rgba(0, 0, 0, .75); }
.cert-reverify-hit { position: absolute; left: 13.4286%; top: 79.3617%; width: 82%; height: 6.8085%; border-radius: 7px; font-size: 0; color: transparent; text-decoration: none; cursor: pointer; transition: box-shadow 140ms ease, background-color 140ms ease; }
.cert-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; padding: 14px 22px; border-top: 1px solid var(--line); }
.cert-note { font: 400 12.5px/1.4 var(--mono); color: var(--muted); }
.cert-verify-link { color: var(--c3); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.cert-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (hover: hover) and (pointer: fine) {
  .cert-trigger:hover:not(:disabled) { transform: translateY(-1px); border-color: color-mix(in oklab, var(--seal-gold) 92%, #fff); box-shadow: 0 1px 0 rgba(255, 245, 214, .25) inset, 0 12px 24px -10px color-mix(in oklab, var(--seal-gold) 35%, transparent); }
  .cert-trigger:hover .cert-seal-ico { transform: scale(1.08) rotate(-4deg); }
  .cert-reverify-hit:hover { background: color-mix(in oklab, var(--c3) 10%, transparent); box-shadow: 0 0 0 2px color-mix(in oklab, var(--c3) 65%, #fff); }
  .cert-verify-link:hover { color: var(--ink); }
}
@media print {
  body.printing-cert > :not(.cert-dialog), body.printing-cert .cert-head, body.printing-cert .cert-foot { display: none !important; }
  body.printing-cert { background: #fff !important; }
  body.printing-cert .cert-dialog { position: static; width: 100%; max-width: none; max-height: none; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  body.printing-cert .cert-stage { padding: 0; background: transparent; overflow: visible; }
  body.printing-cert .cert-stage-frame { max-width: 100%; }
  body.printing-cert .cert-preview-img { max-width: 100%; box-shadow: none; border-radius: 0; }
}

/* Approvals, compare, officer */
.pins { list-style: none; margin: 0; padding: 0 6px; display: grid; gap: 10px; }
.pins li { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; }
.pins li.none { border-style: dashed; text-align: center; padding: 40px 16px; }
.pins .ptitle { font-weight: 500; overflow-wrap: anywhere; }
.pins .pmeta { font: 400 12px/1.45 var(--mono); color: var(--muted); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pins .pactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.compare-form { padding: 0 6px; }
.compare-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.compare-fields input { font-size: 14px; }
.compare-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.compare-result { margin-top: 22px; padding: 0 6px; }
.versions { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 14px; font-size: 13px; }
.versions .v { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.versions .v code { font-size: 12px; color: var(--muted); }
.versions .arrow { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.changes li { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.changes li > div { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.diffline { font: 400 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; padding: 5px 10px; border-radius: 8px; }
.diffline.add { background: color-mix(in oklab, var(--ok) 10%, transparent); color: var(--ok); }
.diffline.del { background: color-mix(in oklab, var(--bad) 10%, transparent); color: var(--bad); }
#assistant-status { display: inline-block; font-size: 13.5px; color: var(--ink-2); padding: 10px 14px; border-radius: 12px; border: 1px solid color-mix(in oklab, var(--c3) 45%, transparent); background: color-mix(in oklab, var(--c3) 8%, transparent); margin-top: 14px; }
/* The officer's model picker: choose a model, create a key, paste it and start. */
.model-picker { margin: 0 6px 22px; max-width: 900px; padding: 18px 20px 20px; border-radius: 18px; border: 1px solid var(--line-2); background: color-mix(in oklab, var(--c2) 3%, transparent); }
.mp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.mp-head h4 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
.mp-current { margin: 0; flex: 1 1 260px; font-size: 14px; color: var(--muted); }
.mp-body { margin-top: 6px; }
.mp-step { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.mp-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12.5px; font-weight: 600; background: var(--c3); color: var(--on-c3); }
.mp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.mp-card { position: relative; display: grid; align-content: start; gap: 2px; padding: 12px 14px 13px; border-radius: 14px; border: 1px solid var(--line-2); background: color-mix(in oklab, var(--c2) 3%, transparent); cursor: pointer; transition: border-color 140ms ease, background-color 140ms ease; }
.mp-card input { position: absolute; opacity: 0; pointer-events: none; }
.mp-card:has(input:checked) { border-color: var(--c3); background: color-mix(in oklab, var(--c3) 10%, transparent); }
.mp-card:has(input:focus-visible) { outline: 2px solid var(--c3); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .mp-card:hover { border-color: color-mix(in oklab, var(--c3) 55%, transparent); } }
.mp-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.mp-by { font-size: 13px; color: var(--muted); }
.mp-cost { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.mp-saved { justify-self: start; margin-top: 8px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; color: var(--ok); background: color-mix(in oklab, var(--ok) 14%, transparent); }
#mp-forget { display: block; margin-top: 4px; }
#mp-forget[hidden] { display: none; }
.mp-model-row { display: grid; gap: 8px; margin-top: 14px; max-width: 520px; }
.mp-model-row label { margin: 0; }
.mp-model-row select { min-height: 44px; padding: 0 12px; border-radius: 12px; font: 500 15px var(--sans); color: var(--ink); background: color-mix(in oklab, var(--well) 70%, transparent); border: 1px solid var(--line-2); }
.mp-key-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-key-row input { flex: 1 1 260px; width: auto; }
.mp-status { min-height: 1.5em; margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.mp-status[data-tone="warn"] { color: var(--warn); }
.mp-current[data-tone="warn"] { color: var(--warn); }
.tech-row { margin: 10px 0 0; }
.mp-advanced { min-height: 32px; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mp-hint { margin: 0; font-size: 13px; color: var(--muted); }
/* The runtime's own settings form stays hidden: the picker is the one place for a key, and it
   fills that form in for the runtime. */
#agent-app [data-ns-slot="settings"] { display: none; }
#agent-app { padding: 0 6px; }
.border { margin: 18px 6px 0; border-top: 1px solid var(--line); padding-top: 14px; }
.border summary { cursor: pointer; font-weight: 500; font-size: 15px; }
.muted-note { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.border-log { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.border-log li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.border-log li.none { display: block; border-style: dashed; }
.border-log .bwho { font-weight: 500; overflow-wrap: anywhere; }
.border-log .bwhy { grid-column: 2; color: var(--muted); font-size: 13px; }

/* ---- Screen 4: passport paper, the diagram ---------------------------------------- */
.band::before, .band::after { content: ""; position: absolute; z-index: -1; inset: 0; }
.band::before { background: var(--c2); }
/* Guilloche: the fine line work printed on passports and banknotes. */
.band::after { background: var(--c1); opacity: .05; -webkit-mask: url("guilloche.svg") 0 0 / 600px 240px repeat; mask: url("guilloche.svg") 0 0 / 600px 240px repeat; }
.diagram { position: relative; border-radius: 24px; background: var(--c1); padding: 28px 28px 20px; box-shadow: 0 30px 70px -40px color-mix(in oklab, var(--c1) 70%, transparent); }
.dg { display: block; width: 100%; height: auto; overflow: visible; }
.dg text { font: 500 15px var(--sans); fill: var(--ink-2); letter-spacing: -.01em; }
.dg-lines path { fill: none; stroke: var(--line-2); stroke-width: 1.2; }
.dg-node rect { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.2; }
.dg-node use { fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dg-core rect { fill: var(--c2); }
.dg-core text { fill: var(--c1); font-weight: 600; }
.dg-core use { fill: none; stroke: var(--c3-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dg-stamp { filter: url(#ink-soft); }
.dg-stamp rect { fill: none; stroke: var(--c3); stroke-width: 2.5; }
.dg-stamp rect.inner { stroke-width: 1.2; opacity: .6; }
.dg-stamp text { font: 700 16px var(--mono); letter-spacing: .14em; text-transform: uppercase; fill: var(--c3); }
.dg-pulses path { fill: none; stroke: var(--c3); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 9 200; stroke-dashoffset: 10; }
/* At rest (before, between and after runs) the dash sits wholly off both ends of its path,
   so no round cap is left behind as a dot. */
.dg-list { display: none; }
/* The loop: a comet runs input, core, the five lanes in a ripple, then the verdict. 3.2 s. */
@media (prefers-reduced-motion: no-preference) and (min-width: 641px) {
  .diagram.run .dg-pulses path { animation: comet 3.2s linear infinite; animation-delay: var(--pd); }
  .diagram.run .dg-lane rect { animation: lane-lit 3.2s linear infinite; animation-delay: var(--ld); }
  .diagram.run .dg-stamp { animation: stamp-lit 3.2s linear infinite; animation-delay: 2.4s; }
  .diagram.paused *, .diagram.offscreen * { animation-play-state: paused !important; }
}
@keyframes comet { 0% { stroke-dashoffset: 10; animation-timing-function: cubic-bezier(0.77, 0, 0.175, 1); } 16% { stroke-dashoffset: -110; } 100% { stroke-dashoffset: -110; } }
@keyframes lane-lit { 0% { stroke: var(--c3); } 14% { stroke: var(--line-2); } 100% { stroke: var(--line-2); } }
@keyframes stamp-lit { 0% { opacity: 1; } 22% { opacity: .55; } 100% { opacity: .55; } }
.principles { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.principles li { border-top: 1px solid var(--line-2); padding-top: 16px; color: var(--muted); font-size: 15px; }
.principles strong { display: block; color: var(--ink); font-weight: 500; font-size: 18px; letter-spacing: -.015em; margin-bottom: 4px; }

/* ---- Screen 5: for builders -------------------------------------------------------- */
.guard { display: flex; align-items: center; }
.guard-wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.guard-text { grid-column: 1 / span 5; }
.facts-list { list-style: none; margin: 22px 0 24px; padding: 0; display: grid; gap: 10px; color: var(--ink-2); }
.facts-list li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.facts-list li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c3); translate: 0 -1px; }
.guard-links { display: flex; flex-wrap: wrap; gap: 0 28px; }
.code-card { grid-column: 7 / span 6; overflow: hidden; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 18px; font: 400 12.5px/1 var(--mono); color: var(--muted); border-bottom: 1px solid var(--line); }
.code-card pre { margin: 0; padding: 26px 24px; overflow-x: auto; font-size: 14.5px; line-height: 1.85; color: var(--ink-2); }
.code-card .k { color: var(--c3); } .code-card .s { color: var(--c2); } .code-card .f { color: var(--c2); font-weight: 500; }

/* ---- Screen 6: the close and the footer, one section ------------------------------- */
footer.closing { display: flex; align-items: stretch; padding-bottom: 32px; }
footer.closing > .wrap { display: grid; grid-template-rows: 1fr auto; gap: 64px; }
.close { align-self: center; display: grid; gap: 24px; justify-items: start; max-width: 900px; }
.close-line { font-size: clamp(40px, 6vw, 88px); font-weight: 500; line-height: 1; letter-spacing: -.035em; color: var(--ink); text-wrap: balance; }
.close-fact { color: var(--muted); font-size: clamp(17px, 1.4vw, 20px); max-width: 46ch; }
.footer-rows { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 24px; align-items: center; font-size: 14px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.footer-links a { color: var(--ink-2); }
.maker { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; font-size: 14px; color: var(--muted); }
.maker strong { font-weight: 500; color: var(--ink); }
.legal { grid-column: 1 / -1; font-size: 13px; color: var(--muted); max-width: 90ch; }
.palette-picker { display: flex; gap: 2px; }
.palette-picker button { min-height: 32px; padding: 6px; border-radius: 999px; gap: 0; }
.palette-picker button[aria-pressed="true"] { border-color: var(--c3); }
.palette-picker i { display: block; width: 13px; height: 13px; border-radius: 50%; margin-left: -4px; border: 1.5px solid color-mix(in oklab, var(--c2) 30%, transparent); }
.palette-picker i:first-child { margin-left: 0; }

/* ---- Reduced motion: colours still change, nothing travels ------------------------ */
@media (prefers-reduced-motion: reduce) {
  .demo-checks li[data-state="checking"] .row-icon { animation: none; }
  .tabs.ready .tabs-highlight { transition: none; }
  .stamp.animate, .finding.stagger, .light.stagger { animation: fade 200ms ease both; animation-delay: 0ms; }
  button:active:not(:disabled), .button:active { transform: none; filter: brightness(.92); }
  .pause-disc { display: none; }
}

/* ---- Tablet and phone ------------------------------------------------------------------ */
@media (max-width: 1023px) {
  :root { --gut: 48px; }
  .hero-text, .hero-demo, .moment-head, .decode, .guard-text, .code-card { grid-column: 1 / -1; }
  .hero-text { margin-bottom: 40px; }
  .hero-facts { display: none; }
  .hero-wrap { min-height: 0; }
  .hero-demo { max-width: 600px; }
  .moment-head { margin-bottom: 40px; }
  .guard-text { margin-bottom: 40px; }
  .lights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .light:nth-child(3) { border-right: 0; }
  .light:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .report-body { grid-template-columns: minmax(0, 1fr); }
  .report-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .principles { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 760px) { .nav-links { display: none; } .nav { justify-content: space-between; } }
@media (max-width: 640px) {
  :root { --gut: 24px; --padt: 96px; --padb: 48px; }
  .topbar { top: 10px; }
  .inspect-row { flex-direction: column; }
  .inspect-row button { width: 100%; }
  /* The replay window is cut by a fade above the fold rather than sliced by it. */
  .hero-demo .demo-frame { max-height: 360px; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
  .demo-run { margin-left: 0; }
  .desk-window { padding: 6px; border-radius: 22px; }
  .panel { padding: 16px 6px 10px; }
  .report-head { grid-template-columns: minmax(0, 1fr); padding: 18px 14px; gap: 18px; }
  .stamp { width: 150px; justify-self: start; }
  .lights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .light { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .light:nth-child(2n) { border-right: 0; }
  .light:nth-child(3) { border-right: 1px solid var(--line); }
  .report-main, .report-side, .report-actions { padding-left: 14px; padding-right: 14px; }
  .compare-fields, .versions { grid-template-columns: minmax(0, 1fr); }
  .versions .arrow { display: none; }
  /* The diagram becomes a still list on a phone. */
  .dg { display: none; }
  .dg-list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; counter-reset: none; }
  .dg-list li { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 15px; }
  .dg-list li:nth-child(2) { background: var(--c2); color: var(--c1); font-weight: 500; border-color: transparent; }
  .dg-list li:last-child { color: var(--c3); border-color: var(--c3); }
  .footer-rows { grid-template-columns: minmax(0, 1fr); }
}
