:root {
  /* night chart ground and plates */
  --night: #0b1a2e;
  --rail: #0c1c31;
  --plate: #10233d;
  --plate-2: #162e4e;
  --control: #14294a;
  --control-line: #2c4a6e;
  --line: #24405f;
  --grid: #1a3050;
  --axis: #2f4f77;
  /* inks */
  --ink: #e8ecf2;
  --muted: #9aaecb;
  --faint: #7d93b0;
  --accent: #f0b24a;       /* owns every active state */
  --accent-ink: #1a1405;
  --ring: #ff6a5e;         /* the object under the eye, and NOK */
  --ok: #86d6a3;
  --nebula: #86aee0;       /* secondary series: mean line, Rk line, overlays */
  --fog: #5b7799;          /* out-of-evaluation profile */

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

  --bar: #0d1f36;
  --row-hover: #10223b;
  --table-hover: #132a49;
  --drop-over: #172f52;
  --control-hover: #183259;
  --control-hover-line: #46699a;
  --pressed: #1d3558;
  --warn-bg: #1a2238;
  --accent-hover: #f6c06a;
  --ok-line: rgba(134, 214, 163, .45);
  --ring-line: rgba(255, 106, 94, .55);
  --selection: rgba(240, 178, 74, .32);
  --backdrop: rgba(4, 10, 20, .35);
  /* chart fills: sampling-length bands, tolerance band */
  --band: rgba(232, 236, 242, .035);
  --band-alt: rgba(232, 236, 242, .07);
  --ok-band: rgba(127, 207, 155, .09);

  --r: 3px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  color-scheme: dark;
}

/* light theme: same roles, daylight inks; amber darkened so it still reads as text on white */
:root[data-theme="light"] {
  --night: #f2f4f7;
  --rail: #f7f8fa;
  --bar: #ffffff;
  --plate: #ffffff;
  --plate-2: #eef3fa;
  --control: #ffffff;
  --control-line: #c3cddb;
  --line: #d6dde7;
  --grid: #e8ecf2;
  --axis: #a9b6c7;
  --ink: #16202e;
  --muted: #4f5f74;
  --faint: #66768b;
  --accent: #a35f00;
  --accent-ink: #ffffff;
  --accent-hover: #8a5000;
  --ring: #d0281b;
  --ok: #1d7a46;
  --nebula: #2456c7;
  --fog: #a3b0c0;
  --row-hover: #f2f5f9;
  --table-hover: #f4f7fb;
  --drop-over: #fbf3e4;
  --control-hover: #f4f6f9;
  --control-hover-line: #8b9cb3;
  --pressed: #fbf1df;
  --warn-bg: #fdf1ef;
  --ok-line: rgba(29, 122, 70, .45);
  --ring-line: rgba(208, 40, 27, .5);
  --selection: rgba(163, 95, 0, .2);
  --backdrop: rgba(22, 32, 46, .18);
  --band: rgba(22, 32, 46, .03);
  --band-alt: rgba(22, 32, 46, .065);
  --ok-band: rgba(29, 122, 70, .08);
  color-scheme: light;
}
:root[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234f5f74' stroke-width='1.4'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { background: var(--night); scrollbar-color: var(--control-line) var(--night); }
body {
  /* app shell: header and tab strip stay put, only the content panes scroll */
  margin: 0; height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--night); color: var(--ink);
  font: 14px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
* { scrollbar-color: var(--control-line) transparent; }
::selection { background: var(--selection); color: var(--ink); }
input, select, button { font: inherit; color: inherit; }
input { caret-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
canvas:focus-visible { outline-offset: -2px; }
[hidden] { display: none !important; }
code, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
b { font-weight: 600; }

.i { width: 16px; height: 16px; flex: none; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border: 1px solid var(--control-line); border-radius: var(--r); background: var(--control);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background-color .15s;
}
.btn:hover { border-color: var(--control-hover-line); background: var(--control-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: var(--control-line); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--pressed); }
.btn:disabled { opacity: .5; cursor: default; }

select {
  appearance: none; height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--control-line); border-radius: var(--r);
  background: var(--control) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239aaecb' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 10px center;
  font-family: var(--font-mono); font-size: 13px; cursor: pointer;
}
select:hover { border-color: var(--control-hover-line); }
input[type=number] {
  width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--control-line); border-radius: var(--r);
  background: var(--night); font-family: var(--font-mono); font-size: 13px; text-align: right;
}
input[type=number]::placeholder { color: var(--faint); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.seg { display: inline-flex; gap: 4px; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--control-line); border-radius: var(--r);
  background: var(--control); color: var(--muted); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.seg button[aria-pressed="true"] { border-color: var(--accent); }
.theme-switch { display: inline-flex; gap: 4px; }
.theme-switch button { width: 32px; height: 30px; padding: 0; justify-content: center; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--accent); background: var(--pressed); }
.seg button:focus-visible { outline-offset: -2px; }

