/* Qubitrage . an instrument panel set in the brand's aubergine. Rules, not boxes. One accent (sky) used for the
   live mark only: the diamond, the current fill, the lit lamp. Numbers right-aligned, tabular, lining. */
:root {
  --bg: #1A0E24; --bg2: #20132D; --bg3: #2A1B3A;
  --ink: #ECE8F4; --ink2: #C9C0D9; --mute: #9C90AF; --faint: #6E6283;
  --rule: rgba(236, 232, 244, .14); --rule2: rgba(236, 232, 244, .32); --rule3: rgba(236, 232, 244, .6);
  --sky: #8FD3FB; --rose: #F0A3B5;
  --display: 'Bodoni Moda', 'Playfair Display', Didot, serif;
  --text: 'Newsreader', Georgia, serif;
  --mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
  --gut: 16px; --max: 1200px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--text); font-variant-numeric: lining-nums tabular-nums; overflow-x: hidden; }
a { color: var(--ink); text-decoration-color: var(--rule3); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--sky); }
code, .mono { font-family: var(--mono); font-size: .86em; overflow-wrap: anywhere; }
::selection { background: var(--sky); color: var(--bg); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: .01em; line-height: 1.1; margin: 0; }
h2 { font-size: 30px; }
h3 { font-size: 21px; }
p { margin: 0 0 .9em; max-width: 68ch; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }
@media (min-width: 760px) { :root { --gut: 32px; } }

