/* Bebas Neue (SIL Open Font License 1.1, see fonts/OFL.txt), self-hosted for the CSP's font-src 'self'. Used only for the name and monogram. */
@font-face {
  font-family: "Bebas Neue"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/BebasNeue-Regular-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
/* ask-peter: light, airy observability UI. Tone text shades are darkened to meet WCAG AA. */
:root {
  color-scheme: light;
  --bg: #e6e7eb;
  --frame: #f3f4f6;
  --card: #ffffff;
  --card-2: #f6f7f9;
  --line: #eceef2;
  --line-2: #dfe2e8;
  --text: #0f1115;
  --text-2: #363a43;
  --muted: #61666f;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 20px rgba(17, 24, 39, .06);
  --shadow-lg: 0 2px 6px rgba(17, 24, 39, .06), 0 24px 60px rgba(17, 24, 39, .14);
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
  /* tone pairs: --*-ink is the AA-safe text/icon shade, the plain colour is for bars and dots */
  --purple: #7b4dff; --purple-ink: #7343ff; --purple-bg: #f2eeff;
  --blue: #2f6bff;   --blue-ink: #1b5cff;   --blue-bg: #edf2ff;
  --green: #17a34a;  --green-ink: #127f3a;  --green-bg: #e9f8ee;
  --orange: #f2780c; --orange-ink: #ae5609; --orange-bg: #fff2e6;
  --indigo: #4f46e5; --indigo-ink: #4f46e5; --indigo-bg: #eeedfd;
  --red: #e0322d;    --red-ink: #d2241f;    --red-bg: #fdeeee;
  --slate: #5b6474;  --slate-ink: #5b6474;  --slate-bg: #eef0f3;
  --grey: #737985;   --grey-ink: #676d77;   --grey-bg: #f0f1f3;
  --primary: #111318; --primary-text: #ffffff;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, monospace;
}

.t-purple { --tc: var(--purple); --ti: var(--purple-ink); --tb: var(--purple-bg); }
.t-blue   { --tc: var(--blue);   --ti: var(--blue-ink);   --tb: var(--blue-bg); }
.t-green  { --tc: var(--green);  --ti: var(--green-ink);  --tb: var(--green-bg); }
.t-orange { --tc: var(--orange); --ti: var(--orange-ink); --tb: var(--orange-bg); }
.t-indigo { --tc: var(--indigo); --ti: var(--indigo-ink); --tb: var(--indigo-bg); }
.t-red    { --tc: var(--red);    --ti: var(--red-ink);    --tb: var(--red-bg); }
.t-slate  { --tc: var(--slate);  --ti: var(--slate-ink);  --tb: var(--slate-bg); }
.t-grey   { --tc: var(--grey);   --ti: var(--grey-ink);   --tb: var(--grey-bg); }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
/* Loading placeholders (index.html, core.js skeleton()): grey bars, never a bare "Loading…" on screen. */
.skel { display: grid; gap: 10px; padding: 4px 0 8px; }
.skel-line, .chip-skel { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--card-2) 0, var(--line-2) 50%, var(--card-2) 100%) 0 0 / 200% 100%; animation: skel 1.4s ease-in-out infinite; }
.skel .skel-line:nth-child(3n) { width: 86%; }
.skel .skel-line:nth-child(3n + 1) { width: 64%; }
.skel-inline { display: inline-block; width: 16em; height: .9em; vertical-align: middle; }
.chip-skel { flex: none; width: 200px; height: 36px; border-radius: 999px; }
.timeline:has(.tl-skel)::before { display: none; }
.tl-skel { list-style: none; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel-line, .chip-skel { animation: none; } }

/* ---------- atoms ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.4;
  color: var(--ti); background: var(--tb); white-space: nowrap;
}
.pdot { width: 6px; height: 6px; border-radius: 50%; background: var(--tc); flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px;
  border-radius: 999px; border: 1px solid transparent; background: var(--card-2); color: var(--text);
  font-weight: 500; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, box-shadow .15s, opacity .15s;
}
.btn.soft { background: var(--card); border-color: var(--line-2); }
.btn.soft:hover { background: var(--card-2); }
.btn.primary { background: var(--primary); color: var(--primary-text); box-shadow: 0 4px 12px rgba(0, 0, 0, .16); }
.btn.primary:hover { opacity: .88; }
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }

/* ---------- frame, rail, header ---------- */
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: 10px; background: var(--primary); color: #fff; text-decoration: none; }
.skip:focus { top: 12px; }
.app { height: 100vh; padding: 16px; }
.frame {
  height: 100%; display: grid; grid-template-columns: 88px minmax(0, 1fr);
  background: var(--frame); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  border: 1px solid color-mix(in srgb, var(--card) 70%, transparent); overflow: hidden; overflow: clip;
}
.rail { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 0 18px; }
.logo { width: 48px; height: 48px; display: block; border-radius: 15px; }
.logo svg { width: 100%; height: 100%; display: block; }
.rail-items { display: flex; flex-direction: column; gap: 6px; margin-top: 40px; }
.rail-item {
  width: 72px; padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  border-radius: 14px; color: var(--text-2); text-decoration: none; font-size: 11.5px; font-weight: 500;
}
.rail-item svg { width: 20px; height: 20px; }
.rail-item:hover { color: var(--text); background: color-mix(in srgb, var(--card) 60%, transparent); }
.rail-item[aria-current="page"] { background: var(--card); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--text), var(--shadow); }

.main-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 22px 24px 18px 4px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 6px 0 18px; flex: none; }
.head-l { min-width: 0; }
.logo-sm { display: none; }
/* The name: Bebas Neue, set with restraint (moderate size, open tracking, soft near-black), not as a slab. */
.name { margin: 0; font-weight: 400; line-height: 1; }
.name-main { display: inline-block; white-space: nowrap; font: 400 42px/1 "Bebas Neue", var(--display); letter-spacing: .07em; word-spacing: .14em; color: #24262b; margin-right: -.07em; }
.name .aka { display: inline-block; margin: 0 0 0 4px; vertical-align: 3px; font: 400 14px var(--font); letter-spacing: .03em; color: var(--muted); }
.role { margin: 2px 0 0; font-size: 13.5px; letter-spacing: .01em; color: var(--muted); }
.head-r { display: flex; gap: 10px; align-items: center; flex: none; flex-wrap: wrap; justify-content: flex-end; padding-top: 6px; }

/* "Built like production" (js/proof.js): proof points, each linking to its evidence. Below the fold on Ask, compact
   near the top of the System card. */
.proof { padding: 16px 20px 18px; }
.view-ask > .proof { flex: none; margin-top: 16px; }
.proof-h { margin: 0 0 10px; font: 500 16px var(--display); }
.proof-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.proof-item { position: relative; min-width: 0; padding-left: 17px; overflow-wrap: anywhere; }
.proof-item::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.proof-text { color: var(--text); }
.proof-links { margin-left: 4px; font-size: 12.5px; color: var(--muted); }
.proof-links a { color: var(--blue-ink); text-underline-offset: 3px; white-space: nowrap; }
.system-card .proof-sc { margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card-2); }
.system-card .proof-sc h3.proof-h { margin: 0 0 8px; }
.system-card .proof-sc .proof-text { color: var(--text); }
.system-card .sc-canary { margin: -6px 0 18px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.system-card .sc-canary a { color: var(--blue-ink); text-underline-offset: 3px; }
@media (max-width: 899px) {
  .view-ask > .proof { margin-top: 0; padding: 16px 14px; }
  .proof-list { gap: 10px; }
}
/* Desktop: the Ask panes fill the view and the card sits under them, one scroll away. The scroll padding leaves only
   the view's bottom 4rem as the place to scroll things into, so the panes' own scrollIntoView calls (runs, citations)
   don't scroll the view down to the card, while focus and find-in-page still reveal it. */
@media (min-width: 900px) {
  .view-ask { overflow-y: auto; scroll-padding-top: calc(100% - 4rem); }
  .view-ask > .panes { flex: 0 0 100%; }
}

/* views (hash routes) */
.views { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.views:focus { outline: none; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view-page { overflow-y: auto; }

/* ---------- panes ---------- */
.panes { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
/* clip (not hidden): hidden boxes can still be scrolled by scrollIntoView/focus, shifting the whole layout */
.pane { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; overflow: clip; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 12px; flex-wrap: wrap; }
.pane-head h2 { margin: 0; font: 500 16px var(--display); }
.pane-sub { font-size: 12px; color: var(--muted); }
.messages, .runs { position: relative; flex: 1; overflow-y: auto; }
.messages { padding: 4px 20px 12px; }
.runs { padding: 4px 16px 20px; background: var(--card-2); border-top: 1px solid var(--line); }

/* Trace / Transcript tabs */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; }
.tabs button { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 9px; cursor: pointer; font: 500 13px var(--font); color: var(--muted); }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }

/* segmented tabs with counts */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line-2); }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0 12px; height: 28px;
  border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 500;
}
.seg button.on { background: var(--primary); color: var(--primary-text); }
.seg-n { font-size: 10.5px; font-weight: 600; min-width: 18px; padding: 0 5px; border-radius: 8px; background: var(--card); color: var(--muted); line-height: 16px; text-align: center; }
.seg button.on .seg-n { background: rgba(255, 255, 255, .18); color: inherit; }
.runs[data-filter="live"] .run:not(.mode-live), .runs[data-filter="recorded"] .run:not(.mode-recorded) { display: none; }