/* ---------- top bar ---------- */
.bar {
  display: flex; align-items: center; gap: var(--s4); min-height: 56px; padding: var(--s2) var(--s4);
  border-bottom: 1px solid var(--line); background: var(--bar); flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.mark { width: 26px; height: 26px; color: var(--ring); }
.brand-name { font: 650 16px/1 var(--font-ui); letter-spacing: .04em; }
.brand-sub { font: 400 15px/1 var(--font-ui); color: var(--muted); }
.meta { margin: 0; padding-left: var(--s4); border-left: 1px solid var(--line); color: var(--muted); font: 12.5px/1.5 var(--font-mono); }
.meta b { color: var(--ink); font-weight: 500; }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.conds, .actions { display: flex; align-items: center; gap: var(--s2); }
.conds { margin-left: auto; padding: 6px var(--s4) 6px 0; border-right: 1px solid var(--line); flex-wrap: wrap; }
.conds select { height: 28px; }
.field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: 13px var(--font-mono); }

/* ---------- tabs + tolerances ---------- */
.tabsbar {
  display: flex; align-items: stretch; gap: var(--s4); padding: 0 var(--s4);
  border-bottom: 1px solid var(--line); background: var(--bar); flex-wrap: wrap;
}
.tabs { display: flex; gap: 2px; }
.tab {
  height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none;
  color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab:focus-visible { outline-offset: -2px; }
.tolbar { display: flex; align-items: center; gap: var(--s2); padding: 6px 0; flex-wrap: wrap; }
.tolbar-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 3px 8px; border: 1px solid var(--control-line); border-radius: var(--r); font: 12px var(--font-mono); white-space: nowrap; }
.chip.none { color: var(--muted); border-style: dashed; }

/* ---------- layout ---------- */
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.layout { flex: 1; display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 0; overflow: hidden; }
.work { min-width: 0; min-height: 0; overflow: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.prof { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s4); align-items: start; }
.plates { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }

.plate-title { display: flex; align-items: center; gap: var(--s2); margin: 0; font: 600 14px/1.3 var(--font-ui); letter-spacing: .01em; color: var(--ink); }
.plate-title.big { font-size: 18px; }
/* technical designation of the quantity plotted: R, P, Mr */
.code { min-width: 26px; padding: 3px 6px; border: 1px solid var(--control-line); border-radius: 2px; background: var(--night); font: 600 11.5px/1 var(--font-mono); text-align: center; }

