/* Isophone Bench — shared material, type and components. Layout lives in desktop.css / phone.css.
   Type levels: L1 route identity and values (15–16px) · L2 section heads (14px semibold) ·
   L3 labels and units (12px, --ink-2) · L4 provenance, only inside sheets (12px, --ink-3).
   No viewport-scaled type, no negative tracking, no uppercase tracking. */
:root {
  --paper: #ecebe6; --plate: #f7f6f2; --plate-2: #dddcd5; --ink: #121412; --ink-2: #3d403a; --ink-3: #5f625b;
  --rule: rgb(18 20 18 / .11); --rule-2: rgb(18 20 18 / .26); --slab: #121412; --on-slab: #f3f2ed; --on-slab-2: #b4b7ad;
  --signal: #c4ee2c; --signal-ink: #121412; --alert: #c2410c; --halo: #f7f6f2; --ground: #ffffff;
  --f-display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "sans-serif-condensed", "Arial Narrow", sans-serif;
  --f-ui: "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", "Hiragino Sans", "Yu Gothic UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --f-num: "Cascadia Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Consolas, monospace;
  --r: 4px; --ease: cubic-bezier(.2, .9, .25, 1); --spring: cubic-bezier(.34, 1.36, .5, 1); --t: 240ms;
  --heat-opacity: .7; --map-tone: .55;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0d0e0d; --plate: #151715; --plate-2: #090a09; --ink: #edece5; --ink-2: #c3c5bc; --ink-3: #959890;
  --rule: rgb(237 236 229 / .1); --rule-2: rgb(237 236 229 / .22); --slab: #edece5; --on-slab: #0f100f; --on-slab-2: #4f524b;
  --signal: #d4f347; --alert: #ff7a2e; --halo: #151715; --ground: #1c1e1b;
  color-scheme: dark;
}
:root[data-motion="reduced"] { --t: 0ms; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 400 14px/1.45 var(--f-ui); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--ink-3); }
.warn { color: var(--alert); }
.fine { font-size: 12px; line-height: 1.5; color: var(--ink-3); margin: 8px 0 0; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sec-title { margin: 0; font: 650 14px/1.3 var(--f-ui); color: var(--ink); }

/* ---------- controls ---------- */
.ib { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: var(--r); background: transparent; color: var(--ink-2); transition: background var(--t), color var(--t); }
.ib:hover { background: var(--rule); color: var(--ink); }
.ib:disabled { opacity: .35; cursor: default; background: transparent; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--rule-2); background: transparent; font-weight: 600; white-space: nowrap; }
.btn.solid { background: var(--slab); color: var(--on-slab); border-color: var(--slab); }
.btn.ghost:hover { background: var(--rule); }
.seg { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 6px; background: var(--rule); }
.seg label { position: relative; display: flex; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg > button, .seg label > span { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 11px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg > button:hover { color: var(--ink); }
.seg > button[aria-pressed="true"], .seg input:checked + span { background: var(--slab); color: var(--on-slab); }
.seg > button > span { color: inherit; }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 1px; }
.pick { position: relative; display: grid; min-width: 0; }
.pick select { appearance: none; min-height: 40px; width: 100%; padding: 15px 30px 1px 10px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--plate); font-weight: 600; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.pick > span { position: absolute; left: 10px; top: 4px; font-size: 11px; line-height: 1.2; color: var(--ink-2); pointer-events: none; white-space: nowrap; }
.pick::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border: solid var(--ink-2); border-width: 0 1.75px 1.75px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }

/* wordmark: the only use of the display face */
.brand { display: inline-grid; place-items: center; height: 30px; padding: 0 9px; background: var(--slab); color: var(--on-slab); font: 700 15px/1 var(--f-display); text-decoration: none; border-radius: 2px; flex: none; }

