/* Agent Assurance Engine: the calibration-certificate system.

   Every page is a record. A title block states what the record is and where it
   stands; ruled tables carry the measurements; verdicts are the only colour.
   Light is the default because the reader works at a desk in daylight beside
   an IDE; a dark set follows the operating system's preference. */

@font-face {
  font-family: "Public Sans";
  src: url("/static/fonts/public-sans-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/static/fonts/public-sans-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ground: #F2F3F0;      /* the desk the sheets lie on */
  --sheet: #FCFCFA;       /* the certificate */
  --field: #FFFFFF;       /* inputs, the one place pure white earns its keep */
  --tray: #F6F7F4;        /* the register column and log wells */
  --ink: #14213D;         /* text and structure */
  --ink-2: #3A465C;       /* secondary text */
  --ink-3: #5B6678;       /* labels and metadata; 5.5:1 on the sheet */
  --rule: #D5D9DF;        /* hairlines between sections */
  --rule-2: #E4E7EB;      /* hairlines between rows */
  --rule-ink: #14213D;    /* the title block's frame */
  --control: #AEB6C2;     /* control borders; 3:1 against the sheet */
  --pass: #2F6F5E;
  --fail: #9B2226;
  --caution: #8A5A0B;
  --pass-wash: #E6EFEB;
  --fail-wash: #F6E8E8;
  --caution-wash: #F4EDDC;
  --focus: #2B59C3;
  --primary-hover: #22345C;
  --tip-shadow: 0 6px 20px rgba(20, 33, 61, 0.16);
  --scrim: rgba(20, 33, 61, 0.38);

  --sans: "Public Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 3px;

  /* Kept for older templates that read them directly. */
  --bg: var(--ground);
  --panel: var(--sheet);
  --border: var(--rule);
  --text: var(--ink);
  --muted: var(--ink-3);
  --subtle: var(--ink-3);
  --inset: var(--tray);
  --none: var(--ink-3);
  --accent: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #0D121B;
    --sheet: #131A26;
    --field: #0F1520;
    --tray: #101723;
    --ink: #E7EAF0;
    --ink-2: #C3CAD6;
    --ink-3: #97A0AF;
    --rule: #2B3446;
    --rule-2: #222B3B;
    --rule-ink: #9AA5B8;
    --control: #4A5569;
    --pass: #79C4AB;
    --fail: #F0949A;
    --caution: #DDB162;
    --pass-wash: rgba(121, 196, 171, 0.12);
    --fail-wash: rgba(240, 148, 154, 0.12);
    --caution-wash: rgba(221, 177, 98, 0.12);
    --focus: #8DB0FF;
    --primary-hover: #FFFFFF;
    --tip-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    --scrim: rgba(3, 6, 12, 0.6);
  }
}

/* --- Base ------------------------------------------------------------------ */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15px/1.55 var(--sans);
  background: var(--ground);
  color: var(--ink);
  caret-color: var(--ink);
  scrollbar-color: var(--control) transparent;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
::selection { background: color-mix(in srgb, var(--focus) 22%, transparent); color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
input, select, textarea, button { accent-color: var(--ink); }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 120ms ease-out;
}
a:hover { text-decoration-color: currentColor; }

h1, h2, h3, h4 { color: var(--ink); text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 16px; }
h2 { font-size: 19px; line-height: 1.3; font-weight: 650; letter-spacing: -0.005em; margin: 32px 0 10px; }
h3 { font-size: 16px; line-height: 1.35; font-weight: 620; margin: 22px 0 8px; }
h4 { font-size: 14px; font-weight: 620; margin: 16px 0 6px; }
p { margin: 0 0 12px; }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: 4px; }
strong { font-weight: 620; }

code, pre, kbd, samp { font-family: var(--mono); font-size: 0.86em; font-variant-ligatures: none; }
code { color: var(--ink); overflow-wrap: anywhere; }
pre {
  background: var(--tray);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 12px;
  overflow: auto;
  max-height: 360px;
  font-size: 12.5px;
  line-height: 1.55;
}
blockquote { margin: 0; }

.muted { color: var(--ink-3); }
.small, .muted.small { font-size: 13px; line-height: 1.5; }
.num, table, .size-cell, .figure-value, .size-value { font-variant-numeric: tabular-nums; }
.error { color: var(--fail); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- The masthead and the record navigation -------------------------------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 0 32px;
  min-height: 56px;
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.005em;
  margin-right: auto;
}
.vail-mark { width: 22px; height: 22px; flex: none; }
.masthead-target { color: var(--ink-3); font-size: 13px; }
.masthead-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; font-size: 14px; }
.masthead-nav a { color: var(--ink-2); text-decoration: none; padding: 17px 0 15px; border-bottom: 2px solid transparent; }
.masthead-nav a:hover { color: var(--ink); }
.masthead-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.masthead-nav form { display: inline; margin: 0; }

.record-nav { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.record-nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  font-size: 14px;
}
body.wide .record-nav-inner { max-width: 1400px; }
.record-nav-name { font-weight: 650; margin-right: 8px; padding: 12px 0; }
.record-nav a { color: var(--ink-2); text-decoration: none; padding: 12px 0 10px; border-bottom: 2px solid transparent; }
.record-nav a:hover { color: var(--ink); }
.record-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 560; }

main { padding: 32px 32px 64px; max-width: 1180px; margin: 0 auto; }
body.wide main { max-width: 1400px; }

