/* PURPLE lab — pit-wall timing screen. Tokens, type, layout, motion from docs/DESIGN_SYSTEM.md. Dark only. */
:root {
  --bg: #0a0a0c; --panel: #121216; --line: #26262c; --text: #e8e8ec; --muted: #8a8a94;
  --purple: #b26cff; --purple-dim: #3a2460; --green: #4ade80; --amber: #fbbf24; --red: #f0506e; --mubit: #ff4500;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-settle: 240ms; --t-trace: 160ms; --t-stage: 200ms; --t-flash: 400ms;
  --r: 6px;
  --rail-h: 248px;   /* QA S6: one fixed rail height for every card state (empty, loading, success, error, racing); see the B1 note below */
}
@media (prefers-reduced-motion: reduce) {
  :root { --t-settle: 0ms; --t-trace: 0ms; --t-stage: 0ms; --t-flash: 0ms; }
  .pulse::after { animation: none !important; content: "…" !important; }
  .progress::before { animation: none !important; width: 100% !important; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 500 13px/1.45 var(--mono); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---- type roles */
.label { font: 500 11px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.h { font: 600 16px/1.2 var(--sans); }
.stage-name { font: 700 13px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.src { font: 400 11px/1.3 var(--sans); color: var(--muted); }
.sans { font-family: var(--sans); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.big { font: 600 28px/1 var(--mono); }

/* ---- page frame */
.top { height: 40px; display: flex; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.top .brand { font: 700 14px/1 var(--sans); letter-spacing: .18em; color: var(--purple); }
.top .sub { font: 400 12px/1 var(--sans); color: var(--muted); }
.top .spacer { flex: 1; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); vertical-align: middle; margin-right: 6px; }
.dot.ok { background: var(--green); } .dot.bad { background: var(--red); } .dot.wait { background: var(--amber); }
.badge { display: inline-block; padding: 2px 6px; border: 1px solid var(--line); border-radius: var(--r); font: 600 11px/1.2 var(--sans); letter-spacing: .04em; }
.badge.td { border-color: var(--amber); color: var(--amber); }
.badge.purple { border-color: var(--purple); color: var(--purple); }
.badge.red { border-color: var(--red); color: var(--red); }
.badge.green { border-color: var(--green); color: var(--green); }
.badge.amber { border-color: var(--amber); color: var(--amber); }
.badge.sm { padding: 1px 5px; font-size: 10.5px; }
.badge.mubit { border-color: var(--mubit); color: var(--mubit); }

/* QA S6: the error banner lives inside the 40 px header (it replaces the subtitle while shown), so it never moves the layout */
#banner { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 4px 0 10px; background: #2a1118; border: 1px solid var(--red); border-radius: var(--r); color: var(--text); font-family: var(--sans); font-size: 12px; white-space: nowrap; overflow: hidden; }
#banner .label { color: var(--red); flex: none; }
#banner code { font-family: var(--mono); color: var(--red); flex: none; }
#banner .msg { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#banner .x { flex: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: var(--r); padding: 1px 8px; color: var(--muted); font-size: 11px; }
body.has-banner .top .sub, body.has-banner .top .spacer { display: none; }

.lab { display: grid; grid-template-columns: 64fr 36fr; gap: 12px; padding: 12px; height: calc(100% - 40px); }
.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-height: 0; }

/* ---- stage rail
   QA B1/S6: the rail has one fixed height (--rail-h) in every state. DESIGN_SYSTEM §4 says 180 px, but the source labels (G-HON-01) and
   the key numbers do not fit in 180 px at 1280 px wide, so the height is fixed at the smallest value that fits all states at 1280×800
   and 1440×900. Each card: head · body (key numbers first; only secondary text can scroll) · srcbar (the label, never scrolls) · foot. */
.rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, .8fr);   /* LEARN (a form) gives width to the three number cards */ gap: 12px; height: var(--rail-h); flex: 0 0 var(--rail-h); min-height: 0; }
.card { position: relative; display: flex; flex-direction: column; padding: 9px 12px; height: 100%; min-height: 0; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: border-color var(--t-stage) var(--ease), background var(--t-stage) var(--ease); }
.card.is-active { border-color: var(--purple); background: linear-gradient(180deg, rgba(58, 36, 96, .55), var(--panel) 70%); }
.card.is-error { border-color: var(--red); }
.card .head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.card .head .stage-name { color: var(--muted); }
.card .head .flag { margin-left: auto; }
.card.is-active .head .stage-name, .card.is-success .head .stage-name { color: var(--text); }
.card .state { font: 500 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card.is-error .state { color: var(--red); } .card.is-loading .state { color: var(--amber); } .card.is-success .state { color: var(--green); }
.card .body { flex: 1 1 auto; min-height: 0; overflow: hidden auto; display: flex; flex-direction: column; gap: 1px; font-size: 11px; line-height: 1.35; scrollbar-width: thin; }
.card .body > * { flex: none; min-width: 0; }
#card-evaluate .body { gap: 0; } #card-evaluate .sectors { margin: 1px 0; } #card-evaluate .body > .one { line-height: 1.25; }   /* QA3 S-4: room for the experiment's conditions in the source label without scrolling the numbers */
.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nw { white-space: nowrap; }
.card .body p { margin: 0 0 2px; font-family: var(--sans); font-size: 12px; line-height: 1.4; color: var(--muted); }
.card .srcbar { flex: none; margin-top: 3px; }
.card .srcbar:empty { display: none; }
.card .srcbar .src { font-size: 10px; line-height: 1.22; }
.card .foot { flex: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; min-height: 27px; }   /* QA3 N-7: a foot of small buttons (LEARN) shares the midline of the others */
.card .foot:empty { display: none; }
.card .foot .row { flex-wrap: nowrap; gap: 6px; }
.card .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); overflow: hidden; }
.card .progress::before { content: ""; position: absolute; left: -40%; width: 40%; height: 100%; background: var(--purple); animation: slide 1.2s linear infinite; }
@keyframes slide { to { left: 100%; } }
.err { color: var(--red); font-family: var(--mono); }
.row { display: flex; gap: 4px 8px; align-items: baseline; flex-wrap: wrap; }
.row.nw { flex-wrap: nowrap; overflow: hidden; align-items: center; }
.row.nw > * { flex: none; }
.row.nw > .one { flex: 0 1 auto; }
.kvl { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 6px; align-items: baseline; }
.kvl > .k { color: var(--muted); font-family: var(--sans); font-size: 11px; }
.kvl .xs { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; column-gap: 10px; }   /* QA3 N-7: S1 / S2 / S3 as a tidy two-line grid (label over value) instead of a ragged wrap */
.kvl .xs > span { display: flex; flex-direction: column; line-height: 1.2; }
.kvl .xs > span > .muted { font: 500 9.5px/1.2 var(--sans); }
.cars { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: baseline; margin-top: 1px; line-height: 1.25; }
.cars .h { font: 400 10px/1.3 var(--sans); color: var(--muted); }
.cars .k { font-family: var(--sans); color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.kv .k { color: var(--muted); font-family: var(--sans); font-size: 11px; }
.hyp { font-family: var(--sans); color: var(--text); font-size: 12px; margin: 3px 0; display: -webkit-box; -webkit-line-clamp: 1; line-height: 1.35; -webkit-box-orient: vertical; overflow: hidden; }
.verdict { font: 700 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: var(--r); border: 1px solid; }
.verdict.sm { font-size: 10.5px; padding: 2px 5px; letter-spacing: .06em; }
.label.tight { letter-spacing: .04em; font-size: 10px; }
.agr { font: 600 10.5px/1.3 var(--sans); }
.agr.green { color: var(--green); } .agr.amber { color: var(--amber); }
.verdict.promote { color: var(--purple); border-color: var(--purple); }
.verdict.reject { color: var(--red); border-color: var(--red); }
.verdict.retest { color: var(--amber); border-color: var(--amber); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border: 1px solid var(--line); border-radius: var(--r); font: 600 11px/1.4 var(--mono); color: var(--text); background: rgba(255,255,255,.03); }
.chip.rule { border-color: var(--purple); color: var(--purple); }
.chip.off { color: var(--muted); border-color: var(--line); text-decoration: line-through; }

/* buttons */
.btn { padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #1a1a20; color: var(--text); font: 600 12px/1.2 var(--sans); transition: border-color var(--t-stage) var(--ease); }
.btn:hover:not(:disabled) { border-color: var(--purple); }
.btn.primary { border-color: var(--purple); background: var(--purple-dim); }
.btn.small { padding: 3px 8px; font-size: 11px; }
.btn.danger { border-color: var(--red); }
.btn.icon { padding: 2px 6px; background: none; border-color: transparent; color: var(--muted); }
.btn.icon:hover { color: var(--text); }

/* deltas */
.delta { font-family: var(--mono); font-weight: 600; }
.delta.faster { color: var(--purple); } .delta.slower { color: var(--red); } .delta.flat { color: var(--muted); }
.delta.flash { animation: flash var(--t-flash) var(--ease); }
@keyframes flash { 0% { background: var(--purple-dim); } 100% { background: transparent; } }
.settle { animation: settle var(--t-settle) var(--ease); }
@keyframes settle { from { color: var(--muted); } to { color: inherit; } }
.sectors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 2px 0; }
.sectors .cell { border: 1px solid var(--line); border-radius: var(--r); padding: 1px 5px; display: flex; flex-direction: column; min-width: 0; line-height: 1.14; }
.sectors .cell .label { font-size: 9.5px; line-height: 1.14; }
.sectors .cell .t { display: block; font-size: 11px; }
.num { font-family: var(--mono); }

/* ---- main area */
.main { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#car3d { position: absolute; inset: 0; }
#car3d canvas { display: block; width: 100%; height: 100%; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.main .overlay { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: flex-end; gap: 12px; pointer-events: none; }   /* table bottom-right: the hero angle puts the front wing bottom-left */
.main .overlay > * { pointer-events: auto; }
.main .corner { position: absolute; top: 10px; left: 12px; display: flex; gap: 8px; align-items: center; }
.main .corner .badge { background: rgba(10,10,12,.92); }   /* QA3 N-1: the front close-up puts the nose under the badge */
.setup-table { border-collapse: collapse; font-size: 11.5px; background: rgba(10,10,12,.92); border: 1px solid var(--line); border-radius: var(--r); }
.setup-table th, .setup-table td { padding: 2px 9px; text-align: right; border-bottom: 1px solid var(--line); }
.setup-table th { font: 500 10px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.setup-table td:first-child, .setup-table th:first-child { text-align: left; font-family: var(--sans); color: var(--muted); }
.setup-table tr:last-child td { border-bottom: 0; }
.setup-table td.changed { color: var(--purple); font-weight: 600; }
.setup-table td.illegal { color: var(--red); font-weight: 600; }
.setup-table .range { color: var(--muted); font-size: 11px; }
.main-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.main-empty .inner { text-align: center; font-family: var(--sans); color: var(--muted); font-size: 12px; max-width: 340px; }
.main-empty .inner .h { color: var(--text); margin-bottom: 6px; }

/* ---- conditions bar (P2.T6) */
.cond { display: flex; align-items: center; gap: 4px 12px; padding: 6px 14px; flex: 0 0 auto; flex-wrap: wrap; font-size: 12px; }
.cond .f { display: flex; align-items: center; gap: 8px; }
.cond input[type=range] { width: 84px; accent-color: var(--purple); }
.cond select { background: #1a1a20; border: 1px solid var(--line); border-radius: var(--r); padding: 3px 6px; }
.dial { position: relative; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; }
.dial::before { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 11px; margin-left: -1px; margin-top: -11px; background: var(--purple); transform-origin: 50% 100%; transform: rotate(var(--deg, 0deg)); transition: transform var(--t-stage) var(--ease); }
.dial::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--text); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .tk { width: 28px; height: 16px; border: 1px solid var(--line); border-radius: var(--r); background: #1a1a20; position: relative; transition: background var(--t-stage) var(--ease), border-color var(--t-stage) var(--ease); }
.switch .tk::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 3px; background: var(--muted); transition: transform var(--t-stage) var(--ease), background var(--t-stage) var(--ease); }
.switch input:checked + .tk { background: var(--purple-dim); border-color: var(--purple); }
.switch input:checked + .tk::after { transform: translateX(12px); background: var(--purple); }
.switch.td input:checked + .tk { background: #3a2e10; border-color: var(--amber); }
.switch.td input:checked + .tk::after { background: var(--amber); }
.switch input:focus-visible + .tk { outline: 2px solid var(--purple); outline-offset: 2px; }

/* ---- right column */
/* QA B3: the widget is as tall as its content (task, facts, exam lines, console + budget line); nothing in it may shrink. The trace takes the rest. */
.widget { flex: 0 0 auto; padding: 10px 16px; border-left: 3px solid var(--mubit); display: flex; flex-direction: column; gap: 3px; }
.widget > * { flex-shrink: 0; min-width: 0; }
.widget .head { display: flex; align-items: center; justify-content: space-between; }
.widget .head .label { color: var(--mubit); }
.widget .task { font: 600 13px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget .facts { display: flex; gap: 14px; flex-wrap: wrap; }
.widget .fact .label { font-size: 10px; }
.widget .fact .v { font-size: 13px; }
.widget .exam { font-size: 12px; line-height: 1.35; }
.widget .exam b { color: var(--mubit); font-weight: 600; }
.widget .upd { margin-top: auto; }
.widget form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 8px; font-size: 11px; font-family: var(--sans); }
.widget form label { display: flex; flex-direction: column; gap: 1px; color: var(--muted); }
.widget form input { background: #1a1a20; border: 1px solid var(--line); border-radius: var(--r); padding: 2px 5px; font-family: var(--mono); font-size: 11px; width: 100%; }
.widget form .acts { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }

.trace { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.trace .head, .ledger .head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.trace .lines { flex: 1; overflow: auto; padding: 6px 0; }
.tl { display: grid; grid-template-columns: 56px 62px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 2px 16px; font-size: 12px; line-height: 1.5; animation: arrive var(--t-trace) var(--ease); border-left: 2px solid transparent; }
@keyframes arrive { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.tl .t { color: var(--muted); font-size: 11px; }
.tl .k { font: 600 10px/1.6 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.tl.plan .k { color: var(--purple); } .tl.race .k { color: var(--green); } .tl.rule .k, .tl.overrule .k { color: var(--amber); } .tl.promote .k { color: var(--purple); } .tl.error .k { color: var(--red); } .tl.status .k { color: var(--mubit); }
.tl.error { border-left-color: var(--red); }
.tl .m { display: flex; gap: 2px 8px; flex-wrap: wrap; min-width: 0; }
.tl .m > span { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }   /* QA N5: long notes end in an ellipsis; full text in the title */
.tl .sess { color: var(--muted); }
.tl .mreq { cursor: copy; border-bottom: 1px dotted var(--muted); }
.tl .mreq:hover { color: var(--purple); border-color: var(--purple); }
.tl .lat { color: var(--muted); }
.tl .vd { font-weight: 600; } .tl .vd.promote { color: var(--purple); } .tl .vd.reject { color: var(--red); } .tl .vd.retest { color: var(--amber); } .tl .vd.err { color: var(--red); }
.tl.untrained { color: var(--muted); font-style: italic; }
.tl.pending .m { color: var(--amber); }
.pulse::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); margin-left: 6px; vertical-align: middle; animation: pulse 1s steps(1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
.trace .empty, .ledger .empty { padding: 12px 16px; font-family: var(--sans); color: var(--muted); font-size: 12px; }

.ledger { flex: 0 0 220px; display: flex; flex-direction: column; overflow: hidden; }
.ledger .wrap { flex: 1; overflow: auto; }
.ledger table { width: 100%; border-collapse: collapse; font-size: 11px; table-layout: fixed; }
.ledger th { position: sticky; top: 0; background: var(--panel); font: 500 9.5px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 5px 5px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger td { padding: 3px 5px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.ledger th:first-child, .ledger td:first-child { padding-left: 12px; }
.ledger col.c-n { width: 34px; } .ledger col.c-change { width: auto; } .ledger col.c-d { width: 58px; } .ledger col.c-agr { width: 44px; } .ledger col.c-v { width: 74px; } .ledger col.c-rule { width: 48px; } .ledger col.c-st { width: 80px; }
.ledger tr.row-x { cursor: pointer; }
.ledger tr.row-x:hover td { background: rgba(255,255,255,.03); }
.ledger tr.current td { background: rgba(178,108,255,.08); }
.ledger td.change { font-family: var(--sans); }
.ledger td.vd2 { white-space: normal; line-height: 1.2; }   /* QA N3: an overruled verdict takes two lines instead of truncating */
.ledger td.vd2 .ovd { display: block; color: var(--muted); white-space: nowrap; font: 500 10px/1.2 var(--sans); }
.ledger td .chip { padding: 0 3px; font-size: 10px; max-width: 100%; overflow: hidden; }
.ledger .st { font: 600 9.5px/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
.st.planned { color: var(--muted); } .st.raced { color: var(--green); } .st.overruled { color: var(--amber); } .st.promoted { color: var(--purple); } .st.parse_error { color: var(--red); }

/* learn card form */
.ov { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; font-family: var(--sans); font-size: 11px; }
.ov label { color: var(--muted); }
.ov select, .ov input { background: #1a1a20; border: 1px solid var(--line); border-radius: var(--r); padding: 3px 6px; font-size: 12px; width: 100%; font-family: var(--mono); }
.ov .acts { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rules { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.rules .r { display: flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 11px; }
.rules .r .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rules .r.off .txt { color: var(--muted); }

/* copied toast */
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--purple); border-radius: var(--r); padding: 6px 12px; font-family: var(--sans); font-size: 12px; z-index: 10; }

/* ---- stacked layout under 1200 px */
@media (max-width: 1199px) {
  body { overflow: auto; }
  .lab { grid-template-columns: 1fr; height: auto; }
  .main { min-height: 420px; }
  .trace { min-height: 240px; }
}

/* conditions bar while a POST /api/state is in flight */
.cond.busy { opacity: .7; }
.cond input:disabled { opacity: .35; }
.widget .budget { display: block; color: var(--mubit); }   /* QA3 N-3: no opacity (4.18:1 -> 5.4:1 on --panel) */
.grid-res { border: 1px solid var(--line); border-radius: var(--r); padding: 4px 6px; margin: 4px 0; }
.card select.small, .card input.small { background: #1a1a20; border: 1px solid var(--line); border-radius: var(--r); padding: 3px 6px; font-size: 11px; font-family: var(--mono); max-width: 150px; }
.main .corner.racing { left: 50%; transform: translateX(-50%); top: 8px; }   /* the game's lap tower owns the top-left */
.ledger .head { flex-wrap: wrap; row-gap: 2px; }
.ledger .head .srcline { flex-basis: 100%; font-size: 10px; }
.ledger .head .srcline:empty { display: none; }
.linkbtn { margin-left: 8px; padding: 0; background: none; border: 0; border-bottom: 1px dotted var(--muted); color: var(--text); font: inherit; }
.linkbtn:hover { color: var(--purple); border-color: var(--purple); }

/* QA B1/N-B/N-E: tighter cards and overlays on a 1280-class screen */
@media (max-width: 1299px) {
  .rail { gap: 8px; }
  .card { padding: 9px 10px; }
  .sectors .cell { padding: 1px 4px; }
  .sectors .cell .t, .sectors .cell .delta { font-size: 10.5px; }
  .setup-table { font-size: 10.5px; }
  .setup-table th, .setup-table td { padding: 1px 6px; }
  .setup-table th { font-size: 9px; }
  .setup-table .range { font-size: 10px; }
  /* QA3 S-1: fixed columns 396 -> 338 px (tighter padding), so "change" gets ~108 px of the 446 px table at 1280×800; full text in the title */
  .ledger th, .ledger td { padding-left: 3px; padding-right: 3px; }
  .ledger th:first-child, .ledger td:first-child { padding-left: 8px; }
  .ledger col.c-n { width: 28px; } .ledger col.c-d { width: 50px; } .ledger col.c-agr { width: 44px; } .ledger col.c-v { width: 58px; } .ledger col.c-rule { width: 38px; } .ledger col.c-st { width: 70px; }
  .kvl .xs { column-gap: 7px; } .kvl .xs .delta { font-size: 10.5px; }
}
.main .overlay .src { max-width: 46%; }