/* ---------- chat ---------- */
.msg {
  position: relative; max-width: 38rem; margin: 0 0 12px; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--card); cursor: pointer; overflow-wrap: anywhere;
  transition: border-color .2s, box-shadow .2s;
}
.msg.user { margin-left: auto; width: fit-content; max-width: 82%; background: var(--card-2); border-color: var(--line); font-size: 15px; }
.msg.user p { margin: 0; }
.msg.is-selected { background: var(--card); box-shadow: var(--shadow); }
.who-tag { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; letter-spacing: .01em; }
.msg.agent p { margin: 0 0 8px; }
.msg.agent ul { margin: 0 0 8px; padding-left: 18px; }
.msg.agent li { margin-bottom: 4px; }
.msg .typing { white-space: pre-wrap; }
.thinking { color: var(--muted); font-size: 13px; }
.thinking::after { content: "…"; animation: blink 1s steps(1) infinite; }
.msg-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; }
.msg-foot button { font: inherit; cursor: pointer; }
.msg-foot .cite {
  min-height: 24px; max-width: 100%; padding: 2px 9px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card-2);
  font: 500 11.5px var(--font); color: var(--text-2); text-align: left; overflow-wrap: anywhere;
}
.msg-foot .cite:hover { border-color: var(--green); color: var(--green-ink); }
.msg-foot .to-trace { min-height: 24px; border: 0; background: none; padding: 2px 0; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; }
.msg-foot .checks-pill { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 2px 10px; border-radius: 999px; border: 1px solid transparent; font: 600 11.5px var(--font); }
.checks-pill.is-pass { background: var(--green-bg); color: var(--green-ink); }
.checks-pill.is-flag { background: var(--orange-bg); color: var(--orange-ink); }
.checks-pill:hover { border-color: currentColor; }
/* a live run in progress: a running clock and a Stop button */
.msg-foot .elapsed { color: var(--muted); font-variant-numeric: tabular-nums; }
.msg-foot .stop-run { height: 26px; padding: 0 12px; font-size: 12px; }
.msg.notice, .msg.withheld { background: var(--orange-bg); border-color: color-mix(in srgb, var(--orange) 30%, transparent); }
.msg.notice .who-tag, .msg.withheld .who-tag { color: var(--orange-ink); }
.msg.notice .body p { margin: 0; }
/* a stopped run: one muted line, not a bubble */
.msg.stopped, .msg.stopped.is-selected { margin: -2px 0 12px; padding: 0 2px; border: 0; background: none; box-shadow: none; }
.stopped-line { margin: 0; font-size: 12.5px; color: var(--muted); }
.stopped-line:focus { outline: none; }
.redacted-note { margin: 6px 0 0; font-size: 12px; color: var(--orange-ink); }

/* ---------- ask box (the first action) ---------- */
.ask-top { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); flex: none; }
.ask-h { margin: 0; font: 500 21px var(--display); letter-spacing: -.01em; }
.ask-sub { margin: 4px 0 14px; color: var(--text-2); font-size: 14px; }
/* The ask box keeps one layout until the first question finishes: chips never move under a pointer mid-click. */
.messages { scroll-margin-top: 12px; }
.msg { scroll-margin: 12px 0; }
.msg-guess { scroll-margin: 12px 0 16px; }
.ask { display: flex; gap: 8px; }
.ask input {
  flex: 1; min-width: 0; height: 54px; padding: 0 18px; border-radius: 16px; border: 1.5px solid var(--line-2);
  background: var(--card); box-shadow: var(--shadow); font-size: 16px;
}
.ask input::placeholder { color: #6b7079; }
.ask input:focus { outline: none; border-color: var(--blue-ink); box-shadow: 0 0 0 4px var(--blue-bg); }
.ask .btn { height: 54px; padding: 0 26px; font-size: 15px; border-radius: 16px; }
.fine { margin: 8px 2px 0; font-size: 12.5px; color: var(--muted); }
/* The hourly limit only matters once someone has asked something. */
.fine .quota { display: none; }
.has-runs .fine .quota { display: inline; }
.try { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.try-label { flex: none; font-size: 13px; font-weight: 500; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 14px 4px 5px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; color: var(--text); text-align: left;
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, box-shadow .15s;
}
.chip-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--tb); color: var(--ti); }
.chip-ic svg { width: 14px; height: 14px; }
.chip:hover { border-color: var(--purple); box-shadow: var(--shadow); }
.chip.used { color: var(--text-2); }
.chip[aria-current] { color: var(--text); border-color: var(--purple); background: var(--purple-bg, var(--card)); }
.chips.nudge .chip:not(.used) { border-color: var(--orange); }
/* A scrolling chip row fades at its right end while there are more chips that way (js/ask.js sets fade-r). It snaps
   chip by chip, so the first chip in view always starts at the row's edge; the tail after the last chip (--chip-tail,
   set by js/ask.js) lets every chip reach that edge. */
.chips { --fr: 0px; }
.chips.fade-r { --fr: 28px; }
/* After the first question finishes, the chips shrink to one sideways-scrolling row so the answer gets the room
   (desktop; phones already have one row). */
@media (min-width: 900px) {
  .chips-compact .ask-top { padding-bottom: 12px; }
  .chips-compact .try { flex-direction: row; align-items: center; gap: 10px; margin-top: 12px; }
  .chips-compact .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding: 2px 2px 4px; min-width: 0;
    scroll-snap-type: x mandatory; scroll-padding-inline: 2px;
    mask-image: linear-gradient(to right, #000 calc(100% - var(--fr)), transparent 100%); }
  .chips-compact .chip { flex: none; scroll-snap-align: start; white-space: nowrap; min-height: 32px; }
}
.chips-compact .chips::after { content: ""; flex: 0 0 var(--chip-tail, 0px); }
.messages { padding: 14px 20px 12px; }
.messages:empty { display: none; }

/* ---------- trace: empty ---------- */
.empty { padding: 16px 4px; color: var(--muted); }
.empty p { margin: 0 0 12px; }
.how { padding: 22px 10px; color: var(--text-2); }
.how h3 { margin: 0 0 14px; font: 500 17px var(--display); color: var(--text); }
.how-note { font-size: 12.5px; color: var(--muted); margin: 0; }
.how-pick { font-size: 13.5px; }

/* ---------- proof strip (js/resume.js renderProofStrip): four numbers from data/resume.json, above the fold ---------- */
.pstrip .pstrip-h { margin: 0 0 10px; font: 600 12px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pstrip-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pstrip-items li { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.pstrip-big { font: 600 22px/1.15 var(--display); letter-spacing: -.01em; color: var(--text); overflow-wrap: anywhere; }
.pstrip-label { font-size: 13px; line-height: 1.3; color: var(--text-2); }
.pstrip-who { margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--muted); }
.pstrip-list .skel { min-height: 138px; }
.pstrip .pstrip-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
.pstrip-foot .btn { gap: 8px; text-decoration: none; color: var(--primary-text); }
.pstrip-foot svg { width: 16px; height: 16px; }
.how .pstrip { margin-bottom: 18px; }
.pstrip-m { display: none; }
.pstrip .pstrip-role { margin: 0 0 10px; font-size: 13.5px; color: var(--text-2); text-wrap: balance; }
@media (max-width: 899px) {
  .how .pstrip { display: none; }
  .pstrip-m { display: block; margin-bottom: 12px; padding: 12px 14px 14px; }
  .pstrip .pstrip-role { font-size: 13px; }
  .pstrip-items { gap: 8px 12px; }
  .pstrip-items li { padding: 0; gap: 0; border: 0; background: none; border-radius: 0; }
  .pstrip-big { font-size: 17px; }
  .pstrip-label { font-size: 12px; }
  .pstrip-who { margin-top: 0; font-size: 11.5px; }
  /* Phones: Peter's part on one line; the header's role line above already says it's AI evaluation. */
  .pstrip-area { display: none; }
  .pstrip-part { white-space: nowrap; }
  .pstrip-list .skel { min-height: 84px; }
  .pstrip .pstrip-foot { margin-top: 12px; }
}

/* ---------- trace: run card ---------- */
.run { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); border: 1px solid var(--line); margin-top: 12px; overflow: hidden; scroll-margin-top: 12px; }
.run.is-selected { box-shadow: var(--shadow-lg); }
.run.stopped { background: var(--card-2); box-shadow: none; }
.run.stopped .run-q { color: var(--muted); }
.run-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 14px 16px 10px; }
.run-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 11.5px var(--mono); color: var(--muted); }
.run-q { grid-column: 1 / -1; margin: 0; font: 400 17px/1.35 var(--display); overflow-wrap: anywhere; }
.run-link { all: unset; cursor: pointer; }
.run-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.run-link:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 2px; }
.mode-note { margin: 0 16px 4px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--card-2); font-size: 12px; color: var(--muted); }
.run.done:not(.is-selected) .steps, .run.done:not(.is-selected) .mode-note { display: none; }
.run.done:not(.is-selected) .run-status::after { content: " · show steps"; font-weight: 500; }