/* --- Sheets: one per record or section. No sheet inside a sheet. ---------- */

.sheet, .panel {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 20px;
}
.sheet-title, .panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.sheet-title { display: flex; align-items: baseline; gap: 12px; font-size: 19px; margin: 0 0 18px; }
.sheet-count { color: var(--ink-3); font-size: 13px; font-weight: 450; }
.sheet .panel, .panel .panel, .review-layout .panel .panel {
  background: none;
  border: 0;
  border-top: 1px solid var(--rule-2);
  border-radius: 0;
  padding: 16px 0 0;
  margin: 16px 0 0;
}
.sheet-danger { border-color: color-mix(in srgb, var(--fail) 28%, var(--rule)); }

.notice {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.notice p:last-child { margin-bottom: 0; }
.choice-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.choice-list li { margin: 0; }
.notice-success { border-color: color-mix(in srgb, var(--pass) 45%, var(--rule)); background: var(--pass-wash); }
.notice-success strong { color: var(--pass); }
.agent-reply {
  margin: 6px 0 0;
  padding: 10px 14px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  white-space: pre-wrap;
  max-width: 78ch;
}

/* --- The title block: the certificate's header of labelled fields. -------- */

.record-head { margin-bottom: 24px; }
.record-head h1 { margin-bottom: 12px; }
/* The name and its rename control on one baseline; the form opens beneath. */
.record-title { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; margin-bottom: 12px; }
.record-title h1 { margin: 0; }
.record-title .rename { margin: 0; font-size: 13.5px; }
.record-title .rename[open] { flex-basis: 100%; margin: 4px 0 0; }
.rename form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.rename input { flex: 0 1 28rem; min-width: 0; }
/* Fields size to their content and wrap as a row; `grow` takes the slack,
   `wide` takes a row of its own. Each field draws its right and bottom rule,
   and the frame clips the ones that land on its edge. */
.titleblock {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  background: var(--sheet);
  border: 1px solid var(--rule-ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.titleblock > div {
  flex: 0 1 auto;
  min-width: 0;
  padding: 8px 20px 9px 16px;
  margin: 0 -1px -1px 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.titleblock > div.grow { flex: 1 1 320px; }
.titleblock > div.wide { flex: 1 1 100%; }
.titleblock dt { color: var(--ink-3); font-size: 12.5px; line-height: 1.4; }
.titleblock dd { margin: 1px 0 0; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.titleblock code { font-size: 13px; }
.record-head .error { margin: 12px 0 0; }

/* Label/value facts inside a record: ruled rows, labels in a fixed column. */
.facts { display: grid; margin: 0 0 16px; border-top: 1px solid var(--rule-2); }
.facts > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-2);
}
.facts dt { color: var(--ink-3); font-size: 13.5px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* --- The stage register and its records ----------------------------------- */

.register-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  min-height: 420px;
}
.ladder { list-style: none; padding: 0; margin: 0; }
.register {
  background: var(--tray);
  border-right: 1px solid var(--rule);
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 8px 0;
}
.register li { margin: 0; }
.register-tab {
  display: grid;
  grid-template-columns: 26px 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: calc(100% + 1px);
  margin: 0;
  padding: 11px 16px 11px 16px;
  border: 0;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.register-tab:hover { background: color-mix(in srgb, var(--sheet) 60%, transparent); color: var(--ink); }
/* The selected stage joins the record beside it: same paper, no rule between. */
.register-tab[aria-selected="true"] {
  background: var(--sheet);
  color: var(--ink);
  border-top-color: var(--rule);
  border-bottom-color: var(--rule);
  font-weight: 560;
}
.register li:first-child .register-tab[aria-selected="true"] { border-top-color: transparent; }
.ladder-num { font-family: var(--mono); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 450; }
.ladder-label { min-width: 0; }
.ladder-state { color: var(--ink-3); font-size: 12.5px; font-weight: 450; white-space: nowrap; display: inline-flex; align-items: center; }
.ladder-todo .ladder-label { color: var(--ink-3); }
.has-failed .ladder-state { color: var(--fail); font-weight: 560; }
.ladder-running .ladder-state { color: var(--ink); }

/* State marks, drawn rather than typed: a ring to do, a heavier ring next,
   a filled seal with a tick when done, a filled bar when the last attempt failed. */
.ladder-mark {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--ink-3) 55%, transparent);
}
.ladder-next .ladder-mark { border: 2px solid var(--ink); }
.ladder-running .ladder-mark { border: 2px solid var(--ink); }
.ladder-running .ladder-mark::after {
  content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--ink);
  animation: run-pulse 1.2s ease-in-out infinite;
}
.ladder-done .ladder-mark { border-color: var(--pass); background: var(--pass); }
.ladder-done .ladder-mark::after {
  content: ""; position: absolute; left: 3.5px; top: 1.5px; width: 3.5px; height: 6.5px;
  border: solid var(--sheet); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.has-failed .ladder-mark { border-color: var(--fail); background: var(--fail); }
.has-failed .ladder-mark::after {
  content: ""; position: absolute; left: 2.5px; right: 2.5px; top: 5px; height: 1.5px; background: var(--sheet);
}

.register-records { padding: 22px 28px 26px; min-width: 0; }
.stage-record-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.stage-record-head h3 { margin: 0; font-size: 18px; font-weight: 650; }
.stage-record-head .ladder-num { font-size: 13px; margin-right: 4px; }
.stage-record > p { max-width: 68ch; }
.record-action { margin: 4px 0 18px; }

/* --- Buttons and fields ------------------------------------------------------ */

button, .button, input, select, textarea {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  border-radius: var(--radius);
}
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  background: var(--sheet);
  border: 1px solid var(--control);
  font-weight: 560;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 120ms ease-out, background-color 120ms ease-out, color 120ms ease-out;
}
button:hover, .button:hover { border-color: var(--ink); text-decoration: none; }
button.primary, .button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}
button.primary:hover, .button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.danger { color: var(--fail); border-color: color-mix(in srgb, var(--fail) 50%, var(--control)); }
button.danger:hover { background: var(--fail-wash); border-color: var(--fail); }
button.quiet { border-color: transparent; background: none; color: var(--ink-2); padding: 7px 4px; min-height: 0; font-weight: 450; }
button.quiet:hover { color: var(--ink); border-color: transparent; }
button:disabled, button:disabled:hover { opacity: 0.5; cursor: not-allowed; border-color: var(--control); }
button.primary:disabled:hover { background: var(--ink); border-color: var(--ink); }