/* overlay identity: which heatmap the ground shows, or an honest warning */
.overlay-note { display: flex; gap: 6px; align-items: center; min-width: 0; margin: 0; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.overlay-note span { overflow: hidden; text-overflow: ellipsis; }
.overlay-note small { font: 12px var(--f-num); color: var(--ink-3); }
.overlay-note .i { width: 15px; height: 15px; }
.overlay-note.is-warn { color: var(--alert); font-weight: 600; }

/* ---------- swatches ---------- */
.sw { flex: none; overflow: visible; }
.sw-line { stroke: var(--rc); stroke-width: 3; fill: none; stroke-linecap: round; }
.sw-head { fill: var(--rc); stroke: var(--halo); stroke-width: 1.2; }
.legend { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; gap: 10px; align-items: center; }
.legend .lg-gap { height: 2px; border-top: 1px solid var(--rule); }
.lg-glyph { fill: var(--ink); }

/* ---------- comparison table (cost model is the identity; algorithm is the glyph) ---------- */
.rtab { --col: 50px; --sw: 26px; --act: 36px; }
.rt-head { display: grid; grid-template-columns: var(--sw) minmax(0, 1fr) repeat(3, var(--col)) calc(var(--act) * 2); column-gap: 8px; align-items: end; padding: 0 0 6px 12px; border-bottom: 1px solid var(--ink); font-size: 12px; font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.rt-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-head span:nth-child(n+3) { text-align: right; }
.rt-head small { display: block; font: 400 11px var(--f-num); color: var(--ink-3); }
.rt-list { list-style: none; margin: 0; padding: 0; }
.rt { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--act) var(--act); column-gap: 0; align-items: center; border-bottom: 1px solid var(--rule); transition: opacity var(--t) var(--ease); }
.rt::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--rc); transform: scaleY(0); transition: transform var(--t) var(--spring); }
.rt.is-focus::before { transform: scaleY(1); }
.rt.is-dim { opacity: .45; }
.rt-main { display: grid; grid-template-columns: var(--sw) minmax(0, 1fr) repeat(3, var(--col)); width: 100%; column-gap: 8px; align-items: center; min-height: 50px; padding: 6px 8px 6px 12px; border: 0; background: transparent; text-align: left; }
.rt-main:hover { background: var(--rule); }
.rt-main:disabled { cursor: default; background: transparent; }
.rt-name { display: grid; min-width: 0; line-height: 1.25; }
.rt-name b { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-name small { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-flag { color: var(--alert) !important; }
.rt .v { font-size: 15px; font-weight: 500; text-align: right; white-space: nowrap; }
.rt .v.is-min { font-weight: 700; text-decoration: underline 2px var(--ink); text-underline-offset: 4px; }
.rt .v.is-unknown { color: var(--ink-3); }
.rt.is-hidden .rt-main { opacity: .38; }
.rt.is-missing .sw { opacity: .4; }
.rt-eye, .rt-more { min-width: var(--act); width: var(--act); min-height: 44px; }

/* ---------- trade-off plot ---------- */
.tp { display: block; width: 100%; height: auto; overflow: visible; }
.tp-grid { stroke: var(--rule); stroke-width: 1; }
.tp-axis { fill: none; stroke: var(--ink); stroke-width: 1; }
.tp-tick { font: 11px var(--f-num); fill: var(--ink-2); }
.tp-title { font: 600 11.5px var(--f-ui); fill: var(--ink); }
.tp-unit { font: 11px var(--f-num); fill: var(--ink-3); }
.tp-pt { cursor: pointer; transition: opacity var(--t); }
.tp-hit { fill: transparent; }
.tp-glyph { fill: var(--rc); stroke: var(--halo); stroke-width: 1.6; }
.tp-lead { stroke: var(--ink-3); stroke-width: 1; }
.tp-pt text { font: 600 12px var(--f-ui); fill: var(--ink); paint-order: stroke; stroke: var(--plate); stroke-width: 3px; stroke-linejoin: round; }
.tp-pt.is-focus .tp-glyph { stroke: var(--ink); stroke-width: 1.8; }
.tp-pt.is-dim { opacity: .3; }
.tp-pt.is-hidden { opacity: .4; cursor: default; }
.tp-pt.is-hidden .tp-glyph { fill: none; stroke: var(--rc); }
.tp-pt:hover text { text-decoration: underline; }
.tp-note { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.tp-empty { margin: 0; padding: 18px 0; font-size: 13px; color: var(--ink-3); }

/* ---------- stage: ROI-cropped plan, heat as ground, the printed plan as ink linework ---------- */
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--plate-2); isolation: isolate; }
.plan, .cube { position: absolute; inset: 0; }
.plan { outline: none; touch-action: none; cursor: grab; transition: opacity 420ms var(--ease); }
.plan.is-panning { cursor: grabbing; }
.plan:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.plan-svg { display: block; width: 100%; height: 100%; user-select: none; }
.plan-layers { isolation: isolate; }
.plan-ground { fill: var(--ground); }
.plan-heat { opacity: var(--heat-opacity); transition: opacity var(--t); }
/* The linework's tone curve is anchored at the paper: paper stays exactly white (multiply) or black (screen), so the
   heat between the lines keeps its colours, while every darker tone of the printed plan is pulled further out. */
.plan-base { opacity: var(--map-tone); filter: grayscale(1) brightness(.8) contrast(2); mix-blend-mode: multiply; }
:root[data-theme="dark"] .plan-base { filter: grayscale(1) invert(1) brightness(1.25) contrast(1.6); mix-blend-mode: screen; }
.plan-roi { fill: none; stroke: var(--ink); stroke-opacity: .5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.route { transition: opacity var(--t) var(--ease); }
.route.is-dim { opacity: .2; }
.route-line, .route-ghost, .route-casing { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.route-line { stroke: var(--rc); }
.route-casing { stroke: var(--halo); stroke-opacity: .85; }
.route-ghost { stroke: var(--rc); stroke-opacity: .3; }
.route-head { fill: var(--rc); stroke: var(--halo); stroke-width: 2; }
.route-pulse { fill: none; stroke: var(--rc); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: pulse 1.8s var(--ease) infinite; }
@keyframes pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.4); opacity: 0; } }
.route-label { font: 650 12.5px var(--f-ui); fill: var(--ink); paint-order: stroke; stroke: var(--halo); stroke-width: 4px; stroke-linejoin: round; }
.mark-ring { fill: var(--halo); stroke: var(--ink); stroke-width: 2; }
.mark-core { fill: var(--ink); }
.mark-start .mark-core { fill: var(--signal); stroke: var(--ink); stroke-width: 1.5; }
.mark-label { font: 700 12.5px var(--f-ui); fill: var(--ink); paint-order: stroke; stroke: var(--halo); stroke-width: 4px; stroke-linejoin: round; }
.scale-line { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.scale-label { font: 600 11.5px var(--f-num); fill: var(--ink); paint-order: stroke; stroke: var(--plate-2); stroke-width: 3px; }
.probe-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 3; }
.probe-leader { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.cube { opacity: 0; pointer-events: none; transition: opacity 420ms var(--ease); }
.cube-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
:root[data-view="cube"] .cube { opacity: 1; pointer-events: auto; }
:root[data-view="cube"] .plan { opacity: 0; pointer-events: none; }
.cube-fail { position: absolute; inset: auto 16px 16px; margin: 0; padding: 12px 14px; background: var(--slab); color: var(--on-slab); }
.cube-note { position: absolute; z-index: 2; left: 12px; bottom: 10px; max-width: min(420px, calc(100% - 24px)); margin: 0; padding: 6px 9px; font-size: 12px; line-height: 1.4; color: var(--ink-2); background: color-mix(in oklab, var(--plate) 88%, transparent); border-radius: var(--r); display: none; }
:root[data-view="cube"] .cube-note { display: block; }

/* probe callout = slab with leader line */
.probe { position: absolute; z-index: 4; min-width: 200px; max-width: 280px; background: var(--slab); color: var(--on-slab); border-radius: var(--r); box-shadow: 0 14px 36px rgb(0 0 0 / .24); animation: drop 240ms var(--spring); }
.probe header { display: flex; align-items: center; justify-content: space-between; padding-left: 12px; font-size: 12px; font-weight: 600; color: var(--on-slab-2); }
.probe .ib { color: var(--on-slab); min-height: 36px; }
.probe ul { list-style: none; margin: 0; padding: 0 0 6px; }
.probe li button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; background: transparent; color: inherit; text-align: left; font-weight: 600; }
.probe li button:hover, .probe li button[aria-pressed="true"] { background: rgb(127 127 127 / .22); }
.probe .muted { padding: 4px 12px 12px; margin: 0; color: var(--on-slab-2); }
.pdot { width: 12px; height: 12px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 0 2px var(--slab), 0 0 0 3px var(--rc); }
@keyframes drop { from { opacity: 0; transform: translateY(6px); } }