/* ---------- trace: steps (calm card timeline) ---------- */
.steps { list-style: none; margin: 0; padding: 10px 16px 4px; }
.step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; position: relative; }
.step::before { content: ""; position: absolute; left: 14.5px; top: 32px; bottom: 2px; width: 1px; background: var(--line-2); }
.step:last-child::before { display: none; }
.step-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--tb); color: var(--ti); }
.step-ic svg { width: 15px; height: 15px; }
.step.pending .step-ic { animation: pulse 1.2s ease-in-out infinite; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 30px; font-size: 12px; }
.meta .nm { font: 500 12px var(--mono); color: var(--text-2); }
.meta .lat { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta .tok { color: var(--muted); font-variant-numeric: tabular-nums; }
.meta .cost { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; padding: 1px 7px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); }
.content { margin-top: 4px; font-size: 13.5px; color: var(--text-2); }
.step.pending .content { color: var(--muted); }
.call { font: 12.5px var(--mono); overflow-wrap: anywhere; }
.call .fn { color: var(--blue-ink); font-weight: 600; }
.call .arg { color: var(--muted); }
details.result summary, details.unsupported summary, details.withheld-draft summary { cursor: pointer; padding: 3px 0; font: 12.5px var(--mono); color: var(--text-2); }
details.result pre {
  margin: 8px 0 0; padding: 12px; max-height: 260px; overflow: auto; border-radius: var(--r-sm);
  background: var(--card-2); border: 1px solid var(--line); font: 12px/1.5 var(--mono); color: var(--text-2); white-space: pre-wrap; word-break: break-word;
}
.draft-note { margin: 0 0 6px; font-size: 11.5px; color: var(--muted); }
.answer-text { padding: 10px 12px; border-radius: var(--r-sm); background: var(--card-2); border: 1px solid var(--line); }
.answer-text p { margin: 0 0 6px; }
.answer-text ul { margin: 0 0 6px; padding-left: 18px; }
.guard { margin: 6px 0 0; font-size: 12px; color: var(--orange-ink); }
details.withheld-draft summary, details.unsupported summary { color: var(--orange-ink); }
details.unsupported ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); font-size: 12.5px; }
.step .body { border-radius: var(--r-sm); }
.step.flash .body { animation: flash 1.8s ease-out; }