input, select, textarea {
  background: var(--field);
  border: 1px solid var(--control);
  padding: 7px 10px;
  min-height: 36px;
  transition: border-color 120ms ease-out;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input[type="number"] { width: 76px; font-variant-numeric: tabular-nums; }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 16px; height: 16px; padding: 0; }
input.rate-input { width: 7.5rem; }
input.probe-id-input { width: 20rem; max-width: 100%; font-family: var(--mono); font-size: 13px; }
textarea { width: 100%; line-height: 1.5; }
label { color: var(--ink-2); font-size: 14px; }
form.inline { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
form.inline label { display: inline-flex; align-items: center; gap: 8px; }
.rate-form { margin: 12px 0 16px; }
.flash { color: var(--pass); font-size: 13px; margin-left: 6px; }

/* --- Badges: stamps rather than pills. ------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 12.5px;
  font-weight: 560;
  line-height: 1.5;
  color: var(--ink-2);
  background: transparent;
  white-space: nowrap;
  vertical-align: baseline;
}
.badge.pass, .badge.status-approved, .badge.side-benign, .badge.verdict-stable,
.badge.ready-clean, .badge.cover-live, .badge.watch-watched {
  color: var(--pass); border-color: color-mix(in srgb, var(--pass) 45%, transparent); background: var(--pass-wash);
}
.badge.fail, .badge.status-rejected, .badge.side-mutating, .badge.verdict-flipped,
.badge.cover-uncovered, .badge.watch-unwatched {
  color: var(--fail); border-color: color-mix(in srgb, var(--fail) 45%, transparent); background: var(--fail-wash);
}
.badge.status-pending, .badge.side-uncertain, .badge.verdict-values-changed, .badge.verdict-drifted,
.badge.ready-fix-first, .badge.ready-your-call, .badge.cover-pending, .badge.watch-partly {
  color: var(--caution); border-color: color-mix(in srgb, var(--caution) 40%, transparent); background: var(--caution-wash);
}
.badge.none, .badge.verdict-single, .badge.verdict-unscored, .badge.ready-not-run, .badge.cover-rejected {
  color: var(--ink-3); border-style: dashed;
}
.badge.kind { color: var(--ink-2); font-weight: 500; }
/* The approval seal: a small double ring, the one ornament the record carries. */
.badge.status-approved::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  box-shadow: inset 0 0 0 1.5px var(--pass-wash), inset 0 0 0 4px currentColor;
}

/* --- Tables: ruled, figures aligned. -------------------------------------- */

table { width: 100%; border-collapse: collapse; background: var(--sheet); font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
thead th {
  color: var(--ink-3);
  font-weight: 600;
  font-size: 12.5px;
  border-bottom: 1px solid var(--rule-ink);
  white-space: nowrap;
}
tbody tr:hover { background: color-mix(in srgb, var(--tray) 70%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
.message { max-width: 44ch; white-space: pre-wrap; }
/* Tool calls on a run: fixed columns so long JSON wraps inside Input/Output
   instead of widening the table and squeezing the tool name. */
table.tool-calls { table-layout: fixed; }
.tool-calls .col-tool { width: 15rem; }
.tool-calls .col-status { width: 8rem; }
.tool-calls td code { overflow-wrap: break-word; }
.tool-calls pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- Disclosures ---------------------------------------------------------- */

details > summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink-2);
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-2px) rotate(-45deg);
  transition: transform 120ms ease-out;
}
details[open] > summary::before { transform: translateY(-3px) rotate(45deg); }
details > summary:hover { color: var(--ink); }
details { margin: 6px 0; }
details[open] { margin-bottom: 14px; }

/* --- Help tips ------------------------------------------------------------ */

.tip-label { position: relative; cursor: help; }
h2 .help, h3 .help { margin-left: 6px; vertical-align: middle; }
h2 .tip-label, h3 .tip-label { margin-left: 0; }
h2 .badge.tip-label { margin-left: 8px; }
.help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--control);
  background: var(--sheet);
  color: var(--ink-3);
  font: 600 11px/1 var(--sans);
  cursor: help;
  vertical-align: middle;
}
.help:hover { color: var(--ink); border-color: var(--ink-3); }
.help-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: max(220px, min(380px, 70vw));
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--sheet);
  font: 400 13px/1.45 var(--sans);
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: var(--tip-shadow);
  white-space: pre-line;
}
th .help { text-transform: none; }
th .help-tip { left: 0; right: auto; }
th:nth-last-child(-n+2) .help-tip { left: auto; right: 0; }
.help:hover .help-tip, .help:focus .help-tip, .help:focus-visible .help-tip,
.tip-label:hover .help-tip, .tip-label:focus .help-tip, .tip-label:focus-visible .help-tip { display: block; }

