/* AMD Call Console — neutral surfaces, hairline borders, generous spacing.
   Colour is spent only where it carries meaning: green for success, amber for
   warning, red for failure. Everything else is ink on a neutral plane. */

:root {
  color-scheme: light;

  --plane: #f7f7f7;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #fafafa;
  --surface-hover: #f4f4f4;
  --surface-active: #ededed;

  --ink: #0a0a0a;
  --ink-secondary: #525252;
  --ink-muted: #737373;
  --ink-inverse: #ffffff;

  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --grid: #ededed;
  --axis: #d4d4d4;

  /* Categorical series palette — eight fixed hue families. The order is the
     colour-blind-safety mechanism, not decoration: it is validated for adjacent
     pair separation (stacks, bars, lines) against this surface and never
     reordered. Slots bind to an entity's own label order, never to rank, so a
     filter that removes a category cannot repaint the survivors.
     Light: worst adjacent CVD ΔE 9.1, normal-vision ΔE 19.6 on #ffffff.
     Three slots sit below 3:1 here, which is why every chart ships direct
     labels or a table view. */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;

  --success: #0ca30c;
  --success-ink: #006300;
  --success-wash: #eaf6ea;
  --warning: #fab219;
  --warning-ink: #7a4f00;
  --warning-wash: #fdf4e3;
  --critical: #d03b3b;
  --critical-ink: #a01f1f;
  --critical-wash: #fbeceb;

  --focus: #0a0a0a;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --shell-width: 1320px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;

    --plane: #0a0a0a;
    --surface: #141414;
    --surface-raised: #191919;
    --surface-sunken: #101010;
    --surface-hover: #1f1f1f;
    --surface-active: #262626;

    --ink: #fafafa;
    --ink-secondary: #a3a3a3;
    --ink-muted: #8a8a8a;
    --ink-inverse: #0a0a0a;

    --border: #262626;
    --border-strong: #333333;
    --grid: #1f1f1f;
    --axis: #333333;

    /* Dark is selected, not flipped: the same eight families re-stepped for
       this surface. All eight clear 3:1 on #141414. */
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;

    --success: #0ca30c;
    --success-ink: #3ec73e;
    --success-wash: #0f2610;
    --warning: #fab219;
    --warning-ink: #f0b64a;
    --warning-wash: #2a2008;
    --critical: #d03b3b;
    --critical-ink: #f08a8a;
    --critical-wash: #2c1414;

    --focus: #fafafa;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --plane: #0a0a0a;
  --surface: #141414;
  --surface-raised: #191919;
  --surface-sunken: #101010;
  --surface-hover: #1f1f1f;
  --surface-active: #262626;

  --ink: #fafafa;
  --ink-secondary: #a3a3a3;
  --ink-muted: #8a8a8a;
  --ink-inverse: #0a0a0a;

  --border: #262626;
  --border-strong: #333333;
  --grid: #1f1f1f;
  --axis: #333333;

  /* Kept byte-identical to the media-query block above: the toggle must win
     over the OS preference in both directions. */
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;

  --success: #0ca30c;
  --success-ink: #3ec73e;
  --success-wash: #0f2610;
  --warning: #fab219;
  --warning-ink: #f0b64a;
  --warning-wash: #2a2008;
  --critical: #d03b3b;
  --critical-ink: #f08a8a;
  --critical-wash: #2c1414;

  --focus: #fafafa;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Several containers below set an explicit `display`, which would otherwise
   out-specify the user-agent rule for [hidden] and leak hidden panels. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.011em;
}

h1 {
  font-size: 15px;
}

h2 {
  font-size: 20px;
  letter-spacing: -0.018em;
}

h3 {
  font-size: 14px;
}

h4 {
  font-size: 13px;
  color: var(--ink-secondary);
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -60px;
  z-index: 20;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: top 120ms ease;
}

.skip-link:focus {
  top: var(--space-3);
}

/* --- app bar ------------------------------------------------------------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.appbar__inner {
  width: min(var(--shell-width), 100%);
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  flex: none;
}

.brand__mark svg {
  display: block;
}

.brand__text {
  min-width: 0;
}

.brand__sub {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar__spacer {
  flex: 1 1 auto;
}

.appbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* --- layout -------------------------------------------------------------- */