/* ───────────── the shell: a fixed index rail on the left, the page on the right */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--rule2); display: flex; flex-direction: column; background: var(--bg); z-index: 5; }
.rail-top { display: flex; align-items: center; padding: 22px 20px 20px; border-bottom: 1px solid var(--rule2); }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { font: 500 18px/1 var(--display); letter-spacing: .16em; }
.menu { display: none; margin-left: auto; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: transparent; border: 1px solid var(--rule3); padding: 9px 12px; cursor: pointer; }
.rail-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rail-nav { padding: 8px 0 16px; overflow-y: auto; flex: 1; counter-reset: pg; }
.rail-h { font: 11px/1 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .16em; margin: 22px 20px 8px; }
.rail-nav ol { list-style: none; margin: 0; padding: 0; }
.rail-nav li { counter-increment: pg; }
.rail-nav a { display: flex; align-items: baseline; gap: 12px; padding: 8px 20px; text-decoration: none; color: var(--ink2); font: 15px/1.2 var(--text); border-left: 2px solid transparent; }
.rail-nav a::before { content: counter(pg, decimal-leading-zero); font: 10px/1 var(--mono); color: var(--faint); width: 16px; }
.rail-nav a:hover { color: var(--ink); background: var(--bg2); }
.rail-nav a[aria-current="page"] { color: var(--ink); border-left-color: var(--sky); background: var(--bg2); }
.rail-nav a[aria-current="page"]::before { color: var(--sky); }
.rail-foot { border-top: 1px solid var(--rule2); padding: 16px 20px 20px; display: grid; gap: 12px; font: 12px/1 var(--mono); }
.rail-foot .btn { width: 100%; }
.page { min-width: 0; }
@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: sticky; height: auto; border-right: 0; border-bottom: 1px solid var(--rule2); }
  .rail-top { padding: 12px var(--gut); border-bottom: 0; }
  .menu { display: block; }
  .rail-body { display: none; border-top: 1px solid var(--rule2); max-height: calc(100vh - 56px); overflow-y: auto; }
  .rail.open .rail-body { display: flex; }
}
.lamp { display: inline-flex; align-items: center; gap: 8px; color: var(--mute); text-decoration: none; text-transform: uppercase; letter-spacing: .08em; }
.lamp i { width: 11px; height: 11px; border: 1px solid var(--rule3); display: inline-block; transform: rotate(45deg); }
.lamp[data-s="fired"] { color: var(--sky); }
.lamp[data-s="fired"] i { background: var(--sky); border-color: var(--sky); box-shadow: 0 0 0 4px rgba(143, 211, 251, .18); }
.lamp[data-s="quiet"] i { border-color: var(--ink2); }
.btn { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: transparent; border: 1px solid var(--rule3); padding: 11px 14px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--ink); background: var(--bg3); }
.btn:disabled { color: var(--faint); border-color: var(--rule); cursor: not-allowed; }
.btn.go { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.btn.go:hover:not(:disabled) { background: #fff; }
.btn.go:disabled { background: transparent; color: var(--faint); border-color: var(--rule); }
.btn.sm { padding: 7px 9px; font-size: 11px; }

/* ───────────── the page head: a cropped ring dial on the left edge (live fills plot onto it) */
.head { position: relative; border-bottom: 1px solid var(--rule2); overflow: hidden; }
.head .dial { position: absolute; left: -210px; top: 50%; width: 420px; height: 420px; transform: translateY(-50%); pointer-events: none; }
.head-in { position: relative; padding-top: 40px; padding-bottom: 30px; padding-left: calc(var(--gut) + 170px); }
.head h1 { font-size: clamp(34px, 6vw, 58px); }
.head .kick { font: 12px/1 var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .14em; margin: 0 0 14px; }
.head .lede { margin: 16px 0 0; color: var(--ink2); font-size: 19px; max-width: 60ch; }
@media (max-width: 759px) { .head .dial { left: -330px; opacity: .55; } .head-in { padding-left: calc(var(--gut) + 78px); padding-top: 28px; } .head .lede { font-size: 17px; } }
.tag { font: 12px/1.6 var(--mono); color: var(--ink2); letter-spacing: .06em; margin-top: 18px; }
.tag em { font-style: normal; color: var(--ink); border-bottom: 1px solid var(--ink); }
.tag .dot { display: inline-block; width: 5px; height: 5px; background: var(--sky); margin: 0 10px; vertical-align: 2px; transform: rotate(45deg); }

/* ───────────── state strip (pre-launch, wallet, draft) */
.strip { border-bottom: 1px solid var(--rule); font: 12px/1.5 var(--mono); color: var(--ink2); }
.strip .wrap { padding-top: 9px; padding-bottom: 9px; }
.strip b { color: var(--ink); font-weight: 500; }
.strip[data-k="warn"] { background: var(--bg3); }

/* ───────────── sections and columns, separated by rules */
main { padding-bottom: 60px; }
.sec { padding-top: 34px; padding-bottom: 6px; }
.sec + .sec { border-top: 1px solid var(--rule); }
.sec > h2 { margin-bottom: 16px; }
.sec-h { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-h h2 { margin: 0; }
.sec-h .note { font: 12px/1.3 var(--mono); color: var(--mute); }
.cols { display: grid; gap: 0; }
@media (min-width: 900px) {
  .cols.c2 { grid-template-columns: 1fr 1fr; }
  .cols.c3 { grid-template-columns: repeat(3, 1fr); }
  .cols.c21 { grid-template-columns: 2fr 1fr; }
  .cols.c12 { grid-template-columns: 1fr 1.4fr; }
  .cols > * + * { border-left: 1px solid var(--rule); padding-left: 28px; }
  .cols > * { padding-right: 28px; }
  .cols > *:last-child { padding-right: 0; }
}
@media (max-width: 899px) { .cols > * + * { border-top: 1px solid var(--rule); margin-top: 22px; padding-top: 22px; } }
.label { font: 11px/1.2 var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .12em; margin: 0 0 8px; }
.small { font-size: 14px; color: var(--ink2); }
.muted { color: var(--mute); }
.dim { color: var(--faint); }
.sky { color: var(--sky); }
.err { color: var(--rose); }

/* ───────────── readings: a ruled ledger of label / value */
.read { width: 100%; border-collapse: collapse; font: 13px/1.35 var(--mono); }
.read th, .read td { padding: 8px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.read th { text-align: left; font-weight: 400; color: var(--ink2); padding-right: 12px; }
.read td { text-align: right; white-space: nowrap; }
.read td small { color: var(--mute); font-size: 11px; margin-left: 4px; }
.read tr.top th, .read tr.top td { border-top: 1px solid var(--rule3); }
.read tr.total th, .read tr.total td { border-top: 1px solid var(--rule3); border-bottom: 3px double var(--rule3); color: var(--ink); }

/* data tables */
.tbl-w { overflow-x: auto; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font: 13px/1.35 var(--mono); }
.tbl th { text-align: left; font-weight: 400; color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule3); white-space: nowrap; }
.tbl td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl .n { text-align: right; white-space: nowrap; }
.tbl tr.off td { color: var(--faint); }
.tbl a { text-decoration: none; border-bottom: 1px solid var(--rule2); }
@media (max-width: 759px) {
  .tbl.stack thead { display: none; }
  .tbl.stack tr { display: block; border-bottom: 1px solid var(--rule2); padding: 8px 0; }
  .tbl.stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; text-align: right; }
  .tbl.stack td::before { content: attr(data-l); color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; text-align: left; }
  .tbl.stack td.n { white-space: normal; }
}

/* ───────────── forms: underlined fields, no boxes */
.field { margin: 0 0 18px; }
.field label, .field .label { display: block; }
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  width: 100%; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--rule3); padding: 8px 0; font: 16px/1.3 var(--mono); outline: none; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-bottom-color: var(--sky); }
.field select option { background: var(--bg2); }
.field .hint { font: 12px/1.45 var(--mono); color: var(--mute); margin-top: 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--rule3); }
.seg button { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; background: transparent; color: var(--ink2); border: 0; padding: 11px 18px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule3); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.status { font: 12px/1.5 var(--mono); color: var(--ink2); margin-top: 12px; min-height: 18px; overflow-wrap: anywhere; }
.status[data-k="err"] { color: var(--rose); }
.status[data-k="ok"] { color: var(--ink); }
.status a { color: inherit; }