/* --- Section furniture ------------------------------------------------------ */

.section-lead { color: var(--ink-3); font-size: 14px; line-height: 1.55; margin: 0 0 16px; max-width: 70ch; }
.subhead { color: var(--ink-2); font-size: 14px; font-weight: 620; margin: 18px 0 8px; }
.subhead:first-child { margin-top: 0; }
.page-section { margin-bottom: 32px; }
.page-section:last-child { margin-bottom: 0; }
.page-section > .section-title { font-size: 19px; font-weight: 650; margin: 0 0 4px; }
.page-section > .section-lead { margin-bottom: 16px; }

/* --- Activity logs: a deploy log, read not admired. ----------------------- */

.logs { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.logs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; }
.logs[open] .logs-head { border-bottom: 1px solid var(--rule); }
.logs-title { font-weight: 620; }
.logs-meta { color: var(--ink-3); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.logs-body { max-height: 420px; overflow-y: auto; }
.logs-step + .logs-step { border-top: 1px solid var(--rule); }
.logs-step-head { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 14px; }
.logs-mark { width: 8px; height: 8px; border-radius: 50%; flex: none; border: 1.5px solid var(--ink-3); }
.logs-succeeded .logs-mark { background: var(--pass); border-color: var(--pass); }
.logs-failed .logs-mark { background: var(--fail); border-color: var(--fail); }
.logs-running .logs-mark { background: var(--ink); border-color: var(--ink); animation: run-pulse 1.2s ease-in-out infinite; }
.logs-step-name { font-weight: 600; }
.logs-failed .logs-step-name .muted { color: var(--fail); }
.logs-step-when { color: var(--ink-3); font-size: 12.5px; margin-left: auto; font-variant-numeric: tabular-nums; text-align: right; }
.logs-lines { padding: 6px 0 10px; background: var(--tray); border-top: 1px solid var(--rule-2); max-height: 360px; overflow-y: auto; }
.logs-line {
  display: flex;
  gap: 16px;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.8;
  white-space: pre-wrap;
}
.logs-time { color: var(--ink-3); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.logs-text { flex: 1 1 auto; word-break: break-word; color: var(--ink-2); }
.logs-line-error .logs-text { color: var(--fail); }
.logs-stalled { margin: 0; padding: 9px 14px; color: var(--caution); font-size: 13px; line-height: 1.6; border-top: 1px solid var(--rule-2); }

/* Something is happening: a job running, a connection being tested. */
.run-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink); margin-right: 7px; vertical-align: middle;
  animation: run-pulse 1.2s ease-in-out infinite;
}
@keyframes run-pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* --- Recent runs: one column per metric ------------------------------------- */

.run-matrix-wrap { overflow-x: auto; }
.run-matrix { width: auto; min-width: 100%; }
.run-matrix th, .run-matrix td { white-space: nowrap; }
.run-matrix th.metric-col { white-space: normal; vertical-align: bottom; max-width: 12ch; text-align: center; }
.run-matrix th.metric-col code { font-size: 11.5px; overflow-wrap: normal; color: var(--ink-2); }
.run-matrix .metric-cell { text-align: center; padding-left: 6px; padding-right: 6px; }
.run-matrix tfoot th, .run-matrix tfoot td { border-top: 1px solid var(--rule-ink); border-bottom: 0; font-size: 13px; color: var(--ink-3); font-weight: 560; }
.run-matrix tfoot th { text-align: right; }
.run-matrix tfoot .metric-tally-short { color: var(--fail); font-weight: 650; }

/* A mark is a filled square for a verdict, so a column of failures reads at a
   glance; the glyph keeps it legible without colour. */
.mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 3px; font-size: 13px; font-weight: 700; line-height: 1;
}
.mark-pass { background: var(--pass); color: var(--sheet); }
.mark-fail { background: var(--fail); color: var(--sheet); }
.mark-none { background: var(--tray); color: var(--ink-3); border: 1px solid var(--rule); }
.mark-absent { color: var(--ink-3); }

.verdict { font-weight: 600; }
.verdict-pass { color: var(--pass); }
.verdict-fail { color: var(--fail); }
.delivery-partial { color: var(--caution); font-weight: 600; }
.delivery-failed { color: var(--fail); font-weight: 600; }

/* --- A run: verdicts in words, per repetition ---------------------------------- */

.run-verdict { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 15px; }
.metric-results td:first-child { width: 100%; }
.metric-results .metric-cell { text-align: center; width: 1%; white-space: nowrap; }
.metric-expectation { margin-top: 3px; color: var(--ink-2); font-size: 14px; }
.metric-observation-line { margin-top: 3px; font-size: 13.5px; color: var(--ink-2); }
.metric-raw { margin: 4px 0 0; font-size: 13px; }
.metric-raw pre { margin-top: 4px; }
.reply-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.repetition-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.rep-checks { list-style: none; padding: 0; margin: 12px 0 4px; border-top: 1px solid var(--rule-2); }
.rep-checks li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; margin: 0; border-bottom: 1px solid var(--rule-2); }
.rep-checks .mark { flex: none; margin-top: 1px; }
.rep-check-observed { margin-top: 2px; font-size: 14px; }
.repetition-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--rule-2); font-size: 14px; }
.repetition-foot p { margin: 6px 0 0; }