/* ---------- rail ---------- */
.rail { border-right: 1px solid var(--line); background: var(--rail); display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; padding: var(--s4) var(--s4) var(--s3); }
.mlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--grid); }
.mlist li { border-bottom: 1px solid var(--grid); }
.mrow {
  width: 100%; display: grid; grid-template-columns: 24px 1fr auto 18px; align-items: center; gap: 6px;
  height: 44px; padding: 0 var(--s4); border: 0; background: none; text-align: left; cursor: pointer;
}
.mrow:hover { background: var(--row-hover); }
.mrow:focus-visible { outline-offset: -2px; }
.mrow .n { font: 500 13px var(--font-mono); }
.mrow .t { font: 12px var(--font-mono); color: var(--muted); }
.mrow .v { font: 13px var(--font-mono); text-align: right; }
.mrow[aria-current="true"] { background: var(--plate-2); box-shadow: inset 0 0 0 1px var(--accent); }
.mrow[aria-current="true"] .n { color: var(--accent); }
.mrow.bad .v { color: var(--ring); }
.mrow.excl .v, .mrow.excl .n { color: var(--faint); text-decoration: line-through; }
.st-ok { color: var(--ok); } .st-no { color: var(--ring); } .st-void { color: var(--faint); }

.verdict { margin: var(--s4); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r); background: var(--plate); display: grid; grid-template-columns: 18px 1fr; gap: 4px 8px; }
.verdict b { font-weight: 600; }
.verdict p { grid-column: 2; margin: 0; color: var(--muted); font-size: 12.5px; }
.verdict.bad { border-color: var(--ring-line); }
.verdict.ok { border-color: var(--ok-line); }
.verdict .i { margin-top: 2px; }
.rail-help { margin: auto var(--s4) var(--s4); color: var(--muted); font-size: 12px; }