.shell {
  width: min(var(--shell-width), 100%);
  margin: 0 auto;
  padding: var(--space-5) var(--space-5) var(--space-7);
}

.stack {
  display: grid;
  gap: var(--space-5);
}

/* Grid and flex items default to `min-width: auto`, so a single wide child —
   a chart SVG holding a legible minimum width — grows its whole track and
   drags the page sideways, taking every sibling with it. Opting layout
   children out of that is what keeps the wide chart's own scrollbar local. */
.stack > *,
.split > *,
.grid > * {
  min-width: 0;
}

.stack--tight {
  gap: var(--space-3);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.section-head p {
  color: var(--ink-muted);
  font-size: 13px;
  max-width: 68ch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.card__title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#verifiedAccuracyTitle,
#detectionLatencyTitle,
#verdictMixTitle {
  cursor: help;
  width: fit-content;
}

/* Verified accuracy / Detection latency are full-width Overview cards; give
   the plot room so per-engine rows and small gaps are easy to compare. */
#chartVerifiedAccuracy,
#chartLatency {
  min-height: 22rem;
}

#chartVerifiedAccuracy .chart__plot,
#chartLatency .chart__plot {
  min-height: 18rem;
  width: 100%;
}

.card__hint {
  font-size: 12px;
  color: var(--ink-muted);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid--kpi {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

@media (max-width: 1000px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- controls ------------------------------------------------------------ */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 34px;
  padding: 0 var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-hover);
}

.btn:active:not(:disabled) {
  background: var(--surface-active);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--ink);
  color: var(--ink-inverse);
  border-color: var(--ink);
}

.btn--primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ink) 85%, var(--surface));
}

.btn--danger {
  color: var(--critical-ink);
  border-color: color-mix(in srgb, var(--critical) 40%, var(--border));
}

.btn--danger:hover:not(:disabled) {
  background: var(--critical-wash);
}

.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-secondary);
}

.btn--quiet:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--ink);
}

.btn--icon {
  width: 34px;
  padding: 0;
}

.btn--block {
  width: 100%;
}

.field {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.field > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.field__hint {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 400;
}

input[type="text"],
input[type="search"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-muted);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-sunken);
  color: var(--ink-muted);
  cursor: not-allowed;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--ink-secondary);
  cursor: pointer;
}

.checkbox input {
  margin: 3px 0 0;
  accent-color: var(--ink);
  width: 15px;
  height: 15px;
  flex: none;
}

.actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.actions--end {
  justify-content: flex-end;
}

/* --- manual S3 evaluation ---------------------------------------------- */

.manual-object-list,
.manual-job-list {
  display: grid;
  gap: var(--space-2);
}

.manual-object-list {
  max-height: 19rem;
  overflow: auto;
  padding: 1px;
}