/* status: loading meter / hard-cut error / empty */
.status { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; background: color-mix(in oklab, var(--plate-2) 84%, transparent); }
.st { width: min(400px, 100%); padding: 20px; background: var(--plate); border-top: 3px solid var(--ink); box-shadow: 0 18px 44px rgb(0 0 0 / .12); }
.st-title { margin: 12px 0 2px; font: 650 18px/1.25 var(--f-ui); }
.st-msg { margin: 0; color: var(--ink-2); }
.st-detail { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.st .btn { margin-top: 16px; }
.st-wave { display: flex; align-items: flex-end; gap: 4px; height: 24px; }
.st-wave i { width: 7px; height: 100%; background: var(--ink); transform-origin: bottom; animation: meter 1.1s var(--ease) infinite alternate; }
.st-wave i:nth-child(2) { animation-delay: -.3s; } .st-wave i:nth-child(3) { animation-delay: -.7s; } .st-wave i:nth-child(4) { animation-delay: -.15s; } .st-wave i:nth-child(5) { animation-delay: -.5s; }
@keyframes meter { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
.st-error { background: var(--slab); color: var(--on-slab); border-top-color: var(--alert); }
.st-error .st-title { color: var(--alert); }
.st-error .st-msg { color: var(--on-slab); } .st-error .st-detail { color: var(--on-slab-2); }
.st-error .st-wave i { background: var(--alert); animation: none; transform: scaleY(.25); }
.st-error .btn.solid { background: var(--alert); border-color: var(--alert); color: #120a04; }
.st-empty .st-wave i { animation: none; transform: scaleY(.15); background: var(--ink-3); }

/* ---------- transport: shared time axis with numbered ticks and arrival glyphs ---------- */
.transport { display: grid; align-items: center; gap: 10px; min-width: 0; }
.play { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--slab); color: var(--on-slab); transition: transform 200ms var(--spring); }
.play:active { transform: scale(.94); }
.play:disabled { opacity: .35; cursor: default; transform: none; }
.play .i { width: 19px; height: 19px; }
:root[data-playing="yes"] .play { background: var(--signal); color: var(--signal-ink); }
.clock { display: grid; grid-template-columns: auto auto; column-gap: 5px; align-items: baseline; white-space: nowrap; }
.clock b { font-size: 18px; font-weight: 600; }
.clock span { color: var(--ink-2); font-size: 12px; }
.clock em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: var(--ink-2); }
.axis { position: relative; min-width: 0; padding: 16px 0 0; }
.marks { position: absolute; left: 0; right: 0; top: 0; height: 16px; }
.mk { position: absolute; left: var(--x); top: 0; width: 22px; height: 22px; margin-left: -11px; padding: 0; border: 0; background: transparent; display: grid; place-items: center; }
.mk svg { width: 13px; height: 13px; overflow: visible; }
.mk path { fill: var(--rc); stroke: var(--halo); stroke-width: 1.4; }
.mk:hover path { stroke: var(--ink); }
.scrub { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; }
.scrub::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--ink) var(--p, 100%), var(--rule-2) var(--p, 100%)); }
.scrub::-moz-range-track { height: 2px; background: var(--rule-2); }
.scrub::-moz-range-progress { height: 2px; background: var(--ink); }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 6px; height: 22px; margin-top: -10px; border-radius: 1px; background: var(--signal); box-shadow: 0 0 0 1.5px var(--ink); }
.scrub::-moz-range-thumb { width: 6px; height: 22px; border: 0; border-radius: 1px; background: var(--signal); box-shadow: 0 0 0 1.5px var(--ink); }
.scrub:disabled { opacity: .4; cursor: default; }
.ticks { position: relative; height: 14px; }
.ticks span { position: absolute; left: var(--x); top: 0; transform: translateX(-50%); font: 11px/1 var(--f-num); color: var(--ink-2); white-space: nowrap; }
.ticks span:first-child { transform: none; }
.ticks span.is-end { transform: translateX(-100%); color: var(--ink); font-weight: 600; }
.speed { display: grid; place-items: center; min-width: 46px; min-height: 40px; border: 1px solid var(--rule-2); border-radius: var(--r); background: transparent; }
.speed b { font-size: 14px; }