/* ---------- plates ---------- */
.plates-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding: 2px 2px var(--s1); }
.meas-title { margin: 0; font: 600 16px/1.3 var(--font-ui); }
.meas-title .mono { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 6px; }
.cond { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.plates-tools { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }

.plate { margin: 0; background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.plate-head { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 6px var(--s2) 6px var(--s4); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.plate-sub { color: var(--muted); font-size: 12px; }
.plate-hint { margin-left: auto; padding-right: var(--s2); color: var(--muted); font-size: 12px; }
.plate-actions { margin-left: auto; display: flex; gap: 4px; }
.tool {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border: 1px solid transparent; border-radius: var(--r);
  background: none; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer;
}
.tool:hover { color: var(--ink); border-color: var(--control-line); background: var(--control); }
.tool[aria-pressed="true"] { color: var(--accent); border-color: var(--control-line); background: var(--pressed); }
.plate canvas { display: block; width: 100%; touch-action: pan-y; }
.plate canvas[data-mode="zoom"] { cursor: crosshair; }
.plate canvas[data-mode="pan"] { cursor: grab; }
.plate canvas[data-mode="pan"]:active { cursor: grabbing; }
.plate canvas[data-mode="cursor"] { cursor: col-resize; }
#cvOv { cursor: ew-resize; }
.plate-foot {
  display: flex; align-items: center; gap: var(--s4); min-height: 34px; padding: 6px var(--s4);
  border-top: 1px solid var(--line); font-size: 12.5px; flex-wrap: wrap;
}
.plate-foot .lab { font: 11px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.plate-foot .focus { margin-left: auto; color: var(--accent); }
.plate-foot .focus.bad { color: var(--ring); }
.plate.flash { animation: flash 900ms cubic-bezier(.16, 1, .3, 1); }
@keyframes flash { from { border-color: var(--ring); } to { border-color: var(--line); } }

/* ---------- index ---------- */
.index { position: sticky; top: 0; background: var(--rail); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) 0 var(--s3); }
.index > .plate-title { padding: 0 var(--s4); display: flex; align-items: baseline; justify-content: space-between; }
.idx-of { font: 500 12.5px var(--font-mono); font-style: normal; color: var(--muted); }
.index-help { margin: 4px var(--s4) var(--s3); color: var(--muted); font-size: 12px; }
.igroup { display: flex; align-items: center; gap: var(--s2); margin: 0; padding: var(--s3) var(--s4) 4px; font: 11px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
/* atlas leader rule: label •———• */
.igroup::after { content: ""; flex: 1; height: 5px; background: radial-gradient(circle, var(--line) 2px, transparent 2.5px) right center / 5px 5px no-repeat, linear-gradient(var(--line), var(--line)) left center / calc(100% - 4px) 1px no-repeat; }
.irow {
  width: 100%; display: grid; grid-template-columns: 52px 1fr auto 18px; align-items: center; gap: 6px;
  height: 32px; padding: 0 var(--s3) 0 var(--s4); border: 0; background: none; text-align: left; cursor: pointer;
}
.irow:hover { background: var(--row-hover); }
.irow:focus-visible { outline-offset: -2px; }
.irow .k { font: 500 13px var(--font-mono); }
.irow .lim { font: 11.5px var(--font-mono); color: var(--muted); text-align: right; }
.irow .v { font: 13.5px var(--font-mono); text-align: right; }
.irow .v small { font-size: 11px; color: var(--muted); margin-left: 3px; }
.irow.bad .v, .irow.bad .lim { color: var(--ring); }
.irow[aria-pressed="true"] { background: var(--plate-2); box-shadow: inset 0 0 0 1px var(--accent); }
.irow[aria-pressed="true"] .k { color: var(--accent); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s3); margin: var(--s3) var(--s4) 0; padding-top: var(--s3); border-top: 1px solid var(--grid); font-size: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }

/* ---------- lot + compare ---------- */
.multiples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.multiples > div { border-left: 1px solid var(--line); }
.multiples > div:first-child { border-left: 0; }
.mult-title { margin: 0; padding: var(--s2) var(--s4) 0; font-size: 13px; font-weight: 500; }
.tablewrap { overflow: auto; max-height: 70vh; }
table.grid { border-collapse: separate; border-spacing: 0; font: 13px var(--font-mono); white-space: nowrap; min-width: 100%; }
.grid th, .grid td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--grid); }
.grid thead th { position: sticky; top: 0; z-index: 2; background: var(--plate); color: var(--muted); font: 500 12px var(--font-ui); }
.grid thead tr.grp th { top: 0; height: 30px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; text-align: left; border-left: 1px solid var(--line); }
.grid thead tr.grp + tr th { top: 30px; }
.grid th.l, .grid td.l { text-align: left; }
.grid .stick { position: sticky; left: 0; z-index: 1; background: var(--plate); }
.grid .stick2 { position: sticky; left: 44px; z-index: 1; background: var(--plate); border-right: 1px solid var(--line); }
.grid thead .stick, .grid thead .stick2 { z-index: 3; }
.grid tbody tr:hover td { background: var(--table-hover); }
.grid td.bad { color: var(--ring); }
.grid td .i { width: 13px; height: 13px; vertical-align: -2px; margin-left: 4px; }
.grid tr.excl td:not(.stick) { color: var(--faint); text-decoration: line-through; }
.grid tr.stat td { background: var(--rail); color: var(--muted); }
.grid tr.stat.first td { border-top: 1px solid var(--line); }
.grid tr.stat td.l { color: var(--ink); font-family: var(--font-ui); }
.grid .sel { border: 0; background: none; padding: 0; color: var(--ink); font: inherit; text-decoration: underline; text-decoration-color: var(--control-line); text-underline-offset: 3px; cursor: pointer; }
.grid .sel:hover { color: var(--accent); text-decoration-color: var(--accent); }
.grid .unit { color: var(--muted); font-weight: 400; margin-left: 3px; }
.grid td.good { color: var(--ok); }
.cmp-note { margin: 0; padding: var(--s3) var(--s4); color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.cmp-note b { color: var(--ink); }
.cmp-note.warn-inline { color: var(--ink); }
.note { color: var(--muted); font-size: 12.5px; margin: 0; }
.note.pad { padding: var(--s3) var(--s4); }

.warn { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3) var(--s4); border: 1px solid var(--ring-line); border-radius: var(--r); background: var(--warn-bg); font-size: 13px; }
.warn .i { color: var(--ring); margin-top: 1px; }

/* ---------- popovers ---------- */
.pop { margin: 0; padding: var(--s4); border: 1px solid var(--control-line); border-radius: var(--r); background: var(--plate-2); color: var(--ink); }
.pop::backdrop { background: var(--backdrop); }
.tolpop { width: min(440px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 32px)); inset: 104px 16px auto auto; overflow: auto; }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.tolform { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 6px var(--s2); align-items: center; }
.tolform .h { font: 11px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tolform .k { font: 500 13px var(--font-mono); }
.tolform .k small { color: var(--muted); font-weight: 400; margin-left: 3px; }
.serpop { width: 280px; }
.serpop h4 { margin: 0 0 var(--s2); font: 11px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.serpop h4:not(:first-child) { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--grid); }
.serpop label { display: flex; align-items: center; gap: var(--s2); padding: 5px 0; font-size: 13px; cursor: pointer; }
.swatch { width: 18px; height: 0; border-top: 2px solid currentColor; flex: none; }
.swatch.dash { border-top-style: dashed; }

/* ---------- empty state ---------- */
.empty { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s5); padding: var(--s6) var(--s4); }
/* an empty chart plate: axes frame, coordinate field, the drop prompt inside the plot area */
.drop { width: min(880px, 100%); transition: border-color .2s; }
.drop-plot { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: 1fr auto; padding: var(--s5) var(--s5) var(--s3) var(--s2); }
.ax-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding: 0 8px 0 0; font-size: 11px; color: var(--muted); }
.ax-y i, .ax-x i { font-style: normal; }
.ax-x { grid-column: 2; display: flex; justify-content: space-between; padding-top: 8px; font-size: 11px; color: var(--muted); }
.drop-field {
  min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s6) var(--s5); text-align: center;
  border: 1px solid var(--axis);
  background:
    linear-gradient(var(--axis), var(--axis)) 0 50% / 100% 1px no-repeat,
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 20% 100%,
    var(--plate);
}
.drop.over { border-color: var(--accent); }
.drop.over .drop-field { border-color: var(--accent); background-color: var(--drop-over); }
.drop-field p { max-width: 54ch; margin: 0; padding: var(--s2) var(--s3); background: var(--plate); color: var(--muted); }
.drop-field p b, .drop-field code { color: var(--ink); }
.drop-actions { display: flex; gap: var(--s2); justify-content: center; margin-top: var(--s3); padding: var(--s2); background: var(--plate); flex-wrap: wrap; }
.drop .plate-foot { justify-content: center; }