/* --- Findings: a requirement's record across runs ------------------------------ */

.findings-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.findings-actions form { margin: 0; }
.finding { border: 1px solid var(--rule); border-left-width: 3px; border-radius: var(--radius); background: var(--sheet); padding: 14px 18px; margin: 0 0 14px; }
.finding-open { border-left-color: var(--fail); }
.finding-regressed { border-left-color: var(--fail); }
.finding-resolved { border-left-color: var(--pass); }
.finding-head { display: flex; align-items: baseline; gap: 10px; }
.finding-title { margin: 0; font-size: 16.5px; font-weight: 640; }
.finding-status { text-transform: capitalize; }
.finding-status-open, .finding-status-regressed { background: var(--fail-wash); color: var(--fail); border-color: color-mix(in srgb, var(--fail) 40%, var(--rule)); }
.finding-status-resolved { background: var(--pass-wash); color: var(--pass); border-color: color-mix(in srgb, var(--pass) 40%, var(--rule)); }
.finding-also { margin: 4px 0 0; }
.finding-rate { margin: 8px 0 2px; font-size: 14.5px; }
.finding-trend { margin: 0 0 6px; }
.trend-improving { color: var(--pass); font-weight: 600; }
.trend-worsening { color: var(--fail); font-weight: 600; }
.finding-patterns { list-style: none; padding: 0; margin: 0 0 10px; border-top: 1px solid var(--rule-2); }
.finding-patterns li { display: flex; gap: 12px; padding: 6px 0; margin: 0; border-bottom: 1px solid var(--rule-2); font-size: 14px; }
.finding-count { flex: none; min-width: 3.5ch; text-align: right; font-weight: 650; color: var(--fail); }
.finding-instead { display: block; margin-top: 2px; }
.finding-instead-line { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-2); }
.finding-example { margin: 8px 0 0; }
.finding-details { margin: 8px 0 0; }
.finding-details[open] { margin-bottom: 0; }
.finding-details p { margin: 6px 0; }

/* --- LangSmith: sending verdicts to the agent's traces ------------------------ */

.langsmith-auto { margin: 10px 0 0; font-size: 14px; }
.langsmith-auto label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

/* --- Definition: the agent as the scan read it ------------------------------ */

.definition-download { margin: 14px 0 0; font-size: 14px; }
.definition-disclosure { max-width: 90ch; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

/* The collected files as directories that open, rather than full paths. */
.file-tree { list-style: none; padding: 0; margin: 0; }
.file-tree .file-tree { padding-left: 16px; margin-left: 3px; border-left: 1px solid var(--rule-2); }
.file-tree li { margin: 0; }
.file-tree details { margin: 0; }
.file-tree details[open] { margin-bottom: 2px; }
.file-tree summary { padding: 2px 0; }
.file-tree-name { font-family: var(--mono); font-size: 12.5px; color: var(--ink); font-weight: 560; }
.file-tree summary .num { font-size: 12.5px; }
.file-tree-file { padding: 1px 0 1px 14px; }
/* A file is a plain name that links to it; the open one is marked. */
a.file-link {
  display: block; padding: 1px 6px; margin-left: -6px; border-radius: 2px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-2);
  text-decoration: none; overflow-wrap: anywhere;
}
a.file-link:hover { color: var(--ink); background: var(--tray); text-decoration: none; }
a.file-link[aria-current] { color: var(--ink); background: color-mix(in srgb, var(--ink) 9%, transparent); font-weight: 600; }

/* Tree on the left, the open file beside it. Both scroll on their own, so a
   long tree does not push the file out of view and the reverse. */
.file-browser {
  display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  border: 1px solid var(--rule); border-radius: var(--radius);
  height: min(640px, 72vh); margin-bottom: 12px;
}
.file-browser-tree { overflow: auto; padding: 12px 12px 12px 14px; border-right: 1px solid var(--rule); }
.file-browser-tree .subhead { margin-top: 0; }
.file-browser-view { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--tray); }
.file-view-head {
  display: flex; align-items: baseline; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--rule); background: var(--sheet);
}
.file-view-path { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.file-view-content {
  flex: 1; min-height: 0; margin: 0; border: 0; border-radius: 0; max-height: none;
  white-space: pre; overflow: auto; tab-size: 4; background: var(--tray);
}
.file-view-note { padding: 16px; margin: 0; }

/* --- Dialog ------------------------------------------------------------------ */

dialog, #source-dialog {
  width: min(680px, 92vw);
  background: var(--sheet);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: 0 18px 48px rgba(10, 18, 34, 0.24);
}
dialog::backdrop { background: var(--scrim); }
.dialog-title { margin: 0 0 12px; font-size: 18px; }
.dialog-close { margin-top: 16px; }
#source-dialog table { width: 100%; }
.repo-filter { width: 100%; margin: 4px 0 10px; }

/* The connect button carries GitHub's own mark and chrome, because a customer
   is about to hand GitHub a decision and should recognise whose. */
