/* =========================================================================
   Tell Tale Console — "tape duplication room" design system
   Putty & charcoal plastics · oxide / cyan / amber · LCD readouts ·
   holographic foil used sparingly (brand mark, demo badge, featured).
   ========================================================================= */

:root {
  --bg: #D6CFC1;
  --bg-grain: rgba(80, 60, 30, .035);
  --panel: #ECE7DC;
  --panel-2: #E2DCCF;
  --panel-3: #D9D2C4;
  --ink: #1F1D1A;
  --ink-2: #3B3833;
  --muted: #6C655A;
  --faint: #8E8679;
  --line: #C6BEAF;
  --line-2: #D4CDBF;
  --hi: rgba(255, 255, 255, .7);
  --lo: rgba(70, 52, 28, .16);
  --shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 -1px 0 rgba(60,45,25,.10) inset, 0 1px 1px rgba(40,30,15,.10), 0 8px 18px -12px rgba(40,30,15,.45);

  --rail: #252321;
  --rail-2: #2F2D2A;
  --rail-3: #3A3734;
  --rail-ink: #ECE5D7;
  --rail-muted: #9D9587;

  --lcd-bg: #15140F;
  --lcd-bg-2: #1C1A14;
  --lcd: #FFB84D;
  --lcd-dim: rgba(255, 184, 77, .55);
  --lcd-ghost: rgba(255, 184, 77, .075);
  --lcd-glow: 0 0 6px rgba(255, 184, 77, .45), 0 0 18px rgba(255, 140, 40, .18);

  --oxide: #D14B34;
  --oxide-ink: #A93622;
  --cyan: #2FB5BC;
  --cyan-ink: #18858B;
  --amber: #FFB84D;

  /* semantic — deliberately distinct from the brand accents */
  --pos: #2D7A4E;
  --pos-bg: rgba(45, 122, 78, .12);
  --neg: #A8304F;
  --neg-bg: rgba(168, 48, 79, .1);
  --warn: #9A6A12;
  --warn-bg: rgba(214, 152, 34, .16);
  --info: #2C6E9B;

  --focus: #1E9AA1;
  --radius: 7px;
  --radius-sm: 4px;
  --rail-w: 236px;

  --f-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --f-lcd: 'VT323', ui-monospace, monospace;
  --f-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --f-hand: 'Permanent Marker', 'Marker Felt', cursive;

  --holo: linear-gradient(112deg, #f3d3a3 0%, #b9efe2 16%, #f5c3d5 31%, #fff0b3 46%, #a7e3ec 61%, #d6f3ae 76%, #f8cdb5 90%, #f3d3a3 100%);
  --holo-grain: repeating-linear-gradient(112deg, rgba(255,255,255,0) 0 2px, rgba(255,255,255,.38) 2px 3px, rgba(0,0,0,.03) 3px 4px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1B1A18;
  --bg-grain: rgba(255, 255, 255, .018);
  --panel: #262421;
  --panel-2: #201E1C;
  --panel-3: #2E2C29;
  --ink: #EDE6D8;
  --ink-2: #D2CABB;
  --muted: #A1998A;
  --faint: #7F786C;
  --line: #3B3834;
  --line-2: #33302C;
  --hi: rgba(255, 255, 255, .05);
  --lo: rgba(0, 0, 0, .45);
  --shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 1px 2px rgba(0,0,0,.4), 0 10px 22px -14px rgba(0,0,0,.8);
  --rail: #121110;
  --rail-2: #1B1A18;
  --rail-3: #282623;
  --pos: #63C08A; --pos-bg: rgba(99, 192, 138, .12);
  --neg: #E67895; --neg-bg: rgba(230, 120, 149, .12);
  --warn: #E2B24F; --warn-bg: rgba(226, 178, 79, .12);
  --oxide-ink: #F07A62;
  --cyan-ink: #5FD0D6;
  --info: #7DB7E0;
  --focus: #4FD1D8;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #1B1A18; --bg-grain: rgba(255,255,255,.018); --panel: #262421; --panel-2: #201E1C; --panel-3: #2E2C29;
    --ink: #EDE6D8; --ink-2: #D2CABB; --muted: #A1998A; --faint: #7F786C; --line: #3B3834; --line-2: #33302C;
    --hi: rgba(255,255,255,.05); --lo: rgba(0,0,0,.45);
    --shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 1px 2px rgba(0,0,0,.4), 0 10px 22px -14px rgba(0,0,0,.8);
    --rail: #121110; --rail-2: #1B1A18; --rail-3: #282623;
    --pos: #63C08A; --pos-bg: rgba(99,192,138,.12); --neg: #E67895; --neg-bg: rgba(230,120,149,.12);
    --warn: #E2B24F; --warn-bg: rgba(226,178,79,.12); --oxide-ink: #F07A62; --cyan-ink: #5FD0D6; --info: #7DB7E0; --focus: #4FD1D8;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.24 0 0 0 0 0.15 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 15px/1.5 var(--f-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan-ink); text-underline-offset: 2px; }
a:hover { color: var(--oxide-ink); }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; margin: 0; letter-spacing: .01em; line-height: 1.1; }
p { margin: 0 0 .8em; }
small { font-size: .82em; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: .86em; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.hand { font-family: var(--f-hand); }

/* engraved label — the console's voice */
.eng {
  font: 600 12px/1 var(--f-display);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- holographic foil ---------- */
.holo {
  background: var(--holo-grain), var(--holo);
  background-size: auto, 260% 100%;
  background-position: 0 0, 0% 50%;
  color: #24211d;
  animation: foil 9s linear infinite;
  box-shadow: 0 0 0 1px rgba(255,255,255,.55) inset, 0 1px 2px rgba(0,0,0,.25);
}
@keyframes foil { to { background-position: 0 0, 260% 50%; } }
@media (prefers-reduced-motion: reduce) { .holo { animation: none; } .reel.spin { animation: none !important; } }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--rail-2), var(--rail) 140px);
  color: var(--rail-ink);
  display: flex; flex-direction: column;
  border-right: 1px solid #000;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.04);
  z-index: 20;
}
.brand { padding: 22px 18px 18px; position: relative; }
.brand-mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark svg { flex: none; }
.brand-word { font: 700 26px/0.9 var(--f-display); letter-spacing: .02em; text-transform: uppercase; font-style: italic; }
.brand-word span { display: block; }
.brand-sticker {
  display: inline-block; margin-top: 12px; padding: 4px 9px 3px; border-radius: 3px;
  font: 700 11px/1 var(--f-display); letter-spacing: .22em; text-transform: uppercase;
  transform: rotate(-2deg);
}
.stripes { display: flex; flex-direction: column; gap: 2px; margin: 0 18px 8px; }
.stripes i { display: block; height: 3px; border-radius: 1px; }
.stripes i:nth-child(1) { background: var(--oxide); }
.stripes i:nth-child(2) { background: var(--amber); }
.stripes i:nth-child(3) { background: var(--cyan); }

.nav { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.nav-sec { margin: 14px 8px 4px; color: var(--rail-muted); font: 600 10.5px/1 var(--f-display); letter-spacing: .22em; text-transform: uppercase; }
.key {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px 10px 14px; border-radius: 5px; text-decoration: none;
  color: var(--rail-ink);
  background: linear-gradient(180deg, #3a3733, #2c2a27);
  border: 1px solid #0d0c0b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 0 #0d0c0b, 0 3px 6px rgba(0,0,0,.25);
  font: 600 15px/1 var(--f-display); letter-spacing: .08em; text-transform: uppercase;
  transition: transform .08s ease, box-shadow .08s ease, background .2s;
}
.key:hover { color: #fff; background: linear-gradient(180deg, #43403b, #32302c); }
.key:active, .key[aria-current="page"] {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 #0d0c0b, 0 1px 2px rgba(0,0,0,.3);
  background: linear-gradient(180deg, #2a2825, #33302c);
}
.key svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.key .led { margin-left: auto; }
.key-count {
  margin-left: auto; min-width: 26px; padding: 2px 5px 0; text-align: center;
  font: 400 18px/1 var(--f-lcd); color: var(--lcd); background: var(--lcd-bg);
  border-radius: 2px; box-shadow: inset 0 1px 2px #000; text-shadow: var(--lcd-glow);
}
.key-count + .led { margin-left: 8px; }

.led { width: 8px; height: 8px; border-radius: 50%; background: #4a4640; box-shadow: inset 0 1px 1px rgba(0,0,0,.6); flex: none; display: inline-block; }
.led.on { background: var(--amber); box-shadow: 0 0 6px var(--amber), inset 0 -1px 1px rgba(0,0,0,.3); }
.led.cyan { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.led.green { background: #57c27b; box-shadow: 0 0 5px rgba(87,194,123,.8); }
.led.red { background: #e2553f; box-shadow: 0 0 5px rgba(226,85,63,.8); }
.led.off { background: #8a8378; box-shadow: none; opacity: .6; }
.led.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.rail-foot { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.06); }
.who { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--rail-muted); }
.who b { color: var(--rail-ink); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--f-display); flex: none; }
.grille { height: 26px; margin: 12px 0 0; background: repeating-linear-gradient(90deg, #0f0e0d 0 3px, transparent 3px 6px); opacity: .55; border-radius: 3px; }

.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 28px; min-height: 70px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--hi);
}
.crumbs { display: flex; flex-direction: column; gap: 3px; min-width: 0; margin-right: auto; }
.crumbs .eng a { color: inherit; text-decoration: none; }
.crumbs .eng a:hover { color: var(--ink); }
.crumbs h1 { font-size: 30px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn.menu-btn { display: none; }

.content { padding: 24px 28px 64px; max-width: 1480px; width: 100%; }

/* ---------- preview / demo marks ---------- */
.preview-strip {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 5px 12px; font: 700 12px/1 var(--f-display); letter-spacing: .22em; text-transform: uppercase;
  color: #1b1a17;
  background: repeating-linear-gradient(-45deg, var(--amber) 0 14px, #1b1a17 14px 28px);
}
.preview-strip span { background: var(--amber); padding: 4px 10px; border-radius: 2px; }
.badge-demo {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px 5px; border-radius: 4px;
  font: 700 12.5px/1 var(--f-display); letter-spacing: .18em; text-transform: uppercase;
  white-space: nowrap;
}
.badge-demo::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #24211d; opacity: .8; }
.demo-note {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin: 0 0 18px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--panel-2); border: 1px dashed var(--line); color: var(--ink-2); font-size: 14px;
}
.demo-note .badge-demo { flex: none; }

/* ---------- controls: tape-deck keys ---------- */
.seg {
  display: inline-flex; padding: 3px; gap: 3px; border-radius: 6px;
  background: var(--panel-3); box-shadow: inset 0 1px 2px var(--lo), 0 1px 0 var(--hi);
}
.seg button {
  border: 0; cursor: pointer; padding: 7px 11px 6px; border-radius: 4px; min-width: 40px;
  font: 600 13px/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: 0 1px 0 var(--hi) inset, 0 1px 0 var(--lo), 0 2px 0 rgba(0,0,0,.08);
  transition: transform .06s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] {
  transform: translateY(1px);
  background: linear-gradient(180deg, #2d2b28, #3a3733); color: var(--lcd);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.6); text-shadow: 0 0 6px rgba(255,184,77,.5);
}
.seg.small button { padding: 6px 9px 5px; min-width: 0; font-size: 12px; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font: 600 13px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; width: 44px; height: 22px; border-radius: 4px; flex: none;
  background: var(--panel-3); box-shadow: inset 0 1px 3px var(--lo), 0 1px 0 var(--hi);
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, #faf7f0, #d9d2c3);
  box-shadow: 0 1px 2px rgba(0,0,0,.35), inset 0 -2px 0 rgba(0,0,0,.08);
  background-image: repeating-linear-gradient(90deg, transparent 0 4px, rgba(0,0,0,.12) 4px 5px), linear-gradient(180deg, #faf7f0, #d9d2c3);
  background-size: 9px 8px, auto; background-position: center, 0 0; background-repeat: no-repeat;
  transition: left .16s ease;
}
.switch input:checked + .track { background: var(--cyan); box-shadow: inset 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track::after { left: 23px; }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 8px 14px 7px; border-radius: 5px; cursor: pointer; text-decoration: none;
  font: 600 14px/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: 0 1px 0 var(--hi) inset, 0 2px 0 var(--lo), 0 2px 4px rgba(0,0,0,.06);
  transition: transform .06s, box-shadow .06s, filter .15s;
}
.btn:hover { filter: brightness(1.03); color: var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--hi) inset, 0 0 0 var(--lo); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(180deg, #DE5A42, #C2432D); color: #fff8ef; border-color: #8f2f1f; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 2px 0 #7d2819, 0 3px 6px rgba(160,50,30,.25); }
.btn-primary:hover { color: #fff; }
.btn-dark { background: linear-gradient(180deg, #3a3733, #2a2825); color: var(--rail-ink); border-color: #111; box-shadow: 0 1px 0 rgba(255,255,255,.1) inset, 0 2px 0 #0d0c0b; }
.btn-dark:hover { color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-danger { color: var(--neg); }
.btn-sm { min-height: 30px; padding: 6px 10px 5px; font-size: 12.5px; }
.btn-icon { padding: 0; width: 36px; }
.btn-sm.btn-icon { width: 30px; }

/* ---------- panels ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-h {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 18px 11px; border-bottom: 1px solid var(--line-2);
}
.panel-h h2 { font-size: 17px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.panel-h .ch {
  font: 400 17px/1 var(--f-lcd); color: var(--lcd-dim); background: var(--lcd-bg);
  padding: 2px 5px 1px; border-radius: 2px; letter-spacing: .05em; box-shadow: inset 0 1px 2px #000;
}
.panel-h .sub { color: var(--muted); font-size: 13px; }
.panel-h .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-b { padding: 16px 18px 18px; }
.panel-b.flush { padding: 0; }
.panel-foot { padding: 10px 18px 12px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13px; }
.screws::before, .screws::after {
  content: ''; position: absolute; top: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--hi), var(--panel-3) 60%);
  box-shadow: inset 0 0 0 1px var(--lo);
}
.screws::before { left: 8px; } .screws::after { right: 8px; }

.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- LCD meter bridge ---------- */
.bridge {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  background: linear-gradient(180deg, #2f2d2a, #232120);
  border-radius: var(--radius); padding: 12px; gap: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 2px 0 #0d0c0b, 0 10px 22px -12px rgba(0,0,0,.6);
  position: relative;
}
.bridge.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bridge.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.meter { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.meter-label { font: 600 11.5px/1 var(--f-display); letter-spacing: .18em; text-transform: uppercase; color: #b9b1a2; display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcd {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 50% 0%, var(--lcd-bg-2), var(--lcd-bg));
  border-radius: 4px; padding: 6px 10px 2px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.9), inset 0 0 0 1px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.07);
  font: 400 44px/1 var(--f-lcd); color: var(--lcd); text-shadow: var(--lcd-glow);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.lcd::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 3px),
              linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0) 40%);
}
.lcd .ghost { position: absolute; left: 10px; top: 6px; color: var(--lcd-ghost); text-shadow: none; }
.lcd .val { position: relative; }
.lcd .unit { font-size: .5em; margin-left: 4px; color: var(--lcd-dim); }
.lcd.cyan { color: #6FE6EC; text-shadow: 0 0 6px rgba(111,230,236,.45), 0 0 18px rgba(47,181,188,.2); }
.lcd.cyan .ghost { color: rgba(111,230,236,.07); }
.lcd.sm { font-size: 30px; padding: 4px 8px 1px; }
.delta { font: 500 13px/1.2 var(--f-body); color: #b9b1a2; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.delta b { font-weight: 600; }
.delta .up { color: #74d39b; } .delta .down { color: #f08aa4; } .delta .flat { color: #b9b1a2; }
.bridge .demo-corner { position: absolute; right: 12px; top: -11px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.tbl th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; padding: 10px 14px 9px; white-space: nowrap;
  font: 600 12px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th button { all: unset; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.tbl th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.tbl th[aria-sort] button { color: var(--ink); }
.tbl th .arrow { font-size: 10px; opacity: .8; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr.link:hover { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .title-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.tbl .title-cell a { color: var(--ink); text-decoration: none; font-weight: 600; }
.tbl .title-cell a:hover { color: var(--oxide-ink); text-decoration: underline; }
.tbl .title-cell small { display: block; color: var(--muted); font-weight: 400; }

.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 3px; border-radius: 3px;
  font: 600 11.5px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--panel-2);
}
.tag.premium { background: #2a2825; color: var(--lcd); border-color: #111; text-shadow: 0 0 5px rgba(255,184,77,.35); }
.tag.free { background: transparent; }
.tag.community { border-color: color-mix(in srgb, var(--cyan) 60%, var(--line)); color: var(--cyan-ink); background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.tag.featured { border: 0; color: #24211d; }
.tag.holo { background: var(--holo-grain), var(--holo); background-size: auto, 260% 100%; }
.status { display: inline-flex; align-items: center; gap: 7px; font: 600 12.5px/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.status-pending { color: var(--warn); }
.status-approved { color: var(--pos); }
.status-rejected { color: var(--neg); }
.status-needs_changes { color: var(--info); }

/* VU completion meter */
.vu { display: inline-flex; gap: 2px; vertical-align: middle; }
.vu i { width: 6px; height: 14px; border-radius: 1px; background: var(--panel-3); box-shadow: inset 0 1px 1px var(--lo); }
.vu.good i.on { background: #4fae74; } .vu.fair i.on { background: #e1ad3f; } .vu.poor i.on { background: #d0587a; }
.vu-cell { display: inline-flex; gap: 10px; align-items: center; }
.vu-cell b { min-width: 3.2ch; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.spark { display: block; overflow: visible; }
.cass-chip { vertical-align: middle; flex: none; }
.ticker .cass-chip { width: 22px; height: 15px; margin: -2px 4px 0 0; }

/* ---------- filters bar ---------- */
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.search { position: relative; flex: 1 1 220px; max-width: 340px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input[type="search"] { padding-left: 34px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lab { font: 600 12px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], input[type="url"], select, textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border-radius: 5px;
  background: color-mix(in srgb, var(--panel) 40%, #fff 0%);
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 2px var(--lo);
  color: var(--ink); font-size: 15px;
}
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: #1a1917; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent), inset 0 1px 2px var(--lo); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--oxide); }

/* fader slider */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--track-fill, var(--cyan)) var(--p, 50%), var(--panel-3) var(--p, 50%)); box-shadow: inset 0 1px 2px var(--lo); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--panel-3); box-shadow: inset 0 1px 2px var(--lo); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--track-fill, var(--cyan)); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 26px; margin-top: -10px; border-radius: 3px;
  background: repeating-linear-gradient(180deg, transparent 0 5px, rgba(0,0,0,.25) 5px 6px), linear-gradient(180deg, #4a4642, #2a2825);
  background-size: 10px 13px, auto; background-position: center, 0 0; background-repeat: no-repeat;
  border: 1px solid #111; box-shadow: 0 2px 3px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.15);
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 26px; border-radius: 3px; background: #2f2d2a; border: 1px solid #111; }
input[type="range"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fader { display: grid; grid-template-columns: minmax(0, 1fr) 72px; gap: 10px; align-items: center; }
.fader output { font: 400 22px/1 var(--f-lcd); color: var(--lcd); background: var(--lcd-bg); padding: 4px 6px 2px; border-radius: 3px; text-align: right; box-shadow: inset 0 1px 3px #000; text-shadow: var(--lcd-glow); }

/* ---------- bar list ---------- */
.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.bl-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.bl-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-label small { color: var(--muted); margin-left: 6px; }
.bl-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bl-val small { color: var(--muted); font-weight: 400; margin-left: 6px; display: inline-block; min-width: 3.5ch; text-align: right; }
.bl-track { height: 8px; background: var(--panel-3); border-radius: 2px; overflow: hidden; box-shadow: inset 0 1px 1px var(--lo); }
.bl-fill { height: 100%; border-radius: 2px; }
.bl-rest { color: var(--muted); font-size: 13px; }
.empty-inline { color: var(--muted); font-size: 14px; margin: 6px 0; }

/* ---------- charts ---------- */
.chart { display: block; overflow: visible; font-family: var(--f-body); }
.chart .gl { stroke: var(--line-2); stroke-width: 1; }
.chart .gl.base { stroke: var(--line); }
.chart .tick { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .tick.strong { fill: var(--ink); font-weight: 600; font-size: 12.5px; }
.chart .tick.neg { fill: var(--neg); font-weight: 600; }
.chart .val { fill: var(--ink); font: 600 13px var(--f-body); font-variant-numeric: tabular-nums; }
.chart .hover-col { fill: var(--ink); fill-opacity: .06; }
.chart .bar { transition: opacity .15s; }
.chart-host { width: 100%; min-height: 120px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

.lcd-panel {
  background: radial-gradient(130% 120% at 50% 0%, var(--lcd-bg-2), var(--lcd-bg));
  border-radius: 6px; padding: 14px 12px 6px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.9), 0 1px 0 var(--hi);
  position: relative; overflow: hidden;
}
.lcd-panel::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(0,0,0,.18) 2px 3px); }
.heat .tick, .lcd-tick { fill: rgba(255, 184, 77, .6) !important; font-family: var(--f-lcd) !important; font-size: 15px !important; }
.heat .led-off { fill: rgba(255, 184, 77, .06); }
.heat .led-on { fill: var(--lcd); filter: drop-shadow(0 0 3px rgba(255,170,60,.55)); }
.heat-legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.heat-legend .ramp { width: 120px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, rgba(255,184,77,.12), var(--lcd)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }

#tip {
  position: fixed; z-index: 1000; pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity .12s, transform .12s;
  min-width: 170px; max-width: 280px; padding: 9px 11px 8px; border-radius: 5px;
  background: #1d1c19; color: #efe8da; font-size: 13px; line-height: 1.35;
  box-shadow: 0 8px 22px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06);
}
#tip.on { opacity: 1; transform: none; }
#tip .tip-h { font: 600 12px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--lcd); margin-bottom: 7px; }
#tip .tip-row, #tip .tip-total { display: flex; align-items: center; gap: 8px; }
#tip .tip-row span, #tip .tip-total span { flex: 1; color: #cfc7b8; }
#tip .tip-row i { width: 9px; height: 9px; border-radius: 2px; }
#tip .tip-total { border-top: 1px solid rgba(255,255,255,.12); margin-top: 6px; padding-top: 6px; }
#tip b { font-variant-numeric: tabular-nums; }

/* ---------- top stories list ---------- */
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: 26px 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.rank li:last-child { border-bottom: 0; }
.rank .pos { font: 400 22px/1 var(--f-lcd); color: var(--faint); text-align: center; }
.rank a { color: var(--ink); font-weight: 600; text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank a:hover { color: var(--oxide-ink); }
.rank small { color: var(--muted); display: block; }
.rank .fig { text-align: right; font-variant-numeric: tabular-nums; }
.rank .fig b { display: block; font-size: 17px; }

/* ---------- live ticker ---------- */
.ticker { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow-y: auto; }
.ticker li { display: grid; grid-template-columns: 62px 112px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 18px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.ticker li.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--amber) 28%, transparent); } }
.ticker time { font: 400 17px/1 var(--f-lcd); color: var(--muted); }
.ticker .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.ticker .what b { color: var(--ink); font-weight: 600; }
.ev { display: inline-flex; gap: 6px; align-items: center; font: 600 11.5px/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.ev::before { content: ''; width: 7px; height: 7px; border-radius: 1px; background: currentColor; }
.ev-session_start, .ev-session_resume { color: var(--info); }
.ev-zone_enter { color: var(--cyan-ink); }
.ev-narration_start { color: var(--warn); }
.ev-narration_complete { color: var(--pos); }
.ev-narration_interrupted { color: var(--neg); }
.ev-session_end, .ev-session_pause { color: var(--muted); }
.live-dot { display: inline-flex; align-items: center; gap: 7px; font: 600 12px/1 var(--f-display); letter-spacing: .16em; color: var(--oxide-ink); }
.live-dot .led { background: var(--oxide); box-shadow: 0 0 6px var(--oxide); }

/* ---------- split / source bars ---------- */
.split { display: flex; height: 26px; border-radius: 4px; overflow: hidden; box-shadow: inset 0 1px 2px var(--lo); background: var(--panel-3); }
.split > div { display: flex; align-items: center; padding: 0 8px; font: 600 12px/1 var(--f-display); letter-spacing: .1em; color: #fff; white-space: nowrap; overflow: hidden; }
.split-legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.stat-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.stat { padding: 10px 12px; border-radius: 5px; background: var(--panel-2); box-shadow: inset 0 1px 2px var(--lo); }
.stat .eng { display: block; margin-bottom: 6px; }
.stat b { font: 600 22px/1 var(--f-display); letter-spacing: .02em; }

/* ---------- story header ---------- */
.story-head { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; align-items: center; margin-bottom: 20px; }
.story-head .cass-hero { width: 100%; height: auto; filter: drop-shadow(0 10px 16px rgba(40,25,10,.28)); }
.story-head h2 { font-size: 40px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
.story-head .synopsis { color: var(--ink-2); max-width: 64ch; margin: 10px 0 14px; font-size: 16px; }
.meta-row { display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; }
.reel { transform-box: view-box; }
.reel.spin { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- funnel ---------- */
.funnel { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.funnel th { text-align: left; font: 600 11.5px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 0 10px 10px; white-space: nowrap; }
.funnel th.r, .funnel td.r { text-align: right; }
.funnel td { padding: 9px 10px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.funnel .zn { display: flex; gap: 10px; align-items: center; min-width: 170px; }
.funnel .zn .idx { font: 400 20px/1 var(--f-lcd); color: var(--lcd); background: var(--lcd-bg); border-radius: 2px; padding: 2px 5px 1px; min-width: 26px; text-align: center; box-shadow: inset 0 1px 2px #000; }
.funnel .zn b { display: block; font-weight: 600; }
.funnel .zn small { color: var(--muted); }
.stages { display: grid; gap: 3px; min-width: 220px; }
.stage { display: grid; grid-template-columns: 74px minmax(0, 1fr) 40px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.stage .t { height: 9px; background: var(--panel-3); border-radius: 2px; overflow: hidden; box-shadow: inset 0 1px 1px var(--lo); }
.stage .f { height: 100%; border-radius: 2px; }
.stage span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.hatch { background-image: repeating-linear-gradient(-45deg, var(--neg) 0 3px, transparent 3px 6px) !important; }

/* listened vs length tape */
.tape { position: relative; height: 22px; border-radius: 11px; background: var(--panel-3); box-shadow: inset 0 1px 2px var(--lo); min-width: 160px; overflow: hidden; }
.tape .fill { position: absolute; inset: 0 auto 0 0; border-radius: 11px; background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 2px, transparent 2px 6px); }
.tape .lab { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.tape .lab span:first-child { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }

/* audio transport */
.transport { display: inline-flex; gap: 6px; }
.tbtn {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 5px; min-height: 30px; border-radius: 4px; cursor: pointer;
  font: 600 12px/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid #111; color: var(--rail-ink);
  background: linear-gradient(180deg, #3a3733, #2a2825);
  box-shadow: 0 1px 0 rgba(255,255,255,.1) inset, 0 2px 0 #0d0c0b;
}
.tbtn svg { width: 12px; height: 12px; }
.tbtn:active, .tbtn[aria-pressed="true"] { transform: translateY(2px); box-shadow: inset 0 1px 3px rgba(0,0,0,.6); color: var(--lcd); }
.tbtn[disabled] { opacity: .4; cursor: not-allowed; }
.tbtn .prog { width: 34px; height: 3px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; display: none; }
.tbtn[aria-pressed="true"] .prog { display: block; }
.tbtn .prog i { display: block; height: 100%; background: var(--lcd); width: 0; }

/* ---------- maps ---------- */
.map { height: 480px; border-radius: 0 0 var(--radius) var(--radius); background: var(--panel-3); z-index: 0; }
.map.tall { height: 100%; min-height: 520px; border-radius: var(--radius); }
.leaflet-tile-pane { filter: grayscale(1) sepia(.28) saturate(.9) contrast(.92) brightness(1.04); }
:root[data-theme="dark"] .leaflet-tile-pane { filter: grayscale(1) invert(1) sepia(.2) brightness(.82) contrast(.9); }
.leaflet-container { font-family: var(--f-body); background: var(--panel-3); }
.leaflet-control-attribution { font-size: 10px; background: rgba(236,231,220,.8) !important; }
.leaflet-popup-content-wrapper { border-radius: 5px; background: #1d1c19; color: #efe8da; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.leaflet-popup-tip { background: #1d1c19; }
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; line-height: 1.4; }
.leaflet-popup-content b { color: var(--lcd); font-weight: 600; }
.leaflet-container a.leaflet-popup-close-button { color: #cfc7b8; }
.zone-pin {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: 400 19px/1 var(--f-lcd); color: #1b1a17; border: 2px solid #1b1a17;
  box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: grab;
}
.zone-pin.sel { outline: 3px solid var(--amber); outline-offset: 2px; }
.zone-pin.overlay { border-style: dashed; background: rgba(255,255,255,.85) !important; font: 700 17px/1 var(--f-body); }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-2); }
.map-legend span { display: inline-flex; gap: 7px; align-items: center; }
.map-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }

/* ---------- zone audio list ---------- */
.zlist { list-style: none; margin: 0; padding: 0; }
.zlist li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.zlist li:last-child { border-bottom: 0; }
.zlist .thumb { width: 64px; height: 48px; border-radius: 3px; object-fit: cover; background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--lo); }
.zlist b { font-weight: 600; }
.zlist small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); gap: 18px; align-items: start; }
.editor .map-col { position: sticky; top: 92px; height: calc(100vh - 112px); display: flex; flex-direction: column; gap: 10px; }
.editor .map-col .panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.editor .map-col .map { flex: 1; height: auto; min-height: 360px; border-radius: 0 0 var(--radius) var(--radius); }
.cass-preview { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: center; }
.cass-preview .cass-hero { width: 100%; height: auto; filter: drop-shadow(0 8px 12px rgba(40,25,10,.25)); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 4px; border: 1px solid rgba(0,0,0,.25); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 1px rgba(0,0,0,.15); padding: 0; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type="color"] { width: 44px; height: 38px; padding: 2px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; }
.color-row input[type="text"] { width: 110px; font-family: var(--f-mono); }

.zones-ed { list-style: none; margin: 0; padding: 0; }
.zones-ed > li { border-bottom: 1px solid var(--line-2); }
.zones-ed > li:last-child { border-bottom: 0; }
.zrow { display: grid; grid-template-columns: 22px 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; }
.zrow:hover { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.zones-ed > li.sel > .zrow { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--oxide); }
.zrow .grip { cursor: grab; color: var(--faint); display: grid; place-items: center; }
.zrow .grip svg { width: 14px; height: 14px; }
.zrow .idx { font: 400 20px/1 var(--f-lcd); color: var(--lcd); background: var(--lcd-bg); border-radius: 2px; padding: 3px 0 1px; text-align: center; box-shadow: inset 0 1px 2px #000; }
.zrow .idx.ov { color: #6FE6EC; }
.zrow b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zrow small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zones-ed > li.dragging { opacity: .4; }
.zones-ed > li.drop-before { box-shadow: inset 0 3px 0 var(--cyan); }
.zinspect { padding: 4px 14px 18px; background: var(--panel-2); box-shadow: inset 3px 0 0 var(--oxide); }
.zinspect .form-grid { gap: 12px 14px; }
.file-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.dirty-dot { display: inline-flex; align-items: center; gap: 7px; font: 600 12px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--warn); }
.dirty-dot .led { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.saved-dot { color: var(--pos); }
.saved-dot .led { background: #57c27b; box-shadow: 0 0 5px rgba(87,194,123,.8); }
.map-tools { position: absolute; z-index: 500; top: 10px; right: 10px; display: flex; gap: 6px; }
.map-hint { position: absolute; z-index: 500; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 7px 12px; border-radius: 4px; background: #1d1c19; color: var(--lcd); font: 600 12px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.ring-lab { font: 600 11px/1 var(--f-display); letter-spacing: .1em; color: #1b1a17; background: rgba(255,255,255,.85); padding: 2px 4px; border-radius: 2px; white-space: nowrap; }

/* ---------- submissions ---------- */
.mod { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.subs { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 250px); overflow-y: auto; }
.subs li a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
.subs li a:hover { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.subs li a[aria-current="true"] { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--oxide); }
.subs b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subs small { color: var(--muted); grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.sub-detail h2 { font-size: 30px; font-weight: 700; text-transform: uppercase; }
.sub-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr); gap: 0; }
.sub-grid > div { padding: 18px; }
.sub-grid > div + div { border-left: 1px solid var(--line-2); }
.transcript { font-size: 16px; line-height: 1.65; color: var(--ink); max-width: 62ch; white-space: pre-wrap; }
.transcript.none { color: var(--muted); font-style: italic; }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; font-size: 14px; margin: 0; }
.kv dt { font: 600 11.5px/1.5 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.consent { display: flex; flex-direction: column; gap: 8px; }
.consent div { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.private { display: inline-flex; gap: 6px; align-items: center; font: 600 11px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--neg); border: 1px solid currentColor; padding: 3px 6px 2px; border-radius: 3px; }
.photo { width: 100%; max-height: 300px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px var(--lo); background: var(--panel-3); }
audio { width: 100%; height: 40px; }
.mini-map { height: 200px; border-radius: 4px; overflow: hidden; }
.mod-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line-2); background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); align-items: center; }

/* ---------- dialog ---------- */
dialog {
  border: 0; padding: 0; border-radius: 8px; background: var(--panel); color: var(--ink);
  width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 60px rgba(0,0,0,.4);
}
dialog::backdrop { background: rgba(25, 20, 15, .55); backdrop-filter: blur(2px); }
dialog .panel-b { display: flex; flex-direction: column; gap: 14px; }
dialog .foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--panel-2); border-radius: 0 0 8px 8px; }

/* ---------- loading / empty ---------- */
.loading { display: grid; place-items: center; align-content: center; gap: 14px; padding: 60px 20px; color: var(--muted); text-align: center; }
.loading .reels { display: flex; gap: 26px; }
.loading .reels i { width: 34px; height: 34px; border-radius: 50%; border: 5px solid var(--ink-2); border-top-color: transparent; border-bottom-color: transparent; animation: spin 1.1s linear infinite; }
.loading .eng { letter-spacing: .24em; }
.skel { position: relative; overflow: hidden; background: var(--panel-2); border-radius: 4px; }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--hi), transparent); animation: sweep 1.4s ease-in-out infinite; }
@keyframes sweep { to { transform: translateX(100%); } }
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 46px 22px; color: var(--muted); }
.empty svg.blank-tape { width: 150px; height: auto; opacity: .85; }
.empty h3 { font-size: 22px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.empty p { max-width: 46ch; margin: 0; }
.error-box { padding: 14px 16px; border-radius: 6px; background: var(--neg-bg); color: var(--neg); border: 1px solid color-mix(in srgb, var(--neg) 30%, transparent); font-size: 14px; }
.error-box code { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); }
.info-box { padding: 12px 14px; border-radius: 6px; background: var(--panel-2); border-left: 3px solid var(--cyan); font-size: 14px; color: var(--ink-2); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.deck {
  width: min(920px, 100%); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: linear-gradient(180deg, #33302c, #232120); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 3px 0 #0d0c0b, 0 40px 80px -30px rgba(30,20,10,.6);
}
.deck-art { padding: 34px 32px; color: var(--rail-ink); display: flex; flex-direction: column; gap: 22px; position: relative; }
.deck-art .cass-hero { width: 100%; height: auto; filter: drop-shadow(0 14px 18px rgba(0,0,0,.45)); }
.deck-art .brand-word { font-size: 40px; }
.deck-art p { color: var(--rail-muted); margin: 0; font-size: 15px; max-width: 40ch; }
.deck-form { background: var(--panel); padding: 34px 32px; display: flex; flex-direction: column; gap: 16px; }
.deck-form h2 { font-size: 28px; text-transform: uppercase; font-weight: 700; }
.deck-form .tabs { margin-bottom: 4px; }
.deck-form .btn { width: 100%; min-height: 44px; font-size: 15px; }
.deck-form .note { font-size: 13.5px; color: var(--muted); }
.deck-form .msg { font-size: 14px; padding: 10px 12px; border-radius: 5px; }
.deck-form .msg.ok { background: var(--pos-bg); color: var(--pos); }
.deck-form .msg.err { background: var(--neg-bg); color: var(--neg); }
.linkish { all: unset; cursor: pointer; color: var(--cyan-ink); text-decoration: underline; text-underline-offset: 2px; font-size: 14px; }
.linkish:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 2000; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 14px; border-radius: 5px; background: #1d1c19; color: #efe8da; font-size: 14px; box-shadow: 0 8px 20px rgba(0,0,0,.3); transform: translateY(8px); opacity: 0; transition: .2s; border-left: 3px solid var(--cyan); max-width: 360px; }
.toast.in { transform: none; opacity: 1; }
.toast-ok { border-left-color: #57c27b; } .toast-warn { border-left-color: var(--amber); } .toast-err { border-left-color: #e2553f; }

/* ---------- settings ---------- */
.prose { max-width: 70ch; color: var(--ink-2); }
.prose h3 { font-size: 18px; text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 8px; color: var(--ink); }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
.code-block { font-family: var(--f-mono); font-size: 13px; background: var(--lcd-bg); color: #e8e0cf; padding: 12px 14px; border-radius: 5px; overflow-x: auto; white-space: pre; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .bridge { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .g-main-side, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .mod { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
  .sub-grid { grid-template-columns: minmax(0, 1fr); }
  .sub-grid > div + div { border-left: 0; border-top: 1px solid var(--line-2); }
}
@media (max-width: 960px) {
  :root { --rail-w: 0px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-105%); transition: transform .2s ease; visibility: hidden; }
  .app.nav-open .rail { transform: none; visibility: visible; box-shadow: 10px 0 40px rgba(0,0,0,.4); }
  .btn.menu-btn { display: inline-flex; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(20,15,10,.4); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor .map-col { position: relative; top: 0; height: 460px; order: -1; }
  .story-head { grid-template-columns: 180px minmax(0, 1fr); gap: 18px; }
  .story-head h2 { font-size: 30px; }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .content { padding: 16px 16px 48px; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .crumbs h1 { font-size: 23px; }
  .bridge { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .lcd { font-size: 36px; }
  .mod { grid-template-columns: minmax(0, 1fr); }
  .subs { max-height: 320px; }
  .story-head { grid-template-columns: minmax(0, 1fr); }
  .story-head .cass-hero { max-width: 240px; }
  .deck { grid-template-columns: minmax(0, 1fr); }
  .deck-art { padding: 24px; }
  .deck-art .cass-hero { max-width: 260px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .cass-preview { grid-template-columns: 140px minmax(0, 1fr); }
  .ticker li { grid-template-columns: 54px minmax(0, 1fr); }
  .ticker li .ev { grid-column: 2; }
  .ticker li .what { grid-column: 2; }
  .controls { width: 100%; }
  .zlist li { grid-template-columns: 48px minmax(0, 1fr); }
  .zlist li .transport { grid-column: 2; }
  .zlist .thumb { width: 48px; height: 40px; }
}
@media (max-width: 760px) {
  .preview-strip { font-size: 10.5px; letter-spacing: .12em; }
  .topbar .badge-demo { display: none; }
}
