/* Jisr Lab and the Jisr shell. Every colour and size is a custom property here; canvas code reads them too. */

@font-face {
  font-family: "Inter";
  src: url("../vendor/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: block;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../vendor/fonts/jetbrains-mono-latin-var.woff2") format("woff2");
  font-weight: 100 800;
  font-display: block;
}

:root {
  color-scheme: dark;
  /* surfaces */
  --bg-0: #05070a;
  --bg-1: #0a0e14;
  --bg-2: #0e131b;
  --bg-3: #141b25;
  --bg-4: #1b2430;
  --grid: rgba(150, 175, 210, 0.035);
  --line-1: rgba(160, 185, 220, 0.07);
  --line-2: rgba(160, 185, 220, 0.13);
  --line-3: rgba(160, 185, 220, 0.24);
  /* ink */
  --ink-1: #eaf0f8;
  --ink-2: #b2bccb;
  --ink-3: #7b879a;
  --ink-4: #6f7a8c;
  /* legs: four hue families (neutral, blue, magenta, cyan), none near the status hues, spread in lightness so
     they stay apart under protanopia and deuteranopia. tests/test_ui_palette.py checks the distances. */
  --leg-eth: #f2f4f7;
  --leg-wifi: #2456d3;
  --leg-cell: #d95ffc;
  --leg-sat: #46d3e6;
  /* text on a leg-coloured badge */
  --leg-eth-ink: #0a0e14;
  --leg-wifi-ink: #ffffff;
  --leg-cell-ink: #0a0e14;
  --leg-sat-ink: #0a0e14;
  /* status: reserved meanings */
  --ok: #3ddc84;
  --ok-bg: rgba(61, 220, 132, 0.12);
  --warn: #f5b83d;
  --warn-bg: rgba(245, 184, 61, 0.13);
  --bad: #ff4d5e;
  --bad-bg: rgba(255, 77, 94, 0.14);
  --bad-glow: rgba(255, 77, 94, 0.45);
  --idle: #5b6577;
  --down-hatch: rgba(160, 175, 200, 0.22);
  /* emphasis */
  --proposed: #eaf0f8;
  --proposed-bg: linear-gradient(90deg, rgba(234, 240, 248, 0.085), rgba(234, 240, 248, 0.015) 60%);
  --select: rgba(234, 240, 248, 0.55);
  --playhead: #eaf0f8;
  /* type */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --fs-2xs: 10px;
  --fs-xs: 11px;
  --fs-s: 12px;
  --fs-m: 13.5px;
  --fs-l: 16px;
  --fs-xl: 20px;
  --fs-num: 15px;
  --fs-clock: 36px;
  --fs-caption: 30px;
  /* layout */
  --topbar-h: 76px;
  --legend-h: 36px;
  --gutter: 20px;
  --label-w: 392px;
  --panel-w: 384px;
  --radius: 10px;
  --row-gap: 6px;
  --band-frac: 0.42;
  --pill-w: 128px;
  --col-gap: 92px;
  --col-out: 82px;
  --col-late: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 30% -10%, rgba(80, 120, 190, 0.10), transparent 70%),
    radial-gradient(900px 500px at 100% 110%, rgba(60, 160, 190, 0.06), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg-0);
  color: var(--ink-1);
  font-family: var(--font-ui);
  font-size: var(--fs-m);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, select { font-family: inherit; color: inherit; }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.caps { text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-3); }
[hidden] { display: none !important; }

.app { display: grid; grid-template-rows: var(--topbar-h) auto 1fr var(--legend-h); height: 100vh; }
.app > .topbar { grid-row: 1; }
.app > .jbar { grid-row: 2; }
.app > .main { grid-row: 3; }
.app > .legend { grid-row: 4; }