a.connect-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #24292f;
  color: #ffffff;
  border: 1px solid #24292f;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-weight: 600;
  text-decoration: none;
}
a.connect-github:hover { background: #32383f; }

.source-buttons { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.source-buttons button.primary { background: var(--sheet); color: var(--ink); border-color: var(--control); }
.source-buttons button.primary:hover { border-color: var(--ink); background: var(--sheet); }

/* --- Sign-in ------------------------------------------------------------------ */

.login { max-width: 400px; margin: 72px auto; }
.login.wide { max-width: 480px; }
.card-title { font-size: 22px; margin: 0 0 8px; }
.login input { width: 100%; margin: 8px 0 12px; }

/* --- Connect form ------------------------------------------------------------- */

/* Labelled fields, one per row: name, control, then help. Shared by the
   connect form and the add-an-agent form. */
.connect form.stack, form.fields { display: flex; flex-direction: column; gap: 18px; max-width: 64ch; }
.connect form.stack label, form.fields label { display: flex; flex-direction: column; gap: 6px; }
.connect form.stack input, .connect form.stack select,
form.fields input, form.fields select { width: 100%; margin: 0; }
.connect form.stack button { align-self: flex-start; }
.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.form-actions a { font-size: 14px; }
.upload-summary { margin: 0; font-size: 14px; color: var(--ink-2); }
.upload-summary:empty { display: none; }
/* The browser's own file control, toned to the form around it. */
form.fields input[type="file"] { padding: 6px; font-size: 13.5px; color: var(--ink-2); }
form.fields input[type="file"]::file-selector-button {
  font: inherit; font-weight: 560; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--control); border-radius: var(--radius); padding: 5px 12px; margin-right: 12px; cursor: pointer;
}
form.fields input[type="file"]::file-selector-button:hover { border-color: var(--ink); }
.connect details { display: flex; flex-direction: column; gap: 14px; }
.connect details[open] > summary { margin-bottom: 12px; }
.connect details label + label { margin-top: 14px; }
.field-name { font-weight: 560; color: var(--ink); }
.field-help { color: var(--ink-3); font-size: 13.5px; line-height: 1.5; margin: 0; }
.connect-status { color: var(--ink-3); font-size: 14px; margin: 0; }

/* --- Probe review --------------------------------------------------------------- */

.review-head { margin-bottom: 20px; }
.review-head h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.review-back { font-size: 14px; margin: 0 0 12px; }
.queue-tally { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 18px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.queue-tally > div { padding: 10px 18px; border-right: 1px solid var(--rule); }
.queue-tally > div:last-child { border-right: 0; }
.queue-tally dt { color: var(--ink-3); font-size: 12.5px; }
.queue-tally dd { margin: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.queue-table td:first-child a { font-family: var(--mono); font-size: 13px; font-weight: 600; text-decoration-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.queue-table .kind-line { margin-top: 4px; color: var(--ink-3); font-size: 12.5px; }
th[aria-sort] button.sort {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
}
th[aria-sort] button.sort::after {
  content: "";
  width: 0; height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.35;
}
th[aria-sort="ascending"] button.sort::after { border-top: 0; border-bottom: 4px solid currentColor; opacity: 1; }
th[aria-sort="descending"] button.sort::after { opacity: 1; }
th[aria-sort] button.sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.open-live { margin: 28px 0 0; }
.open-live > summary { font-weight: 560; }

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.review-layout > * { min-width: 0; }
.review-layout .message-block { white-space: pre-wrap; max-height: none; font-size: 13.5px; background: var(--field); border-color: var(--rule); padding: 14px 16px; }
.review-layout textarea { min-height: 88px; resize: vertical; }
.review-layout .panel > h2, .review-layout .panel > h3 { font-size: 15px; font-weight: 650; color: var(--ink); margin: 0 0 12px; }
.review-layout .panel > p, .review-layout .behavior p, .review-layout .metric-spec p { max-width: 68ch; }
.review-layout .behavior, .review-layout .metric-spec {
  border-top: 1px solid var(--rule-2);
  padding: 12px 0;
  margin: 0;
}
.review-layout .behavior:first-of-type, .review-layout .metric-spec:first-of-type { border-top: 0; padding-top: 4px; }
.review-layout .behavior > strong, .review-layout .metric-spec > strong { margin-right: 6px; }
.review-layout .metric-spec > strong { font-family: var(--mono); font-size: 13px; }
.review-layout .behavior p, .review-layout .metric-spec p { margin: 6px 0 0; }
.review-layout .metric-spec details { margin: 8px 0 0; }
.review-layout details { margin: 6px 0; }
.review-layout aside .tool-call-io { grid-template-columns: minmax(0, 1fr); }
.metric-how { color: var(--ink-3); font-size: 13.5px; line-height: 1.5; margin: 6px 0 0; }

/* The probe's title block, and the decision recorded against it. */
.decision { border: 1px solid var(--rule-ink); border-radius: var(--radius); background: var(--sheet); margin-bottom: 24px; }
.decision .titleblock { border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; }
.decision-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 10px 16px; }
.decision-bar form.stack { display: inline; margin: 0; }
.decision-state { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.decision-note { flex-basis: 100%; margin: 0; color: var(--ink-3); font-size: 13.5px; }
.decision-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.arming, .arming-preview { flex: 1 1 auto; }
.arming { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.arming-state { margin: 0; }
.arming-preview { font-size: 13.5px; margin: 0; max-width: 80ch; color: var(--ink-3); }

.tabs { display: flex; gap: 20px; margin: 0 0 20px; border-bottom: 1px solid var(--rule); }
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--ink-3);
  font-size: 14.5px;
  font-weight: 560;
  padding: 10px 0;
  min-height: 0;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); border-color: transparent; border-bottom-color: var(--rule); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab-count { color: var(--ink-3); font-size: 12.5px; font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }

.run-bar { border-top: 1px solid var(--rule-2); margin-top: 16px; padding-top: 14px; }
.run-bar .subhead { margin-top: 0; }
.run-endpoint { font-size: 13px; margin: 10px 0 0; }
.trials-heading { font-size: 15px; margin: 24px 0 4px; }
.compare-scroll { overflow-x: auto; }
.compare-table { min-width: 100%; }
.compare-table th, .compare-table td { vertical-align: top; white-space: nowrap; }
.cell-values {
  display: block;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.5px;
  margin-top: 4px;
  max-width: 26ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compare-note { font-size: 13.5px; color: var(--ink-3); margin: 10px 0 0; max-width: 80ch; }
.compare-note code, .compare-note strong { color: var(--ink); margin-right: 4px; }
.compare-note.verdict-flipped, .compare-note.verdict-values-changed { color: var(--ink-2); }
.metric-key { display: block; font-family: var(--mono); font-size: 11.5px; }

/* Readiness advises; it never refuses. Its level is carried by the stamp. */
.panel.readiness .readiness-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 0 0 6px; font-size: 16px; }
.readiness-list { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--rule-2); }
.readiness-list li { position: relative; padding: 10px 0 10px 18px; margin: 0; border-bottom: 1px solid var(--rule-2); max-width: 84ch; }
.readiness-list li::before {
  content: ""; position: absolute; left: 0; top: 17px; width: 7px; height: 7px; border-radius: 1px; background: var(--ink-3);
}
.readiness-list li.level-suggestion::before { background: var(--caution); }
.readiness-list strong { display: block; font-size: 14px; margin-bottom: 2px; }
.readiness-list span { color: var(--ink-3); font-size: 13.5px; }
.readiness-note { color: var(--ink-3); font-size: 13px; margin: 14px 0 0; }

.tool-note { font-size: 13px; margin: -4px 0 8px; max-width: 76ch; }
.metric-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.trial-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.trial-head strong { font-family: var(--mono); font-size: 13.5px; }
.metric-breakdown { margin: 10px 0 14px; }
.metric-result { border-top: 1px solid var(--rule-2); padding: 9px 0; }
.metric-result-head, .metric-observation { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.metric-result p { margin: 4px 0 7px; }
.metric-observation { color: var(--ink-3); font-size: 13px; margin-top: 5px; }
.metric-details { max-height: 180px; margin: 6px 0 0; }
.tool-call { border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.tool-call-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool-call-io { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 8px; }
.io-label { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 600; margin: 10px 0 4px; }
.tool-call-io .io-label { margin-top: 0; }
.tool-call pre { margin: 0; max-height: 220px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Expected size: three measurements in one ruled strip, not three cards. */
.size-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); }
.size-stat { padding: 10px 14px 10px 0; }
.size-stat + .size-stat { padding-left: 14px; border-left: 1px solid var(--rule-2); }
.size-label, .size-hint { display: block; color: var(--ink-3); font-size: 12.5px; }
.size-label { font-weight: 600; }
.size-value { display: block; font-size: 20px; font-weight: 600; line-height: 1.25; margin: 2px 0; font-family: var(--mono); letter-spacing: -0.02em; }
.size-cell { white-space: nowrap; }
.size-cell .muted { font-size: 12.5px; }

/* The agent definition this probe runs against, folded away until wanted. */
.agent-panel { padding: 0; }
.agent-panel > details { margin: 0; }
.agent-panel > details > summary { flex-wrap: wrap; gap: 10px; padding: 12px 18px; color: var(--ink); }
.agent-panel > details[open] > summary { border-bottom: 1px solid var(--rule); }
.agent-panel .agent-body { padding: 16px 18px; }
.agent-panel .agent-body > p:first-child { margin-top: 0; }
.agent-panel ul { margin: 0 0 10px; padding-left: 1.2em; max-width: 68ch; }
.agent-label { color: var(--ink-3); font-size: 13px; font-weight: 600; }

.probe-header h2 { font-size: 18px; margin: 0 0 6px; }
.probe-header > p { margin: 0 0 12px; }

/* --- Behaviors and assurance ------------------------------------------------ */

.coverage-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.behavior-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.behavior-card p { max-width: 70ch; margin: 10px 0 0; }
.behavior-probes { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--rule-2); }
.behavior-probe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; margin: 0; border-bottom: 1px solid var(--rule-2); }
.probe-count { color: var(--ink-3); font-size: 13px; margin-left: auto; }
.uncovered-note { color: var(--fail); }
.warning-list { margin: 0; padding-left: 1.2em; }
.warning-list li { margin-bottom: 6px; }
.assurance-split { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 28px; align-items: start; margin-top: 14px; }
.rule-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-2); }
.rule-list li { display: flex; gap: 10px; padding: 6px 0; margin: 0; border-bottom: 1px solid var(--rule-2); font-size: 14px; }
.rule-line { color: var(--ink-3); font-family: var(--mono); font-size: 12px; min-width: 32px; }
.rule-note { font-size: 13px; margin-top: 12px; max-width: 60ch; }
.risk { padding: 12px 0; margin: 0; border-top: 1px solid var(--rule-2); }
.risk-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.risk p { max-width: 70ch; margin: 8px 0 0; }
.check-label { color: var(--ink-3); font-size: 13px; margin-top: 10px; }
.check-list { margin: 4px 0 0; padding-left: 1.2em; font-size: 14px; }
.check-list li { margin-bottom: 3px; }
.risk-miss { color: var(--caution); font-size: 14px; }
.risk-probes { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; }

