/* ============================================================
   Nīmo — design tokens + components
   Technical / modern dispatch console. Dark by default,
   light theme + accent swaps driven by [data-theme]/[data-accent].
   ============================================================ */

@import url('/static/vendor/fonts/fonts.css');

:root {
  /* dark (default) */
  --bg:        oklch(0.165 0.006 260);
  --bg-grid:   oklch(0.205 0.008 260);
  --panel:     oklch(0.196 0.007 260);
  --panel-2:   oklch(0.232 0.008 260);
  --panel-3:   oklch(0.265 0.009 260);
  --line:      oklch(0.30 0.010 260);
  --line-soft: oklch(0.255 0.009 260);
  --text:      oklch(0.945 0.004 260);
  --text-dim:  oklch(0.74 0.008 260);
  --muted:     oklch(0.60 0.010 260);
  --faint:     oklch(0.46 0.010 260);

  /* status */
  --accent:    oklch(0.79 0.135 70);   /* amber */
  --accent-ink: oklch(0.22 0.05 70);
  --live:      oklch(0.635 0.205 25);  /* red — recording / live */
  --ok:        oklch(0.74 0.14 152);   /* green — passed */
  --warn:      oklch(0.80 0.14 85);    /* yellow — a warning */
  --info:      oklch(0.70 0.12 235);
  /* The feedback's two middle verdicts: partly right is orange, a
     recommendation not followed yellow (user, 2026-10-20). */
  --partial:   oklch(0.75 0.155 52);
  --advice:    oklch(0.80 0.14 85);
  --sel:       oklch(0.74 0.13 245);   /* blue — the selection: a turn, a question, a node. No verdict uses it */

  --shadow: 0 1px 0 oklch(1 0 0 / 0.03) inset, 0 8px 30px oklch(0 0 0 / 0.35);
  --radius: 9px;
  --rail-w: 232px;

  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
}

[data-theme='light'] {
  --partial:   oklch(0.66 0.17 50);
  --bg:        oklch(0.965 0.004 260);
  --bg-grid:   oklch(0.925 0.006 260);
  --panel:     oklch(0.995 0.002 260);
  --panel-2:   oklch(0.975 0.004 260);
  --panel-3:   oklch(0.945 0.006 260);
  --line:      oklch(0.875 0.008 260);
  --line-soft: oklch(0.915 0.006 260);
  --text:      oklch(0.235 0.012 260);
  --text-dim:  oklch(0.42 0.012 260);
  --muted:     oklch(0.55 0.012 260);
  --faint:     oklch(0.66 0.010 260);
  --sel:       oklch(0.56 0.17 250);
  --accent-ink: oklch(0.30 0.06 70);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.04), 0 10px 24px oklch(0 0 0 / 0.06);
}

[data-accent='red']   { --accent: oklch(0.635 0.205 25); --accent-ink: oklch(0.98 0.01 25); }
[data-accent='blue']  { --accent: oklch(0.65 0.16 248);  --accent-ink: oklch(0.98 0.01 248); }
[data-accent='green'] { --accent: oklch(0.72 0.15 152);  --accent-ink: oklch(0.20 0.05 152); }

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

#root { height: 100%; }

::selection { background: color-mix(in oklch, var(--accent) 35%, transparent); }

/* scrollbars */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 8px;
  border: 3px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  height: 100%;
  background: var(--bg);
}

/* ---- side rail ---- */
.rail {
  background: var(--panel);
  border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  gap: 6px;
}
/* The logo (window.UI.Brand): mark and wordmark, the wordmark in the theme's
   text colour. */
.brand { display: flex; align-items: center; padding: 4px 8px 18px; color: var(--text); }
.brand-logo { display: block; flex: none; }
.login-brand { padding: 0 0 6px; }

.rail-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em;
  color: var(--faint); text-transform: uppercase;
  padding: 14px 10px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 11px; border-radius: 8px;
  color: var(--text-dim); cursor: pointer;
  border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500;
  transition: background .14s, color .14s, border-color .14s;
  position: relative;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active {
  background: var(--panel-2); color: var(--text);
  border-color: var(--line);
}
.nav-item.active::before {
  content: ''; position: absolute; inset-inline-start: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-glyph {
  width: 26px; height: 26px; border-radius: 6px; flex: none;
  display: grid; place-items: center;
  background: var(--panel-3); border: 1px solid var(--line-soft);
  color: var(--muted);
}
.nav-item.active .nav-glyph { color: var(--accent); border-color: color-mix(in oklch, var(--accent) 40%, var(--line)); }
.nav-glyph svg { width: 15px; height: 15px; }
.nav-meta { margin-inline-start: auto; font-family: var(--mono); font-size: 10px; color: var(--faint); }
.nav-sub { font-size: 11px; color: var(--faint); font-weight: 400; }
.nav-item .nav-stack { display: flex; flex-direction: column; gap: 1px; }

/* Pushes the audio test and the foot to the bottom of the rail. */
.rail-end { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.rail-foot { padding: 12px 8px 2px; border-top: 1px solid var(--line-soft); }
.rail-stat { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); padding: 4px 2px; }
.rail-help { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 6px; padding: 6px 2px;
  background: none; border: 0; font: inherit; font-size: 12px; color: var(--text-dim); cursor: pointer; text-align: left; }
.rail-help:hover { color: var(--text); }
/* The manual's links look like the help beside them: they are help too. */
a.rail-help { text-decoration: none; }
.rail-help svg { width: 14px; height: 14px; }

/* ---- main column ---- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }
.topbar {
  height: 56px; flex: none;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--panel) 55%, transparent);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
  /* Keep the topbar (and the settings popover it hosts) above the scrolling
     panel content — otherwise the map iframe paints over the popover. */
  position: relative; z-index: 30;
}
.crumb { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 600; }
.topbar h1 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.topbar .spacer { flex: 1; }
/* The topbar's right end: settings, who is signed in, signing out. */
.topbar-user { font-size: 13px; color: var(--text-dim); white-space: nowrap; margin-inline-end: -6px; }
.btn.icon { padding: 7px; }
.btn.icon svg { width: 16px; height: 16px; }

.scroll { overflow: auto; flex: 1; min-height: 0; }
.pad { padding: 24px; }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-h {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.card-h .t { font-size: 13px; font-weight: 600; }
.sec-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--muted); text-transform: uppercase;
}