.manual-object {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.manual-object:hover,
.manual-object[aria-selected="true"] {
  border-color: var(--border-strong);
  background: var(--surface-active);
}

.manual-object__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-object__meta {
  color: var(--ink-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.manual-jobs__head,
.manual-job__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.manual-jobs__head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.manual-batch-tools {
  display: grid;
  justify-items: end;
  gap: var(--space-2);
}

.manual-live-status {
  margin: 0;
  font-size: 12px;
  text-align: right;
}

.manual-batch-controls {
  gap: var(--space-2);
}

@media (max-width: 42rem) {
  .manual-jobs__head {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-batch-tools {
    justify-items: start;
  }

  .manual-live-status {
    text-align: left;
  }
}

.manual-job {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.manual-job:last-child {
  border-bottom: 0;
}

.manual-corpus-wrap {
  --manual-corpus-row-height: 45px;
  max-block-size: 32.5rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.manual-corpus-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: 13px;
}

.manual-corpus-table th,
.manual-corpus-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.manual-corpus-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
}

.manual-corpus-table tr[aria-current="true"] {
  background: var(--surface-active);
}

.manual-corpus-spacer td {
  padding: 0;
  border: 0;
}

.manual-corpus-table .manual-object {
  display: inline-flex;
  width: auto;
  min-width: 10rem;
  min-height: 28px;
  padding: 0 var(--space-2);
  vertical-align: middle;
}

.manual-corpus-table .manual-object__meta {
  display: inline-block;
  margin-inline-start: var(--space-2);
  vertical-align: middle;
}

@media (pointer: coarse) {
  .manual-corpus-wrap {
    --manual-corpus-row-height: 61px;
  }

  .manual-corpus-table .manual-object {
    min-height: 44px;
  }
}

.manual-transcript-list {
  display: grid;
  gap: var(--space-2);
  max-height: 16rem;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.manual-transcript-event {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.45;
}

.manual-transcript-event__time {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.manual-scoreboard {
  padding: var(--space-4) var(--space-5);
}

.manual-review-dialog {
  width: min(44rem, calc(100% - (var(--space-4) * 2)));
  max-width: none;
  max-height: min(46rem, calc(100dvh - (var(--space-4) * 2)));
  padding: 0;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px rgb(0 0 0 / 0.2);
  overflow: hidden;
}

.manual-review-dialog::backdrop {
  background: rgb(0 0 0 / 0.48);
}

.manual-review-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.manual-review-dialog__head,
.manual-review-dialog__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
}

.manual-review-dialog__head {
  border-bottom: 1px solid var(--border);
}

.manual-review-dialog__footer {
  align-items: center;
  border-top: 1px solid var(--border);
}

.manual-review-dialog__footer .btn:last-child {
  margin-left: auto;
}

.manual-review-dialog__body {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5);
}

.manual-review-dialog .manual-transcript-list {
  max-height: none;
}

/* --- tabs ---------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  min-height: 30px;
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

/* --- filter bar ---------------------------------------------------------- */

.filterbar--panel {
  margin-bottom: var(--space-4);
}

.filterbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: grid;
  gap: var(--space-3);
}

.filterbar__row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

/* Overview keeps the scope toggle, presets, date fields, and Apply action on
   one bottom-aligned control baseline. The Manila helper gets its own full
   row so it always starts at the same left edge as the controls. */
.filterbar__row--overview {
  display: grid;
  gap: var(--space-2);
  align-items: stretch;
}

.filterbar__controls {
  display: flex;
  gap: var(--space-3);
  align-items: end;
  flex-wrap: wrap;
}

.filterbar__row--overview .field--inline,
.filterbar__row--overview .filterbar__controls > .range,
.filterbar__row--overview .filterbar__controls > .btn {
  align-self: end;
}

.filterbar__row--overview #overviewDateHint {
  margin: 0;
}

.range {
  display: flex;
  gap: var(--space-1);
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}

.range button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 4px var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 26px;
}

.range button:hover {
  color: var(--ink);
}

.range button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 3px calc(var(--space-3) - 1px);
}

.search {
  position: relative;
  flex: 1 1 240px;
  min-width: 180px;
}

.search input {
  padding-left: 32px;
}

.search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.disclosure {
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}

.disclosure > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 26px;
}

.disclosure > summary::-webkit-details-marker {
  display: none;
}

.disclosure > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 140ms ease;
}

.disclosure[open] > summary::before {
  transform: rotate(45deg);
}

.disclosure__body {
  margin-top: var(--space-4);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

/* --- stat tiles ---------------------------------------------------------- */

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: grid;
  gap: var(--space-1);
  align-content: start;
}

.stat__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.stat__value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
}

.stat--hero .stat__value {
  font-size: 48px;
  letter-spacing: -0.03em;
}

.stat__meta {
  font-size: 12px;
  color: var(--ink-muted);
}

.stat__spark {
  margin-top: var(--space-2);
  height: 30px;
}

/* --- badges -------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.5;
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge--good {
  color: var(--success-ink);
  background: var(--success-wash);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
}

.badge--warn {
  color: var(--warning-ink);
  background: var(--warning-wash);
  border-color: color-mix(in srgb, var(--warning) 35%, transparent);
}

.badge--bad {
  color: var(--critical-ink);
  background: var(--critical-wash);
  border-color: color-mix(in srgb, var(--critical) 30%, transparent);
}

.badge--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- charts -------------------------------------------------------------- */

.chart {
  position: relative;
  min-width: 0;
}

.chart__plot {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  /* SVG widths follow the card, so Overview never introduces a horizontal
     scrollbar. The table view remains available for dense values. */
  overflow-x: hidden;
}