/* the verdict line on Trade: who fills */
.verdict { border-top: 1px solid var(--rule3); border-bottom: 1px solid var(--rule3); padding: 14px 0; margin: 16px 0; font: 13px/1.5 var(--mono); }
.verdict b { font: 500 22px/1.1 var(--display); display: block; margin-bottom: 6px; letter-spacing: .02em; }
.verdict[data-k="agents"] b::before { content: ''; display: inline-block; width: 9px; height: 9px; background: var(--sky); transform: rotate(45deg); margin: 0 12px 3px 2px; }

/* the readout of big numbers */
.dials { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--rule3); }
.dials > div { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--rule); }
.dials > div:nth-child(2n) { padding-left: 14px; border-left: 1px solid var(--rule); }
.dials .v { font: 400 26px/1.1 var(--mono); letter-spacing: -.01em; }
.dials .v small { font-size: 12px; color: var(--mute); margin-left: 4px; }
@media (min-width: 900px) {
  .dials { grid-template-columns: repeat(5, 1fr); }
  .dials > div { padding: 16px 16px 16px 0; }
  .dials > div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
}

/* ───────────── specimen plates (agents) */
.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); border-top: 1px solid var(--rule3); }
.plate { display: block; text-decoration: none; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); }
.plate svg { width: 100%; height: auto; display: block; margin-bottom: 8px; }
.plate .t { font: 500 15px/1.2 var(--display); letter-spacing: .04em; }
.plate .m { font: 11px/1.5 var(--mono); color: var(--mute); display: flex; justify-content: space-between; gap: 8px; }
.plate.lead .t::after { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--sky); transform: rotate(45deg); margin-left: 8px; vertical-align: 2px; }
.plates.top4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .plates.top4 { grid-template-columns: repeat(4, 1fr); } .plates.top4 .plate + .plate, .plates .plate { padding-left: 0; } }