.foot { margin: auto 0 0; padding-top: var(--s3); color: var(--muted); font-size: 12px; text-align: center; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  padding: 9px 14px; border: 1px solid var(--control-line); border-radius: var(--r); background: var(--plate-2); color: var(--ink);
  font-size: 13px; transition: opacity .2s, transform .3s cubic-bezier(.16, 1, .3, 1);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .prof { grid-template-columns: minmax(0, 1fr); }
  .index { position: static; }
  #index { columns: 2; column-gap: 0; }
  .igroup, .irow { break-inside: avoid; }
}
@media (max-width: 820px) {
  /* small screens: the whole page scrolls, a fixed header would eat half the screen */
  body { height: auto; overflow: visible; }
  .layout, .work, .rail, .empty { overflow: visible; }
  .index { position: static; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .mlist { display: flex; overflow-x: auto; border-top: 0; }
  .mlist li { border-bottom: 0; border-right: 1px solid var(--grid); flex: none; }
  .mrow { width: auto; min-width: 150px; }
  .rail-help { display: none; }
  .verdict { margin-top: var(--s3); }
  .multiples { grid-template-columns: minmax(0, 1fr); }
  .multiples > div { border-left: 0; border-top: 1px solid var(--line); }
  .multiples > div:first-child { border-top: 0; }
  #index { columns: 1; }
  .meta { border-left: 0; padding-left: 0; flex-basis: 100%; }
  .bar-end { margin-left: 0; }
  .plate-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