.chart__plot svg {
  display: block;
  overflow: visible;
}

.chart.is-stale .chart__plot {
  opacity: 0.45;
}

.chart__empty {
  display: grid;
  place-items: center;
  min-height: 140px;
  color: var(--ink-muted);
  font-size: 13px;
  text-align: center;
  padding: var(--space-5);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
  font-size: 12px;
  color: var(--ink-secondary);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.legend__swatch--line {
  height: 2px;
  width: 14px;
  border-radius: 2px;
}

.tooltip {
  position: absolute;
  z-index: 5;
  min-width: 132px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 12px;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.12);
  pointer-events: none;
  opacity: 0;
  transition: opacity 90ms ease;
}

.tooltip[data-visible="true"] {
  opacity: 1;
}

.tooltip__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.tooltip__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
  color: var(--ink-secondary);
}

.tooltip__key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tooltip__value {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.chart__tableview {
  margin-top: var(--space-3);
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}

.chart__tableview > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-muted);
  list-style: none;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}

.chart__tableview > summary::-webkit-details-marker {
  display: none;
}

.chart__tableview > summary:hover {
  color: var(--ink);
}

/* --- tables -------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

caption {
  text-align: left;
}

th,
td {
  text-align: left;
  padding: 8px var(--space-3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface-sunken);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table--compact th,
.table--compact td {
  padding: 6px var(--space-3);
}

.rows {
  max-height: 480px;
  overflow-y: auto;
}

tr.row {
  cursor: pointer;
}

tr.row:hover td {
  background: var(--surface-hover);
}

tr.row[aria-selected="true"] td {
  background: var(--surface-active);
}

tr.row:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.cell-strong {
  font-weight: 500;
  color: var(--ink);
}

.cell-muted {
  color: var(--ink-muted);
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

/* --- run detail ---------------------------------------------------------- */

.kv {
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  font-size: 13px;
}

.kv dt {
  color: var(--ink-muted);
}

.kv dd {
  margin: 0;
  word-break: break-word;
}

.compare {
  display: grid;
  grid-template-columns: minmax(120px, auto) repeat(3, minmax(0, 1fr));
  gap: 0;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.compare > * {
  padding: 7px var(--space-3);
  border-bottom: 1px solid var(--border);
  min-width: 0;
  word-break: break-word;
}

.compare > *:nth-child(4n + 1) {
  color: var(--ink-muted);
  background: var(--surface-sunken);
}

.compare__head {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted) !important;
  background: var(--surface-sunken);
}

.engine-result-grid,
.engine-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-2);
}

.engine-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 8rem;
}

.engine-result-grid > .engine-result,
.engine-result-list > .engine-result {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}

.engine-result__name {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
}

.engine-result__label {
  font-size: 12px;
  font-weight: 600;
}

.engine-result__meta {
  color: var(--ink-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

.engine-result--empty .engine-result__label {
  color: var(--ink-muted);
}

.transcript {
  margin: 0;
  padding: var(--space-3);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

audio {
  width: 100%;
  min-height: 40px;
}

.timeline {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

#recentList {
  max-height: 22rem;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.timeline li {
  display: grid;
  gap: 2px;
  padding-left: var(--space-4);
  position: relative;
  font-size: 13px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
}

.timeline__meta {
  font-size: 12px;
  color: var(--ink-muted);
}

.timeline__change {
  font-family: var(--mono);
  font-size: 12px;
}

.empty {
  color: var(--ink-muted);
  font-size: 13px;
  padding: var(--space-4) 0;
}

.danger-zone {
  border-color: color-mix(in srgb, var(--critical) 25%, var(--border));
}

/* --- messages ------------------------------------------------------------ */

.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  font-size: 13px;
  color: var(--ink-secondary);
}

.notice--error {
  color: var(--critical-ink);
  background: var(--critical-wash);
  border-color: color-mix(in srgb, var(--critical) 30%, transparent);
}

.notice--ok {
  color: var(--success-ink);
  background: var(--success-wash);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
}

.notice[hidden] {
  display: none;
}

.codeblock {
  margin: 0;
  padding: var(--space-3);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 280px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- sign in ------------------------------------------------------------- */

/* Session hint is stamped before first paint. Never show Sign in in that case,
 * even while #appCard still has the hidden attribute from the static HTML. */
html[data-signed-in] #loginCard {
  display: none !important;
}
html[data-signed-in] #appCard {
  display: grid !important;
}

.signin {
  /* dvh, not vh: a mobile browser's collapsing toolbar makes vh taller than the
     visible viewport, which pushes the sign-in button under the chrome. */
  min-height: 72dvh;
  display: grid;
  place-items: center;
  padding: var(--space-5);
}

.signin__card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: grid;
  gap: var(--space-4);
}

.signin__head {
  display: grid;
  gap: var(--space-2);
  justify-items: center;
  text-align: center;
}

.signin__head p {
  color: var(--ink-muted);
  font-size: 13px;
}

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 720px) {
  .shell {
    padding: var(--space-4) var(--space-3) var(--space-6);
  }

  .appbar__inner {
    padding: var(--space-3);
  }

  .card,
  .filterbar {
    padding: var(--space-4);
  }

  .stat__value {
    font-size: 24px;
  }

  .stat--hero .stat__value {
    font-size: 36px;
  }

  .compare {
    grid-template-columns: minmax(96px, auto) repeat(3, minmax(0, 1fr));
    font-size: 12px;
  }

  .brand__sub {
    display: none;
  }

  /* The history table is its own scroll region inside a page that also
     scrolls. A fixed 480px box strands it mid-viewport on a phone. */
  .rows {
    max-height: 60dvh;
  }
}