.btn {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 9px 15px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .14s, border-color .14s, transform .06s;
}
.btn:hover { background: var(--panel-3); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.accent:hover { background: color-mix(in oklch, var(--accent) 88%, white); }
.btn.live { background: var(--live); color: white; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.lg { padding: 13px 20px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* The trainer's protocol page: the chart scaled to the column, the page
   scrolls its height (a protocol is a tall top-down chart). */
.protocol-page svg { width: 100% !important; height: auto !important; max-width: 100% !important; display: block; }

/* The dispatch decision: a radio group drawn as choice chips. Real radio
   inputs (one-of-N, arrow keys and screen readers for free), visually the
   buttons of the rest of the console; the checked one keeps its fill, so the
   decision stays visible after it was made. "No dispatch" fills neutral
   rather than accent — it is a decision, not a dispatch. */
fieldset.choice { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 12px; margin: 0; min-width: 0; }
fieldset.choice legend { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 0 6px; }
.choice-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-opt { position: relative; }
.choice-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.choice-opt .btn { user-select: none; }
.choice-opt input:checked + .btn { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.choice-opt.none input:checked + .btn { background: var(--text); color: var(--panel); border-color: transparent; font-weight: 600; }
.choice-opt input:focus-visible + .btn { outline: 2px solid var(--sel); outline-offset: 2px; }
.choice-opt input:disabled + .btn { opacity: .5; cursor: not-allowed; }
.choice-opt input:disabled:not(:checked) + .btn:hover { background: var(--panel-2); border-color: var(--line); }

.badge {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  padding: 3px 8px; border-radius: 5px; letter-spacing: 0.02em;
  border: 1px solid var(--line); color: var(--text-dim); background: var(--panel-2);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.badge.ok  { color: var(--ok);  border-color: color-mix(in oklch, var(--ok) 35%, var(--line));  background: color-mix(in oklch, var(--ok) 10%, transparent); }
.badge.warn{ color: var(--warn);border-color: color-mix(in oklch, var(--warn) 35%, var(--line));background: color-mix(in oklch, var(--warn) 10%, transparent); }
.badge.partial { color: var(--partial); border-color: color-mix(in oklch, var(--partial) 38%, var(--line)); background: color-mix(in oklch, var(--partial) 11%, transparent); }
.badge.miss{ color: var(--live);border-color: color-mix(in oklch, var(--live) 35%, var(--line));background: color-mix(in oklch, var(--live) 10%, transparent); }
.badge.accent { color: var(--accent); border-color: color-mix(in oklch, var(--accent) 40%, var(--line)); background: color-mix(in oklch, var(--accent) 12%, transparent); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.input, .select {
  font-family: var(--sans); font-size: 13px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
  padding: 9px 11px; width: 100%; outline: none;
  transition: border-color .14s, box-shadow .14s;
}
[data-theme='light'] .input, [data-theme='light'] .select { background: var(--panel-2); }
/* A date/time box draws its own calendar indicator and picker: told the wrong
   scheme it paints them dark on the dark console. Scoped to these inputs —
   the rest of the app colours everything itself. */
.input[type='datetime-local'], .input[type='date'], .input[type='time'] { color-scheme: dark; }
[data-theme='light'] .input[type='datetime-local'],
[data-theme='light'] .input[type='date'],
[data-theme='light'] .input[type='time'] { color-scheme: light; }
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent);
}
.input.mono { font-family: var(--mono); }
/* A text box of more than one line (dispatch_form.yaml: `rows`) — the
   Hinweise block. `rows` sets the height, so no min-height fights it; the
   drag handle is vertical only, because widening it would break the grid
   cell it sits in. */
textarea.input { resize: vertical; line-height: 1.5; }

/* code / yaml */
.code {
  font-family: var(--mono); font-size: 12px; line-height: 1.65;
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 7px;
  padding: 14px 16px; overflow: auto; white-space: pre; color: var(--text-dim);
  tab-size: 2;
}
.code .k { color: var(--accent); }
.code .s { color: var(--ok); }
.code .n { color: var(--info); }
.code .c { color: var(--faint); font-style: italic; }
.code .d { color: var(--live); }

/* collapsible */
.collapse-h {
  display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  padding: 13px 16px;
}
.collapse-h .chev { transition: transform .18s; color: var(--muted); display: grid; place-items: center; }
.collapse-h .chev svg { width: 14px; height: 14px; }
.collapse-h.open .chev { transform: rotate(90deg); }
.collapse-body { padding: 0 16px 16px; }

.divider { height: 1px; background: var(--line-soft); }
/* The dispatch record's own grid — the field cards, the 12 tracks, the
   "+N more fields" expander and the suggestion dropdown — belongs to the
   mask that draws it and lives in masks/standard/mask.css, scoped to
   [data-mask="standard"] like every mask's stylesheet (MASKS-DESIGN §5). */
.row { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* ============================================================
   TRAINER
   ============================================================ */
.trainer { display: grid; grid-template-columns: 380px 1fr; gap: 0; height: 100%; min-height: 0; }
.case-col { border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.case-toolbar { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.search { position: relative; }
.search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); }
.search .input { padding-inline-start: 33px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--mono); font-size: 10.5px; padding: 4px 9px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); color: var(--muted); background: var(--bg); transition: all .12s;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--panel-3); color: var(--text); border-color: var(--faint); }

.case-list { overflow: auto; flex: 1; min-height: 0; }
.case-row {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px;
  padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--line-soft);
  border-inline-start: 2px solid transparent;
}
.case-row:hover { background: var(--panel-2); }
.case-row.sel { background: var(--panel-2); border-inline-start-color: var(--accent); }
.case-id { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.case-row.sel .case-id { color: var(--accent); }
.case-title { font-size: 13px; font-weight: 500; line-height: 1.25; }
.case-sub { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 2px; }

/* Catalogue chapters. The header sticks while its cases scroll past, so a long
   list never leaves the trainer wondering which chapter they are looking at.
   The count is the plain number of cases in the chapter — while a search is
   running it reads matches/total. */
.case-group-h {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; cursor: pointer; user-select: none;
  background: var(--panel-2); border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.case-group-h:hover { color: var(--text); }
.case-group-h .chev { transition: transform .18s; display: grid; place-items: center; }
.case-group-h .chev svg { width: 13px; height: 13px; }
.case-group-h.open .chev { transform: rotate(90deg); }
/* A folded chapter holding the case shown on the right. */
.case-group-h.has-sel .case-group-name { color: var(--accent); }
.case-group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-group-n {
  margin-inline-start: auto; flex: none; padding: 1px 7px; border-radius: 999px;
  background: var(--panel-3); border: 1px solid var(--line-soft); color: var(--faint);
}
.case-group-empty {
  padding-block: 10px 10px; padding-inline: 37px 16px; font-size: 12px; color: var(--faint);
  border-bottom: 1px solid var(--line-soft);
}

.detail-col { overflow: auto; min-height: 0; padding: 22px; }
.detail-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.detail-head h2 { font-size: 20px; margin: 0 0 7px; letter-spacing: -0.01em; }
.detail-head .meta { display: flex; gap: 8px; flex-wrap: wrap; }
/* The run page's heading (runs.jsx): the case's name, chapter and level above. */
.run-head { margin: 4px 0 18px; display: grid; gap: 4px; }
.run-head-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.run-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.run-head h2.muted { font-size: 15px; font-weight: 500; color: var(--muted); }
.diff { display: inline-flex; gap: 3px; align-items: center; }
.diff i { width: 6px; height: 12px; border-radius: 2px; background: var(--line); display: inline-block; }
.diff i.on { background: var(--accent); }
/* The level reads at a glance: easy is green, hard runs hot. */
.diff.lvl-1 i.on { background: var(--ok); }
.diff.lvl-3 i.on { background: var(--live); }

/* ---- challenges of a hard call ---- */
.chal-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
  color: var(--text);
  border: 1px solid color-mix(in oklch, var(--live) 38%, var(--line));
  background: linear-gradient(100deg, color-mix(in oklch, var(--live) 16%, transparent),
                                      color-mix(in oklch, var(--accent) 10%, transparent));
  cursor: help;
}
.chal svg { color: var(--live); flex: none; }
.chal-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; margin-bottom: 14px; }
.chal-strip .hint { margin-inline-start: auto; font-size: 11.5px; color: var(--faint); }
/* The reveal after the call: a card that runs a little hot. */
.chal-card {
  margin-bottom: 14px; overflow: hidden;
  border-color: color-mix(in oklch, var(--live) 30%, var(--line));
  background:
    radial-gradient(130% 120% at 100% 0%, color-mix(in oklch, var(--live) 11%, transparent), transparent 55%),
    var(--panel);
}
.chal-card .card-h .t { display: inline-flex; align-items: center; gap: 8px; }
.chal-card .card-h .t svg { color: var(--live); }
.chal-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 16px 16px; }
.chal-item { display: flex; gap: 12px; align-items: flex-start; animation: chal-in .45s cubic-bezier(.2,.8,.2,1) both; }
.chal-glyph {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  color: var(--live);
  background: color-mix(in oklch, var(--live) 13%, var(--panel-2));
  border: 1px solid color-mix(in oklch, var(--live) 32%, var(--line));
}
.chal-text { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.45; color: var(--text-dim); }
.chal-text b { font-size: 13.5px; color: var(--text); }
@keyframes chal-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chal-item { animation: none; } }
/* A level header in the practice table: hard carries its flame. */
.lvl-head-wrap { display: inline-flex; align-items: center; gap: 5px; }
.lvl-head-wrap svg { color: var(--live); }

