/* =====================================================================
   XT-HUB — Telemetry Console · minimal UI
   Flat surfaces, hairline borders, large clear numbers, one accent colour.
   Colour is kept for data (games, up/down, status) — the chrome stays neutral.
   ===================================================================== */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-var.woff2") format("woff2");
}
@view-transition { navigation: auto; }

:root {
  --bg: #09090b;
  --surface: #111113;
  --raised: #1a1a1e;
  --well: rgba(255, 255, 255, .032);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --ink: #f4f4f5;
  --ink-2: #c5c5cd;
  --ink-3: #8c8c97;
  --ink-4: #5d5d68;
  --accent: #4ade80;
  --green: #4ade80;
  --amber: #f5a524;
  --red: #f87171;
  --blue: #60a5fa;
  --sky: #38bdf8;
  --violet: #a78bfa;
  --gold: #fbbf24;
  --mint: #34d399;
  --pink: #f472b6;
  --slate: #94a3b8;
  /* names older markup may still reference */
  --lcd: var(--ink);
  --edge: var(--line);
  --metal-1: var(--surface); --metal-2: var(--surface); --metal-3: var(--surface);
  --r: 14px;
  --r-s: 8px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --font: "Inter", "Leelawadee UI", "Noto Sans Thai", "Segoe UI", Tahoma, system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font: 14px/1.5 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
svg.lucide, [data-lucide] { width: 16px; height: 16px; flex: none; stroke-width: 1.75; }
::selection { background: rgba(74, 222, 128, .28); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .26); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page frame ---------- */
.rack { max-width: 1520px; margin: 0 auto; padding: 18px 22px 40px; }

/* ---------- card ---------- */
.panel {
  position: relative;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
}
.panel > * { position: relative; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap;
  padding: 18px 20px 0;
}
.panel-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.panel-title h2 { font-size: 14px; font-weight: 600; letter-spacing: -.005em; color: var(--ink); }
.panel-title .ico { display: grid; place-items: center; flex: none; color: var(--ink-3); }
.panel-title .ico svg { width: 16px; height: 16px; }
.panel-note { font-size: 12.5px; color: var(--ink-3); padding: 5px 20px 0; max-width: 900px; }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.panel-tools > * { min-width: 0; max-width: 100%; }
.panel-body { padding: 16px 20px 20px; }
.panel-body.tight { padding: 14px; }

/* ---------- inner block (a quiet sub-surface; .flat = no box at all) ---------- */
.screen {
  position: relative;
  border-radius: 10px;
  background: var(--well);
  color: var(--ink);
  overflow: hidden;
}
.screen > * { position: relative; z-index: 1; }
.screen.pad { padding: 14px 16px; }
.screen.flat { background: none; border-radius: 0; }

/* ---------- labels and numbers ---------- */
.eng { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.lcd { font-weight: 600; letter-spacing: -.015em; color: var(--ink); font-variant-numeric: tabular-nums; }
.lcd.c { color: var(--c); }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }
.th { font-size: 12.5px; color: var(--ink-3); }
.mono { font-family: var(--mono); }
.up { color: var(--green); } .down { color: var(--red); } .flat-d { color: var(--ink-3); }

/* ---------- status dot ---------- */
.led {
  --c: var(--green);
  display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c);
  transition: background .3s;
}
.led.a { --c: var(--amber); } .led.r { --c: var(--red); } .led.b { --c: var(--blue); }
.led.off { --c: var(--ink-4); }
.led.pulse { animation: ping 2s ease-out infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

/* ---------- badge ---------- */
.tape {
  --c: var(--slate);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  color: color-mix(in srgb, var(--c) 78%, #fff);
  background: color-mix(in srgb, var(--c) 13%, transparent);
}
.tape.sm { font-size: 10.5px; padding: 1px 7px; }
.swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px; padding: 0 13px; border-radius: 8px; cursor: pointer; user-select: none; white-space: nowrap;
  font-size: 13px; font-weight: 500; color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  transition: background .15s, border-color .15s, transform .12s var(--ease), opacity .15s;
}
.btn:hover { background: rgba(255, 255, 255, .08); border-color: var(--line-2); }
.btn:active, .btn.down { transform: scale(.97); }
.btn.down { opacity: .7; }
.btn.primary { color: #09090b; background: #f4f4f5; border-color: #f4f4f5; font-weight: 600; }
.btn.primary:hover { background: #fff; border-color: #fff; }
.btn.sm { min-height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.sm { width: 28px; }

/* ---------- segmented control ---------- */
.bank {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  background: rgba(255, 255, 255, .05);
}
.bank::-webkit-scrollbar { display: none; }
.bank button {
  border: 0; cursor: pointer; white-space: nowrap; flex: none;
  min-height: 28px; padding: 0 11px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  background: transparent;
  transition: background .18s, color .18s;
}
.bank button[style*="--c"]::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; vertical-align: 1px;
  background: var(--c); opacity: .55; transition: opacity .18s;
}
.bank button:hover { color: var(--ink); }
.bank button.on { color: var(--ink); background: rgba(255, 255, 255, .1); }
.bank button.on::before { opacity: 1; }
.bank button b { margin-left: 6px; font-weight: 500; font-variant-numeric: tabular-nums; opacity: .55; }
.bank button svg { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }

/* ---------- fields ---------- */
.field {
  display: flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field:hover { border-color: var(--line-2); }
.field:focus-within { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.field svg { color: var(--ink-3); }
.field input, .field select {
  flex: 1; min-width: 0; height: 34px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13.5px;
}
.field input::placeholder { color: var(--ink-4); }
.field input[type="search"]::-webkit-search-cancel-button { display: none; }
.field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.field input[type="number"]::-webkit-outer-spin-button, .field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field select { cursor: pointer; }
.field select option { background: var(--raised); }
.field .x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 17px; line-height: 1; padding: 0 2px; }
.field .x:hover { color: var(--ink); }
.field.mono input { font-family: var(--mono); font-size: 12.5px; }
.form-row { display: grid; gap: 6px; margin-bottom: 16px; }
.form-row > label, .form-label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.form-hint { font-size: 12.5px; color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- toggle ---------- */
.switch { display: flex; align-items: center; gap: 13px; cursor: pointer; padding: 11px 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative; flex: none; width: 38px; height: 22px; border-radius: 99px;
  background: rgba(255, 255, 255, .14);
  transition: background .22s;
}
.switch .knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  transition: transform .26s var(--spring);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track .knob { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .sw-text b { display: block; font-size: 13.5px; font-weight: 500; }
.switch .sw-text small { display: block; font-size: 12.5px; color: var(--ink-3); }
.switch-row { padding: 3px 14px; margin-bottom: 12px; }
.switch-row .switch + .switch { border-top: 1px solid var(--line); }

/* ---------- top bar ---------- */
.deck {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 10px 8px 12px; border-radius: 14px;
  position: sticky; top: 10px; z-index: 40;
}
.plate { display: flex; align-items: center; gap: 10px; flex: none; }
.plate-logo {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  color: #09090b; background: #f4f4f5;
}
.plate-logo svg { width: 16px; height: 16px; stroke-width: 2.25; fill: currentColor; }
.plate-txt b { display: block; font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; color: var(--ink); }
.plate-txt small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-4); line-height: 1.2; }

.keys { display: flex; gap: 2px; flex: 1; justify-content: center; min-width: 0; }
.key {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
  transition: background .15s, color .15s;
}
.key svg { width: 16px; height: 16px; }
.key:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.key.on { color: var(--ink); background: rgba(255, 255, 255, .09); }

.deck-right { display: flex; align-items: center; gap: 10px; flex: none; }
.clock { text-align: right; line-height: 1.2; padding: 0 4px; overflow: visible; }
.clock b { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.clock small { display: block; font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.who i {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 600; font-size: 12px;
  color: var(--ink); background: rgba(255, 255, 255, .09);
}
.power { color: var(--ink-3); background: transparent; border-color: transparent; }
.power:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); border-color: transparent; }

/* ---------- live strip (same readouts on every page) ---------- */
.rail { display: flex; align-items: stretch; margin-top: 12px; overflow-x: auto; scrollbar-width: none; background: none; border: 1px solid var(--line); border-radius: 12px; }
.rail::-webkit-scrollbar { display: none; }
.rail-cell { flex: 1 0 auto; display: flex; align-items: baseline; gap: 9px; padding: 11px 18px; border-right: 1px solid var(--line); white-space: nowrap; }
.rail-cell:last-child { border-right: 0; }
.rail-cell .eng { font-size: 12px; }
.rail-cell b { font-size: 14px; font-weight: 600; }
.rail-cell.state { align-items: center; }
.rail-cell.state b { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }

/* ---------- page head ---------- */
.content { padding-top: 28px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; padding: 0 2px; }
.page-title { font-size: 24px; font-weight: 650; letter-spacing: -.025em; color: var(--ink); }
.page-sub { margin-top: 4px; font-size: 13.5px; color: var(--ink-3); max-width: 820px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- grids ---------- */
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.g-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .8fr); }
.g-hero > .panel { display: flex; flex-direction: column; }
.g-hero > .panel > .panel-body { flex: 1; display: flex; flex-direction: column; }
.g-hero > .panel > .panel-body > .screen.fill { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.g-hero > .panel > .panel-body > .push { margin-top: auto; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stack { display: grid; gap: 18px; align-content: start; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------- headline number (Overview) ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; }
.hero-num { font-size: 76px; font-weight: 650; letter-spacing: -.045em; line-height: .95; color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-side { display: grid; gap: 2px; text-align: right; padding-bottom: 6px; }
.hero-side b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.hero-bar { margin-top: 18px; }
.hero-bar .row { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.hero-bar .row b { color: var(--ink); font-weight: 600; }
.hero-mix { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- KPI tile ---------- */
.tile { padding: 16px 16px 14px; border-radius: var(--r); transition: border-color .2s, background .2s, transform .25s var(--ease); }
.tile:hover { border-color: var(--line-2); }
.tile[role="button"] { cursor: pointer; }
.tile[role="button"]:hover { transform: translateY(-2px); }
.tile[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile.on { border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 6%, var(--surface)); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 0 10px; }
.tile-top .eng { display: flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-top .eng svg { flex: none; width: 14px; height: 14px; color: var(--c, var(--ink-3)); }
.tile .screen { padding: 0; background: none; border-radius: 0; overflow: visible; }
.tile-val { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.tile-val small { font-size: 13px; font-weight: 500; margin-left: 3px; color: var(--ink-3); letter-spacing: 0; }
.tile-sub { margin-top: 5px; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 18px; }
.tile-foot { padding: 10px 0 0; font-size: 12px; color: var(--ink-4); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 12px; }
.delta svg { width: 12px; height: 12px; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: 10px; }
.spark i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--c, var(--blue)); opacity: .3; height: var(--h, 4%); transform-origin: bottom; animation: growY .7s var(--ease) both; animation-delay: calc(var(--n, 0) * 22ms); }
.spark i:last-child { opacity: 1; }
@keyframes growY { from { transform: scaleY(0); } }

/* ---------- bars ---------- */
.meter {
  --c: var(--blue);
  position: relative; height: 6px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, .07);
}
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0%); border-radius: inherit; background: var(--c); transition: width .9s var(--ease); }
.meter.thin { height: 4px; }
.stackbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .07); position: relative; }
.stackbar i { display: block; width: var(--w, 0%); background: var(--c); transition: width .9s var(--ease); }

/* ---------- one row per game ---------- */
.chan { display: grid; grid-template-columns: minmax(118px, auto) 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.chan:last-child { border-bottom: 0; }
.chan .cnt { min-width: 62px; text-align: right; font-size: 18px; }
.chan .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

/* ---------- key / value rows, rankings ---------- */
.rows { display: grid; }
.rows .r { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rows .r:last-child { border-bottom: 0; }
.rows .r > span:first-child { color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .r > span:first-child svg { width: 14px; height: 14px; vertical-align: -2.5px; margin-right: 5px; opacity: .8; }
.rows .r b { font-weight: 600; color: var(--ink); white-space: nowrap; }
.rows .r .led { vertical-align: 0; margin-right: 3px; }
.rows .led.r { display: inline-block; padding: 0; border: 0; }   /* the red dot shares the class name .r with a row */
.rows .r a, .th a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.rows .r a:hover, .th a:hover { text-decoration-color: var(--ink); }
.rank { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 5px 10px; align-items: center; padding: 8px 0; }
.rank .n { font-size: 12px; font-weight: 500; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.rank .nm { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .vl { font-size: 13px; font-weight: 600; }
.rank .meter { grid-column: 2 / 4; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink); font-weight: 600; }

/* ---------- charts ---------- */
.chart { position: relative; height: 300px; padding: 6px 0 0; }
.chart.sm { height: 220px; } .chart.lg { height: 360px; } .chart.xs { height: 150px; }
.chart canvas { position: relative; z-index: 1; }
.chart-empty { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--ink-3); font-size: 13px; }
.statline { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 14px 0 0; margin-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.statline:empty { display: none; }
.statline b { color: var(--ink); font-weight: 600; margin-left: 5px; }

/* ---------- hour × day heat map ---------- */
.heat { display: grid; grid-template-columns: 62px repeat(24, minmax(0, 1fr)); gap: 3px; padding: 6px 0; min-width: 620px; }
.heat .hh { font-size: 10.5px; color: var(--ink-4); text-align: center; }
.heat .hd { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; white-space: nowrap; }
.heat .c {
  aspect-ratio: 1 / .78; border-radius: 3px;
  background: color-mix(in srgb, var(--accent) calc(var(--v, 0) * 100%), #1b1b1f);
  transition: transform .15s var(--ease), background .5s;
  animation: fadeIn .5s both; animation-delay: calc(var(--n, 0) * 3ms);
}
.heat .c.nil { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.heat .c:hover { transform: scale(1.35); z-index: 3; outline: 1.5px solid var(--ink); }
.scroll-x { overflow-x: auto; }

/* ---------- data table ---------- */
.tablewrap { overflow: auto; max-height: 620px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th {
  position: sticky; top: 0; z-index: 2; text-align: left; padding: 10px 14px; white-space: nowrap;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  background: var(--surface); box-shadow: inset 0 -1px 0 var(--line);
}
table.t th.sort { cursor: pointer; user-select: none; transition: color .15s; }
table.t th.sort:hover { color: var(--ink); }
table.t th.sort::after { content: "↕"; margin-left: 5px; opacity: .3; }
table.t th.sort.asc::after { content: "↑"; opacity: 1; color: var(--ink); }
table.t th.sort.desc::after { content: "↓"; opacity: 1; color: var(--ink); }
table.t th.sort.asc, table.t th.sort.desc { color: var(--ink); }
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .15s; }
table.t tbody tr:hover { background: rgba(255, 255, 255, .035); }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.sel { background: rgba(255, 255, 255, .06); box-shadow: inset 2px 0 0 var(--accent); }
table.t .r { text-align: right; }
table.t td.mono { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
table.t td b { color: var(--ink); font-weight: 600; }
table.t td.zero { color: var(--ink-4); }
table.t tr.today td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
table.t tr.spacer td { padding: 0; border: 0; }
table.t.fixed tbody tr { height: 38px; }
#featTable th, #featTable td { padding-left: 11px; padding-right: 11px; }   /* 11 columns: keep it inside a 1100px window */
@media (max-width: 1100px) { #featTable th, #featTable td { padding-left: 8px; padding-right: 8px; } }
.cellbar { display: inline-block; vertical-align: middle; width: 70px; margin-left: 8px; }
.tfoot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 0 0; font-size: 12.5px; color: var(--ink-3); }
.empty { padding: 34px 16px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.empty svg { width: 24px; height: 24px; display: block; margin: 0 auto 10px; color: var(--ink-4); }

/* ---------- notices, code ---------- */
.note {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 15px; border-radius: 10px; margin-bottom: 18px; font-size: 13.5px;
  border: 1px solid color-mix(in srgb, var(--c, #94a3b8) 30%, transparent);
  background: color-mix(in srgb, var(--c, #94a3b8) 7%, transparent);
}
.note .led { margin-top: 7px; }
.note.ok { --c: var(--green); } .note.err { --c: var(--red); } .note.info { --c: var(--blue); }
.note b { color: var(--ink); font-weight: 600; }
.note > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; line-height: 1.65; }
pre.code { margin: 0; }
.kbd { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .08); color: var(--ink); }

/* ---------- side sheet (deep detail) ---------- */
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 71; top: 12px; right: 12px; bottom: 12px; width: min(520px, calc(100vw - 24px));
  display: flex; flex-direction: column; border-radius: 16px;
  background: #131316; border-color: var(--line-2); box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
  transform: translateX(calc(100% + 30px)); transition: transform .4s var(--ease);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.drawer-head h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.drawer-head small { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; letter-spacing: 0; }
.drawer-head h3 small { margin-top: 3px; }
.drawer-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 20px 22px; display: grid; gap: 14px; align-content: start; grid-auto-rows: max-content; grid-template-columns: minmax(0, 1fr); }
.drawer table.t th { background: #131316; }
.dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dcell { padding: 11px 13px; }
.dcell .lcd { font-size: 20px; display: block; margin-top: 2px; }
.dcell .th { font-size: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0;
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  background: var(--raised); border-color: var(--line-2); box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  transition: transform .3s var(--spring), opacity .25s; pointer-events: none; display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- hover card ---------- */
.tip {
  position: absolute; z-index: 30; pointer-events: none; min-width: 150px; padding: 10px 12px; border-radius: 10px;
  background: var(--raised); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  font-size: 12px; color: var(--ink-2); opacity: 0; transition: opacity .12s, transform .12s var(--ease);
  transform: translate(-50%, calc(-100% - 6px));
}
.tip.fixed { position: fixed; }
.tip h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ink); }
.tip .tr { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 1.5px 0; white-space: nowrap; }
.tip .tr span { display: inline-flex; align-items: center; gap: 6px; }
.tip .tr b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip .tt { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); }

/* ---------- footer ---------- */
.foot { display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; margin-top: 30px; padding: 0 2px; font-size: 12px; color: var(--ink-4); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 26px 16px; }
.login { width: min(400px, 100%); padding: 30px 28px 26px; border-radius: 18px; }
.login .plate { justify-content: center; margin-bottom: 22px; }
.login-screen { padding: 12px 14px; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-3); }
.login-screen b { display: block; font-size: 13px; font-weight: 600; }
.login .btn { width: 100%; min-height: 42px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; margin-bottom: 18px; }
.check input { appearance: none; width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); display: grid; place-items: center; cursor: pointer; margin: 0; transition: background .15s, border-color .15s; }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { content: ""; width: 9px; height: 5px; margin-top: -2px; border-left: 2px solid #09090b; border-bottom: 2px solid #09090b; transform: rotate(-45deg); animation: pop .2s var(--spring); }
@keyframes pop { from { opacity: 0; scale: .4; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- webhook message preview ---------- */
.embed-author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
.embed-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #09090b; background: #f4f4f5; }
.embed { display: grid; gap: 8px; padding: 11px 13px 10px; border-radius: 4px 8px 8px 4px; border-left: 3px solid var(--c, #38bdf8); background: rgba(255, 255, 255, .04); }
.embed-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.embed-desc { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.embed code { font-family: var(--mono); font-size: 11.5px; padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, .08); color: var(--ink); }
.embed-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 10px; }
.embed-fields > div { min-width: 0; }
.embed-fields .full { grid-column: 1 / -1; }
.embed-fields b { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink); margin-bottom: 1px; }
.embed-fields span { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.embed-foot { font-size: 11px; color: var(--ink-4); padding-top: 2px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding: 2px 0 2px 36px; font-size: 13px; line-height: 1.55; color: var(--ink-2); min-height: 26px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); background: rgba(255, 255, 255, .08); }
.steps li b { color: var(--ink); font-weight: 600; }

/* ---------- motion ---------- */
.rise { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadeIn { from { opacity: 0; } }
.screen.boot > * { animation: fadeIn .5s ease-out both; animation-delay: calc(var(--i, 0) * 50ms + 120ms); }
.flash { animation: flash .8s ease-out; }
@keyframes flash { 0% { opacity: .35; } }
.rowin { animation: rowIn .3s var(--ease) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } }
.deck { animation: deckIn .45s var(--ease) both; }
@keyframes deckIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes deckFade { from { opacity: 0; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.view { animation: viewIn .35s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

/* frosted top bar only where the page tabs live inside it (see the note in the next block) */
@media (min-width: 1001px) {
  .deck { background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); }
}

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .g-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-hero > :first-child { grid-column: 1 / -1; }
  .key { padding: 0 10px; }
  .who span { display: none; }
  .plate-txt small { display: none; }
}
@media (max-width: 1000px) {
  .g-2, .g-3, .g-21, .g-12, .g-hero { grid-template-columns: minmax(0, 1fr); }
  .rack { padding: 12px 12px 110px; }
  /* The tabs become a bar fixed to the bottom of the screen. Nothing here may give .deck a transform, filter or
     backdrop-filter (not even a finished transform animation): that would make the deck the box the bar is fixed to. */
  .deck { top: 6px; padding: 8px 10px 8px 12px; gap: 10px; animation-name: deckFade; }
  .keys {
    position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; gap: 0; justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .key { flex: 1; flex-direction: column; gap: 3px; min-width: 0; height: 50px; padding: 0 2px; font-size: 10.5px; border-radius: 10px; }
  .key svg { width: 19px; height: 19px; }
  .key:hover, .key.on { background: none; }
  .key.on svg { color: var(--accent); }
  .deck-right { margin-left: auto; }
  .page-title { font-size: 21px; }
  .hero-num { font-size: 60px; }
  .chart { height: 250px; } .chart.lg { height: 280px; }
  .panel-head { padding: 16px 16px 0; } .panel-body { padding: 14px 16px 18px; } .panel-note { padding: 5px 16px 0; }
  .toast { bottom: 90px; }
  .embed-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .clock { display: none; }
  .g-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid, .stack { gap: 12px; } .grid { margin-bottom: 12px; }
  .tile { padding: 14px 14px 12px; }
  .tile-val { font-size: 23px; }
  .hero-num { font-size: 52px; }
  .hero-side { text-align: left; }
  .rail-cell { padding: 10px 14px; }
  .chan { grid-template-columns: minmax(96px, auto) 1fr auto; gap: 8px; }
  .dgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .drawer { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 86vh; transform: translateY(calc(100% + 30px)); }
}
/* ---------- language switch ---------- */
.lang { display: inline-flex; align-items: center; flex: none; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 11px; font-weight: 600; letter-spacing: .05em; }
.lang a, .lang span { display: block; padding: 4px 8px; border-radius: 6px; color: var(--ink-3); text-decoration: none; line-height: 1.25; transition: color .15s ease, background-color .15s ease; }
.lang a:hover { color: var(--ink); }
.lang a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lang .on { background: var(--raised); color: var(--ink); }
.login-lang { display: flex; justify-content: center; margin-top: 14px; }
/* ---------- public page ---------- */
body.pub .rack { max-width: 1280px; }
body.pub .deck { justify-content: space-between; }
body.pub .plate-txt small { display: block; }
.pub-upd { font-size: 12.5px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.pub-upd svg { width: 13px; height: 13px; }
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cmp:first-child { padding-top: 2px; }
.cmp:last-child { border-bottom: 0; padding-bottom: 2px; }
.cmp .k { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--ink-3); }
.cmp .k svg { flex: none; width: 14px; height: 14px; color: var(--c); }
.cmp .v { font-size: 21px; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; color: var(--ink); }
.cmp .meter { grid-column: 1 / -1; }
.cmp .s { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-4); }
.cmp .s b { font-weight: 500; color: var(--ink-3); }
.rec { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rec:last-child { border-bottom: 0; }
.rec .k { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); min-width: 0; }
.rec .k .swatch { margin: 0 3px; }
.rec .v { font-size: 15px; font-weight: 600; color: var(--ink); text-align: right; }
.rec .d { grid-column: 2; font-size: 12px; color: var(--ink-4); text-align: right; }
table.t.snug th, table.t.snug td { padding-left: 9px; padding-right: 9px; }
@media (max-width: 1200px) { body.pub .g-12 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1000px) { body.pub .rack { padding-bottom: 40px; } }
@media (max-width: 560px) { .pub-upd svg { display: none; } .cmp .v { font-size: 19px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