/* Phone widths. The 720px step above was the only breakpoint, so every
   multi-column grid stayed two-up at 380px and clipped. */
@media (max-width: 480px) {
  .grid--2,
  .grid--3,
  .grid--kpi,
  .disclosure__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .kv {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1) 0;
  }

  .kv dt {
    margin-top: var(--space-2);
  }

  .compare {
    grid-template-columns: minmax(72px, auto) minmax(0, 1fr) minmax(0, 1fr);
  }

  .stat--hero .stat__value {
    font-size: 30px;
  }

  .filterbar__row {
    gap: var(--space-2);
  }

  .range {
    width: 100%;
    justify-content: space-between;
  }

  .range button {
    flex: 1 1 0;
  }

  .search {
    flex-basis: 100%;
  }

  /* Two full-width actions beat two cramped ones sharing a line. */
  #applyFiltersBtn,
  #clearFiltersBtn {
    flex: 1 1 0;
  }

  .transcript,
  .codeblock {
    max-height: 200px;
  }
}

/* Touch input, at any width: the control sizes above are tuned for a cursor
   and land well under a comfortable touch target. */
@media (pointer: coarse) {
  .btn,
  .tab,
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="number"],
  input[type="datetime-local"],
  select,
  .disclosure > summary,
  .chart__tableview > summary {
    min-height: 44px;
  }

  .btn--icon {
    width: 44px;
  }

  .range button {
    min-height: 38px;
  }

  .checkbox input {
    width: 20px;
    height: 20px;
  }

  tr.row td {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

@media print {
  .appbar__actions,
  .filterbar,
  .tabs {
    display: none;
  }

  .card {
    break-inside: avoid;
  }
}

/* --- Brand comparison cards (Overview) ----------------------------------- */

.brand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: grid;
  gap: var(--space-2);
}

.brand-card__name {
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}

.brand-card__coverage {
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.brand-card__pct {
  font-size: 1.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.brand-card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-secondary);
}

.brand-card__row strong {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}

.brand-card__meta {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: var(--space-1);
}

.brand-card--compact {
  text-align: center;
  align-content: center;
}

.brand-card--demo {
  border-style: dashed;
  opacity: 0.92;
}

.brand-card__demo {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  vertical-align: middle;
}

/* --- Verify tab ------------------------------------------------------------
   One call at a time, judged with the hands on the keyboard. The layout puts
   the evidence above the buttons so a verdict is never given before the words
   have been read, and the two answers sit far enough apart that the wrong one
   is not a near-miss of the right one. */

