/* Transport Bake-off — design 2A, "live lab report".
   A single committed light aesthetic (paper, not a themed surface), so every
   colour is painted explicitly rather than inherited. */

:root {
  --page:    #e7e4dd;
  --card:    #faf8f3;
  --panel:   #f3f0e9;
  --ink:     #1b1a17;
  --ink-2:   #302d27;
  --ink-3:   #57544c;
  --ink-4:   #6d685e;
  --muted:   #8a8478;
  --muted-2: #9c968a;
  --rule:    #e2ddd2;
  --rule-2:  #d8d3c8;
  --rule-3:  #c7c1b4;

  --ws:      #a35a28;
  --ws-mark: #c2703a;
  --sse:     #1f6f78;
  --sse-mark:#2f8f99;
  --live:    #3f7a4a;

  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --serif: Newsreader, Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
/* `display: flex` on .popped / .panecard children beats the UA's [hidden]
   rule, so hidden blocks kept rendering. Make hidden actually mean hidden. */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: #7a5c3a; }
a:hover { color: var(--ink); }

.sheet {
  max-width: 1440px; margin: 40px auto; background: var(--card); color: var(--ink);
  border: 1px solid var(--rule-2); display: flex; align-items: stretch;
}
@media (max-width: 1480px) { .sheet { margin: 0 auto; border-left: 0; border-right: 0; } }
@media (max-width: 1080px) { .sheet { flex-direction: column; } }

/* ── left rail ────────────────────────────────────────────────────────── */
.rail {
  box-sizing: border-box; width: 600px; flex: none;
  display: flex; flex-direction: column; gap: 24px;
  padding: 40px 40px 34px; border-right: 2px solid var(--ink);
}
@media (max-width: 1080px) { .rail { width: 100%; border-right: 0; border-bottom: 2px solid var(--ink); } }
.railblock { display: flex; flex-direction: column; gap: 12px; }
.railblock.ruled { padding-top: 22px; border-top: 1px solid var(--rule); }
.railblock.foot { margin-top: auto; gap: 14px; padding-top: 24px; }

.runline {
  display: flex; align-items: center; gap: 10px; font-family: var(--mono);
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); flex: none; }
.dot.stale { background: var(--ws-mark); }
h1.title {
  margin: 0; font-family: var(--serif); font-size: 40px; font-weight: 400;
  letter-spacing: -.015em; line-height: 1.05;
}
h1.title em { font-style: italic; }
.intro { font-size: 14.5px; color: var(--ink-3); line-height: 1.5; text-wrap: pretty; }