/* Run row: one line for everything that changes THIS instance (difficulty,
   seed, regenerate), separated from the case identity above it. The case says
   what is trained; the run row says how it is played. */
.run-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 16px; margin-bottom: 14px; }
.run-bar .sec-label { flex: none; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline label { text-transform: uppercase; }
.field.inline .select { padding-top: 5px; padding-bottom: 5px; }
.run-seed { font-family: var(--mono); font-size: 11px; color: var(--muted); cursor: help; }

.stat-strip {
  display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; margin-bottom: 18px;
  /* Width follows content, not the column count: a dispatch keyword is three
     characters, the course of events is a sentence. */
  /* Every minimum is what the cell's own uppercase label needs (a narrower
     column clipped "STICHWORT"), plus enough for "16 Monate · male" to stay on
     one line. The fractions then hand the remaining width to the two cells that
     hold prose rather than a keyword. */
  grid-template-columns:
    minmax(150px, .6fr) minmax(100px, .5fr) minmax(120px, .95fr) minmax(150px, 2.55fr);
}
.stat-cell { background: var(--panel); padding: 13px 15px; }
.stat-cell .l { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.stat-cell .v { font-size: 14.5px; font-weight: 600; margin-top: 5px; }
/* Keep the strip two or three lines tall whatever the case writes; the full
   text stays available as a tooltip. */
.stat-cell .v.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   TRAINEE
   ============================================================ */
/* The Call-Taker page: the desk in front of the console window (trainee.jsx).
   One card for where the training stands and the key that matters, the three
   steps of the flow under it — the call-taker works in the console window
   (user, 2026-10-21). Type and spacing as on the other pages: 13 px text, a
   20 px heading like the run page's, standard keys, 14 px between blocks. */
.desk { display: flex; flex-direction: column; gap: 14px; }
.desk-unfinished { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 16px; font-size: 13px; flex-wrap: wrap; }
.desk-stage { padding: 20px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px;
  align-items: center; }
.desk-stage.live {
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--live) 8%, transparent), transparent 62%), var(--panel);
}
.desk-stage.ended { background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--ok) 8%, transparent), transparent 62%), var(--panel); }
.desk-main { display: grid; gap: 9px; align-content: center; min-width: 0; }
.desk-head { display: flex; align-items: center; gap: 10px; }
.desk-head .badge svg { width: 12px; height: 12px; }
.desk-title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.desk-case { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.desk-text { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; max-width: 620px; }
.desk-keys { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.desk-phone { display: flex; align-items: center; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.desk-phone .select { width: auto; }
.desk-status { margin: 0; font-size: 11px; color: var(--faint); }
.desk-limit { margin: 0; font-size: 13px; font-weight: 600; color: var(--live); }
.desk-live { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--live); font-weight: 600; }
.live-tag .rec { width: 9px; height: 9px; border-radius: 50%; background: var(--live); animation: pulse2 1.3s infinite; }
@keyframes pulse2 { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.call-timer { font-family: var(--mono); font-size: 34px; font-weight: 500; letter-spacing: 0.02em; line-height: 1; color: var(--live);
  font-variant-numeric: tabular-nums; }

/* The state at a glance, on the right of the card. */
.desk-visual { display: grid; place-items: center; min-width: 140px; }
.desk-glyph { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.desk-glyph svg { width: 52px; height: 52px; stroke-width: 1.5; }
.desk-stage.ended .desk-glyph { color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, transparent);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.desk-stage.none .desk-glyph { color: var(--muted); background: var(--panel-2); border-color: var(--line); }

.desk-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.desk-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); font-size: 13px; line-height: 1.4; color: var(--text-dim);
  box-shadow: var(--shadow); }
.desk-steps li > span:last-child { display: grid; gap: 2px; }
.desk-steps li b { color: var(--text); font-weight: 600; }
.desk-steps li .muted { font-size: 12px; }
.desk-step-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); color: var(--muted); }
.desk-step-n svg { width: 12px; height: 12px; }
.desk-steps li.now { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.desk-steps li.now .desk-step-n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.desk-steps li.done .desk-step-n { background: color-mix(in srgb, var(--ok) 15%, transparent); border-color: var(--ok); color: var(--ok); }

/* No number to be rung back on, said before the mask is opened. */
.desk-nophone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent); border-radius: 8px;
  background: color-mix(in srgb, var(--warn) 12%, transparent); font-size: 12.5px; color: var(--text); max-width: 680px; }
.desk-nophone > svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.desk-nophone > span { flex: 1; min-width: 200px; }

@media (max-width: 900px) { .desk-visual { display: none; } .desk-stage { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .desk-steps { grid-template-columns: 1fr; } }

/* The Settings page (settings.jsx): cards as on the other pages, two columns
   where there is room, every choice a row of segments (user, 2026-10-21). */
.settings { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 1100px) { .settings { grid-template-columns: 1fr 1fr; } }
.settings-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.settings-card { overflow: hidden; }
.settings-body { padding: 16px; display: grid; gap: 14px; }
.settings-hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.settings-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.settings-row { display: flex; gap: 24px; flex-wrap: wrap; }
.settings-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .settings-pair { grid-template-columns: 1fr; } }
.settings-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings-foot > :only-child { margin-inline-start: auto; }
.settings-account { display: flex; align-items: center; gap: 12px; }
.settings-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); }
.settings-who { display: grid; gap: 2px; flex: 1; min-width: 0; }
.settings-who b { font-size: 14px; }
.settings-who .mono { font-size: 11.5px; }
.settings-empty { font-size: 13px; color: var(--muted); padding: 12px 14px; border: 1px dashed var(--line);
  border-radius: 8px; }
.settings-list { display: grid; gap: 8px; }
.settings-line { display: grid; gap: 8px; align-items: center; }
.settings-line.phone { grid-template-columns: 130px minmax(0, 1fr) auto auto; }
.settings-line.allow { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto; }
@media (max-width: 560px) { .settings-line.phone, .settings-line.allow { grid-template-columns: 1fr auto; } }
.settings-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .settings-limits { grid-template-columns: 1fr; } }
.settings-limit { display: grid; gap: 6px; }
.settings-limit b { font-size: 14px; font-weight: 600; }
.settings-meter { display: block; block-size: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.settings-meter > span { display: block; block-size: 100%; background: var(--accent); }
.settings-meter > span.full { background: var(--live); }
.settings-default { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim);
  white-space: nowrap; cursor: pointer; }

/* A row of choices: one framed strip, the chosen one lit in the accent. */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--panel-2); width: fit-content; max-width: 100%; }
.seg button { font-family: var(--sans); font-size: 12.5px; font-weight: 500; color: var(--text-dim);
  background: transparent; border: 0; border-radius: 7px; padding: 6px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: background .14s, color .14s; }
.seg button:hover { background: var(--panel-3); color: var(--text); }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.seg-dot.amber { background: oklch(0.79 0.135 70); }
.seg-dot.blue { background: oklch(0.65 0.16 248); }
.seg-dot.green { background: oklch(0.72 0.15 152); }
.seg-dot.red { background: oklch(0.635 0.205 25); }
.seg button.on .seg-dot { background: var(--accent-ink); }

/* ============================================================
   ANALYSIS
   ============================================================ */
.analysis-grid { display: grid; grid-template-columns: 1fr 0.95fr; gap: 22px; align-items: start; }