/* weights editor */
.wgrid { display: grid; grid-template-columns: 70px repeat(9, minmax(0, 1fr)); font: 11px/1 var(--mono); border-top: 1px solid var(--rule3); }
.wgrid > * { border-bottom: 1px solid var(--rule); padding: 3px 2px; min-width: 0; }
.wgrid .h { color: var(--mute); padding: 6px 2px; text-align: center; overflow: hidden; }
.wgrid .rl { color: var(--mute); padding: 7px 4px 0 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wgrid input { width: 100%; background: transparent; border: 0; color: var(--ink); font: 12px/1 var(--mono); text-align: right; padding: 5px 2px; outline: none; }
.wgrid input:focus { background: var(--bg3); }
.wgrid input.neg { color: var(--sky); }

/* the tape of fills */
.tape { font: 12px/1.5 var(--mono); border-top: 1px solid var(--rule3); }
.tape .ln { display: grid; grid-template-columns: 90px 1fr 110px 120px; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.tape .ln span:nth-child(n+3) { text-align: right; }
.tape .ln.ag span:nth-child(2)::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--sky); transform: rotate(45deg); margin-right: 8px; vertical-align: 1px; }
@media (max-width: 759px) { .tape .ln { grid-template-columns: 1fr 1fr; } .tape .ln span:nth-child(3) { text-align: left; } }