/* ---------- judge ---------- */
.scores { display: grid; gap: 10px; margin-top: 2px; }
.score-row { display: grid; grid-template-columns: 150px minmax(60px, 1fr) 40px auto; gap: 4px 12px; align-items: center; font-size: 12.5px; }
.mname { min-width: 0; overflow-wrap: anywhere; font-weight: 500; color: var(--text); }
.skind { font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.bar { position: relative; height: 4px; border-radius: 4px; background: var(--line-2); }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--tc); }
.bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--text); }
.score-row .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.rationale { grid-column: 1 / -1; margin-top: -2px; color: var(--muted); font-size: 12px; }
.gate { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.removed { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }

/* ---------- run summary ---------- */
.summary { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 8px; }
.stat { padding: 8px 10px; border-radius: var(--r-sm); background: var(--card-2); }
.stat span { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.stat strong { font: 600 14px var(--font); font-variant-numeric: tabular-nums; }
.stat.wide { grid-column: 1 / -1; }
.split i { font-style: normal; color: var(--muted); font-weight: 400; margin: 0 3px; }
.cost-note { margin: 0 0 12px; font-size: 11.5px; color: var(--muted); }

/* ---------- transcript ---------- */
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }
.tx-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px 10px; flex-wrap: wrap; }
.tx-title { display: grid; gap: 6px; min-width: 0; }
.tx-actions { display: flex; gap: 8px; flex: none; }
.tx .mode-note code { font: 11.5px var(--mono); padding: 0 4px; border-radius: 5px; background: var(--card); border: 1px solid var(--line); color: var(--text-2); }
.tx-section { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 16px 8px; font: 500 13px var(--font); color: var(--text); }
.tx-list { list-style: none; margin: 0; padding: 0 16px 8px; display: grid; gap: 8px; }
.tx-msg { padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); min-width: 0; }
.tx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; }
.tx-meta .nm { font: 500 12px var(--mono); color: var(--text-2); }
.tx-msg pre, .tx-call pre {
  margin: 8px 0 0; padding: 10px 12px; max-height: 360px; overflow: auto; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--line); font: 12px/1.55 var(--mono); color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.tx-long summary { cursor: pointer; margin-top: 8px; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.tx-call { margin-top: 8px; font-size: 12px; }
.tx-call .fn { font: 600 12px var(--mono); color: var(--blue-ink); }

/* ---------- judge labels + calibration ---------- */
.tabs .seg-n { margin-left: 4px; background: var(--line); }
.tabs button.on .seg-n { background: var(--card-2); }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.msg-guess { margin-top: 10px; }
.msg .draft { color: var(--text-2); border-left: 3px solid var(--line-2); padding-left: 10px; }
/* darker inks so the result stays above 4.5:1 on the purple tint */
.fb-status { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.fb-status:empty { margin: 0; }
.cal .stats { margin: 10px 16px 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat small { font-size: 11px; font-weight: 400; color: var(--muted); }
.caveat.strong { border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent); font-size: 12.5px; }
.rg { margin: 0 16px 10px; font-size: 13px; color: var(--text-2); }
.rg strong { font: 600 18px var(--font); color: var(--text); }
.cal .tx-section { margin: 6px 16px 6px; }
.caveat { margin: 0 16px 8px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--orange-bg); color: var(--orange-ink); font-size: 12px; }
.cal-note { margin: 0 16px 8px; font-size: 12px; color: var(--muted); }
.cm { margin: 6px 16px 12px; border-collapse: separate; border-spacing: 4px; font-size: 12.5px; }
.cm caption { text-align: left; padding: 0 4px 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.cm th { font-weight: 500; color: var(--muted); padding: 6px 8px; text-align: left; }
.cm td { min-width: 76px; padding: 10px 12px; border-radius: 10px; text-align: center; font: 600 16px var(--font); font-variant-numeric: tabular-nums; }
.cm td.on-diag { background: var(--green-bg); color: var(--green-ink); }
.cm td.off-diag { background: var(--orange-bg); color: var(--orange-ink); }
.dialog { max-width: min(560px, calc(100vw - 32px)); padding: 20px 22px; border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); color: var(--text); font: 14px/1.5 var(--font); }
.dialog::backdrop { background: rgba(15, 17, 21, .28); }
.dialog h2 { margin: 0 0 10px; font: 500 24px var(--display); }
.dialog ul { margin: 0 0 16px; padding-left: 18px; color: var(--text-2); }
.dialog li { margin-bottom: 8px; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes flash { from { background: var(--green-bg); box-shadow: 0 0 0 6px var(--green-bg); } to { background: transparent; box-shadow: 0 0 0 6px transparent; } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.step, .msg, .run { animation: rise .25s ease-out; }

/* ---------- tablet / mobile ---------- */
@media (max-width: 1100px) {
  .name-main { font-size: 40px; }
}
@media (max-width: 899px) {
  .app { height: auto; padding: 0 0 76px; }
  .frame { height: auto; display: block; border-radius: 0; box-shadow: none; border: 0; }
  /* the rail becomes a bottom tab bar */
  .rail {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: row; justify-content: center; padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(17, 24, 39, .06);
  }
  .rail .logo { display: none; }
  .rail-items { flex-direction: row; margin: 0; gap: 0; width: 100%; max-width: 420px; }
  .rail-item { width: auto; flex: 1 1 0; min-width: 0; }
  .rail-item[aria-current="page"] { background: var(--purple-bg); color: var(--purple-ink); box-shadow: inset 0 -3px 0 var(--purple-ink); }
  html { scroll-padding-bottom: 84px; }
  /* One compact header on every page: the logo, the name on one line and Email Peter beside it (GitHub and LinkedIn
     join it where there's room). The role line moves into the proof strip on Ask. */
  .head-l { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
  .logo-sm { display: block; width: 40px; height: 40px; border-radius: 12px; }
  .role { display: none; }
  .main-col { padding: 18px 14px 16px; }
  .head { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
  .name-main { font-size: 26px; letter-spacing: .07em; }
  .name .aka { font-size: 13px; }
  .head-r { padding: 0; }
  .head-r .btn { height: 30px; padding: 0 10px; font-size: 12px; }
  .ask-top { padding: 16px 14px 14px; }
  .try { flex-direction: column; gap: 6px; }
  .try-label { padding-top: 0; }
  /* Before the first question the chips wrap, each fully on screen. After it (chips-compact) they become one swipeable
     row that snaps chip by chip (the first chip in view is never cut off) and fades on the right, so the answer starts near the top. */
  .chips { gap: 6px; }
  .chip { max-width: 100%; }
  .chips-compact .chips { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 0 4px;
    mask-image: linear-gradient(to right, #000 calc(100% - var(--fr)), transparent 100%); }
  .chips-compact .chips::-webkit-scrollbar { display: none; }
  .chips-compact .chip { flex: none; scroll-snap-align: start; white-space: nowrap; }

  .panes { display: block; }
  .pane { overflow: visible; margin-bottom: 12px; }
  .messages, .runs { overflow: visible; }
  .has-runs .runs { min-height: 100vh; min-height: 100svh; }
  .msg.user { max-width: 92%; }
  .score-row { grid-template-columns: minmax(40px, 1fr) 40px auto; }
  .score-row > .mname { grid-column: 1 / -1; }
  .ask input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}





/* ---------- pages: Résumé and Timeline ---------- */
.page { max-width: 880px; width: 100%; margin: 0 auto; padding: 28px 32px 36px; }
.page-head h2 { margin: 0; font: 600 18px/1.3 var(--font); color: var(--text); }
.page-head h2:focus { outline: none; }
.page-head h2 { margin-bottom: 6px; }
.page-head h2:last-child { margin-bottom: 18px; }
.page-head p { margin: 0 0 22px; color: var(--text-2); }
.page-head a, .resume a, .timeline a { color: var(--blue-ink); text-underline-offset: 3px; }
.resume h3 { margin: 26px 0 10px; font: 600 12px var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.resume .summary-p { margin: 0; font-size: 16px; color: var(--text); max-width: 46rem; }
.r-role { padding: 14px 0; border-top: 1px solid var(--line); }
.r-role:first-of-type { border-top: 0; }
.r-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.r-head h4 { margin: 0; font: 600 16px var(--font); }
.r-period { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.r-org { margin: 2px 0 6px; font-size: 13px; color: var(--text-2); }
.r-role > p { margin: 0 0 8px; color: var(--text-2); }
.r-projects { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.r-projects li { padding: 10px 14px; border-radius: var(--r-sm); background: var(--card-2); }
.r-projects strong { font-weight: 600; }
.r-projects .r-prole { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.r-more { margin-top: 10px; }
.r-more > summary { cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; color: var(--blue-ink); font-weight: 500; }
@media (max-width: 899px) { .r-more > summary { min-height: 44px; } }
@media print { .r-more > summary { display: none; } }
.r-projects p { margin: 3px 0 0; font-size: 13.5px; color: var(--text-2); }
.r-metrics { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); }
.r-metrics li { padding: 0; background: none; margin-bottom: 2px; }
.r-group { margin: 0 0 4px; font-size: 13px; color: var(--text-2); }
/* Selected work: the case-study cards (js/case-studies.js) */
.cs-list { display: grid; gap: 12px; }
.cs-card { min-width: 0; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--card); scroll-margin-top: 12px; }
.cs-card:focus { outline: none; }
.cs-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.cs-head { display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; align-items: baseline; }
.cs-head h4 { margin: 0; font: 600 16px var(--font); }
.cs-role { font-size: 13px; color: var(--muted); }
.cs-problem { margin: 4px 0 0; font-size: 14px; color: var(--text-2); }
.cs-k { margin-right: 6px; font: 600 11px var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cs-built { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); }
.cs-built li { margin-bottom: 2px; }
.cs-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cs-chips li { max-width: 100%; padding: 3px 10px; border-radius: 999px; background: var(--green-bg); color: var(--green-ink); font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.cs-decisions { margin-top: 8px; font-size: 13.5px; color: var(--text-2); }
.cs-decisions p { margin: 0; }
.cs-decisions ul { margin: 2px 0 0; padding-left: 18px; }
.cs-ask { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 13.5px; font-weight: 500; }
.r-see { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 899px) { .cs-ask { min-height: 44px; margin-top: 2px; } }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 47px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); border-radius: 2px; }
.tl-item { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 18px; padding: 0 0 26px; align-items: start; }
.tl-photo { width: 220px; }
.tl-now { padding-bottom: 26px; }
.tl-earlier { position: relative; padding-left: 0; }
.tl-earlier summary { display: inline-block; margin-left: 24px; padding: 4px 12px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line-2); cursor: pointer; font-size: 13px; color: var(--text-2); position: relative; z-index: 1; }
.tl-earlier details[open] summary { margin-bottom: 18px; }
.tl-earlier .timeline::before { display: none; }
.tl-outside { margin: 26px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.tl-outside:empty, .tl-also:empty { display: none; }
.r-outside { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.r-outside + .r-outside { margin-top: 6px; padding-top: 0; border-top: 0; }
.tl-also { margin: 26px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.tl-also + .tl-outside { margin-top: 6px; padding-top: 0; border-top: 0; }
.tl-year { justify-self: center; position: relative; z-index: 1; padding: 3px 10px; border-radius: 999px; background: var(--primary); color: #fff; font: 600 13px var(--font); font-variant-numeric: tabular-nums; }
.tl-body h3 { margin: 0; font: 600 17px var(--font); }
.tl-place { margin: 2px 0 6px; font-size: 13px; color: var(--muted); }
.tl-body p { margin: 0; color: var(--text-2); }
.tl-photo { margin: 0; }
.tl-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); box-shadow: var(--shadow); }
.tl-photo figcaption { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.tl-slot { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--purple-bg), var(--blue-bg)); color: var(--purple-ink); }
.tl-slot svg { width: 22px; height: 22px; opacity: .7; }

@media (max-width: 899px) {
  .msg-guess { scroll-margin-bottom: 96px; }
  .page { padding: 20px 16px 28px; }
  .resume .summary-p { font-size: 15px; }
  .timeline::before { left: 27px; }
  .tl-item { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .tl-photo { grid-column: 2; width: 100%; }
  .tl-slot { display: none; }
}

/* ---------- Judge Lab ---------- */
.lab-h3 { margin: 30px 0 4px; font: 600 12px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.page-head + .lab-h3 { margin-top: 4px; }
.lab-sub { margin: 0 0 12px; color: var(--text-2); }
.lab-tally { margin: 4px 0 0; color: var(--text-2); }
.lab-tally strong { color: var(--text); font-weight: 600; }
.attacks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.attack { display: flex; flex-direction: column; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card-2); }
.attack h4 { margin: 0 0 4px; font: 600 15px var(--font); }
.attack p { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }
.attack blockquote { margin: 0 0 12px; padding: 8px 10px; border-left: 2px solid #d4d4d8; background: var(--card); border-radius: 0 8px 8px 0; font: 12.5px/1.5 var(--mono); color: var(--text-2); white-space: pre-wrap; word-break: normal; overflow-wrap: break-word; }
.attack-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.attack-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.incident { padding: 16px 0 20px; border-top: 1px solid var(--line); }
.inc-head { margin: 0; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.inc-summary { margin: 0 0 12px; color: var(--text-2); }
.inc-more { margin: 0 0 12px; }
.inc-more summary { cursor: pointer; font-size: 13px; color: var(--blue-ink); margin-bottom: 10px; }
.incident h4 { margin: 6px 0 10px; font: 600 17px var(--font); }
.inc-facts { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 14px; margin: 0 0 14px; font-size: 13.5px; }
.inc-facts dt { font-weight: 600; color: var(--text-2); }
.inc-facts dd { margin: 0; color: var(--text-2); }
.inc-facts ul { margin: 0; padding-left: 18px; }
.inc-facts code { font: 12px var(--mono); padding: 1px 6px; border-radius: 6px; background: var(--card-2); border: 1px solid var(--line); }
.compare { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; table-layout: fixed; }
.compare caption { text-align: left; font-weight: 600; padding-bottom: 6px; color: var(--text); }
.compare th, .compare td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { color: var(--muted); font-weight: 600; font-size: 12px; }
.compare tbody th, .compare thead td { color: var(--text-2); font-weight: 500; width: 140px; }
.compare td { font-variant-numeric: tabular-nums; color: var(--text); }
.defenses { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.def-label { color: var(--text-2); font-weight: 500; }
.attack-result { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; }
.attack-result.is-caught { background: var(--green-bg); color: #0f6a30; }
.attack-result.is-escaped { background: var(--red-bg); color: #b01e1a; }
.attack-result.is-error { background: var(--orange-bg); color: var(--orange-ink); }
/* a Break the Gate run reports inside its own card */
/* every card reserves the same result area above its Run button, so the buttons stay in line whatever ran */
.attack-out { order: 1; margin: auto 0 10px; height: 7.5rem; overflow-y: auto; border-radius: var(--r-sm); }
.attack-out:empty { border: 1px dashed var(--line-2); display: grid; place-items: center; }
.attack-out:empty::before { content: "The result shows here"; font-size: 12px; color: var(--muted); }
.attack-foot { order: 2; margin-top: 0; }
.attack-out p { margin: 0 0 6px; }
.attack-out .attack-result { margin-bottom: 6px; }
.attack-out .defenses { margin: 0 0 6px; }
.atk-running .elapsed { font-variant-numeric: tabular-nums; }
.atk-shown { overflow-wrap: anywhere; }
.lab-incidents { margin-top: 30px; }
.lab-incidents > summary { width: fit-content; padding: 4px 0; cursor: pointer; font: 600 12px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--blue-ink); }
.lab-incidents[open] > summary { margin-bottom: 6px; }
/* Break the Gate challenge and hall of fame (js/challenge-panel.js) */
.chal { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px 20px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card-2); }
.chal:empty { display: none; }
.chal h4 { margin: 0 0 4px; font: 600 15px var(--font); }
.chal-lead { margin: 0 0 4px; font-weight: 500; }
.chal-how { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.chal-form { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center; font-size: 13px; }
.chal-form label { color: var(--text-2); font-weight: 500; }
.chal-form input { min-width: 0; min-height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); font: 13px var(--font); color: var(--text); }
.chal-form #chal-link { font-family: var(--mono); }
.chal-form input[aria-invalid="true"] { border-color: var(--red); }
.chal-go { grid-column: 2; justify-self: start; }
.chal-status { margin: 8px 0 0; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.chal-status:empty { margin: 0; }
.chal-status.is-error { color: var(--red-ink); }
.chal-fine { margin: 6px 0 0; font-size: 12.5px; }
.chal-hof { border-left: 1px solid var(--line); padding-left: 18px; }
.chal-hof-h { margin: 0 0 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.chal-hof-list { margin: 0; padding-left: 20px; font-size: 13px; }
.chal-hof-list li { margin: 0 0 4px; }
.chal-hof-list a { white-space: nowrap; }
.chal-hof-who { font-weight: 600; overflow-wrap: anywhere; }
.chal-hof-empty { margin: 0; font-size: 13px; }
.share-chal { margin: 6px 0 0; color: var(--text-2); }
@media (max-width: 899px) {
  .chal { grid-template-columns: 1fr; }
  .chal-hof { border-left: 0; padding-left: 0; padding-top: 10px; border-top: 1px solid var(--line); }
  .chal-form { grid-template-columns: 1fr; }
  .chal-go { grid-column: auto; }
  .chal-form input { min-height: 44px; font-size: 16px; }
  .chal a, .share-chal a { display: inline-block; padding: 12px 0; margin: -12px 0; }
}

@media (max-width: 899px) {
  /* one swipeable row of attacks */
  .attacks { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; gap: 10px; margin: 0 -16px; padding: 2px 16px 8px; }
  .attack { flex: 0 0 84%; scroll-snap-align: start; }
  .inc-facts { grid-template-columns: 1fr; gap: 2px; }
  .inc-facts dd { margin-bottom: 8px; }
  .compare tbody th, .compare thead td { width: 96px; }
}

@media (max-width: 899px) {
  .compare tr.judge-said { display: none; }
  .compare tbody th, .compare thead td { width: 34%; }
  .compare { font-size: 13px; }
}
@media (max-width: 359px) {
  body[data-route] .head { flex-direction: column; align-items: flex-start; }
}
/* Phones: the name sits on one line with only Email Peter beside it (GitHub and LinkedIn show from 560 px up). */
@media (max-width: 559px) {
  .head-r .btn-social { display: none; }
}

/* print: the Résumé page prints its one-page layout (.rp, js/resume.js), the same one tools/resume_pdf.py saves
   as resume.pdf. Other pages print as a plain document. */
@media print {
  body { background: #fff; }
  .rail, .skip, .head-r, .logo-sm, #view-ask, #view-timeline, #view-lab, .page-head p, dialog { display: none !important; }
  .app, .frame, .main-col, .views, .view, .view-page { height: auto !important; overflow: visible !important; display: block !important; padding: 0 !important; box-shadow: none !important; border: 0 !important; background: #fff !important; }
  .page { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .name-main { font-size: 30px; }
  body[data-route="resume"] :is(.head, .foot, .view:not(#view-resume), #view-resume .page-head, #resume > :not(.rp)) { display: none !important; }
  body[data-route="resume"] .main-col { margin: 0 !important; }
  body[data-route="resume"] .rp { display: block; }
}
@page { size: letter; margin: .5in .55in; }

.rp { display: none; font: 9.5pt/1.32 Arial, "Liberation Sans", Helvetica, sans-serif; color: #15171c; }
.rp p { margin: 0; }
.rp a { color: inherit; text-decoration: none; }
.rp-head { padding-bottom: 7pt; border-bottom: 1.2pt solid #15171c; }
.rp-name { margin: 0; font: 400 27pt/1 "Bebas Neue", Arial, sans-serif; letter-spacing: .06em; }
.rp-name small { font: 400 10pt Arial, "Liberation Sans", sans-serif; letter-spacing: 0; color: #555a63; }
.rp-role { margin-top: 4pt !important; font-size: 10.5pt; }
.rp-contact { margin-top: 2pt !important; font-size: 9pt; color: #363a43; }
.rp h2 { margin: 10pt 0 4pt; padding-bottom: 2pt; border-bottom: .6pt solid #c9ccd2; font: 700 8.5pt Arial, "Liberation Sans", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #555a63; }
.rp-job { margin: 7pt 0 0; break-inside: avoid; }
.rp-job-h { display: flex; justify-content: space-between; gap: 12pt; }
.rp-job-h > span:last-child { flex: none; color: #555a63; font-variant-numeric: tabular-nums; }
.rp-org { font-size: 10.5pt; }
.rp-dim { color: #555a63; }
.rp-projects { margin: 4pt 0 0; padding-left: 12pt; }
.rp-projects li { margin: 0 0 4pt; break-inside: avoid; }
.rp-metrics { font-size: 8.8pt; color: #363a43; }
.rp-metrics::before { content: "› "; color: #8a8f98; }

.role { text-wrap: balance; }
.r-skills { margin: 0; padding-left: 18px; }
.r-skills li { margin: 5px 0; }
.resume > h3:first-child { margin-top: 0; }
.page-head .r-pdf { display: flex; align-items: center; gap: 10px; margin: -12px 0 22px; }
.r-pdf .btn { gap: 8px; text-decoration: none; color: var(--primary-text); }
.r-pdf svg { width: 16px; height: 16px; }
.r-pdf .muted { font-size: 12.5px; }


/* ---------- round 1: one line about Peter, gated answers, Beat the Judge, system card ---------- */
.about-line { margin: -6px 0 14px; font-size: 13.5px; color: var(--text-2); flex: none; }
.ask-more { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.ask-more a { color: var(--blue-ink); text-underline-offset: 3px; }
.how p { margin: 0 0 10px; font-size: 14px; }
.bot-stats { font-size: 12.5px; color: var(--muted); }
.bot-stats a { color: var(--blue-ink); }
.verdict-tag.is-pass { color: #0f7334; font-weight: 600; }
.verdict-tag.is-flag { color: #9c4d07; font-weight: 600; }
.ai-badge { margin-left: auto; font-size: 11.5px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.ai-badge:hover { color: var(--text); border-color: var(--line-2); }
.mode-note .ai-badge { margin: 0 6px 0 0; }
.fb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12.5px; color: var(--text-2); }
.fb-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); cursor: pointer; }
.fb-btn svg { width: 15px; height: 15px; }
.fb-btn[aria-pressed="true"] { border-color: currentColor; color: var(--purple-ink); }
.fb-status { font-size: 12px; color: var(--muted); }
/* "Use my question as a test": shown under a thumbs-down when the server offers it */
.fb-keep { flex-basis: 100%; margin-top: 2px; }
.fb-keep-l { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); cursor: pointer; }
.fb-keep-l input { width: 16px; height: 16px; margin: 0; accent-color: var(--purple-ink); }
.fb-keep-note { margin: 2px 0 0 24px; max-width: 62ch; font-size: 12px; color: var(--muted); }
.fb-keep-status { margin: 4px 0 0 24px; font-size: 12px; color: var(--text-2); }
.fb-keep-status:empty { display: none; }
.btj-card { padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card-2); }
/* One height for every state (draft, verdict, end screen), so the card doesn't jump as you play: js/lab.js measures the
   round's tallest state at the card's width (--btj-h); the rem values only hold until it has. */
.btj { position: relative; }
.btj-card { min-height: var(--btj-h, 30rem); }
@media (max-width: 899px) { .btj-card { min-height: var(--btj-h, 35rem); } }
.btj-probe { position: absolute; top: 0; left: 0; right: 0; visibility: hidden; pointer-events: none; }
.btj-probe .btj-card { min-height: 0; }
/* "Share this run" (js/share.js) and the shared-run page /t/{id} (t.html, js/share-page.js) */
.share { font-size: 13px; }
.share:not(:empty) { margin-top: 10px; }
.msg-foot .share-open { height: auto; min-height: 24px; padding: 2px 10px; border-radius: 999px; font: 600 11.5px var(--font); }
.share-panel { margin-top: 2px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card-2); }
.share-h { margin: 0 0 6px; font-weight: 600; }
.share-h:focus { outline: none; }
.share-consent { margin: 0 0 10px; color: var(--text-2); }
.share-preview { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); }
.share-preview p, .share-a p, .share-a ul { margin: 0 0 6px; }
.share-k { margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.share-k2, .sp-k2 { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.share-a { max-height: 200px; overflow: auto; margin: 0 0 6px; }
.share-checks .pill { margin-left: 4px; }
.share-days { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--text-2); }
.share-days select { min-height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); font: inherit; }
.share-actions, .share-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-url { flex: 1 1 220px; min-width: 0; min-height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); font: 13px var(--mono); color: var(--text); }
.share-exp { margin: 8px 0 0; color: var(--text-2); }
.share-status { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.share-status:empty { margin: 0; }
.sp-body { min-height: 100vh; }
.sp-head { max-width: 860px; margin: 0 auto; padding: 18px 16px 6px; }
.sp-home { display: inline-flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.sp-home svg { width: 48px; height: 48px; flex: none; }
@media (max-width: 899px) { .sp-home { gap: 12px; } .sp-home svg { width: 40px; height: 40px; } }
.sp-main { max-width: 860px; margin: 0 auto; padding: 6px 16px 40px; outline: none; }
.sp-break { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--red-bg); color: #b01e1a; font-size: 13.5px; }
.sp-banner { display: inline-block; margin: 6px 0 12px; padding: 4px 12px; border-radius: 999px; background: var(--purple-bg); color: var(--purple-ink); font-size: 12.5px; font-weight: 600; }
.sp-card { margin: 0 0 14px; padding: 18px 20px; border-radius: var(--r-md); background: var(--card); box-shadow: var(--shadow); }
.sp-k { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.sp-q { margin: 0 0 16px; font: 500 22px/1.3 var(--display); }
.sp-a { font-size: 15px; }
.sp-a p, .sp-a ul { margin: 0 0 8px; }
.sp-src { margin: 10px 0 0; }
.sp-src .pill { margin: 2px 4px 2px 0; }
.sp-meta { margin: 12px 0 0; font-size: 12.5px; }
.sp-h { margin: 0 0 4px; font: 500 18px var(--display); }
.sp-note { margin: 0 0 8px; font-size: 12.5px; }
.sp-note a { color: var(--blue-ink); }
.sp-wf .wfx-host, .sp-wf.wfx-host { padding: 2px 0 0; border-top: 0; }
.sp-checks .jr-check { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.sp-ck-s { display: block; font-size: 12.5px; }
.sp-cta { margin: 18px 0 0; text-align: center; }
.sp-empty p { margin: 0; color: var(--text-2); }
@media (max-width: 899px) { .share-days select, .share-url, .msg-foot .share-open { min-height: 44px; } }
.btj-meta { margin: 0 0 8px; font-size: 12px; }
.btj-q { margin: 0 0 10px; font-weight: 600; }
.btj-q .muted, .btj-draft .muted { display: block; font-weight: 400; font-size: 12px; margin-bottom: 2px; }
.btj-draft { padding: 10px 12px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); }
.btj-draft p { margin: 0 0 6px; }
.btj-sources { margin: 10px 0; font-size: 13px; color: var(--text-2); }
.btj-sources ul { margin: 6px 0 0; padding-left: 18px; }
.btj-call { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btj-call span { font-size: 13.5px; }
.btj-call .btn svg { width: 14px; height: 14px; }
.btj-call [aria-pressed="true"] { border-color: currentColor; font-weight: 600; color: var(--purple-ink); }
.btj-result { margin-top: 12px; font-size: 13.5px; color: var(--text-2); }
.btj-result p { margin: 0 0 6px; }
.btj-result.is-match strong { color: #0f7334; }
.btj-result.is-split strong { color: #9c4d07; }
.btj-result:focus { outline: none; }
.btj-result:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 2px; }
/* rounds: progress dots, big Pass/Flag buttons with their hotkeys, an end screen */
.btj-dots { display: flex; gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; }
.btj-dots li { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--card); }
.btj-dots li.is-now { border-color: var(--text-2); }
.btj-dots li.is-match { background: #1a8f45; border-color: #1a8f45; }
/* A different call from the judge isn't an error: amber, not red. */
.btj-dots li.is-split { background: #e3a23b; border-color: #e3a23b; }
.btj-call { margin-top: 12px; }
.btj-big { height: 48px; padding: 0 22px; font-size: 15px; border: 1.5px solid var(--line-2); background: var(--card); gap: 8px; }
.btj-big svg { width: 18px; height: 18px; }
.btj-big kbd { font: 600 11px var(--mono, monospace); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); background: var(--card-2); }
.btj-result:empty { display: none; }
.btj-end h4 { margin: 0 0 8px; font: 600 20px var(--display); }
.btj-end h4:focus { outline: none; }
.btj-splits { margin: 4px 0 10px; padding-left: 18px; }
.btj-splits li { margin-bottom: 4px; }
@media (hover: none) { .btj-big kbd { display: none; } }
.atk-prompt { margin: 0 0 12px; font-size: 13px; }
.atk-prompt summary { cursor: pointer; color: var(--blue-ink); }
.atk-prompt blockquote { margin: 8px 0 0; }
.attacks-more { margin-top: 4px; }
.attacks-more > summary { width: fit-content; cursor: pointer; color: var(--blue-ink); font-size: 13.5px; margin: 4px 0 10px; }
.lab-tally:empty { display: none; }
.system-card h3 { margin: 22px 0 6px; font: 600 12px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.system-card > h3:first-child { margin-top: 0; }
.system-card p, .system-card li { color: var(--text-2); }
.system-card .sc-summary { font-size: 16px; color: var(--text); }
.system-card a { color: var(--blue-ink); text-underline-offset: 3px; }
/* the card opens on its computed lead (planted claims, unanswerable questions), one stat line and the judge version and
   run date; every section below is collapsed behind its title and a one-line verdict */
.sc-headline { margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card-2); display: grid; gap: 6px; }
.system-card .sc-headline p { margin: 0; color: var(--text); }
.system-card .sc-lead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.sc-lead-main { font-size: 21px; font-weight: 700; line-height: 1.25; }
.sc-lead-side { font-size: 15px; font-weight: 500; }
.system-card .sc-line { font-size: 15px; font-weight: 500; }
.system-card .sc-meta { font-size: 12.5px; color: var(--muted); }
.sc-sec { border-top: 1px solid var(--line); }
.sc-sec:last-of-type { border-bottom: 1px solid var(--line); }
.sc-sec > summary { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr auto; gap: 4px 16px; align-items: baseline; padding: 12px 2px; cursor: pointer; list-style: none; min-height: 44px; }
.sc-sec > summary::-webkit-details-marker { display: none; }
/* The open/close arrow: a 10 px chevron, pointing right when closed and down when open. */
.sc-sec > summary::after { content: ""; align-self: center; justify-self: center; width: 10px; height: 10px; margin: 0 8px; border-right: 2.5px solid var(--text-2); border-bottom: 2.5px solid var(--text-2); transform: rotate(-45deg); transition: transform .15s; }
.sc-sec[open] > summary::after { transform: rotate(45deg); }
.sc-sec > summary:hover .sc-h { color: var(--text); }
.sc-h { font: 600 12px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sc-h:focus { outline: none; }
.sc-verdict { color: var(--text); font-size: 14px; }
.sc-body { padding: 0 2px 14px; }
.sc-body > :first-child { margin-top: 0; }
.sc-foot { margin-top: 16px; }
.judge-validation .run.cal { margin: 0; }
@media (max-width: 899px) {
  .sc-sec > summary { grid-template-columns: 1fr auto; }
  .sc-verdict { grid-column: 1; grid-row: 2; }
  .sc-sec > summary::after { grid-column: 2; grid-row: 1; }
}
@media (max-width: 899px) {
  .chip, .rail-item, .btn, .btn.sm, .fb-btn, .tabs [role="tab"], .seg button, .atk-prompt summary, .attacks-more > summary, .lab-incidents > summary, .tl-earlier summary, .ai-badge, .ask-more a, .linkish { min-height: 44px; }
  .fb-btn { min-width: 44px; }
  .fb-keep-l { min-height: 44px; }
  .ask-more a, .linkish, .ai-badge { display: inline-flex; align-items: center; }
}

.ask-h:focus { outline: none; }
@media (max-width: 899px) {
  .msg-foot .cite, .to-trace, .msg-foot .checks-pill, .run-link, .btj-sources summary, .incident summary, .stat a { min-height: 44px; display: inline-flex; align-items: center; }
  /* short inline links (the "#1" failure links, "judge report", an attack's "Source"): a 44 px target without taller lines */
  .sc-num, a[href="#/judge"], .attack p a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  .lab-incidents > summary { display: list-item; line-height: 36px; }
  .logo-sm { width: 44px; height: 44px; }
  .btj-call > span { flex-basis: 100%; }
  /* sources on a phone: one "N sources" toggle (a 44 px target); the tags inside are small and wrap */
  .srcs { flex-basis: 100%; }
  .srcs > summary { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; color: var(--text-2); list-style: none; }
  .srcs > summary::-webkit-details-marker { display: none; }
  .srcs > summary::after { content: "▸"; font-size: 11px; transition: transform .15s; }
  .srcs[open] > summary::after { transform: rotate(90deg); }
  .srcs-list { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
  .msg-foot .srcs .cite { min-height: 32px; padding: 3px 10px; font-size: 11.5px; line-height: 1.3; }
}
.btj-call [aria-disabled="true"] { opacity: .5; cursor: default; }

/* ---------- confidence tint (opt-in; body.conf-on) ---------- */
.conf-row { margin: 12px 4px 0; }
.conf-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.conf-toggle input { width: 16px; height: 16px; accent-color: var(--blue-ink); }
.conf-hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.conf-hint a { color: var(--blue-ink); }
.conf-sr { display: none; }
.conf-callout { display: none; }
.conf-on .conf-sr { display: inline; position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* each level has its own tint and underline style, so it doesn't rely on color alone */
.conf-on .conf-medium { background: var(--orange-bg); text-decoration: underline dotted var(--orange-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.conf-on .conf-low { background: var(--red-bg); text-decoration: underline wavy var(--red-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.conf-on .conf-least { box-shadow: inset 0 -2px 0 var(--orange); }
.conf-on .conf-callout { display: block; margin: 8px 0 0; font-size: 12.5px; color: var(--text-2); }
.conf-callout-h { font-weight: 600; }
@media (max-width: 899px) { .conf-toggle { min-height: 44px; } }
.conf-legend { display: none; margin: 2px 0 0; font-size: 12px; color: var(--text-2); }
.conf-on .conf-legend { display: flex; gap: 10px; }
.conf-on .conf-legend .cs { padding: 0 4px; border-radius: 3px; }
.conf-on .conf-legend .conf-high { text-decoration: underline solid var(--line-2); text-underline-offset: 3px; }
.atk-stop { margin-left: 6px; }
@media (max-width: 899px) { .atk-stop { min-height: 44px; } }

/* ---------- Email Peter and Feedback (contact.js) ---------- */
.btn.ghost { background: transparent; color: var(--text-2); padding: 0 10px; }
.btn.ghost:hover { background: color-mix(in srgb, var(--card) 70%, transparent); color: var(--text); }
.btn-mail svg { width: 16px; height: 16px; color: var(--blue-ink); }
.btn-mail.primary svg { color: currentColor; }
.msg-foot .msg-mail { margin-left: auto; min-height: 24px; border: 0; background: none; padding: 2px 0; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; }
.foot { flex: none; margin: 10px 2px 0; font-size: 12px; color: var(--muted); }
.foot .linkish { color: var(--muted); }
.foot .linkish:hover { color: var(--text); }
.cdlg { position: relative; width: min(520px, calc(100vw - 32px)); padding: 22px 24px 20px; }
.cdlg h2 { padding-right: 32px; }
.cdlg h2:focus { outline: none; }
.cdlg-sub { margin: -4px 0 16px; color: var(--muted); }
.cdlg-fine { margin: 0; font-size: 12.5px; color: var(--muted); }
.cdlg-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 12px; }
.cdlg-actions .btn { height: 40px; padding: 0 18px; }
.cdlg-x { position: absolute; top: 14px; right: 14px; margin: 0; }
.cdlg-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.cdlg-close:hover { background: var(--card-2); color: var(--text); }
.cf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.cf-row { margin-bottom: 10px; }
.cf-row label { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.cf-opt { font-weight: 400; color: var(--muted); }
.cf input, .cf textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: var(--card);
  font: 15px/1.45 var(--font); color: var(--text);
}
.cf textarea { resize: vertical; min-height: 112px; }
.cf input:focus, .cf textarea:focus { outline: none; border-color: var(--blue-ink); box-shadow: 0 0 0 4px var(--blue-bg); }
.cf [aria-invalid="true"] { border-color: var(--red-ink); }
.cf-err { margin: 4px 0 0; font-size: 12.5px; color: var(--red-ink); }
.cf-err:empty { display: none; }
.cf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cf-count { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cf-status { margin: 10px 0 0; font-size: 13.5px; color: var(--red-ink); }
.cf-status:empty { display: none; }
.cf-status a { color: inherit; }
.cf-send[aria-disabled="true"] { opacity: .6; cursor: progress; }
.cf-done p { margin: 0 0 4px; color: var(--text-2); }
.fb-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; padding: 0; border: 0; }
.fb-kind { position: relative; }
.fb-kind input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.fb-kind span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; color: var(--text-2); }
.fb-kind input:checked + span { border-color: var(--text); color: var(--text); font-weight: 600; background: var(--card-2); }
.fb-kind input:focus-visible + span { outline: 2px solid var(--blue-ink); outline-offset: 2px; }
/* Email Peter, direct (js/config.js DIRECT_EMAIL_LIVE): the address with Copy, then the form as the quieter option */
.ep-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 10px 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card-2); }
.ep-addr { flex: 1; min-width: 0; font: 500 16px var(--font); color: var(--text); overflow-wrap: anywhere; user-select: all; }
.ep-row .btn { flex: none; height: 34px; padding: 0 14px; }
.ep-status { margin: 6px 0 0; font-size: 12.5px; color: var(--green-ink); }
.ep-status:empty { display: none; }
.ep-form { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.ep-form .linkish { font-size: 14px; }
.ep-fine { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
@media (max-width: 899px) {
  .foot { margin: 6px 14px 0; }
  .cdlg { padding: 20px 18px 16px; }
  .cf-pair { grid-template-columns: 1fr; }
  .cf input, .cf textarea { font-size: 16px; }
  .fb-kind span, .cdlg-close, .msg-foot .msg-mail { min-height: 44px; }
  .cdlg-close { width: 44px; height: 44px; }
  .cdlg-x { top: 8px; right: 8px; }
}
/* ---------- System card: experiment tables ---------- */
.table-scroll { overflow-x: auto; margin: 8px 0 12px; }
table.exp { border-collapse: collapse; font-size: 13px; min-width: 560px; }
table.exp th, table.exp td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.exp thead th { font-weight: 600; color: var(--text-2); }
table.exp tbody th { font-weight: 500; }
table.exp small { color: var(--muted); }
.sc-sub { margin: 10px 0 0; font-size: 14px; }
.sc-more { margin: 8px 0; }
.sc-more summary { cursor: pointer; color: var(--blue-ink); min-height: 32px; }
.sc-more > summary::marker { font-size: 1.25em; }
.sc-full { margin-top: 4px; }
/* Jargon on the System card: a dotted underline; hover, focus or tap shows what it means, under its line (the
   line is the tooltip's containing block, so it never runs off the side of a phone). */
.sc-headline p, .sc-verdict, .sc-body p { position: relative; }
.gloss { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; border-radius: 3px; }
.gloss:focus { outline: none; }
.gloss:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 1px; }
.gloss::after { content: attr(data-tip); display: none; position: absolute; z-index: 20; left: 0; top: calc(100% + 4px); width: max-content; max-width: min(340px, 100%); padding: 7px 10px; border-radius: 8px; background: #24262b; color: #fff; box-shadow: var(--shadow); font: 400 12.5px/1.4 var(--font); letter-spacing: 0; text-transform: none; white-space: normal; text-align: left; }
.gloss:hover::after, .gloss:focus::after { display: block; }
.sc-example { border-left: 3px solid var(--line-2); padding-left: 10px; margin: 4px 0 10px; }

/* ---------- Judge report: plain-English checks for one answer ---------- */
.jr-checks { list-style: none; margin: 4px 16px 8px; padding: 0; display: grid; gap: 6px; }
.jr-b { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); font: 500 14px var(--font); color: var(--text); text-align: left; cursor: pointer; }
.jr-b:hover, .jr-b[aria-expanded="true"] { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.jr-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.jr-check.is-ok .jr-ic { background: var(--green-bg); color: #0f6a30; }
.jr-check.is-bad .jr-ic { background: var(--orange-bg); color: var(--orange-ink); }
.jr-why { margin: 4px 0 2px 44px; font-size: 13px; color: var(--text-2); }
.jr-hint { margin: 6px 16px; font-size: 12.5px; }
.jr-hint:last-child { margin-bottom: 14px; }
.jr-raw { margin: 10px 16px; }
.jr-raw > summary { cursor: pointer; color: var(--blue-ink); font-size: 13px; min-height: 32px; display: inline-flex; align-items: center; }
@media (max-width: 899px) { .jr-b { min-height: 44px; } .jr-raw > summary { min-height: 44px; } }

/* ---------- claim ↔ source map (judge v4): hover, focus or tap a claim to see its passage ---------- */
.gq { border-radius: 3px; cursor: help; outline-offset: 1px; }
.gq.is-aligned:hover, .gq.is-aligned:focus-visible { background: var(--green-bg); }
/* Red is only for a claim the judge found unsupported. A supported claim code couldn't link to a passage is a neutral
   note: a muted dotted underline on hover or focus, and "Not linked to a passage" in its popover. */
.gq.is-unaligned:hover, .gq.is-unaligned:focus { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }
.gq.is-unsupported { text-decoration: underline wavy #c4361f; text-underline-offset: 3px; }
.gq-pop { position: absolute; z-index: 50; padding: 10px 12px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 13px; line-height: 1.45; color: var(--text-2); }
.gq-src { display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }

/* the live API is down (the page found out at load): say so up front; recorded runs and Beat the Judge still work */
.api-offline-note { display: none; margin: 8px 2px 0; padding: 8px 12px; border-radius: var(--r-sm); background: var(--orange-bg); color: var(--orange-ink); font-size: 13px; }
.api-offline .api-offline-note { display: block; }

/* ---------------- span waterfall (js/waterfall.js): tools blue, answer purple, judge orange ---------------- */
.wfx-host { padding: 2px 16px 12px; border-top: 1px solid var(--line); }
.wfx { --wfx-name: 172px; --wfx-ms: 56px; margin: 0; }
.wfx-cap { margin: 10px 0 6px; font-size: 12px; color: var(--muted); }
.wfx-title { font: 600 11px var(--font); letter-spacing: .1em; text-transform: uppercase; }
.wfx-crit { color: var(--text); }
.wfx-axis { position: relative; height: 14px; margin: 0 calc(var(--wfx-ms) + 8px) 2px calc(var(--wfx-name) + 8px); font: 10px var(--mono); color: var(--muted); }
.wfx-tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.wfx-tick:first-child { transform: none; }
.wfx-tick:last-child { transform: translateX(-100%); }
.wfx-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.wfx-hit { display: grid; grid-template-columns: var(--wfx-name) 1fr var(--wfx-ms); gap: 8px; align-items: center; width: 100%; min-height: 22px; padding: 1px 2px; border: 0; border-radius: 4px; background: none; font: 11px var(--mono); color: var(--muted); text-align: left; cursor: pointer; }
.wfx-hit:hover, .wfx-hit[aria-expanded="true"] { background: var(--card-2); color: var(--text); }
.wfx-hit.is-static { cursor: default; }
.wfx-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfx-row.d-1 .wfx-name { padding-left: 10px; }
.wfx-row.d-2 .wfx-name { padding-left: 20px; }
.wfx-row.d-3 .wfx-name { padding-left: 30px; }
.wfx-track { position: relative; height: 8px; border-radius: 4px; background: var(--line); }
.wfx-bar { position: absolute; top: 0; bottom: 0; min-width: 2px; border-radius: 4px; background: var(--tc); opacity: .5; transition: left .3s ease, width .3s ease; }
.wfx-row.crit .wfx-bar { opacity: 1; }
.wfx-row.crit .wfx-name { color: var(--text); font-weight: 600; }
.wfx-row.crit .wfx-name::before { content: "● "; color: var(--tc); }
.wfx-ms { text-align: right; font-variant-numeric: tabular-nums; }
.wfx-row.pending .wfx-bar { opacity: .85; transform-origin: left center; animation: wfx-grow 1s linear both; }
.wfx-bar.wfx-indet { background: var(--grey); animation: wfx-pulse 1.2s ease-in-out infinite; }
.wfx-row.new { animation: wfx-in .25s ease-out; }
@keyframes wfx-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wfx-pulse { 50% { opacity: .2; } }
@keyframes wfx-in { from { opacity: 0; transform: translateY(-3px); } }
.wfx-detail { margin: 8px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card-2); font-size: 12px; }
.wfx-d-title { margin: 0 0 6px; font: 600 12px var(--mono); }
.wfx-d-facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0; }
.wfx-d-facts dt { color: var(--muted); }
.wfx-d-facts dd { margin: 0; }
.wfx-d-io { margin: 6px 0 0; overflow-wrap: anywhere; }
.wfx-d-io code { font: 11px var(--mono); white-space: pre-wrap; }
.wfx-d-k { margin-right: 4px; font-weight: 600; color: var(--muted); }
.wfx-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.wfx-note { font-size: 11.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .wfx-bar, .wfx-row.new, .wfx-row.pending .wfx-bar, .wfx-bar.wfx-indet { animation: none; transition: none; }
}
/* Phones: each span's bar sits on its own line under its name, and the axis goes. */
@media (max-width: 480px) {
  .wfx-axis { display: none; }
  .wfx-hit { grid-template-columns: 1fr auto; grid-template-areas: "name ms" "track track"; row-gap: 4px; min-height: 44px; padding: 4px 2px; }
  .wfx-name { grid-area: name; }
  .wfx-ms { grid-area: ms; }
  .wfx-track { grid-area: track; }
  .wfx-foot .btn { min-height: 44px; }
}

/* ---------------- incident log by class (js/incidents.js) ---------------- */
.inc-chips { display: flex; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; padding: 0; list-style: none; }
.inc-chips li + li::before { content: "·"; margin: 0 8px; color: var(--muted); }
.inc-chip { border: 0; background: none; padding: 2px 0; font: 500 13.5px var(--font); color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.inc-n { font-weight: 600; font-variant-numeric: tabular-nums; }
.inc-class { padding: 16px 0 4px; border-top: 2px solid var(--line); }
.inc-class:focus { outline: none; }
.inc-cls-head h4 { margin: 0; font: 600 16px var(--font); }
.inc-cls-sub { margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
.inc-cls-tally { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 12.5px; color: var(--text-2); }
.inc-spark { flex: none; }
.inc-spark .sp-c { fill: var(--green); }
.inc-spark .sp-e { fill: var(--red); }
.inc-attack h4 { font-size: 15px; }
.inc-older { margin: 0 0 6px; }
.inc-older > summary { width: fit-content; padding: 4px 0; font-size: 13px; color: var(--blue-ink); cursor: pointer; }
.inc-run { margin: 4px 0 10px; }
.attack.is-target { box-shadow: 0 0 0 3px var(--purple); }
@media (max-width: 899px) {
  .inc-chip, .inc-older > summary, .inc-run .btn { min-height: 44px; }
}

/* ---------- compare two eval runs (#/compare, js/compare.js) ---------- */
.sc-compare { margin: 10px 0; }
.sc-compare a { color: var(--blue-ink); font-weight: 500; text-underline-offset: 3px; }
.ab-note { margin: 0 0 14px; font-size: 13px; color: var(--text-2); }
.ab-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px 14px; align-items: end; margin-bottom: 16px; }
.ab-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.ab-field select { width: 100%; min-width: 0; min-height: 36px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); font: 400 13px var(--font); color: var(--text); text-overflow: ellipsis; }
.ab-out[aria-busy="true"] { opacity: .6; }
.ab-verdict { margin: 4px 0 8px; font: 600 16px/1.35 var(--font); color: var(--text); }
.ab-runs { margin: 0 0 10px; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-2); }
.ab-runs li { margin: 2px 0; overflow-wrap: anywhere; }
.ab-runs a { color: var(--blue-ink); text-underline-offset: 3px; }
.ab-caveat, .ab-refuse { margin: 8px 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--orange-bg); color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.ab-refuse { font-size: 13.5px; }
.ab-refuse p { margin: 0; }
.ab-refuse .btn { margin-top: 10px; height: auto; min-height: 30px; padding: 6px 12px; white-space: normal; text-align: left; }
.ab-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.ab-stats div { padding: 8px 12px; border-radius: var(--r-sm); background: var(--card-2); }
.ab-stats dt { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.ab-stats dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ab-stats small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.ab-stats #ab-flips { font-size: 13px; }
.ab-stats #ab-flips span { display: block; }
.ab-how { margin: 0 0 10px; font-size: 12px; }
.ab-only { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; }
.ab-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.ab-table th, .ab-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-variant-numeric: tabular-nums; }
.ab-table thead th { font-size: 12px; font-weight: 600; color: var(--text-2); }
.ab-table thead th:nth-child(2), .ab-table thead th:nth-child(3) { width: 56px; }
.ab-table thead th:nth-child(4), .ab-table thead th:nth-child(5) { width: 76px; }
.ab-table tbody th { font-weight: 400; }
.ab-table tbody th .pill { display: flex; width: fit-content; margin-top: 4px; }
.ab-c { font: 12px var(--mono); overflow-wrap: anywhere; }
.ab-pass, .ab-up { color: var(--green-ink); }
.ab-fail, .ab-down { color: var(--red-ink); }
.ab-fail { font-weight: 600; }
.ab-same { color: var(--muted); }
@media (max-width: 899px) {
  .ab-pick { grid-template-columns: minmax(0, 1fr); }
  .ab-field select, .ab-swap, .ab-only { min-height: 44px; }
  .ab-swap { justify-self: start; }
  .ab-table { font-size: 12px; }
  .ab-table th, .ab-table td { padding: 6px 4px; }
  .ab-table thead th:nth-child(2), .ab-table thead th:nth-child(3) { width: 40px; }
  .ab-table thead th:nth-child(4), .ab-table thead th:nth-child(5) { width: 54px; }
}