.run-state { display: grid; place-items: center; padding: 70px 24px; text-align: center; }
.scanner { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin-bottom: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Audio echo test (BACKEND-DESIGN §6): live meters and the verdict line. */
/* The audio test (audiotest.jsx): two cards side by side where there is room —
   the test, and the microphone in the browser in three steps. */
.audiotest { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 1100px) { .audiotest { grid-template-columns: 1.1fr 1fr; } }
.audiotest-card { overflow: hidden; }
.audiotest-body { padding: 16px; display: grid; gap: 14px; }
.audiotest-intro { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.audiotest-starts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .audiotest-starts { grid-template-columns: 1fr; } }
.audiotest-start { display: flex; gap: 12px; align-items: flex-start; text-align: start; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); color: var(--text);
  font-family: var(--sans); cursor: pointer; transition: border-color .14s, background .14s; }
.audiotest-start:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel-2)); }
.audiotest-start:disabled { opacity: .55; cursor: not-allowed; }
.audiotest-start > span:last-child { display: grid; gap: 3px; font-size: 13px; }
.audiotest-start > span:last-child > span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.audiotest-start-ico { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.audiotest-start-ico svg { width: 18px; height: 18px; }
.audiotest-tip { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.audiotest-tip svg { width: 14px; height: 14px; flex: none; }
.audiotest-live { display: grid; gap: 14px; }
.audiotest-live-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.audiotest-clock { margin-inline-start: auto; font-size: 22px; color: var(--text); font-variant-numeric: tabular-nums; }
.audiotest-mic { display: flex; align-items: center; gap: 12px; }
.audiotest-mic > svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.audiotest-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.audiotest-details { flex: 1; min-width: 260px; font-size: 12px; }
.audiotest-details summary { cursor: pointer; color: var(--muted); }
.audiotest-details .audiotest-meters { margin-top: 10px; }
.audiotest-meters { display: flex; flex-direction: column; gap: 8px; }
.audiotest-row { display: grid; grid-template-columns: 130px 1fr 80px; gap: 10px; align-items: center; font-size: 12.5px; }
.audiotest-row .mono { text-align: end; font-size: 11.5px; }
.meter { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; flex: 1; }
.meter.big { height: 14px; border-radius: 7px; }
.meter > span { display: block; height: 100%; background: var(--ok); transition: width 150ms linear; }
.meter.bad > span { background: var(--live); }
.audiotest-verdict { margin: 0; font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--text-dim); background: var(--panel-2); }
.audiotest-verdict.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  background: color-mix(in srgb, var(--ok) 8%, transparent); }
.audiotest-verdict.bad { color: var(--live); border-color: color-mix(in srgb, var(--live) 40%, transparent);
  background: color-mix(in srgb, var(--live) 7%, transparent); }

/* Help: the microphone in the browser (audiotest.jsx MicHelp) — on the audio
   test page and in the rail's help window. Three numbered steps. */
.mic-help { font-size: 13px; line-height: 1.5; display: grid; gap: 14px; }
.mic-help-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mic-help-steps li { display: flex; gap: 10px; align-items: flex-start; }
.mic-help-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--accent-ink); background: var(--accent); margin-top: 1px; }
.mic-help-step { display: grid; gap: 8px; min-width: 0; flex: 1; }
.mic-help-step > .muted { font-size: 12px; }
.mic-help-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.mic-help-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; font-size: 12.5px; }
.mic-help-url { font-family: var(--mono); font-size: 11px; overflow-wrap: anywhere; user-select: all; color: var(--text-dim); }
.mic-help-more summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.mic-help-more .mic-help-row { margin-top: 8px; }
.mic-help-check { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-dim);
  padding-top: 12px; border-top: 1px solid var(--line-soft); }
.mic-help-check svg { width: 15px; height: 15px; color: var(--ok); flex: none; margin-top: 2px; }
@media (max-width: 720px) { .mic-help-row { grid-template-columns: 1fr; } }
.run-steps { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 18px; display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.run-steps .s { display: flex; align-items: center; gap: 9px; opacity: .4; transition: opacity .3s; }
.run-steps .s.done { opacity: 1; color: var(--text-dim); }
.run-steps .s.act { opacity: 1; color: var(--accent); }
.run-steps .tick { width: 14px; height: 14px; }

.score-ring { display: flex; align-items: center; gap: 18px; }
.ring { width: 76px; height: 76px; flex: none; }
.score-meta .big { font-size: 26px; font-weight: 700; }
.score-meta .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }

.check-group { padding: 6px 0; }
.check-group .gh { display: flex; align-items: center; gap: 9px; padding: 12px 16px 8px; }
.check-group .gh .sec-label { color: var(--text-dim); }
.check-row { display: grid; grid-template-columns: 22px 1fr auto auto; align-items: center; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line-soft); }
.check-icon { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; flex: none; }
.check-icon.ok { background: color-mix(in oklch, var(--ok) 18%, transparent); color: var(--ok); }
.check-icon.warn { background: color-mix(in oklch, var(--warn) 18%, transparent); color: var(--warn); }
.check-icon.partial { background: color-mix(in oklch, var(--partial) 18%, transparent); color: var(--partial); }
.check-icon.miss { background: color-mix(in oklch, var(--live) 16%, transparent); color: var(--live); }
/* not_applicable: the protocol did not require this criterion here, so it is
   neither a pass nor a failure and must not read as either. */
