:root {
  --train-ink: #1d4ed8;
  --test-ink: #15803d;
  --c0: #0a66ff;
  --c0-ink: #0047b8;
  --c0-pale: #d3e3ff;
  --c0-strong: #9cc0ff;
  --c0-est: #ebf2ff;
  --c1: #ff6b00;
  --c1-ink: #b84a00;
  --c1-pale: #ffdcc2;
  --c1-strong: #ffb37d;
  --c1-est: #fff0e5;
  --ink: #1c2230;
  --muted: #5d6677;
  --bg: #f4f5f8;
  --card: #fff;
  --line: #e3e6ec;
  --yes-pale: #f0fdf4;
  /* The ROC curve's own color, the area under it and its label: neither
     class. */
  --roc: #6d28d9;
  --roc-dot: #8b5cf6;
  --roc-pale: #ede9fe;
  /* A hovered metric's numerator and the rest of its denominator. */
  --hl-num: #9aa1ad;
  --hl-out: #f1f2f4;
  --hl-edge: #c9cdd4;
  --no-ink: #b91c1c;
  --no-pale: #fef2f2;
  --radius: 14px;
}
* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

header, main, footer {
  max-width: 1360px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
header { padding-top: 28px; padding-bottom: 6px; }
h1 { font-size: 2rem; margin: 0 0 2px; letter-spacing: -0.015em; }
.sub { color: var(--muted); margin: 0; font-size: 1.05rem; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}
.check.popular {
  margin-left: auto;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
}
.tab {
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 18px;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04),
    0 6px 20px rgba(16, 24, 40, .05);
}
.side { display: flex; flex-direction: column; gap: 14px; }
.side .card { padding: 16px 18px; }
.card h2 { font-size: 1.12rem; margin: 0 0 8px; }
.card h3 {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 12px 0 6px;
}
.side .readout h3 { margin-top: 0; }
.card h3 i { text-transform: none; letter-spacing: 0; font-size: 1.1em; }
.card p { margin: 0 0 10px; }
.implies { margin: 0 .45em; color: var(--muted); }
.frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  line-height: 1.25;
}
.frac > span:first-child {
  border-bottom: 1.3px solid currentColor;
  padding: 0 .25em 1px;
}
.frac > span:last-child { padding-top: 1px; }
ul.try { margin: 0 0 10px; padding-left: 1.1em; }
ul.try li { margin: 3px 0; }
.answer { margin: 4px 0 2px; }
.answer summary {
  cursor: pointer;
  color: var(--train-ink);
  font-weight: 600;
  width: max-content;
}
.answer[open] {
  background: #f6f7fa;
  border-radius: 8px;
  padding: 4px 10px 6px;
}
.readout { font-variant-numeric: tabular-nums; }
.readout .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.readout .row:last-child { border-bottom: 0; }
.readout .val { font-weight: 600; white-space: nowrap; }
.muted { color: var(--muted); font-size: .88em; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
button:not(.tab) {
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfd4dd;
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
}
button:not(.tab):hover { background: #f3f4f7; }
button:not(.tab):active { background: #e9ebf0; }
footer {
  padding-top: 4px;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: .9rem;
}
footer a { color: inherit; }
.warn {
  color: #9a3412;
  background: #fff7ed;
  border-radius: 8px;
  padding: 6px 9px;
  margin: 6px 0;
  font-size: .92rem;
}

.intro {
  max-width: 1312px;
  margin: 12px auto 0;
  padding: 16px 20px 6px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 8px 32px;
}
.intro .card h3, .intro h3 { margin-top: 2px; }
.goal {
  background: #f3f6ff;
  border-left: 3px solid var(--train-ink);
  border-radius: 0 8px 8px 0;
  padding: 7px 11px;
}
.goal.approach { background: #f0fdf4; border-left-color: var(--test-ink); }
.notation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 10px;
}
.notation .labels { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.notation .labels > span {
  font-weight: 650;
  background: #f1f3f7;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 10px;
}
.notation i { font-family: "STIX Two Text", Georgia, serif; }

main { padding-top: 14px; padding-bottom: 24px; }
.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}
[hidden] { display: none !important; }
.panel > * { min-width: 0; }

.stage { padding: 12px 14px 8px; }
/* The box and Every metric share a row, so they stretch to one height;
   both views fill the same flexible area, so toggling keeps it. */
.table-panel {
  grid-template-areas: "stage side";
  align-items: stretch;
}
.table-panel > .stage {
  grid-area: stage;
  display: flex;
  flex-direction: column;
}
.table-panel > .side { grid-area: side; position: relative; }
/* The box alone sets the row's height: the metric list fills it and
   scrolls when every metric is shown. */
.table-panel > .side > .card {
  position: absolute;
  inset: 0;
  overflow-y: auto;
}
.view {
  flex: 1;
  min-height: 360px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.view #mosaic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stage-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.stage-controls .seg:not(.wrap) button { padding: 3px 14px !important; }
.stage-controls #presets { margin-left: auto; }
.stage svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
}
.stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  font-size: .92rem;
  margin-bottom: 4px;
}
.hint { margin: 4px 2px 0; color: var(--muted); font-size: .86rem; }

/* ------------------------------------------------------------ controls */
.controls { display: flex; flex-direction: column; gap: 10px; }
.slider, .field {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 2px 10px;
  margin: 0;
}
.slider input { accent-color: var(--ink); margin: 0; }
/* Own line under the slider, so its changing width cannot resize it. */
.slider .val {
  grid-column: 2;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: .92rem;
}
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--ink); margin: 0; }
.controls .buttons { margin: 0; }
.controls .buttons button { flex: 1; }
.seg {
  display: flex;
  border: 1px solid #cfd4dd;
  border-radius: 8px;
  overflow: hidden;
}
.seg.wrap { flex-wrap: wrap; border: 0; gap: 6px; overflow: visible; }
.seg button {
  flex: 1;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 5px 8px !important;
}
.seg.wrap button {
  flex: 0 1 auto;
  border: 1px solid #cfd4dd !important;
  border-radius: 999px !important;
  padding: 3px 11px !important;
}
.seg:not(.wrap) button + button { border-left: 1px solid #cfd4dd !important; }
.seg button[aria-checked="true"] {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: #fff;
}


/* ------------------------------------------------------- cells, chips */
.chip {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: .82em;
  line-height: 1.35;
  padding: 0 4px;
  border-radius: 5px;
  border: 2px solid transparent;
  color: var(--ink);
}
/* Cells: fill = true class (row), border = estimated class (column). */
.chip.tn, .chip.fp, .cm-cell.tn, .cm-cell.fp { background: var(--c0-pale); }
.chip.fn, .chip.tp, .cm-cell.fn, .cm-cell.tp { background: var(--c1-pale); }
.chip.tn, .chip.fn { border-color: var(--c0); }
.chip.fp, .chip.tp { border-color: var(--c1); }
.chip.all { background: #eceef3; }

.cell.tn, .cell.fp { fill: var(--c0-pale); }
.cell.fn, .cell.tp { fill: var(--c1-pale); }
.cell.tn.num, .cell.fp.num { fill: var(--c0-strong); }
.cell.fn.num, .cell.tp.num { fill: var(--c1-strong); }
.cell.tn, .cell.fn { stroke: var(--c0); }
.cell.fp, .cell.tp { stroke: var(--c1); }
.cell.sliver { stroke: none; }
.cell.sliver.tn, .cell.sliver.fn { fill: var(--c0); }
.cell.sliver.fp, .cell.sliver.tp { fill: var(--c1); }
.chip-bg { stroke-width: 2; }
.chip-bg.t0 { fill: var(--c0-pale); }
.chip-bg.t1 { fill: var(--c1-pale); }
.chip-bg.e0 { stroke: var(--c0); }
.chip-bg.e1 { stroke: var(--c1); }
.cell.dim, .cell-name.dim, .cell-count.dim { opacity: .3; }
/* A metric's highlight is all grey: numerator filled, the denominator
   framed in ink (.den-frame), no class colors while it shows. */
.cell.grey { stroke: none; fill: #fff; }
.cell.grey.num { fill: var(--hl-num); }
.cell.grey.dim { fill: var(--hl-out); opacity: 1; }
#mosaic .rl-box.plain { fill: var(--hl-out); }
#mosaic .cl-box.plain { stroke: var(--hl-edge); }
.cell.sliver.grey { fill: var(--hl-edge); }
.cell.sliver.grey.num { fill: var(--hl-num); }
.den-frame {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
  pointer-events: none;
}
.cell-name {
  font-weight: 750;
  font-size: 15px;
  text-anchor: middle;
  pointer-events: none;
}
.cell-name { fill: var(--ink); }
.cell-count {
  fill: var(--ink);
  font-size: 14px;
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ------------------------------------------------------ the metrics tab */
table.cm {
  border-collapse: separate;
  border-spacing: 8px;
  margin: 0 auto 6px;
  font-variant-numeric: tabular-nums;
}
table.cm th {
  font-size: .85rem;
  font-weight: 650;
  color: var(--muted);
  padding: 2px 8px;
  text-align: center;
  line-height: 1.25;
}
table.cm tbody th { text-align: right; }
/* Row headers shaded like their row, column headers bordered like their
   column: the key to fill = truth, border = estimate. */
table.cm th.rl, table.cm th.cl { color: var(--ink); border-radius: 8px; }
table.cm th.rl { text-align: center; white-space: nowrap; }
table.cm th.rl.t0 { background: var(--c0-pale); }
table.cm th.rl.t1 { background: var(--c1-pale); }
table.cm th.cl { border: 3px solid; background: #fff; }
table.cm th.cl.e0 { border-color: var(--c0); }
table.cm th.cl.e1 { border-color: var(--c1); }
table.cm .noun {
  display: block;
  font-weight: 500;
  font-size: .8rem;
}
table.cm td {
  text-align: center;
  border-radius: 8px;
  padding: 6px 10px;
}
table.cm td.cm-cell { border: 3.5px solid; color: var(--ink); }
table.cm td.cm-cell.tn, table.cm td.cm-cell.fn { border-color: var(--c0); }
table.cm td.cm-cell.fp, table.cm td.cm-cell.tp { border-color: var(--c1); }
table.cm td.cm-cell.dim { opacity: .35; }
table.cm td.cm-cell.num.tn, table.cm td.cm-cell.num.fp {
  background: var(--c0-strong);
}
table.cm td.cm-cell.num.fn, table.cm td.cm-cell.num.tp {
  background: var(--c1-strong);
}
table.cm td.cm-cell.grey { border-color: transparent; background: #fff; }
table.cm td.cm-cell.grey.num { background: var(--hl-num); }
table.cm td.cm-cell.grey.dim { background: var(--hl-out); opacity: .55; }
#cm-table.plain th.rl { background: var(--hl-out); }
#cm-table.plain th.cl { border-color: var(--hl-edge); }
#cm-table { position: relative; }
#cm-table .den-frame {
  position: absolute;
  border: 3px solid var(--ink);
  border-radius: 12px;
}
table.cm td.cm-cell label {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 750;
}
/* The count reads as plain text; an underline on hover marks it
   editable. */
table.cm input {
  width: 4.2em;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  padding: 0 2px;
  border: 0;
  border-bottom: 1.5px dashed transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
}
table.cm input::-webkit-inner-spin-button,
table.cm input::-webkit-outer-spin-button { -webkit-appearance: none; }
table.cm input:hover { border-bottom-color: var(--ink); }
table.cm input:focus {
  outline: none;
  border-bottom: 2px solid var(--ink);
}
table.cm .prop { display: block; font-size: .78rem; color: var(--muted); }
table.cm td.tot, table.cm tr.tot td {
  color: var(--muted);
  font-weight: 600;
}
table.cm.mini { border-spacing: 3px; margin: 0; }
table.cm.mini td { padding: 3px 8px; font-weight: 600; }

#mosaic .cell-name { font-size: 25px; }
#mosaic .cell-count { font-size: 22px; }
#mosaic .rl-head { font-size: 22px; }
#mosaic .rl-noun { font-size: 19px; }
#mosaic .rl-count { font-size: 18px; }
#mosaic .axis-label { font-size: 19px; }
#mosaic .handle { cursor: grab; }
#mosaic .handle.row { cursor: ns-resize; }
#mosaic .handle.col { cursor: ew-resize; }
.h-line { stroke: var(--ink); stroke-width: 2.2; }
.h-hit { stroke: transparent; stroke-width: 16; }
.h-grip { fill: #fff; stroke: var(--ink); stroke-width: 2.2; }
.handle:hover .h-grip { fill: var(--ink); }
.row-label, .col-label { text-anchor: middle; }
.rl-head { fill: var(--ink); font-weight: 750; font-size: 15px; }
/* Row labels shaded like their row's fill, column labels bordered like
   their column's cells: the key to fill = truth, border = estimate. */
.rl-box.t0 { fill: var(--c0-pale); }
.rl-box.t1 { fill: var(--c1-pale); }
.cl-box { fill: #fff; stroke-width: 3.5; }
#mosaic .cl-box { stroke-width: 5.5; }
.cl-box.e0 { stroke: var(--c0); }
.cl-box.e1 { stroke: var(--c1); }
.rl-noun { fill: var(--ink); font-size: 13.5px; }
.rl-count { fill: var(--muted); font-size: 13px; }

button:disabled { opacity: .4; cursor: default; }

.mlist h4 {
  margin: 10px 0 2px;
  font-size: .8rem;
  color: var(--muted);
  font-weight: 650;
}
.mlist h4:first-child { margin-top: 0; }
.mrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 56px;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.mrow.cheat { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.mrow:hover, .mrow.on { background: #eef1f6; }
.mrow.on { box-shadow: inset 3px 0 0 var(--ink); }
.mrow.in-num { background: #fef3c7; }
.mrow.in-den { background: #fffbeb; }
.mname { font-weight: 650; line-height: 1.2; }
.aka {
  display: block;
  font-weight: 400;
  font-size: .78rem;
  color: var(--muted);
}
.mdef { font-size: .85rem; }
.mrow .val { text-align: right; font-weight: 650; }

/* ---------------------------------------------------------- ROC tab */
.key { display: inline-flex; align-items: center; gap: 6px; }
.key i { font-family: "STIX Two Text", Georgia, serif; }
.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.c0 { background: var(--c0); }
.dot.c1 { background: var(--c1); }
/* Legend dots on the ROC strip: fill = truth, border = prediction. */
.dot.t0, .dot.t1, .dot.e0, .dot.e1 { width: 14px; height: 14px; }
.dot.t0 { background: var(--c0-strong); }
.dot.t1 { background: var(--c1-strong); }
.dot.e0, .dot.e1 { background: #fff; border: 3px solid; }
.dot.e0 { border-color: var(--c0); }
.dot.e1 { border-color: var(--c1); }
#strip { cursor: ew-resize; }
.est-label { font-weight: 700; font-size: 14px; }
.est-label { fill: var(--ink); }
.band-floor { stroke: #c5cad4; stroke-width: 1.2; }
.band-label { font-weight: 750; font-size: 15px; }
.band-label { fill: var(--ink); }
.sd.t0 { fill: var(--c0-strong); }
.sd.t1 { fill: var(--c1-strong); }
.sd.e0 { stroke: var(--c0); }
.sd.e1 { stroke: var(--c1); }
.thr-line { stroke: var(--ink); stroke-width: 2.4; }
.thr-grip { fill: var(--ink); }
.thr-label { font-weight: 700; font-size: 15px; fill: var(--ink); }

/* ROC plot with the confusion matrix at the threshold beside it. */
.curves {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 28px;
  margin-top: 6px;
}
.curves #rocplot { flex: 1 1 340px; max-width: 520px; }
.r-cm h3 { margin: 0 0 4px; }
#r-readout h3:first-child { margin-top: 0; }
.curves svg { max-height: calc(100vh - 200px); cursor: crosshair; }
.grid { stroke: #edf0f4; stroke-width: 1; }
.frame { fill: none; stroke: #a3abb9; stroke-width: 1.2; }
.tick { fill: #8a93a3; font-size: 13px; }
.axis-label { fill: var(--muted); font-size: 15px; }
.chance { stroke: #a3abb9; stroke-width: 1.4; stroke-dasharray: 5 5; }
.chance-label { fill: #8a93a3; font-size: 12.5px; }
.auc-fill { fill: var(--roc-pale); }
.curve-all { fill: none; stroke: #9aa3b2; stroke-width: 1.6; }
.curve-traced {
  fill: none;
  stroke: var(--roc);
  stroke-width: 3;
  stroke-linejoin: round;
}
.cur { fill: var(--roc-dot); stroke: #fff; stroke-width: 2.5; }
.auc-label { font-weight: 700; font-size: 15px; fill: var(--roc); }
#rocplot [data-explain] {
  cursor: help;
  text-decoration: underline dotted #a3abb9;
}
.r-cm table.cm.mini { margin: 0; }

/* --------------------------------------------------------- game tab */
.game h2 { margin: 4px 0 6px; font-size: 1.3rem; }
.game .goal { margin-bottom: 8px; }
.wyr { font-weight: 700; font-size: 1.1rem; margin: 12px 0 8px; }
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.option { padding: 14px 16px; display: flex; flex-direction: column; }
.option h3 { margin-top: 0; }
.option.win { box-shadow: 0 0 0 3px var(--test-ink); }
.option.lose { opacity: .85; }
.option.picked h3::after { content: " · your pick"; color: var(--ink); }
.clue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.cname { font-weight: 650; }
.cval {
  font-weight: 800;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.clue .cname, .mrow .mname, .readout .row[data-explain] > span:first-child {
  text-decoration: underline dotted #a3abb9;
  text-underline-offset: 3px;
}
[data-explain], [data-cell] { cursor: help; }
.mrow[data-explain]:not(.cheat):not(.static) { cursor: pointer; }

#tip {
  position: fixed;
  z-index: 50;
  max-width: 300px;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: .9rem;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(16, 24, 40, .25);
}
button.choose {
  margin-top: auto;
  align-self: stretch;
  font-size: 1.05rem !important;
  padding: 9px 12px !important;
}
.option .clue:last-of-type { margin-bottom: 12px; }
.reveal { margin-top: 8px; }
.mini-mosaic { width: 100%; max-width: 260px; display: block; margin: 0 auto; }
.mini-mosaic .cell-name { font-size: 14px; }
.goalval { font-weight: 700; margin: 4px 0 0; }
.verdict p { margin: 12px 0 0; }
.verdict .yes, .verdict .no {
  font-weight: 650;
  border-radius: 10px;
  padding: 10px 12px;
}
.verdict .yes { background: var(--yes-pale); color: var(--test-ink); }
.verdict .no { background: var(--no-pale); color: var(--no-ink); }
.verdict .buttons { margin-top: 10px; }
.ok { color: var(--test-ink); }
.bad { color: var(--no-ink); }

.g-kinds { max-width: 560px; margin: 2px 0 14px; }
.reveal p { margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.reveal .mini-mosaic { margin-top: 8px; }

/* Which number?: questions left, metrics right, lines drawn between them
   in an SVG laid over the gap. */
.match {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(32px, .35fr)
    minmax(0, 1fr);
  margin: 4px 0 12px;
}
.m-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 10px;
}
.m-col.m-ms { grid-column: 3; }
.m-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
button.m-item {
  position: relative;
  text-align: left;
  font-weight: 500;
  line-height: 1.35;
  padding: 8px 14px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
button.m-item.m { font-weight: 650; }
button.m-item.sel { box-shadow: 0 0 0 2px var(--ink); }
.match.done button.m-item { cursor: default; }
.match.done button.m-item:hover { background: #fff; }
button.m-item.ok { border-color: var(--test-ink); }
button.m-item.bad { border-color: var(--no-ink); }
.m-text { display: block; }
.m-why { display: block; font-size: .86rem; }
.m-why:not(:empty) { margin-top: 4px; }
.m-item.ok .m-why { color: var(--test-ink); }
.m-item.bad .m-why { color: var(--no-ink); }
.m-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ink);
}
.m-item.q .m-dot { right: -8px; }
.m-item.m .m-dot { left: -8px; }
.m-item.linked .m-dot { background: var(--ink); }
.m-line { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.m-line.rubber { stroke-dasharray: 6 5; }
.m-end { fill: var(--ink); }
.m-line.yes { stroke: var(--test-ink); }
.m-line.no { stroke: var(--no-ink); }
.m-end.yes { fill: var(--test-ink); }
.m-end.no { fill: var(--no-ink); }
.m-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  pointer-events: stroke;
  cursor: pointer;
}

/* New prior: one row per metric, an up / same / down choice each. */
.s-rows { margin: 4px 0 10px; }
.s-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 16em);
  align-items: center;
  gap: 4px 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.s-row .seg button:disabled { opacity: 1; cursor: default; }
.s-row .mname {
  text-decoration: underline dotted #a3abb9;
  text-underline-offset: 3px;
}
.s-out {
  grid-column: 1 / -1;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.card p.s-out { margin: 0; }
.s-mosaics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.s-mosaics figure { margin: 0; }
.s-mosaics figcaption {
  text-align: center;
  font-size: .88rem;
  color: var(--muted);
}

.defs { position: absolute; }

@media (max-width: 1360px) {
  .intro { margin-left: 24px; margin-right: 24px; }
}
@media (max-width: 1000px) {
  .panel, .intro { grid-template-columns: 1fr; }
  .table-panel { grid-template-areas: "stage" "side"; }
  .table-panel > .side > .card { position: static; }
}
@media (max-width: 640px) {
  .options { grid-template-columns: 1fr; }
  table.cm input { width: 3.6em; }
  table.cm td { padding: 4px 5px; }
}
@media (max-width: 520px) {
  header, main, footer { padding-left: 16px; padding-right: 16px; }
  .match { grid-template-columns: minmax(0, 2fr) 28px minmax(0, 1fr); }
  button.m-item { font-size: .85rem; padding: 6px 10px; }
  .s-row { grid-template-columns: minmax(0, 1fr) minmax(0, 13em); }
  .stage { padding: 8px; }
  .intro { margin-left: 16px; margin-right: 16px; }
}