.verify-one {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.verify-why {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-sunken);
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

/* The reveal. Held back until a verdict is saved, then left up until Next is
   pressed — it is the only place the engine verdicts are ever shown against the
   answer just given, so it is read, not glimpsed. */
.verify-flash {
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-sunken);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.verify-flash--hit {
  border-color: color-mix(in srgb, var(--series-1) 55%, var(--border-strong));
  color: var(--series-1);
}

.verify-flash--miss {
  border-color: color-mix(in srgb, var(--critical, #e34948) 55%, var(--border-strong));
  color: var(--critical, #e34948);
}

.verify-flash--none { color: var(--ink-muted); }

/* Every one of these sets a display, which beats the hidden attribute's UA
   `display: none`. Miss one and it is on screen the whole time — which is what
   the Next row did on first ship. */
.verify-flash[hidden],
.verify-verdicts[hidden],
.verify-actions[hidden] { display: none; }

.verify-verdicts {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.verify-verdict {
  background: var(--surface);
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.verify-verdict .who {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.verify-verdict .what {
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.verify-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.verify-said blockquote {
  margin: 0;
  padding: 0.9rem 1rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 60ch;
}

.verify-audio {
  width: 100%;
  max-width: 34rem;
}

.verify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.verify-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* The two real answers are colour-separated so a mis-click reads as wrong
   before it is read as text. */
.btn--person {
  border-color: color-mix(in srgb, var(--series-1) 45%, var(--border-strong));
  color: var(--series-1);
}
.btn--machine {
  border-color: color-mix(in srgb, var(--series-2) 45%, var(--border-strong));
  color: var(--series-2);
}
.btn--ghost { color: var(--ink-muted); }

.verify-actions kbd {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-sunken);
  color: var(--ink-muted);
}

.verify-board {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.verify-board .cell {
  background: var(--surface);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.verify-board .cell h4 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

.verify-board .big {
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.verify-board .sub {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.verify-board .danger { color: var(--critical, #e34948); }

/* --- Verify scoreboard: head-to-head comparison --------------------------- */

.score-compare { padding: 0.25rem 0 0.5rem; }

.score-compare__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  align-items: stretch;
}

/* Three engines: even columns, no "vs" separator — a three-way is a
   scoreboard, not a duel. */
.score-compare__grid--3 { grid-template-columns: repeat(3, 1fr); }
/* The renderer always stamps a --N class, so the base `1fr auto 1fr` (which
   expects a "vs" element between two sides) never applies on its own. */
.score-compare__grid--2 { grid-template-columns: repeat(2, 1fr); }
.score-compare__grid--1 { grid-template-columns: 1fr; }

@media (max-width: 52rem) {
  .score-compare__grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 36rem) {
  .score-compare__grid,
  .score-compare__grid--3 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .score-compare__vs { display: none; }
}

/* Quieter styling for non-leading engines in tie scenarios. */
.score-compare__side--baseline {
  background: transparent;
  border-style: dashed;
}

.score-compare__badge--quiet {
  color: var(--ink-muted);
}

.score-compare__side {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.score-compare__side--win {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #2563eb) 35%, transparent);
}

.score-compare__name {
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}

.score-compare__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent, #2563eb);
  margin-bottom: 0.15rem;
}

.score-compare__fraction {
  font-size: 1.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.score-compare__pct {
  font-size: 1.1rem;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.score-compare__meta {
  font-size: 0.84rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.score-compare__vs {
  align-self: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-compare__tie {
  text-align: center;
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
}

.score-details {
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.score-details > summary {
  cursor: pointer;
  color: var(--ink-secondary);
  user-select: none;
  padding: 0.35rem 0;
}

.score-details[open] > summary {
  margin-bottom: 0.75rem;
}

.verify-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}

.field--inline {
  min-width: 9rem;
}

.field--inline span {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.btn--compact {
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
}

.cell-actions {
  white-space: nowrap;
  text-align: right;
}

#verifyCallsList tr.row--fresh {
  background: color-mix(in srgb, var(--accent, #2563eb) 8%, var(--surface));
}

/* --- Benchmark tab ---------------------------------------------------------
   Built to be read by someone deciding whether to trust the thing, so the
   caveats sit with the numbers rather than in a footnote, and the per-call
   breakdown is given as much room as the headline scores. */

.bench-caveats {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  max-width: 60ch;
}
.bench-caveats li::marker { color: var(--ink-muted); }

.bench-note { font-size: 0.85rem; margin-top: 0.9rem; max-width: 62ch; }

.bench-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 34rem; }
.bench-table th, .bench-table td {
  text-align: left;
  padding: 0.55rem 0.9rem 0.55rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.bench-table th {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.bench-table td.claim { color: var(--ink-secondary); }
.bench-table tr.ours td { font-weight: 600; }

/* The pipeline is numbered because it genuinely is a sequence — each stage
   consumes what the one above it produced. */
.pipeline {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stage;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.pipeline li {
  counter-increment: stage;
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: 0.9rem;
  padding: 0.75rem 0.9rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pipeline li::before {
  content: counter(stage);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--ink-muted);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
}
.pipeline .stage-name { font-weight: 600; font-size: 0.95rem; }
.pipeline .stage-detail { font-size: 0.9rem; color: var(--ink-secondary); }
.pipeline .stage-why { font-size: 0.86rem; color: var(--ink-muted); margin-top: 0.2rem; }

.bench-input {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  padding: 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-sunken);
  color: var(--ink);
  resize: vertical;
  margin-bottom: 0.9rem;
}

.bench-explain { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.bench-verdict { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.bench-verdict .big { font-size: 1.5rem; font-weight: 600; }
.bench-verdict .machine { color: var(--series-2); }
.bench-verdict .person { color: var(--series-1); }

.contrib { display: grid; gap: 1.25rem; }
@media (min-width: 44rem) { .contrib { grid-template-columns: 1fr 1fr; } }
.contrib h4 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.contrib .machine h4 { color: var(--series-2); }
.contrib .person h4 { color: var(--series-1); }
.contrib .row {
  display: grid;
  grid-template-columns: 10rem 1fr 3.2rem;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.86rem;
  margin-bottom: 0.3rem;
}
.contrib .clue {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contrib .bar { height: 0.5rem; border-radius: 1px; }
.contrib .machine .bar { background: var(--series-2); }
.contrib .person .bar { background: var(--series-1); }
.contrib .val {
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

/* --- Scorecard tab ---------------------------------------------------------
   A list of eight rows, not a grid of tiles. The axes are read top to bottom
   in a fixed order and half of them have no number at all, so a card layout
   would spend its emphasis on whichever ones happen to be populated. Colour is
   spent only on the verdict chip, because the verdict is the finding. */

.score-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}
.score-tally { display: inline-flex; align-items: baseline; gap: 0.4rem; }
.score-tally__n { font-variant-numeric: tabular-nums; font-weight: 600; }

.verdict {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-sunken);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
}
/* Ear-verified evidence is the only kind that earns colour. Proxy stays neutral
   so it can never be mistaken for a measurement, and unmeasured is drawn plainly
   rather than as a warning — it is the honest state, not a fault. */
.verdict--gold { border-color: var(--success); color: var(--success-ink); background: var(--success-wash); }
.verdict--verified { border-color: var(--success); color: var(--success-ink); background: var(--success-wash); }
.verdict--proxy { border-color: var(--warning); color: var(--warning-ink); background: var(--warning-wash); }
.verdict--unmeasured { border-style: dashed; color: var(--ink-muted); }

.score-axes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.score-axis {
  background: var(--surface);
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.score-axis__head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.score-axis__head h4 { margin: 0; font-size: 1rem; font-weight: 600; }
.score-axis__value {
  margin-left: auto;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.score-axis__value--none { font-size: 0.85rem; color: var(--ink-muted); }

.score-axis__position { margin: 0; font-size: 0.92rem; max-width: 78ch; }
.score-axis__basis {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.score-axis__caveat {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-secondary);
  max-width: 78ch;
}

/* Secondary readings are indented behind a rule because the indent is the
   claim: they belong to this axis but not to its denominator. */
.score-also {
  margin: 0.55rem 0 0;
  padding: 0 0 0 0.85rem;
  list-style: none;
  border-left: 2px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.score-also li { display: grid; gap: 0.1rem; }
.score-also__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.9rem;
}
.score-also__label { font-size: 0.85rem; }
.score-also__meta {
  font-size: 0.76rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.score-also__note { font-size: 0.82rem; color: var(--ink-secondary); max-width: 74ch; }

@media (max-width: 40rem) {
  .score-axis__value { margin-left: 0; }
}