/* prose pages */
.prose h2 { margin: 30px 0 12px; }
.prose h3 { margin: 22px 0 8px; }
.prose ul, .prose ol { padding-left: 1.2em; max-width: 68ch; }
.prose li { margin: 0 0 .45em; }
.prose li::marker { color: var(--mute); }
.limits li::marker { content: '\25C7  '; color: var(--sky); }
.callout { border-left: 2px solid var(--ink); padding: 4px 0 4px 16px; margin: 18px 0; max-width: 68ch; }
.kbd { font: 12px/1.5 var(--mono); background: var(--bg2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 10px 0; overflow-wrap: anywhere; }
.svgcard { border-top: 1px solid var(--rule3); padding-top: 12px; }
.svgcard img { width: 100%; max-width: 400px; display: block; }

/* footer */
.foot { border-top: 1px solid var(--rule2); padding: 26px 0 40px; font: 12px/1.6 var(--mono); color: var(--mute); }
.foot-in { display: grid; gap: 18px; }
@media (min-width: 900px) { .foot-in { grid-template-columns: 2fr 1fr 1fr; } }
.foot a { color: var(--ink2); }
.foot ul { list-style: none; margin: 0; padding: 0; }

/* ═════════════ minimal: one grotesk, figures in a small mono, space instead of rules ═════════════ */
:root {
  --display: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --text: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Martian Mono', ui-monospace, monospace;
  --rule: rgba(236, 232, 244, .08); --rule2: rgba(236, 232, 244, .12); --rule3: rgba(236, 232, 244, .22);
}
body { font: 16px/1.6 var(--text); letter-spacing: -.003em; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.02em; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
code, .mono { font-size: .8em; }

/* the rail: text only */
.rail { border-right: 0; }
.rail-top { border-bottom: 0; padding: 28px 28px 12px; }
.brand b { font: 600 14px/1 var(--display); letter-spacing: .28em; }
.brand svg { width: 26px; height: 26px; }
.rail-nav { padding: 10px 0 16px; }
.rail-h { font: 400 10px/1 var(--mono); letter-spacing: .14em; margin: 26px 28px 10px; }
.rail-nav a { padding: 6px 28px; font: 400 14px/1.3 var(--text); border-left: 0; color: var(--mute); gap: 0; }
.rail-nav a::before { content: none; }
.rail-nav a:hover { background: transparent; color: var(--ink); }
.rail-nav a[aria-current="page"] { background: transparent; color: var(--ink); }
.rail-nav a[aria-current="page"]::after { content: ''; width: 5px; height: 5px; background: var(--sky); transform: rotate(45deg); margin-left: 10px; align-self: center; }
.rail-foot { border-top: 0; padding: 20px 28px 28px; }
.lamp { letter-spacing: .1em; font-size: 10px; }
@media (max-width: 899px) { .rail { border-bottom: 1px solid var(--rule); } .rail-top { padding: 14px var(--gut); } .rail-body { border-top: 0; } }

/* the page head: just words */
.head { border-bottom: 0; }
.head-in, .head .head-in { padding: 88px var(--gut) 24px; }
@media (min-width: 760px) { .head-in, .head .head-in { padding-left: var(--gut); padding-top: 112px; } }
.head h1 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 500; letter-spacing: -.035em; line-height: 1.04; max-width: 18ch; }
.head .kick { font: 400 10px/1 var(--mono); letter-spacing: .16em; color: var(--mute); margin-bottom: 22px; }
.head .lede { font-size: 17px; line-height: 1.6; color: var(--ink2); margin-top: 22px; max-width: 56ch; }
.tag { font: 400 11px/1.6 var(--mono); color: var(--mute); letter-spacing: .02em; margin-top: 26px; }
.tag em { border-bottom: 0; color: var(--ink); }

/* sections breathe; no rules between them */
.sec { padding-top: 56px; padding-bottom: 8px; }
.sec + .sec { border-top: 0; }
.sec-h { margin-bottom: 20px; }
.sec-h .note, .label { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; }
.cols > * + * { border-left: 0 !important; border-top: 0 !important; }
@media (min-width: 900px) { .cols > * + * { padding-left: 48px; } }

/* figures: large, light, no grid lines */
.dials { border-top: 0; gap: 28px 24px; }
.dials > div, .dials > div + div, .dials > div:nth-child(2n) { border: 0; padding: 0; }
.dials .v { font: 300 28px/1.15 var(--mono); letter-spacing: -.04em; margin: 4px 0 6px; }
.dials .label { margin-bottom: 4px; }

/* tables and readings: hairlines only where the eye needs them */
.read, .tbl, .tape { font-family: var(--mono); font-size: 12px; }
.read th { font-family: var(--text); font-size: 14px; color: var(--mute); }
.read th, .read td, .tbl td { border-bottom-color: var(--rule); }
.tbl th { border-bottom: 1px solid var(--rule2); font-size: 10px; }
.read tr.total th, .read tr.total td { border-bottom: 0; border-top: 1px solid var(--rule3); }
.tape { border-top: 0; }
.tape .ln { border-bottom-color: var(--rule); }

/* plates and controls */
.plates { border-top: 0; gap: 18px; }
.plate { border-bottom: 0; padding: 0; }
.plate .t { font: 500 14px/1.2 var(--text); letter-spacing: 0; }
.btn { font: 500 11px/1 var(--text); letter-spacing: .06em; padding: 12px 18px; border-color: var(--rule3); }
.btn.sm { padding: 8px 12px; font-size: 10px; }
.seg button { font: 500 11px/1 var(--text); }
.verdict { border-top: 0; border-bottom: 0; padding: 0; margin: 4px 0 22px; }
.verdict b { font: 500 22px/1.15 var(--text); letter-spacing: -.02em; }
.callout { border-left-width: 1px; border-left-color: var(--sky); }
.strip { border-bottom: 0; }
.foot { border-top: 0; margin-top: 40px; font-family: var(--text); font-size: 13px; }
.wgrid { border-top: 0; }
.cols > * { min-width: 0; }
.wgrid input { min-width: 0; }
@media (max-width: 599px) {
  .wgrid { grid-template-columns: 40px repeat(10, minmax(0, 1fr)) !important; font-size: 9px; }
  .wgrid input { font-size: 10px; padding: 5px 0; }
  .wgrid .rl { font-size: 9px; }
}
@media (max-width: 899px) { .cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 599px) { .read td { white-space: normal; overflow-wrap: anywhere; } }