/* ---------- sheet (run details / route details / settings / all metrics) ---------- */
.sheet { border: 0; padding: 0; color: var(--ink); background: var(--plate); max-width: none; max-height: none; }
.sheet::backdrop { background: rgb(10 11 10 / .36); }
.sheet-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.sheet-bar { display: flex; justify-content: flex-end; align-items: center; padding: 6px 8px 0; }
.sheet-body { flex: 1; min-height: 0; overflow: auto; padding: 0 20px 28px; overscroll-behavior: contain; }
.sheet-head { display: flex; gap: 14px; align-items: center; padding: 4px 0 14px; border-bottom: 1px solid var(--ink); margin-bottom: 6px; }
.sheet-kicker { margin: 0; font-size: 12px; color: var(--ink-2); }
.sheet-title { margin: 2px 0 0; font: 650 20px/1.25 var(--f-ui); overflow-wrap: anywhere; }
.sheet section { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.sheet h3 { margin: 0 0 10px; font-size: 13px; font-weight: 650; color: var(--ink); }
.sheet-pick { margin: 12px 0 4px; }
.note { margin: 8px 0; padding: 9px 12px; background: var(--rule); font-size: 13px; border-radius: var(--r); }
.note.warn { color: var(--alert); }
.facts, .ids { display: grid; margin: 0; }
.facts > div, .ids > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.facts dt, .ids dt { font: 12px var(--f-ui); color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ids dd { margin: 0; font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.dmetrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; margin: 0; background: var(--rule); border: 1px solid var(--rule); }
.dm { padding: 10px 12px; background: var(--plate); }
.dm dt { font-size: 12px; color: var(--ink-2); }
.dm dd { margin: 2px 0 0; }
.dm b { font: 600 17px/1.25 var(--f-num); }
.dm small { color: var(--ink-3); font-size: 12px; }
.dm.is-unknown b { font: 600 14px var(--f-ui); color: var(--ink-3); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 14px; margin: 0; }
.kv dt { font-size: 12px; color: var(--ink-2); } .kv dd { margin: 0; }
.colour-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.colour-row input[type="color"] { width: 52px; height: 40px; padding: 2px; border: 1px solid var(--rule-2); border-radius: var(--r); background: transparent; }
.matrix-wrap { overflow: auto; max-width: 100%; border: 1px solid var(--rule); }
.matrix { border-collapse: collapse; min-width: 100%; font-size: 13px; }
.matrix th, .matrix td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.matrix thead th { position: sticky; top: 0; background: var(--plate); vertical-align: bottom; text-align: left; }
.matrix thead th span { display: block; margin-top: 4px; font-weight: 650; }
.matrix tbody th { position: sticky; left: 0; background: var(--plate); text-align: left; font-weight: 600; }
.matrix tbody th small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.matrix td.is-min { font-weight: 700; text-decoration: underline 2px var(--ink); text-underline-offset: 4px; }
.settings { display: grid; gap: 18px; padding-top: 12px; }
.settings fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.settings legend, .field > span { font-size: 13px; font-weight: 650; color: var(--ink); padding: 0; margin-bottom: 8px; }
.field { display: grid; }
.field input[type="range"] { width: 100%; accent-color: var(--ink); min-height: 32px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.legacy { display: flex; gap: 12px; align-items: center; margin-top: 22px; padding: 14px; border: 1px dashed var(--rule-2); border-radius: var(--r); color: inherit; text-decoration: none; }
.legacy small { display: block; color: var(--ink-3); }

/* ---------- channel meters (package 1): a bar per value, relative to the shown routes; lowest = signal ---------- */
.rt .v-n { line-height: 1.2; }
.rt .v.is-min { text-decoration: none; }
.v-bar { position: relative; display: block; width: 100%; height: 3px; border-radius: 1px; background: var(--rule); overflow: hidden; }
.v-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--m, 0) * 100%); background: var(--ink-3); transition: width var(--t) var(--ease); }
.rt .v.is-min .v-bar::after { background: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.rt .v.is-min .v-n { box-shadow: inset 0 -2px 0 var(--signal); }
:root[data-theme="dark"] .rt .v.is-min .v-bar::after { background: var(--signal); }
.rt.is-hidden .v-bar { visibility: hidden; }
.tp-pt.is-peek .tp-glyph { stroke: var(--ink); stroke-width: 2; }
.tp-pt.is-peek text { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { :root:not([data-motion="full"]) * { animation: none !important; } }
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before { animation: none !important; transition-duration: 0ms !important; }
/* Saved-source provenance is a normal-flow disclosure, not a map overlay. */
.bench-quality-warning{min-width:0;max-height:24dvh;overflow:auto;margin:0 .75rem .375rem;padding-inline-start:.625rem;border-inline-start:3px solid var(--alert);font-size:.875rem;line-height:1.45;color:var(--ink-2);overflow-wrap:anywhere}
.bench-quality-warning[hidden]{display:none}
.bench-quality-warning summary{min-height:44px;padding:.5rem .25rem;cursor:pointer;font-weight:650;color:var(--alert)}
.bench-quality-warning p{margin:.25rem 0 .625rem}
.bench-quality-copy{overflow-wrap:anywhere;white-space:normal}
.rcard:has(>.bench-quality-warning:not([hidden])){grid-template-rows:auto auto minmax(0,1fr) auto}
.pcmp:has(>.bench-quality-warning:not([hidden])){grid-template-rows:auto auto minmax(0,1fr)}