.ctllabel {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font: inherit; font-family: var(--mono); font-size: 11.5px; padding: 6px 12px;
  border: 1px solid var(--rule-3); background: transparent; color: var(--ink-4); cursor: pointer;
}
.pill.sm { font-size: 11px; padding: 5px 10px; }
.pill[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--card); }
.pill:hover:not([aria-pressed="true"]):not(:disabled) { border-color: var(--muted); color: var(--ink); }
.pill:disabled { opacity: .5; cursor: default; }
.unitnote { font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1.5; }
.subctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── pane cards ───────────────────────────────────────────────────────── */
.paneshead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panestitle { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.panescap { font-family: var(--mono); font-size: 10.5px; color: var(--muted); text-align: right; }
.panecard { display: flex; flex-direction: column; border: 1px solid var(--rule-2); background: #fff; }
.pcHead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 13px; background: var(--panel); border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em;
}
.panecard.ws .pcHead .who { color: var(--ws); }
.panecard.sse .pcHead .who { color: var(--sse); }
.pcRight { display: flex; align-items: center; gap: 8px; flex: none; }
.pcHead .proto { color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.pop {
  font: inherit; font-family: var(--mono); font-size: 11px; line-height: 1; padding: 3px 6px;
  border: 1px solid var(--rule-3); background: transparent; color: var(--ink-4); cursor: pointer;
}
.pop:hover:not(:disabled) { border-color: var(--muted); color: var(--ink); }
.pop:disabled { opacity: .45; cursor: default; }
.pcStatus {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 13px; border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-4);
}
.pcStatus .live { display: flex; align-items: center; gap: 7px; min-width: 0; }
.pcStatus .live span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
iframe { border: 0; width: 100%; height: 236px; display: block; background: #fff; }
.popped {
  height: 236px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 9px; text-align: center; padding: 0 26px; background: var(--panel);
}
.popped p { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.popped p.sub { font-size: 11px; color: var(--muted); max-width: 34ch; line-height: 1.6; }

/* ── rail colophon ────────────────────────────────────────────────────── */
.foot .say { font-family: var(--serif); font-size: 17px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.foot .say b { font-family: var(--mono); font-size: 14px; font-weight: 400; }
.foot .say b.ws { color: var(--ws); }
.foot .say b.sse { color: var(--sse); }
.foot .meta { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-4); }

/* ── right column ─────────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* Everything on this bar sits on ONE shared baseline. Bottom-aligning the
   boxes instead lets differing line-heights — and the two-line "apart right
   now" label hanging below the number — float the big figure ~18px high.
   Each readout's label is taken out of flow, so the only in-flow line box is
   the value: that makes the value define the readout's baseline, and
   align-items: baseline then lines all four up exactly. */
.readoutbar {
  display: flex; align-items: baseline; gap: 30px;
  padding: 34px 44px 22px; border-bottom: 1px solid var(--rule);
}
.readouts { display: flex; align-items: baseline; gap: 30px; margin-left: auto; flex-wrap: wrap; }
/* The label is out of flow so the VALUE defines the baseline (see .readoutbar).
   That means it contributes no width, so a short value like the em-dash
   placeholder would collapse the box and let neighbouring labels overlap.
   Floor the width at the widest label. */
.readout { position: relative; padding-top: 17px; min-width: 5.5rem; }
.readout .k {
  position: absolute; top: 0; left: 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.readout .v { font-family: var(--mono); font-size: 21px; line-height: 1; font-variant-numeric: tabular-nums; }
.readout.ws .k, .readout.ws .v { color: var(--ws); }
.readout.sse .k, .readout.sse .v { color: var(--sse); }
/* The label is two lines against one 54px figure. Baseline-aligning it puts
   "apart" ON the number's baseline and drops "right now" below it, so the pair
   droops. Bottom-align instead: both lines nest beside the figure. The gapbox's
   own baseline still comes from its first item (the number), so the outer
   baseline row is unaffected. */
.gapbox { display: flex; align-items: flex-end; gap: 10px; flex: none; }
.gapbox.empty .n, .readout.empty .v { color: var(--rule-2); }
.gapbox .n { font-family: var(--serif); font-size: 54px; line-height: .85; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.gapbox .l { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); max-width: 92px; line-height: 1.5; }

/* ── sections ─────────────────────────────────────────────────────────── */
.sec { display: flex; flex-direction: column; gap: 4px; padding: 30px 44px 26px; }
.sec.alt { background: var(--panel); border-top: 1px solid var(--rule); gap: 12px; padding: 22px 44px 26px; }
.sec.tight { padding: 18px 44px 34px; }

.sechead {
  display: flex; justify-content: space-between; align-items: baseline;
  cursor: pointer; gap: 20px;
}
.sechead h2 {
  margin: 0; display: flex; align-items: baseline; gap: 12px;
  font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: .02em;
}
.sec.alt .sechead h2, .sec.tight .sechead h2 { font-size: 13px; }
.caret {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border: 1px solid var(--rule-3);
  color: var(--ink-4); font-size: 12px; line-height: 1; flex: none;
}
.sechint { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.seclegend { display: flex; gap: 22px; font-family: var(--mono); font-size: 11.5px; flex-wrap: wrap; }
.seclegend span { display: flex; align-items: center; gap: 7px; }
.seclegend .sw { width: 9px; height: 9px; flex: none; }
.summary { padding: 4px 0 0 29px; font-family: var(--mono); font-size: 12px; color: var(--ink-4); }
.subhead { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding: 0 0 6px 29px; }

/* ── chart ────────────────────────────────────────────────────────────── */
.chartbox { position: relative; width: 100%; }
.chartbox svg { display: block; width: 100%; height: auto; }
.chartbox .tip {
  position: absolute; font-family: var(--mono); font-size: 12.5px;
  transform: translateY(-50%); pointer-events: none; white-space: nowrap;
}
.chartbox .tip.ws { color: var(--ws); }
.chartbox .tip.sse { color: var(--sse); }
.chartbox .bandlab {
  position: absolute; top: 0; font-family: var(--mono); font-size: 11px;
  color: var(--ws); padding-left: 6px; pointer-events: none;
}
.chartfoot {
  display: flex; align-items: center; gap: 12px; padding: 10px 0 0 29px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-4);
}
.chartfoot .dot { background: var(--ws-mark); }

/* ── bars ─────────────────────────────────────────────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 70px; }
.nodata {
  display: flex; align-items: center; height: 70px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.trow.nodata { display: block; height: auto; padding: 16px 0; border: 0; }
.barpair { flex: 1; display: flex; align-items: flex-end; gap: 3px; height: 100%; min-width: 0; }
.barpair i { flex: 1; display: block; }
.barpair .bws { background: var(--ws-mark); }
.barpair .bsse { background: var(--sse-mark); }

/* ── readings table ───────────────────────────────────────────────────── */
.tgrid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.1fr; gap: 20px; }
.thead {
  padding: 18px 0 10px; border-bottom: 1px solid var(--ink);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.thead .cws { color: var(--ws); }
.thead .csse { color: var(--sse); }
.trow { align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.trow .lab { font-size: 14.5px; color: var(--ink-2); }
.trow .num { font-family: var(--mono); font-size: 17px; font-variant-numeric: tabular-nums; }
.trow .num.ws { color: var(--ws); }
.trow .num.sse { color: var(--sse); }
.trow .why { font-size: 13px; color: var(--ink-4); line-height: 1.45; }