/* --- Charts and spend ----------------------------------------------------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 20px; }
.chart { width: 100%; height: auto; }
.chart .axis { stroke: var(--rule); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.chart .dot-pass { fill: var(--pass); }
.chart .dot-fail { fill: var(--fail); }
.chart .dot-none { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.chart .tick, .chart .chart-empty { fill: var(--ink-3); font-size: 10px; font-family: var(--sans); }
.spend-windows { display: flex; gap: 16px; margin: 0 0 14px; }
.spend-windows .tab { font-size: 13.5px; padding: 6px 0; }
.spend-windows .tab-current { color: var(--ink); border-bottom-color: var(--ink); }
.spend-figures { display: flex; flex-wrap: wrap; gap: 32px; margin: 0 0 16px; }
.spend-figures .figure { display: flex; flex-direction: column; gap: 2px; }
.figure-value { font-size: 20px; font-weight: 600; font-family: var(--mono); letter-spacing: -0.02em; }
.figure-label { color: var(--ink-3); font-size: 13px; }
.spend-components { margin-bottom: 4px; }
.spend-note { font-size: 13.5px; color: var(--ink-3); margin: 10px 0 16px; max-width: 84ch; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

/* --- Narrow viewports ----------------------------------------------------- */

@media (max-width: 960px) {
  .review-layout, .assurance-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .masthead { padding: 0 18px; }
  .masthead-nav { gap: 4px 16px; }
  .masthead-nav a { padding: 10px 0 8px; }
  .record-nav-inner { padding: 0 18px; gap: 0 18px; overflow-x: auto; flex-wrap: nowrap; }
  .record-nav-name { display: none; }
  .record-nav a { white-space: nowrap; }
  main { padding: 22px 16px 48px; }
  h1 { font-size: 24px; }
  .sheet, .panel { padding: 18px 16px; }
  .titleblock > div { flex: 1 1 100%; }
  .register-layout { grid-template-columns: 1fr; min-height: 0; }
  .register { border-right: 0; border-bottom: 1px solid var(--rule); border-radius: var(--radius) var(--radius) 0 0; }
  .register-tab { width: 100%; }
  .register-records { padding: 18px 16px 20px; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .file-browser { grid-template-columns: 1fr; grid-template-rows: minmax(0, 40%) minmax(0, 1fr); }
  .file-browser-tree { border-right: 0; border-bottom: 1px solid var(--rule); }
  table { display: block; overflow-x: auto; }
  .size-stats { grid-template-columns: 1fr; }
  .size-stat + .size-stat { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule-2); }
  .decision-actions { margin-left: 0; }
  .queue-tally > div { flex: 1 1 40%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* A sheet whose content is a full-bleed table. */
.sheet-flush { padding: 0; overflow: hidden; }
.sheet-flush table { background: none; }
.sheet-flush th:first-child, .sheet-flush td:first-child { padding-left: 20px; }
.sheet-flush th:last-child, .sheet-flush td:last-child { padding-right: 20px; }

/* The Status sheet is the register: the sheet's own edge frames it. */
.sheet-register { padding: 0; }
.sheet-register .sheet-title { padding: 20px 26px 18px; margin: 0; border-bottom: 1px solid var(--rule); }
.sheet-register .register-layout { border: 0; border-radius: 0 0 var(--radius) var(--radius); min-height: 380px; }
.sheet-register .register { border-radius: 0 0 0 var(--radius); }
@media (max-width: 760px) {
  .sheet-register .sheet-title { padding: 16px 16px 14px; }
  .sheet-register .register-layout { min-height: 0; }
  .sheet-register .register { border-radius: 0; }
}

/* A page head with its primary action beside the title. */
.record-head-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.record-head-row h1 { margin-bottom: 6px; }
.record-head-row .section-lead { margin: 0; }
.row-title { font-weight: 620; }
.status-cell { display: inline-flex; align-items: center; gap: 8px; }
.status-cell .ladder-mark { display: inline-block; }
.empty-note { padding: 22px 26px; margin: 0; }

/* Register labels wrap; the base button style keeps other buttons on one line. */
.register-tab { white-space: normal; }

/* --- Live probes ----------------------------------------------------------- */

.live-table td { vertical-align: top; }
.live-table .message { max-width: 36ch; }
.schedule-cell { min-width: 230px; }
.schedule-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.schedule-edit { margin: 8px 0 0; }
.schedule-edit > summary { font-size: 13.5px; }
.schedule-form { display: grid; gap: 10px; padding: 10px 0 2px; max-width: 260px; }
.schedule-form label { display: grid; gap: 4px; font-size: 13.5px; }
.schedule-form label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.schedule-form input[type="number"] { width: 100%; }
.schedule-form button { justify-self: start; }
/* The interval only means something for "Every N minutes". */
.schedule-form .interval-field { display: none; }
.schedule-form:has(select option[value="interval"]:checked) .interval-field { display: grid; }
.run-cell form.inline label { font-size: 13.5px; }
.run-cell input[type="number"] { width: 64px; }