/* journey switcher: the published journeys as tabs, duels apart, the seed, and every session in a menu */
.jbar {
  display: flex; align-items: center; gap: 12px; padding: 8px var(--gutter); min-width: 0;
  border-bottom: 1px solid var(--line-1); background: rgba(10, 14, 20, 0.7);
}
.jb-label { font-size: var(--fs-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; white-space: nowrap; }
.jb-tabs { display: flex; gap: 6px; }
.jb-tab {
  height: 34px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink-2);
  font-size: 14px; font-weight: 650; cursor: pointer; white-space: nowrap;
}
.jb-tab:hover { color: var(--ink-1); border-color: var(--line-3); }
.jb-tab.on { background: var(--ink-1); color: var(--bg-0); border-color: var(--ink-1); }
.jb-group { display: flex; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.jb-chip { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.jb-chip.on { background: var(--bg-4); color: var(--ink-1); border-color: var(--line-3); }
.jb-seeds .seedchips button { height: 28px; min-width: 30px; font-size: 13px; }
.jb-more { display: flex; align-items: center; gap: 8px; }
.jb-more select {
  appearance: none; background: var(--bg-2) 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='%237b879a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 30px 5px 10px; font-size: var(--fs-s); max-width: 260px; cursor: pointer;
}
body.present .jbar { display: none; }

/* ---- top bar ------------------------------------------------------------------------------------------- */
.topbar {
  min-width: 0; overflow: hidden;
  display: flex; align-items: center; gap: 18px; padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line-1);
  background: linear-gradient(180deg, rgba(14, 19, 27, 0.92), rgba(10, 14, 20, 0.86));
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand svg { flex: none; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; }
.vsep { width: 1px; height: 36px; background: var(--line-2); flex: none; }
.scenario { min-width: 0; }
.scn-title { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.scn-sub { font-size: var(--fs-s); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.picker { display: flex; flex-direction: column; gap: 3px; }
.picker select {
  appearance: none; background: var(--bg-2) 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='%237b879a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 30px 6px 10px; font-size: var(--fs-s);
  min-width: 200px; max-width: 250px; cursor: pointer; text-overflow: ellipsis;
}
.picker select:focus-visible { outline: 2px solid var(--select); outline-offset: 1px; }
.chips { display: flex; gap: 8px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.1em; border: 1px solid var(--line-2); color: var(--ink-2);
  background: var(--bg-2); white-space: nowrap;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.chip.live { color: var(--ink-1); border-color: rgba(234, 240, 248, 0.35); }
.chip.live .dot { background: var(--ink-1); box-shadow: 0 0 0 0 rgba(234, 240, 248, 0.6); animation: pulse 1.6s ease-out infinite; }
.chip.live.paused .dot { animation: none; background: var(--ink-3); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(234, 240, 248, 0.55); } 80%, 100% { box-shadow: 0 0 0 9px rgba(234, 240, 248, 0); } }
.chip.synth {
  color: var(--warn); border-color: rgba(245, 184, 61, 0.45);
  background: repeating-linear-gradient(135deg, rgba(245, 184, 61, 0.10) 0 6px, rgba(245, 184, 61, 0.03) 6px 12px);
}
.seedchips { display: flex; gap: 4px; }
.seedchips button { height: 26px; min-width: 34px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: var(--fs-xs); font-family: var(--font-mono); cursor: pointer; color: var(--ink-3); }
.seedchips button.on { color: var(--ink-1); border-color: var(--line-3); background: var(--bg-4); }
.spacer { flex: 1; }

.transport { display: flex; align-items: center; gap: 10px; }
.tbtn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg-2);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.tbtn:hover { background: var(--bg-3); color: var(--ink-1); }
.tbtn.play { width: 46px; height: 46px; background: var(--ink-1); color: var(--bg-0); border: none; }
.tbtn.play:hover { background: #fff; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--bg-2); }
.seg button {
  border: 0; background: transparent; padding: 0 10px; height: 30px; font-size: var(--fs-s); cursor: pointer; color: var(--ink-3);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.seg button + button { border-left: 1px solid var(--line-1); }
.seg button.on { background: var(--bg-4); color: var(--ink-1); }
.seg.views button { font-family: var(--font-ui); font-weight: 600; letter-spacing: 0.02em; padding: 0 14px; }
.rowpick { position: relative; }
.pickbtn {
  height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink-2);
  font-size: var(--fs-s); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.pickbtn span { font-family: var(--font-mono); color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.pickbtn.filtered { border-color: var(--line-3); color: var(--ink-1); }
.pop {
  position: fixed; z-index: 50; min-width: 250px; padding: 8px; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.pop label { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; font-size: var(--fs-s); cursor: pointer; white-space: nowrap; }
.pop label:hover { background: var(--bg-3); }
.pop input { accent-color: var(--ink-1); }
.pop .pop-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--line-1); margin-top: 6px; padding: 8px 6px 2px; }
.pop .pop-foot button { background: none; border: 0; color: var(--ink-2); font-size: var(--fs-s); cursor: pointer; padding: 0; }
.pop .pop-foot button:hover { color: var(--ink-1); }
.clock { display: grid; justify-items: end; line-height: 1; min-width: 172px; }
.clock-label { font-size: var(--fs-2xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.clock-val { font-family: var(--font-mono); font-size: var(--fs-clock); font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 6px; line-height: 1; }
.clock-val .unit { font-size: 0.45em; color: var(--ink-3); margin-left: 4px; }
.clock-dur { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 4px; font-family: var(--font-mono); }

/* ---- main ---------------------------------------------------------------------------------------------- */
.main { position: relative; min-height: 0; }
.ladder-view { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); gap: var(--gutter); padding: 14px var(--gutter) 10px; height: 100%; min-height: 0; }
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.card {
  background: linear-gradient(180deg, rgba(20, 27, 37, 0.55), rgba(12, 16, 23, 0.55));
  border: 1px solid var(--line-1); border-radius: var(--radius);
}

/* journey strip */
.journey { display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); padding: 10px 0 10px; margin-bottom: 10px; }
.j-left { padding: 0 16px 0 16px; display: flex; flex-direction: column; justify-content: flex-end; }
.j-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: auto; padding-top: 2px; }
.j-head .caps { color: var(--ink-2); }
.j-src { font-size: var(--fs-2xs); color: var(--ink-3); border: 1px dashed var(--line-3); border-radius: 4px; padding: 1px 6px; letter-spacing: 0.04em; }
.j-now { font-size: var(--fs-s); color: var(--ink-2); line-height: 1.35; min-height: 34px; margin: 4px 0 6px; }
.j-now b { color: var(--ink-1); font-weight: 600; }
.j-legs { display: grid; gap: 0; }
.j-leg { display: grid; grid-template-columns: 12px 74px 1fr; align-items: center; gap: 8px; font-size: var(--fs-s); }
.j-leg .sw { width: 12px; height: 4px; border-radius: 2px; }
.j-leg .nm { color: var(--ink-2); font-weight: 550; }
.j-leg .cond { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.j-leg .cond.down { color: var(--ink-2); }
.j-svg { display: block; width: 100%; overflow: visible; }
.j-svg text { font-family: var(--font-ui); }
.j-svg .tick text { font-family: var(--font-mono); font-size: var(--fs-2xs); fill: var(--ink-3); }
.j-svg .tick line { stroke: var(--line-2); }
.j-svg .domain { display: none; }
.j-svg .ev-label { font-size: var(--fs-s); fill: var(--ink-2); font-weight: 550; }
.j-svg .ev-label.past { fill: var(--ink-1); }
.j-svg .ev-stem { stroke: var(--line-3); }
.j-svg .ev-glyph { fill: var(--bg-1); stroke: var(--ink-2); stroke-width: 1.5; }
.j-svg .ev-glyph.past { fill: var(--ink-1); stroke: var(--ink-1); }
.j-svg .ev-span { fill: rgba(234, 240, 248, 0.07); }
.j-svg .ev-span, .j-svg .ev-glyph, .j-svg .ev-label, .j-svg .ev-stem { pointer-events: none; }
.j-svg .tr-key rect { fill: var(--bg-3); stroke: var(--line-3); }
.j-svg .tr-key text { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-1); font-weight: 700; }
.j-svg .tr-key.active rect { fill: var(--ink-1); stroke: var(--ink-1); }
.j-svg .tr-key.active text { fill: var(--bg-0); }
.j-svg .leo { stroke: var(--ink-1); stroke-width: 1; opacity: 0.55; }

/* lanes */
.lanes-head {
  display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); align-items: end; height: 22px; margin-bottom: 4px;
}
.lh-cols { display: grid; grid-template-columns: var(--pill-w) var(--col-gap) var(--col-out) var(--col-late) 1fr; padding: 0 16px; }
.lh-cols span { font-size: var(--fs-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.lh-track { font-size: var(--fs-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; text-align: right; padding-right: 4px; }
.lh-track span { transition: opacity 0.2s; }
.lanes { flex: 1; display: flex; flex-direction: column; gap: var(--row-gap); min-height: 0; }
.row {
  position: relative; flex: 1 1 0; min-height: 0; max-height: 120px;
  display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 27, 37, 0.62), rgba(13, 18, 25, 0.62));
  border: 1px solid var(--line-1); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.row.ctl { flex-grow: 1.3; }
.row:hover { border-color: var(--line-2); }
.row.selected { border-color: var(--select); box-shadow: 0 0 0 1px rgba(234, 240, 248, 0.10), 0 8px 30px rgba(0, 0, 0, 0.35); }
.row.proposed { background: var(--proposed-bg), linear-gradient(180deg, rgba(24, 32, 44, 0.75), rgba(14, 19, 27, 0.75)); }
.row.proposed::before {
  content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--proposed);
}
.row.reference { background: transparent; border-style: dashed; border-color: var(--line-2); }
/* many rows on a short screen: the lanes container is marked dense or tight by the space each row gets */
.lanes.dense .row-label { padding: 4px 12px 4px 16px; gap: 3px; }
.lanes.dense .rung-title { font-size: calc(var(--fs-l) - 1px); }
.lanes.dense .pill { height: 20px; }
.lanes.dense .rd { font-size: calc(var(--fs-num) - 1px); }
.lanes.dense .nstrip { bottom: 3px; }
.lanes.dense .nchip { padding: 1px 4px; }
.lanes.tight .row-label { padding: 2px 12px 2px 16px; gap: 1px; }
.lanes.tight .rung-title { font-size: var(--fs-m); }
.lanes.tight .pill { height: 17px; font-size: 9px; }
.lanes.tight .leg-badge { padding: 1px 4px; }
.lanes.tight .nchip { padding: 0 3px; font-size: 9px; }
.lanes.tight .ticker { font-size: 10px; }
/* a run that has not begun is a slim placeholder; it opens into a full row when its first events arrive */
.row.queued { flex: 0 0 34px; min-height: 34px; opacity: 0.5; }
.row.queued .status-line, .row.queued .nstrip, .row.queued .leg-badges { display: none; }
.row.queued .row-label { padding-top: 0; padding-bottom: 0; }
.row.queued .rung-title { font-size: var(--fs-m); }
.row.queued .row-track::after { content: "queued"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: var(--fs-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.row.queued canvas { opacity: 0; }
.row-label { padding: 9px 16px 9px 18px; display: flex; flex-direction: column; justify-content: center; gap: 7px; min-width: 0; border-right: 1px solid var(--line-1); }
.name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rung-title { font-size: var(--fs-l); font-weight: 620; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: var(--fs-2xs); letter-spacing: 0.12em; font-weight: 650; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-3); white-space: nowrap; }
.tag.proposed { color: var(--bg-0); background: var(--proposed); border-color: var(--proposed); }
.tag.reference { border-style: dashed; color: var(--ink-2); }
.leg-badges { margin-left: auto; display: flex; gap: 4px; flex: none; }
.leg-badge {
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.08em; padding: 3px 6px 3px 6px; border-radius: 4px;
  color: var(--ci, var(--bg-0)); background: var(--c); white-space: nowrap; animation: glow 0.6s ease-out;
}
.status-line { display: grid; grid-template-columns: var(--pill-w) var(--col-gap) var(--col-out) var(--col-late); align-items: center; }
.pill {
  justify-self: start; display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px 0 9px; border-radius: 12px;
  font-size: var(--fs-2xs); font-weight: 750; letter-spacing: 0.11em; border: 1px solid transparent;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.FLOWING { color: var(--ok); background: var(--ok-bg); border-color: rgba(61, 220, 132, 0.28); }
.pill.STALLED { color: var(--bad); background: var(--bad-bg); border-color: rgba(255, 77, 94, 0.45); }
.pill.DEAD { color: #fff; background: var(--bad); border-color: var(--bad); box-shadow: 0 0 18px var(--bad-glow); }
.pill.RECOVERING { color: var(--warn); background: var(--warn-bg); border-color: rgba(245, 184, 61, 0.4); }
.pill.QUEUED, .pill.WAITING { color: var(--ink-3); background: var(--bg-3); border-color: var(--line-2); }
.pill.FAILED { color: var(--ink-2); background: var(--bg-3); border-color: var(--line-3); border-style: dashed; }
.rd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-num); color: var(--ink-2); white-space: nowrap; }
.rd small { font-size: 0.72em; color: var(--ink-3); margin-left: 2px; }
.rd.zero { color: var(--ink-4); }
.rd.hot { color: var(--bad); font-weight: 600; }
.rd.warm { color: var(--ink-1); }
.notice-line { display: flex; gap: 4px; flex-wrap: nowrap; flex: none; }
.nchip {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 6px; border-radius: 5px; font-size: var(--fs-2xs);
  border: 1px solid var(--line-2); background: var(--bg-2); white-space: nowrap; transition: background 0.3s, border-color 0.3s;
}
.nchip b { font-weight: 700; letter-spacing: 0.06em; color: var(--ink-2); }
.nchip b::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 2px; background: var(--c); margin-right: 5px; vertical-align: 1px; }
.nchip span { font-weight: 650; letter-spacing: 0.05em; }
.nchip.AVAILABLE span { color: var(--ok); }
.nchip.STANDBY { border-color: rgba(245, 184, 61, 0.45); background: var(--warn-bg); }
.nchip.STANDBY span { color: var(--warn); }
.nchip.HALF_OPEN { border-color: rgba(245, 184, 61, 0.35); border-style: dashed; }
.nchip.HALF_OPEN span { color: var(--warn); }
.nchip.DOWN { background: repeating-linear-gradient(135deg, var(--bg-3) 0 4px, var(--bg-2) 4px 8px); }
.nchip.DOWN span { color: var(--ink-3); }
.nchip.flip { animation: flip 0.6s ease-out; }
/* every transition starts from a fully visible state, so a frame caught mid-animation is still legible */
@keyframes flip { 0% { transform: scale(1.14); filter: brightness(1.9); } 100% { transform: none; filter: none; } }
@keyframes glow { 0% { filter: brightness(1.9); } 100% { filter: none; } }

.row-track { position: relative; min-width: 0; }
.row-track canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lane-note {
  position: absolute; left: 12px; right: 12px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  padding: 6px 10px; border: 1px dashed var(--line-3); border-radius: 6px; background: rgba(10, 14, 20, 0.85);
}
.nstrip { position: absolute; left: 8px; right: 8px; bottom: 6px; display: flex; align-items: center; gap: 12px; pointer-events: none; min-width: 0; }
.ticker {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ticker .tt { color: var(--ink-4); margin-right: 8px; }
.ticker .arrow { color: var(--ink-3); margin: 0 6px; }
.ticker .st { color: var(--ink-1); }
.ticker.fresh { animation: glow 0.8s ease-out; }

/* the playhead spans the journey and the lanes */
.playhead { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none; z-index: 5; will-change: transform; }
.playhead::before { content: ""; position: absolute; top: 0; bottom: 0; left: -0.5px; width: 1px; background: var(--playhead); opacity: 0.9; box-shadow: 0 0 10px rgba(234, 240, 248, 0.35); }
.playhead .ph-tag {
  position: absolute; top: 0; left: 0; transform: translate(-50%, 0); background: var(--playhead); color: var(--bg-0);
  font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 650; padding: 2px 6px; border-radius: 4px; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.scrub-zone { cursor: ew-resize; }

/* ---- side panel ---------------------------------------------------------------------------------------- */
.panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.psec { padding: 12px 14px; }
.psec h3 { margin: 0 0 8px; font-size: var(--fs-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; display: flex; justify-content: space-between; align-items: baseline; }
.psec h3 em { font-style: normal; font-family: var(--font-mono); letter-spacing: 0; text-transform: none; color: var(--ink-4); font-weight: 500; }
.p-head { padding: 14px; }
.p-title { font-size: var(--fs-xl); font-weight: 650; display: flex; align-items: center; gap: 8px; }
.p-blurb { color: var(--ink-2); font-size: var(--fs-s); margin-top: 4px; line-height: 1.4; }
.p-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.spark { display: grid; grid-template-columns: 58px 1fr 64px; align-items: center; gap: 8px; height: 36px; }
.spark .nm { font-size: var(--fs-s); color: var(--ink-2); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.spark .nm i { width: 8px; height: 3px; border-radius: 2px; background: var(--c); }
.spark canvas { width: 100%; height: 32px; display: block; }
.spark .val { font-family: var(--font-mono); font-size: var(--fs-s); color: var(--ink-1); text-align: right; font-variant-numeric: tabular-nums; }
.spark .val.dim { color: var(--ink-4); }
.phase-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.phase-svg { width: 100%; height: 78px; display: block; }
.phase-svg .ax { stroke: var(--line-2); }
.phase-svg text { font-family: var(--font-mono); font-size: 9px; fill: var(--ink-4); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: var(--fs-s); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-1); text-align: right; overflow-wrap: anywhere; }
.big { font-family: var(--font-mono); font-size: 30px; font-weight: 500; line-height: 1; }
.big small { font-size: 12px; color: var(--ink-3); font-family: var(--font-ui); margin-left: 6px; }
.prio { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prio .lbl { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 4px; }
.log { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.log ol { list-style: none; margin: 0; padding: 0; overflow: hidden; flex: 1; min-height: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent); }
.log li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; font-size: var(--fs-xs); padding: 4px 0; border-top: 1px solid var(--line-1); line-height: 1.35; }
.log li:first-child { border-top: 0; }
.log li .lt { font-family: var(--font-mono); color: var(--ink-4); text-align: right; }
.log li .lx { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.log li .k { font-weight: 700; font-size: var(--fs-2xs); letter-spacing: 0.08em; margin-right: 6px; }
.log li .k.signal { color: var(--ink-1); }
.log li .k.state { color: var(--warn); }
.log li .k.action { color: var(--ok); }
.log li .k.stack { color: var(--ink-3); }
.log li .k.fail { color: var(--bad); }
.flip { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-1); font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.4; }
.flip b { color: var(--ink-3); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; font-size: var(--fs-2xs); margin-right: 4px; }
.flip .ok { color: var(--ok); }
.flip .dim { color: var(--ink-4); }
.log li .k.ext { color: var(--ink-1); border: 1px solid var(--line-3); border-radius: 3px; padding: 0 3px; }
.log li.new { animation: glow 0.8s ease-out; }
.muted { color: var(--ink-4); font-size: var(--fs-s); }

/* ---- scoreboard ---------------------------------------------------------------------------------------- */
.score-view { position: absolute; inset: 0; padding: 14px var(--gutter) 18px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto auto; align-content: start; gap: 14px var(--gutter); overflow-y: auto; }
@media (max-width: 1500px) { .score-view { grid-template-columns: minmax(0, 1fr); } .score-view > .sb-card { grid-column: 1 / -1 !important; } }
.sb-card { padding: 14px 16px; min-height: auto; align-self: start; display: flex; flex-direction: column; }
.sb-card h2 { margin: 0; font-size: var(--fs-l); font-weight: 650; }
.sb-card .sub { color: var(--ink-3); font-size: var(--fs-s); margin: 3px 0 10px; }
.sb-ladder { grid-column: 1 / -1; }
.sb-svg { width: 100%; display: block; overflow: visible; }
.sb-svg text { font-family: var(--font-ui); fill: var(--ink-2); font-size: var(--fs-xs); }
.sb-svg .num { font-family: var(--font-mono); }
.sb-svg .grid line { stroke: var(--line-1); }
.sb-svg .axis text { fill: var(--ink-3); font-family: var(--font-mono); font-size: var(--fs-2xs); }
.sb-svg .axis line, .sb-svg .axis path { stroke: var(--line-2); }
table.sb { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
table.sb th { text-align: right; font-size: var(--fs-2xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; padding: 6px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.sb th:first-child, table.sb td:first-child { text-align: left; }
table.sb td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line-1); font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
table.sb td:first-child { font-family: var(--font-ui); color: var(--ink-1); font-weight: 600; }
table.sb tr.proposed td { background: rgba(234, 240, 248, 0.05); }
table.sb tr.proposed td:first-child { box-shadow: inset 3px 0 0 var(--proposed); }
table.sb tr.reference td { color: var(--ink-3); font-style: normal; }
table.sb td.best { color: var(--ok); }
table.sb td.na { color: var(--ink-4); }
table.sb td.worst { color: var(--bad); }
table.sb .bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--bad); vertical-align: middle; margin-left: 8px; opacity: 0.85; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: auto; padding-top: 14px; }
.tile { border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; background: rgba(8, 11, 16, 0.4); min-width: 0; }
.tile.proposed { border-color: rgba(234, 240, 248, 0.45); background: linear-gradient(180deg, rgba(234, 240, 248, 0.07), rgba(234, 240, 248, 0.02)); }
.tile .tl { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.35; }
.tile .tv { font-size: 34px; font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.1; }
.tile .ts { font-size: var(--fs-s); color: var(--ink-2); margin-top: 2px; }
.sb-empty { color: var(--ink-3); padding: 40px; text-align: center; }

/* ---- legend and caption -------------------------------------------------------------------------------- */
.legend {
  display: flex; align-items: center; gap: 22px; padding: 0 var(--gutter); border-top: 1px solid var(--line-1); font-size: var(--fs-s); color: var(--ink-3);
  background: rgba(8, 11, 16, 0.7);
}
.lg { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.lg i { display: inline-block; width: 16px; height: 6px; border-radius: 2px; background: var(--c); }
.lg i.outage { background: var(--bad); box-shadow: 0 0 8px var(--bad-glow); }
.lg svg { display: block; }
.keys { margin-left: auto; display: flex; gap: 14px; }
.keys kbd { font-family: var(--font-mono); font-size: var(--fs-2xs); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--ink-2); margin-right: 4px; background: var(--bg-2); }
.caption { display: none; min-width: 0; flex: 0 1 auto; max-width: 52vw; text-align: right; line-height: 1.15; }
.caption .c-l { font-size: var(--fs-caption); font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caption .c-l .c-t { font-family: var(--font-mono); font-size: 0.6em; color: var(--ink-3); font-weight: 500; margin-right: 12px; }
.caption .c-d { font-size: 16px; color: var(--ink-2); margin-top: 3px; line-height: 1.25; }
.toast { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--bg-3); border: 1px solid var(--line-2); padding: 8px 14px; border-radius: 8px; font-size: var(--fs-s); color: var(--ink-2); z-index: 30; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: var(--fs-m); pointer-events: none; }

/* ---- presentation mode: chrome hidden, larger type, a caption for the current event --------------------- */
body.present {
  --fs-xs: 13px; --fs-s: 14px; --fs-m: 15px; --fs-l: 21px; --fs-xl: 24px; --fs-num: 19px; --fs-2xs: 12px; --fs-clock: 52px;
  --label-w: 480px; --pill-w: 152px; --col-gap: 108px; --col-out: 104px; --col-late: 76px; --topbar-h: 88px;
}
body.present .transport, body.present .seg.views, body.present .seedchips, body.present .keys, body.present .rowpick, body.present #rowsPop,
body.present .panel { display: none !important; }
body.present .ladder-view { grid-template-columns: 1fr; }
body.present .row { max-height: 160px; }
body.present .caption { display: block; }
body.present .clock-dur { display: none; }

/* ---- guided tour --------------------------------------------------------------------------------------- */
.tourpanel { display: none; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden; }
body.tour .panel { display: none !important; }
body.tour .row.selected { border-color: var(--line-1); box-shadow: none; }
body.tour .row.proposed.selected { border-color: var(--line-1); }
body.tour .tourpanel { display: flex; }
body.present.tour .ladder-view { grid-template-columns: minmax(0, 1fr) var(--tour-w); }
body.tour { --tour-w: clamp(330px, 25vw, 480px); --label-w: clamp(300px, 22vw, 440px); --pill-w: 132px; --col-gap: 96px; --col-out: 92px; --col-late: 64px; }
.thead { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.thead .caps { color: var(--ink-2); }
.tdots { margin-left: auto; display: flex; gap: 5px; }
.tdots i {
  font-style: normal; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-mono);
  font-size: 12px; font-weight: 700; color: var(--ink-3); border: 1px solid var(--line-2); background: var(--bg-2);
}
.tdots i.past { color: var(--ink-2); background: var(--bg-4); }
.tdots i.now { color: var(--bg-0); background: var(--ink-1); border-color: var(--ink-1); }
.tcard { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(24, 32, 44, 0.85), rgba(14, 19, 27, 0.85)); }
.tcard.next { border-style: dashed; }
.tkicker { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ttitle { font-size: clamp(22px, 3.2vh, 32px); font-weight: 680; letter-spacing: -0.01em; margin-top: 6px; line-height: 1.1; }
.tworld { font-size: clamp(14px, 1.9vh, 18px); color: var(--ink-2); line-height: 1.4; margin-top: 8px; }
.thint { margin-top: 12px; font-size: clamp(13px, 1.7vh, 16px); color: var(--ink-3); }
.slowpill { color: var(--ink-1); border: 1px solid var(--line-3); border-radius: 10px; padding: 2px 8px; letter-spacing: 0.1em; }
.tlines { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.tlines.dim { opacity: 0.55; }
.tline { display: grid; grid-template-columns: 12px 1fr; column-gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 8px; border: 1px solid transparent; }
.tline i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-4); align-self: center; grid-row: span 2; }
.tline.bad i { background: var(--bad); box-shadow: 0 0 10px var(--bad-glow); }
.tline.ok i { background: var(--ok); }
.tline.warn i { background: var(--warn); }
.tline b { font-size: clamp(14px, 1.9vh, 18px); font-weight: 650; }
.tline b em { font-style: normal; font-size: 0.7em; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; margin-left: 6px; }
.tline span { font-size: clamp(13px, 1.75vh, 17px); color: var(--ink-1); grid-column: 2; }
.tline.proposed { background: rgba(234, 240, 248, 0.07); border-color: rgba(234, 240, 248, 0.25); }
.tline.reference { opacity: 0.75; }
.tnote, .tfoot { color: var(--ink-3); font-size: clamp(12px, 1.6vh, 15px); margin-top: 6px; }
.tzoom { padding: 10px 12px; border: 1px solid var(--line-1); border-radius: 8px; background: rgba(8, 11, 16, 0.5); }
.tzoom canvas { display: block; width: 100%; margin-top: 8px; }
@media (max-height: 820px) { .tzoom { display: none; } }
.tprog { height: 3px; border-radius: 2px; background: var(--line-1); overflow: hidden; margin-top: auto; }
.tprog i { display: block; height: 100%; width: 0; background: var(--ink-2); }
.chip.synth.small { height: 20px; font-size: 10px; padding: 0 8px; }
.tourcard {
  position: fixed; left: 0; right: 0; top: var(--topbar-h); bottom: 0; z-index: 40; display: grid; place-items: center; padding: 3vh 4vw;
  overflow-y: auto;
  background: radial-gradient(1200px 700px at 50% 40%, #101620, #05070a);
}
.tover { width: min(1400px, 100%); display: flex; flex-direction: column; gap: clamp(10px, 2vh, 22px); }
.tover h1 { margin: 0; font-size: clamp(36px, 7vh, 76px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.02; }
.tover .tdesc { margin: 0; font-size: clamp(16px, 2.5vh, 24px); color: var(--ink-2); max-width: 60em; line-height: 1.35; }
.tover h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.tcols { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(20px, 4vw, 60px); }
.tleg { display: grid; grid-template-columns: 26px 120px 1fr; align-items: center; gap: 10px; padding: clamp(4px, 0.8vh, 8px) 0; border-bottom: 1px solid var(--line-1); font-size: clamp(15px, 2.2vh, 21px); }
.tleg i { width: 26px; height: 10px; border-radius: 3px; }
.tleg span { color: var(--ink-3); font-family: var(--font-mono); font-size: 0.75em; }
.tmech { display: flex; align-items: baseline; gap: 10px; padding: clamp(3px, 0.6vh, 7px) 0; border-bottom: 1px solid var(--line-1); font-size: clamp(14px, 2vh, 19px); min-width: 0; }
.tmech b { font-weight: 650; white-space: nowrap; }
.tmech span:last-child { color: var(--ink-3); font-size: max(13px, 0.8em); min-width: 0; }
@media (max-height: 820px) {
  .tmech span:last-child { display: none; }
  .tover .tdesc { font-size: 15px; }
  .tover h1 { font-size: 40px; }
  .tcols > div:last-child { columns: 2; column-gap: 28px; }
  .tcols > div:last-child h3 { column-span: all; }
  .tmech { break-inside: avoid; font-size: 14px; }
  .tleg { font-size: 15px; }
}
.tmech.proposed b { color: var(--ink-1); }
.tfoot b.red { color: var(--bad); font-weight: 650; }
.tover .tfoot { font-size: clamp(14px, 2vh, 19px); color: var(--ink-2); margin: 0; }
.trows { display: flex; flex-direction: column; gap: clamp(4px, 0.9vh, 10px); }
.trow { display: grid; grid-template-columns: minmax(180px, 26%) 1fr 110px 90px; gap: 18px; align-items: center; font-size: clamp(15px, 2.3vh, 22px); padding: 4px 10px; border-radius: 8px; }
.trow.head { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; padding-bottom: 0; }
.trow b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow b em { font-style: normal; font-size: 0.6em; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; margin-left: 6px; }
.trow.proposed { background: rgba(234, 240, 248, 0.07); box-shadow: inset 3px 0 0 var(--proposed); }
.trow.reference { opacity: 0.7; }
.tbar { position: relative; height: clamp(10px, 1.8vh, 18px); background: var(--bg-2); border-radius: 4px; }
.tbar i { position: relative; display: block; height: 100%; background: var(--bad); border-radius: 4px; }
.tbar u { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.tticks { position: relative; height: 14px; text-transform: none; letter-spacing: 0; font-family: var(--font-mono); }
.tticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tval.none { color: var(--ok); }
.tval, .tdup { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.tdup { color: var(--ink-2); }

/* ---- how to read this ----------------------------------------------------------------------------------- */
.helpbtn { width: 32px; padding: 0; font-family: var(--font-mono); font-size: 15px; }
body.present .helpbtn { display: none; }
.help {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 3vh 3vw;
  background: rgba(5, 7, 10, 0.86); backdrop-filter: blur(6px); overflow: auto;
}
.hwrap {
  width: min(1500px, 100%); background: linear-gradient(180deg, #121925, #0b1018); border: 1px solid var(--line-2);
  border-radius: 16px; padding: clamp(18px, 3vh, 34px) clamp(20px, 3vw, 40px); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.hhead { display: grid; grid-template-columns: 1fr auto; align-items: end; margin-bottom: clamp(12px, 2vh, 24px); }
.hhead .tkicker { grid-column: 1; }
.hhead h1 { grid-column: 1; margin: 4px 0 0; font-size: clamp(30px, 5vh, 52px); font-weight: 700; letter-spacing: -0.02em; }
.hclose { grid-column: 2; grid-row: 1 / 3; align-self: center; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; color: var(--ink-2); padding: 8px 12px; cursor: pointer; font-size: 14px; }
.hclose kbd, .help kbd { font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; background: var(--bg-2); color: var(--ink-1); }
.hgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.6vh, 18px) clamp(14px, 2vw, 28px); }
.hgrid section { border-top: 1px solid var(--line-2); padding-top: 10px; }
.hgrid section.wide { grid-column: span 3; }
.hgrid section.hkeys { grid-column: span 3; }
.hgrid h3 { margin: 0 0 6px; font-size: clamp(15px, 2.1vh, 20px); font-weight: 650; display: flex; align-items: center; gap: 10px; }
.hgrid p { margin: 0 0 6px; font-size: clamp(13px, 1.8vh, 17px); color: var(--ink-2); line-height: 1.45; }
.hgrid b { color: var(--ink-1); font-weight: 650; }
.hleg { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; color: var(--ink-1); }
.hleg i { width: 22px; height: 8px; border-radius: 2px; }
.hred { display: inline-block; width: 26px; height: 12px; border-radius: 3px; background: var(--bad); box-shadow: 0 0 10px var(--bad-glow); }
.hmk { color: var(--ink-1); display: inline-block; width: 18px; }
.hmk.ok { color: var(--ok); }
.s-ok { color: var(--ok) !important; } .s-bad { color: var(--bad) !important; } .s-warn { color: var(--warn) !important; }
.s-dead { color: #fff !important; background: var(--bad); border-radius: 4px; padding: 0 5px; }
@media (max-width: 1100px) { .hgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hgrid section.wide, .hgrid section.hkeys { grid-column: span 2; } }

/* ---- projectors (1280x720, 1366x768) and other small screens in presentation and tour ---------------- */
@media (max-width: 1500px) {
  body.present { --label-w: 360px; --pill-w: 116px; --col-gap: 86px; --col-out: 84px; --col-late: 60px; --fs-l: 17px; --fs-num: 16px; --fs-caption: 26px; --fs-clock: 44px; }
  body.tour { --label-w: 326px; --tour-w: 340px; }
  body.tour .status-line .late, body.tour .lh-cols span:nth-child(4) { display: none; }
  body.tour .leg-badges .leg-badge + .leg-badge { display: none; }
}
@media (max-height: 820px) {
  .tcard { padding: 10px 14px; }
  .tline { padding: 3px 8px; }
  .tlines { gap: 2px; }
  .tworld { margin-top: 4px; }
  .tdots i { width: 21px; height: 21px; font-size: 11px; }
  .tourpanel { gap: 8px; }
}
.thead { flex-wrap: wrap; row-gap: 6px; }

/* ---- narrower screens (1440) --------------------------------------------------------------------------- */
@media (max-width: 1700px) {
  :root { --label-w: 344px; --panel-w: 320px; --gutter: 14px; --pill-w: 120px; --col-gap: 76px; --col-out: 70px; --col-late: 48px; --fs-clock: 30px; --fs-l: 15px; --fs-num: 14px; --fs-xl: 18px; }
  .topbar { gap: 12px; }
  .brand > div, .vsep, .scn-sub, .keys { display: none; }
  .picker select { min-width: 150px; max-width: 190px; }
  .clock { min-width: 140px; }
  .seg button { padding: 0 8px; }
  .seg.views button { padding: 0 10px; }
  .nchip { padding: 3px 4px; }
  .pill { letter-spacing: 0.07em; padding: 0 8px 0 7px; }
}
@media (max-height: 1000px), (max-width: 1700px) {
  .score-view { overflow-y: auto; gap: 10px var(--gutter); }
  table.sb td, table.sb th { padding: 4px 6px; }
  .tile { padding: 8px 12px; }
  .tile .tv { font-size: 26px; }
  .sb-card { padding: 10px 14px; }
  .sb-card .sub { margin-bottom: 6px; }
  .psec h3 em.opt { display: none; }
}
@media (max-height: 820px) {
  .panel { overflow-y: auto; }
  .panel .log { flex: none; }
  .panel .log ol { max-height: 240px; flex: none; }
}
@media (max-height: 1000px) {
  .p-blurb, .p-tags { display: none; }
  .psec.settings { display: none; }
  .phase-svg { height: 58px; }
  .spark { height: 30px; }
  .spark canvas { height: 26px; }
}