.check-icon.na { background: color-mix(in oklch, var(--muted) 14%, transparent); color: var(--muted); }
.badge.na { color: var(--muted); }
.check-icon svg { width: 13px; height: 13px; }
.check-name { font-size: 13px; font-weight: 500; }
.check-name .de { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-inline-start: 7px; }
.check-time { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.transcript { display: flex; flex-direction: column; gap: 2px; padding: 6px; max-height: 520px; overflow: auto; }
/* One selection, three places (runs.jsx / analysis.jsx): the turn in the
   transcript, the question in the result and the node in the chart are marked
   in the same colour — one no verdict uses, so a selected question never reads
   as a failed one. An inset shadow rather than a border, so nothing shifts. */
.run-turn { padding: 7px 8px; border-radius: 8px; margin: 2px -8px; cursor: pointer; }
.run-turn:hover { background: var(--panel-2); }
.run-turn.selected { background: color-mix(in oklch, var(--sel) 12%, transparent); box-shadow: inset calc(var(--dir-sign) * 3px) 0 0 var(--sel); }
.run-turn.selected .seq { color: var(--sel); }
.result-item { display: flex; gap: 10px; padding: 9px 8px; margin: 0 -8px; border-top: 1px solid var(--line); cursor: pointer; }
.result-item:hover { background: var(--panel-2); }
.result-item.selected { background: color-mix(in oklch, var(--sel) 12%, transparent); box-shadow: inset calc(var(--dir-sign) * 3px) 0 0 var(--sel); }
.turn { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 9px 12px; border-radius: 7px; }
.turn:hover { background: var(--panel-2); }
.turn .ts { font-family: var(--mono); font-size: 10.5px; color: var(--faint); padding-top: 2px; }
.turn .who { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; }
.turn.disp .who { color: var(--accent); }
.turn.call .who { color: var(--info); }
.turn .tx { font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.turn .tx mark { background: color-mix(in oklch, var(--accent) 22%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }

@media (max-width: 1180px) {
  .analysis-grid { grid-template-columns: 1fr; }
}


/* ---- runs table ----------------------------------------------------------- */
/* The run page's right column: the player, the transcript and the chart stay
   in view while the result scrolls, because an evidence chip drives all three.
   The column is never taller than the visible page — one that was cut off
   the chart at its foot and, once the result ended, its own head (user,
   2026-10-19): the transcript and the chart share the height instead, each
   scrolling inside its own box. Only a window too low for both of them at
   their least lets the column scroll as a whole. */
@media (min-width: 1181px) {
  .run-aside { position: sticky; top: 16px; display: flex; flex-direction: column;
    max-height: calc(100vh - 56px - 32px); overflow-y: auto; }   /* the topbar, a gap above and below */
  .run-aside > .card { flex: none; }
  .run-aside > .run-transcript { flex: 0 1 auto; min-height: 200px; display: flex; flex-direction: column; }
  .run-transcript > .card-h { flex: none; }
  .run-transcript > .transcript { flex: 1 1 auto; min-height: 0; }
  .run-aside-chart { display: contents; }
  .run-aside-chart > .card { flex: 0 1 auto; min-height: 240px; display: flex; flex-direction: column; }
  .run-aside-chart > .card > :not(.proc):not(.chart-viewport) { flex: none; }
  .run-aside-chart .proc { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .run-aside-chart .chart-viewport { flex: 0 1 auto; min-height: 160px; }
}

.runs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.runs-table th {
  text-align: start; padding: 10px 14px; font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.runs-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.runs-table tbody tr:hover { background: var(--panel-3); }
.runs-table tbody tr:last-child td { border-bottom: 0; }
/* An admin's delete column (runs.jsx): the tick on the left, the bin on the right. */
.runs-table .runs-pick { width: 1%; padding-inline: 10px; text-align: center; white-space: nowrap; }
.runs-table .runs-pick input { cursor: pointer; accent-color: var(--accent); }
.runs-table tbody tr.picked td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.runs-table .runs-trash { opacity: .55; }
.runs-table tbody tr:hover .runs-trash { opacity: 1; }
.runs-table .runs-trash:hover { color: var(--live); }

/* The run list's filters: one wrapping row of labelled boxes above it. */
.runs-filters {
  display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end;
  padding: 12px 14px; margin-bottom: 14px;
}
.runs-filters label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 130px; max-width: 220px; }
.runs-filters label.wide { flex-basis: 200px; max-width: 320px; }
.runs-filters label.narrow { flex: 0 1 90px; }
.runs-filters label.period { flex: 0 0 auto; max-width: none; }
.runs-filters label > span:first-child {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.runs-filters .select, .runs-filters .input { padding-top: 6px; padding-bottom: 6px; }
.runs-filters .input[type='date'] { width: auto; }

/* --- sign-in and settings (BACKEND-DESIGN §9, §10) ------------------------ */

/* The one screen that runs without a signed-in user: centred, no rail, no
   topbar — there is nothing to navigate to yet. */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.login-card {
  width: 100%; max-width: 360px; padding: 26px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-card h2 { font-size: 17px; font-weight: 600; }

/* A short outcome line under a form: what was saved, or why it was refused. */
.notice {
  font-size: 12.5px; line-height: 1.45; padding: 9px 12px; border-radius: 7px;
  border: 1px solid var(--line); margin-top: 10px;
}
.notice.bad {
  color: var(--live);
  border-color: color-mix(in oklch, var(--live) 35%, var(--line));
  background: color-mix(in oklch, var(--live) 8%, transparent);
}
.notice.good {
  color: var(--ok);
  border-color: color-mix(in oklch, var(--ok) 35%, var(--line));
  background: color-mix(in oklch, var(--ok) 8%, transparent);
}

/* --- dialogs -------------------------------------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: color-mix(in oklch, var(--bg) 72%, transparent);
  backdrop-filter: blur(2px);
}
.modal-card {
  width: 100%; padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 18px 48px -12px rgb(0 0 0 / 0.35);
}
/* The one-time password: large, monospaced and selectable in one gesture,
   because it is read out or copied once and never shown again. */
.once-only {
  font-family: var(--mono); font-size: 17px; letter-spacing: 0.02em;
  user-select: all; word-break: break-all;
  padding: 11px 13px; border-radius: 8px;
  border: 1px solid color-mix(in oklch, var(--ok) 35%, var(--line));
  background: color-mix(in oklch, var(--ok) 9%, transparent);
}

/* --- releases (releases.jsx) ----------------------------------------------
   The dialog is tall — a catalogue and an account list — so it scrolls inside
   the viewport instead of pushing its buttons off-screen. */
.release-dialog { display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 130px); overflow: auto; padding-inline-end: 2px; }
.release-dialog-lead { margin: 0; font-size: 13px; line-height: 1.5; }
.release-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
/* Rows of a picker are labels (the whole row ticks the box), but not the
   field captions `.field label` styles — they read as text, not as headings. */
.field .release-check, .field .release-case {
  font-family: var(--sans); font-size: 13px; letter-spacing: normal; text-transform: none; color: var(--text);
}
.release-check input, .release-case input, .release-chapter input, .release-case-row input,
.release-group-h input,
.release-switch input { accent-color: var(--accent); margin: 0; }
.release-picker { border: 1px solid var(--line); border-radius: 9px; background: var(--bg); overflow: hidden; }
.release-picker-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px; border-bottom: 1px solid var(--line-soft); }
.release-picker-list { max-height: 300px; overflow: auto; position: relative; }
.release-picker-list.short { max-height: 220px; }
.release-group-h {
  position: sticky; top: 0; z-index: 1; padding: 8px 12px; font-size: 12px; font-weight: 600;
  background: var(--panel-2); border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
}
.release-group-h .chev { display: grid; place-items: center; color: var(--muted); transition: transform .18s; }
.release-group-h .chev svg { width: 13px; height: 13px; }
.release-group-h.open .chev { transform: rotate(90deg); }
.release-group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.release-group-n { margin-inline-start: auto; font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--muted); }
.release-group-n.some { color: var(--accent); }
.release-case {
  display: grid; grid-template-columns: 18px 56px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer;
}
.release-targets .release-case { grid-template-columns: 18px 1fr auto; }
.release-case:hover { background: var(--panel-2); }
.release-case.on { background: color-mix(in oklch, var(--accent) 8%, transparent); }
.release-case .case-title, .release-case .case-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.release-targets { display: flex; flex-direction: column; gap: 10px; }
.release-fixed {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg);
}
.release-fixed .item {
  font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel);
}
/* What saving does, in sentences — the last thing read before the button. */
.release-summary { border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: var(--panel-2); }
.release-summary p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.release-summary-warn { color: var(--warn); font-weight: 500; }

/* The page: two views, then the case list or the call-takers. */
.release-page { display: flex; flex-direction: column; gap: 18px; }
.release-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.release-views { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--bg); }
.release-view {
  font: inherit; font-size: 12.5px; padding: 7px 13px; background: none; border: 0;
  color: var(--muted); cursor: pointer;
}
.release-view + .release-view { border-inline-start: 1px solid var(--line); }
.release-view:hover { color: var(--text); }
.release-view.on { background: var(--panel-3); color: var(--text); font-weight: 600; }
.release-search { width: 280px; max-width: 100%; }
.release-section { display: flex; flex-direction: column; gap: 10px; }
.release-hint { font-size: 12px; color: var(--muted); }
.release-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.release-cases-bar { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; }
.release-person-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; }
.release-person-pick .select { width: auto; min-width: 180px; padding-top: 6px; padding-bottom: 6px; }
.release-selection {
  position: sticky; top: 0; z-index: 3; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 14px; border-color: var(--accent);
  box-shadow: 0 6px 18px -12px color-mix(in oklch, var(--accent) 60%, transparent);
}
.release-selection b { font-size: 13px; font-weight: 600; margin-inline-end: 4px; }

/* By case: the catalogue with its releases. A row is a grid so the columns
   line up across chapters without being a table the switches fight with. */
.release-cases { padding: 0; overflow: hidden; }
.release-chapter {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 12.5px; cursor: pointer;
  background: var(--panel-2); border-bottom: 1px solid var(--line-soft); user-select: none;
}
.release-chapter .chev { display: grid; place-items: center; color: var(--muted); transition: transform .18s; }
.release-chapter .chev svg { width: 13px; height: 13px; }
.release-chapter.open .chev { transform: rotate(90deg); }
.release-case-row {
  display: grid; align-items: center; gap: 12px; padding: 9px 16px; cursor: pointer;
  grid-template-columns: 16px 52px minmax(0, 1fr) 190px 120px 52px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.release-case-row:hover { background: var(--panel-2); }
.release-case-row.on { background: color-mix(in oklch, var(--accent) 7%, transparent); }
.release-case-row .chev { display: grid; place-items: center; color: var(--faint); transition: transform .18s; }
.release-case-row .chev svg { width: 12px; height: 12px; }
.release-case-row.open .chev { transform: rotate(90deg); }
/* The case the Trainer's release badge sent someone to: lit up twice as the
   scroll lands, then back to an ordinary row. */
.release-case-row.flash { animation: release-flash 2.2s ease-out .35s both; }
@keyframes release-flash {
  0%, 40% { background: color-mix(in oklch, var(--accent) 22%, transparent); box-shadow: inset calc(var(--dir-sign) * 3px) 0 0 var(--accent); }
  20%     { background: color-mix(in oklch, var(--accent) 8%, transparent);  box-shadow: inset calc(var(--dir-sign) * 3px) 0 0 var(--accent); }
  100%    { background: transparent; box-shadow: inset calc(var(--dir-sign) * 3px) 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .release-case-row.flash { animation: none; background: color-mix(in oklch, var(--accent) 12%, transparent); } }
.release-case-main { min-width: 0; }
.release-case-main .case-title, .release-case-main .case-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.release-ref { color: var(--text-dim); }
.release-case-release { min-width: 0; overflow: hidden; }
.release-case-release .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.release-case-figs { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.release-case-mean { text-align: end; }
.release-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }
.release-case-detail { background: var(--panel-2); border-bottom: 1px solid var(--line); }
.release-case-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-block: 10px 10px; padding-inline: 44px 16px; border-bottom: 1px solid var(--line-soft); }
.release-case-detail .runs-table th:first-child, .release-case-detail .runs-table td:first-child { padding-inline-start: 44px; }

/* By call-taker: a row per person; a click shows the cases as they see them. */
.release-table-wrap { overflow-x: auto; }
.release-table th, .release-table td { white-space: nowrap; }
.release-table .num { text-align: end; }
.release-table td.right { text-align: end; }
.release-person-row { cursor: pointer; }
.release-people .chev-col { width: 1%; padding-inline-end: 0; }
.release-people .chev { display: grid; place-items: center; color: var(--muted); transition: transform .18s; }
.release-people .chev svg { width: 13px; height: 13px; }
.release-person-row.open .chev { transform: rotate(90deg); }
.release-person-row.open td { background: var(--panel-2); }
.release-people tbody tr.release-person-detail:hover { background: none; }
.release-person-detail > td { padding: 0; background: var(--panel-2); white-space: normal; }
/* One call-taker opened: their figures, then their released cases a row each. */
.release-person { padding-block: 4px 14px; padding-inline: 40px 16px; display: flex; flex-direction: column; gap: 10px; }
.release-person-figures { display: flex; gap: 10px 28px; align-items: center; flex-wrap: wrap; padding-top: 8px; }
.release-person-figures > div { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.release-person-figures .l {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.release-person-figures .release-person-actions { flex-direction: row; gap: 8px; margin-inline-start: auto; }
.release-person-cases { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.release-person-cases tr.off td { opacity: .55; }
.release-person-case { display: flex; gap: 10px; align-items: baseline; max-width: 520px; }
.release-person-case .release-ref { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.release-person-case .case-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.release-mini-bar {
  display: inline-block; width: 56px; height: 5px; border-radius: 3px; margin-inline-end: 8px;
  vertical-align: middle; background: var(--panel-3); overflow: hidden;
}
.release-mini-bar i { display: block; height: 100%; background: var(--ok); }

/* On the case setup: to whom the case is released, and a mark in the list. */
.case-mark { display: grid; place-items: center; color: var(--faint); }
.case-mark svg { width: 13px; height: 13px; }
/* Released or not, on the case in the Trainer — a click opens it on the
   release page. */
.release-state { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.release-state:not(.ok) { border-style: dashed; }
.release-state > svg:last-child { opacity: .45; margin-inline-end: -3px; transition: opacity .12s, transform .12s; }
.release-state:hover { border-color: var(--accent); color: var(--text); }
.release-state.ok:hover { color: var(--ok); }
.release-state:hover > svg:last-child { opacity: 1; transform: translateX(calc(var(--dir-sign) * 1px)); }

@media (max-width: 900px) {
  .release-case-row { grid-template-columns: 16px minmax(0, 1fr) auto auto 14px; }
  .release-case-row .case-id, .release-case-row .release-case-figs { display: none; }
}

/* --- my practice (practice.jsx) --------------------------------------------
   The call-taker's starting page, the whole width: a table per release — a row
   per category that opens into its cases, a column per level — and a ▶ at
   the end of every row that starts what the row says. */
.practice { display: flex; flex-direction: column; gap: 14px; }
.practice-figures { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 0; }
.practice-card { overflow: hidden; }
.practice-card .card-h { gap: 12px; }
.practice-free { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.practice-scroll { overflow-x: auto; }
.practice-table th, .practice-table td { white-space: nowrap; }
.practice-table th.num, .practice-table td.num { text-align: end; }
/* A case never practised: "neu", bold and red so it stands out (user, 2026-10-21). */
.practice-table td.practice-new { color: var(--live); font-weight: 700; }
.practice-table tbody tr.todo td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.practice-table .play-col { width: 1%; text-align: end; }
/* A category: its own figures, and the switch for its cases. */
.chapter-row { cursor: pointer; user-select: none; }
.chapter-row td { background: var(--panel-2); }
.practice-table tbody tr.chapter-row:hover td { background: var(--panel-3); }
.chapter-row .chev { display: inline-grid; place-items: center; width: 16px; margin-inline-end: 6px; color: var(--muted); transition: transform .18s; vertical-align: -2px; }
.chapter-row .chev svg { width: 13px; height: 13px; }
.chapter-row.open .chev { transform: rotate(90deg); }
.case-row-p td:first-child { padding-inline-start: 38px; }
.case-num { color: var(--text-dim); }
.case-num b { font-family: var(--mono); color: var(--text); margin-inline-start: 2px; }
/* A level: how often, how well, and the ▶ for exactly that. */
.lvl-cell { border-inline-start: 1px solid var(--line-soft); }
/* …and the column after the last level, where the level is drawn. */
.lvl-cell + .play-col { border-inline-start: 1px solid var(--line-soft); padding-inline-start: 18px; }
.practice-table th.lvl-cell { cursor: help; }
.lvl-head { border-bottom: 1px dotted var(--faint); }
.lvl-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 132px; }
.lvl-fig { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; }
/* Quiet until the row is looked at: a table of cases would otherwise be a
   wall of red circles. The big ones — a release's, an open task's — are the
   page's main actions and stay in the accent colour. */
.play-btn {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border-radius: 50%; cursor: pointer; color: var(--muted);
  border: 1px solid var(--line); background: var(--panel);
  transition: background .12s, color .12s, border-color .12s, transform .06s;
}
.practice-table tr:hover .play-btn:not(:disabled), .play-btn.big {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}
.play-btn svg { width: 13px; height: 13px; margin-left: 2px; }
.play-btn:hover:not(:disabled), .practice-table tr:hover .play-btn:hover:not(:disabled) {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.play-btn:active:not(:disabled) { transform: scale(.94); }
.play-btn:disabled { opacity: .3; cursor: not-allowed; }
.play-btn.big { width: 34px; height: 34px; }
.play-btn.big svg { width: 15px; height: 15px; }
.practice-legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 11.5px; }
.practice-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.practice-legend i.ok { background: var(--ok); }
.practice-legend i.warn { background: var(--warn); }
.practice-legend i.miss { background: var(--live); }


/* The protocol flowchart on the run page (analysis.jsx): wide charts scroll
   inside their own box, and a node is a button for its evidence. */
.protocol-chart svg { max-width: none; }
.protocol-chart .node { cursor: pointer; }
/* The selected node keeps its verdict fill and gets the selection outline.
   `!important` because Mermaid writes its classDefs into the SVG as
   `#<render id> .ok>*` rules, which outrank any class selector of ours. */
.protocol-chart .node.selected > * { stroke: var(--sel) !important; stroke-width: 4px !important; }
.protocol-chart .node.selected { filter: drop-shadow(0 0 3px var(--sel)); }
/* The chart box: fixed height, the drawing pans and zooms inside it. */
.chart-viewport { position: relative; height: 70vh; min-height: 560px; overflow: hidden; border-top: 1px solid var(--line-soft); background: var(--panel-2); cursor: grab; user-select: none; }
.chart-viewport.dragging { cursor: grabbing; }
.chart-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: inline-block; }


/* --- the finished record on its own console (sheet.jsx) ---------------------
   The console's sheet at its own width, its judged boxes framed in their
   verdict's colour with a mark at the right edge — a tick, or the number of
   the note in the margin beside it. */
.badge.advice { color: var(--advice); border-color: color-mix(in oklch, var(--advice) 38%, var(--line)); background: color-mix(in oklch, var(--advice) 11%, transparent); }
.btn.on { border-color: color-mix(in oklch, var(--sel) 55%, var(--line)); color: var(--sel); background: color-mix(in oklch, var(--sel) 10%, transparent); }

.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px 0; }
.sheet-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-dim); }
.sheet-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sheet-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
/* The review's verdict colours (sheet.jsx): the same in both themes — they
   mark boxes on the mask, which keeps its light console face — and one
   source for the marks, the notes, the legend and the boxes' frames. The
   grounds stand in for the console's yellow under a judged box: a tint over
   that yellow would turn red into orange and green into lime. */
:root {
  --review-ok: #1f9d55; --review-partial: #ea7a0b; --review-advice: #c99a06; --review-missed: #d93025;
  --review-ok-ground: #d7f1df; --review-partial-ground: #ffdcbd; --review-advice-ground: #fff0b8;
  --review-missed-ground: #fbd3ce; --review-neutral: #f7f7f5; --review-selected: #1a73e8;
}
.sheet-legend i.s-ok { background: var(--review-ok); } .sheet-legend i.s-partial { background: var(--review-partial); }
.sheet-legend i.s-advice { background: var(--review-advice); } .sheet-legend i.s-missed { background: var(--review-missed); }
.sheet-legend i.s-none { background: var(--review-neutral); border: 1px solid #b9b9b4; }

.sheet-detail { padding: 10px 12px; border-radius: 8px; background: var(--panel); border: 1px solid color-mix(in oklch, var(--sel) 40%, var(--line)); font-size: 12.5px; line-height: 1.5; }
.sheet-detail-t { font-weight: 600; font-size: 13px; }
.sheet-detail-item { display: flex; gap: 9px; align-items: baseline; margin-top: 7px; }
.sheet-x { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; }
.sheet-x:hover { color: var(--text); }
.sheet-pill { flex: none; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px; color: #fff; background: var(--muted); white-space: nowrap; }
.sheet-pill.s-ok { background: var(--review-ok); } .sheet-pill.s-partial { background: var(--review-partial); }
.sheet-pill.s-advice { background: var(--review-advice); } .sheet-pill.s-missed { background: var(--review-missed); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.review-body { display: grid; grid-template-columns: var(--review-sheet-w) minmax(0, 1fr); gap: var(--review-gap); padding: 14px 16px 18px; align-items: start; }
.review-body.narrow { grid-template-columns: minmax(0, 1fr); }
.mask-review { position: relative; max-width: 100%; cursor: default; }
.review-body.narrow .mask-review { overflow-x: auto; }
.mask-review [data-uid] { transition: outline-color .12s, opacity .12s; }

.review-mark {
  position: absolute; z-index: 4; width: 14px; height: 14px; border-radius: 50%;
  display: grid; place-items: center; pointer-events: none;
  font: 700 9.5px/1 var(--sans); color: #fff; box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgb(0 0 0 / 0.35);
}
.review-mark.fixed { position: fixed; z-index: 1100; }
.review-mark.static { position: static; flex: none; box-shadow: none; width: 18px; height: 18px; font-size: 10.5px; }
.review-mark.s-ok { background: var(--review-ok); } .review-mark.s-partial { background: var(--review-partial); }
.review-mark.s-advice { background: var(--review-advice); } .review-mark.s-missed { background: var(--review-missed); }

.review-notes { position: relative; min-width: 0; }
.review-note {
  position: absolute; left: 0; right: 0; padding: 8px 11px 9px; cursor: pointer;
  border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 8px;
  background: var(--panel); box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.45;
  transition: top .18s ease, box-shadow .12s;
}
.review-body.narrow .review-note { position: static; margin-bottom: 8px; }
.review-note.s-partial { border-left-color: var(--review-partial); } .review-note.s-advice { border-left-color: var(--review-advice); }
.review-note.s-missed { border-left-color: var(--review-missed); }
.review-note:hover { border-color: color-mix(in oklch, var(--sel) 45%, var(--line)); }
.review-note.focus { box-shadow: 0 0 0 2px var(--sel), var(--shadow); }
.review-note-h { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.review-note-t { font-weight: 600; font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-note-h .sheet-pill { margin-left: auto; }
.review-note-item + .review-note-item { margin-top: 4px; }
.review-note-it { font-weight: 500; }
.review-allright { padding: 10px 12px; border-radius: 8px; border: 1px solid color-mix(in oklch, var(--review-ok) 40%, var(--line)); color: var(--review-ok); font-size: 13px; }

.review-pop { position: fixed; z-index: 1500; animation: sheet-in .14s ease-out; filter: drop-shadow(0 12px 28px rgb(0 0 0 / 0.35)); }


/* The control room's written procedure (procedure.jsx): questions as
   diamonds, "ja" to the right into the box of actions, "nein" down to the
   next question; the way the case goes drawn strong, the rest faded, each
   action of the box it reaches marked by its verdict. */
.proc { padding: 12px 16px 14px; --proc-q: 150px; --proc-a: 46px; --proc-h: 96px; --proc-h-small: 76px; }
.proc-intro { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; }
.proc-row, .proc-gap { display: grid; grid-template-columns: var(--proc-q) var(--proc-a) minmax(0, 1fr); }
.proc-row.dim, .proc-gap.dim { opacity: 0.45; }
.proc-row.passed .proc-box, .proc-row.passed .proc-yes { opacity: 0.45; }

/* The line through the questions, half above and half below each diamond;
   on the way of this case drawn strong. The last box has no question: the
   line bends into it. */
.proc-qcell { position: relative; min-height: var(--proc-h); }
.proc-qcell.small { min-height: var(--proc-h-small); }
.proc-qcell::before, .proc-qcell::after { content: ""; position: absolute; left: calc(50% - 0.75px);
  border-left: 1.5px solid var(--line); }
.proc-qcell::before { top: 0; bottom: 50%; }
.proc-qcell::after { top: 50%; bottom: 0; }
.proc-qcell.first::before, .proc-qcell.end::after { display: none; }
.proc-qcell.in::before, .proc-qcell.out::after { left: calc(50% - 1px); border-left: 2px solid var(--text-dim); }
.proc-qcell.elbow::after { display: block; top: calc(50% - 0.75px); bottom: auto; left: calc(50% - 0.75px); right: 0;
  border-left: 0; border-top: 1.5px solid var(--line); }
.proc-qcell.elbow.taken::after { top: calc(50% - 1px); border-top: 2px solid var(--text-dim); }

/* A question: the diamond, its tips on the line and on the "ja" arrow. */
.proc-diamond { position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: auto 0; height: var(--proc-h);
  z-index: 1; display: grid; place-items: center; }
.proc-diamond.small { height: var(--proc-h-small); }
.proc-diamond svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.proc-diamond polygon { fill: var(--panel-2); stroke: var(--line); stroke-width: 1.5; stroke-linejoin: round; }
.proc-diamond.path polygon { stroke: var(--text-dim); stroke-width: 2.5; }
.proc-diamond > span { position: relative; padding: 0 22%; text-align: center; font-size: 11.5px; line-height: 1.25;
  color: var(--text-dim); }
.proc-diamond.small > span { font-size: 11px; padding: 0 24%; }
.proc-diamond.path > span { color: var(--text); font-weight: 600; }

/* "ja": from the diamond's tip into the middle of its box. */
.proc-yes { position: relative; }
.proc-yes::before { content: ""; position: absolute; left: 0; right: 7px; top: calc(50% - 0.75px);
  border-top: 1.5px solid var(--line); }
.proc-yes::after { content: ""; position: absolute; right: 0; top: calc(50% - 4.5px);
  border: 4.5px solid transparent; border-left: 7px solid var(--line); border-right: 0; }
.proc-yes > span { position: absolute; left: 0; right: 7px; bottom: calc(50% + 3px); text-align: center;
  font-size: 11px; color: var(--muted); }
.proc-yes.path::before { top: calc(50% - 1px); border-top: 2px solid var(--text-dim); }
.proc-yes.path::after { border-left-color: var(--text-dim); }
.proc-yes.path > span { color: var(--text); font-weight: 600; }

.proc-box { align-self: center; margin: 7px 0; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px;
  background: var(--panel); }
.proc-box.taken { border: 2px solid var(--text-dim); }
.proc-box ul { margin: 0; padding: 0; list-style: none; }
.proc-action { display: flex; gap: 8px; align-items: baseline; padding: 3px 6px; border-radius: 6px;
  font-size: 12.5px; line-height: 1.4; }
.proc-action.link { cursor: pointer; }
.proc-action.link:hover { background: var(--panel-3); }
.proc-action.sel { outline: 2px solid var(--sel); outline-offset: -1px; }
.proc-mark { flex: none; width: 16px; height: 16px; border-radius: 50%; display: inline-grid;
  place-items: center; font-size: 10.5px; font-weight: 700; color: var(--muted); transform: translateY(2px); }
.proc-action.s-ok .proc-mark { background: color-mix(in oklch, var(--ok) 22%, transparent); color: var(--ok); }
.proc-action.s-partial .proc-mark { background: color-mix(in oklch, var(--partial) 22%, transparent); color: var(--partial); }
.proc-action.s-advice .proc-mark { background: color-mix(in oklch, var(--advice) 25%, transparent); color: var(--advice); }
.proc-action.s-missed .proc-mark { background: color-mix(in oklch, var(--live) 22%, transparent); color: var(--live); }
.proc-action.s-missed { color: var(--text); }
.proc-note { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--text-dim); }
.proc-note ul { margin: 3px 0 0 16px; list-style: disc; }

/* "nein": the line on to the next question — beside it the print's box of
   its own where it has one. */
.proc-gap { min-height: 30px; }
.proc-gap-line { position: relative; }
.proc-gap-line::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 0.75px);
  border-left: 1.5px solid var(--line); }
.proc-gap.path .proc-gap-line::before { left: calc(50% - 1px); border-left: 2px solid var(--text-dim); }
.proc-gap-line > span { position: absolute; left: calc(50% + 8px); top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--muted); }
.proc-gap.path .proc-gap-line > span { color: var(--text); font-weight: 600; }
.proc-aside { grid-column: 3; margin: 10px 0; padding: 8px 12px; border: 1.5px solid var(--text-dim); border-radius: 4px;
  font-size: 11.5px; line-height: 1.45; color: var(--text-dim); }
.proc-aside b { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.proc-aside ul { margin: 4px 0 0 16px; list-style: disc; }
.proc-source { font-size: 11px; line-height: 1.4; }
.proc-foot { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 12px; }
@media (max-width: 520px) {
  .proc { --proc-q: 118px; --proc-a: 32px; --proc-h: 84px; --proc-h-small: 66px; }
}

/* The head of a result (analysis.jsx): beside the title how good the run was
   in per cent, in the traffic light's colours; then one tile per thing
   judged — the call, the sheet, the handling — with its count and a thin bar. */
.result-percent { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.result-percent.ok { color: var(--ok); background: color-mix(in oklch, var(--ok) 14%, transparent); }
.result-percent.warn { color: var(--warn); background: color-mix(in oklch, var(--warn) 16%, transparent); }
.result-percent.miss { color: var(--live); background: color-mix(in oklch, var(--live) 13%, transparent); }
.result-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px;
  padding: 14px 16px 6px; }
.result-kpi { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2);
  padding: 10px 12px 8px; }
.result-kpi-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.result-kpi-value { margin-top: 4px; font-size: 13px; color: var(--text-dim); }
.result-kpi-value b { font-size: 24px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.result-kpi-value .of { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.result-kpi-bar { display: flex; height: 5px; margin-top: 8px; border-radius: 3px; overflow: hidden;
  background: var(--panel-3); }
.result-kpi-bar .ok { background: var(--ok); }
.result-kpi-bar .partial { background: var(--partial); }
.result-kpi-bar .advice { background: var(--advice); }
.result-kpi-bar .miss { background: var(--live); }
.result-kpi-rest { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
/* The pending analysis: a bar of the estimate and how long it still takes. */
.analysis-eta { max-width: 320px; }
.analysis-eta .result-kpi-bar { margin-top: 6px; }
/* Progress, not a verdict: the account's accent colour (user, 2026-10-21) —
   green is what the score bars use for "right". */
.analysis-eta .result-kpi-bar .eta { background: var(--accent); transition: width 1s linear; }
/* Right to left (the language registry's `dir`, set on <html> by the app).
   Margins, paddings, borders and offsets above are logical properties and
   follow by themselves; what remains is what points somewhere. */
:root { --dir-sign: 1; }
[dir="rtl"] { --dir-sign: -1; }
/* A closed group's chevron points along the reading direction, an open one
   down: mirrored, and turned the other way when it opens. */
[dir="rtl"] .chev svg { transform: scaleX(-1); }
[dir="rtl"] .open .chev { transform: rotate(-90deg); }
/* Codes, ids, numbers, times — and whatever someone types — take their
   direction from their own content: a phone number keeps reading left to
   right inside an Arabic page, an Arabic street name typed into a box reads
   right to left on an English one. */
.mono, input, textarea, select { unicode-bidi: plaintext; }
/* An empty box has no text to take its direction from, and `plaintext` then
   falls back to left to right: the caret would start on the left of an Arabic
   page. Until something is typed, a box follows the page. (React mirrors a
   controlled input's text into its value attribute, and a textarea's into its
   content, which is what these selectors read.) */
input[value=""], input:not([value]), textarea:empty { unicode-bidi: normal; }
/* A password shows only dots, which carry no direction either. */
input[type="password"] { unicode-bidi: normal; }
input[type="tel"], input[type="number"] { direction: ltr; }
/* Arabic letters join: spacing them apart breaks the words, and the script
   has no capitals — labels set in spaced small caps elsewhere stay plain. */
:lang(ar) * { letter-spacing: normal !important; text-transform: none !important; }
/* Code and the YAML of a case read left to right on every page. */
.code, pre { direction: ltr; text-align: left; unicode-bidi: isolate; }
/* Case data is written in the scenario set's language, which need not be
   the reader's: each paragraph takes its direction from its own text. */
.case-title, .case-sub, .detail-head h2, .detail-head .muted, .stat-cell .v {
  unicode-bidi: plaintext;
}
