/* PRASAN — DDPM Radio Interoperability Console
   Dark control-room theme. Amber accent from the ปภ. / VRA marks. System identity colors are a validated
   categorical set (dark surface, adjacent pairs): Spender blue, iTalk orange, WOR aqua, Mumble violet.
   Status colors are reserved for state and always ship with an icon + label. */

@font-face { font-family: "Plex Thai"; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-thai-400.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Plex Thai"; font-weight: 500; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-thai-500.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Plex Thai"; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-thai-600.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Plex Thai"; font-weight: 700; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-thai-700.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Plex Thai"; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Thai"; font-weight: 500; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Thai"; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Thai"; font-weight: 700; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-600.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  /* planes */
  --bg-0: #060a10;          /* page */
  --bg-1: #0b111b;          /* panel */
  --bg-2: #101824;          /* card / chart surface */
  --bg-3: #162131;          /* raised, hover */
  --bg-4: #1d2a3d;          /* pressed, selected */
  --line: rgba(150, 175, 210, 0.10);
  --line-2: rgba(150, 175, 210, 0.18);
  --line-3: rgba(150, 175, 210, 0.30);
  /* ink */
  --ink-1: #e9eef5;
  --ink-2: #aab6c6;
  --ink-3: #758296;
  --ink-4: #4f5b6d;
  /* brand */
  --amber: #f3b50a;
  --amber-2: #ffd24a;
  --amber-ink: #1a1300;
  --amber-wash: rgba(243, 181, 10, 0.10);
  /* systems (categorical, fixed order) */
  --sys-1: #3987e5;   /* SpenderNetwork */
  --sys-2: #d95926;   /* iTalk */
  --sys-3: #199e70;   /* WOR */
  --sys-4: #9085e9;   /* Mumble */
  --sys-5: #c9428d;   /* Zello */
  --sys-6: #4cc3d9;   /* Hytera P30 (radio port via USB interface) */
  /* status (reserved) */
  --ok: #0ca30c;
  --ok-ink: #3fd13f;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --crit-ink: #ff6b6b;
  --live: #ff3b3b;          /* REC / TX lamp */
  --focus: #ffd24a;
  /* type */
  --sans: "Plex Thai", "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r-1: 4px; --r-2: 6px; --r-3: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 8px 24px rgba(0,0,0,0.35);
  --header-h: 64px;
  --nav-h: 42px;
  --player-h: 0px;
  --status-h: 26px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg-0); color: var(--ink-1);
  font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before { /* faint console grid texture */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(150,175,210,0.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(150,175,210,0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--amber-2); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-1); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- app shell */
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.hdr {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  height: var(--header-h); display: flex; align-items: center; gap: 18px; padding: 0 18px;
  background: linear-gradient(180deg, #0d1522 0%, #0a101a 100%);
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(243,181,10,0.18), 0 6px 18px rgba(0,0,0,0.35);
}
.hdr::after { /* amber hazard hairline */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--amber) 0 180px, transparent 180px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-tile {
  width: 44px; height: 44px; border-radius: 8px; background: #fff; display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.14), 0 2px 8px rgba(0,0,0,0.45); overflow: hidden; flex: none;
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.logo-tile.ddpm img { object-fit: cover; transform: scale(0.9); }
.wordmark { display: flex; flex-direction: column; min-width: 0; }
.wordmark .name { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 21px; letter-spacing: 0.14em; line-height: 1; }
.wordmark .name .th { font-weight: 600; letter-spacing: 0; font-size: 17px; color: var(--amber-2); }
.wordmark .sub { margin-top: 5px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-poc {
  font: 600 11px/1 var(--mono); letter-spacing: 0.08em; padding: 5px 7px 4px; border-radius: 4px;
  color: var(--amber-ink); background: var(--amber);
}
.hdr .spacer { flex: 1; }
.hdr-stat { display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--bg-2); font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em; white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pill.ok { border-color: rgba(12,163,12,0.45); color: var(--ok-ink); background: rgba(12,163,12,0.08); }
.pill.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(12,163,12,0.18); }
.pill.warn { border-color: rgba(250,178,25,0.5); color: var(--warn); background: rgba(250,178,25,0.08); }
.pill.warn .dot { background: var(--warn); }
.pill.crit { border-color: rgba(208,59,59,0.6); color: var(--crit-ink); background: rgba(208,59,59,0.12); }
.pill.crit .dot { background: var(--crit); animation: blink 1s steps(2) infinite; }
.pill.alerts { cursor: pointer; }
.pill.alerts.has { border-color: rgba(250,178,25,0.5); color: var(--warn); }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; padding-left: 14px; border-left: 1px solid var(--line-2); }
.clock .t { font: 600 24px/1 var(--mono); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.clock .d { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; white-space: nowrap; }
.clock .tz { color: var(--ink-3); font: 500 10px/1 var(--mono); letter-spacing: 0.08em; }
.logo-tile.vra { width: 40px; height: 40px; }
.usermenu { position: relative; }
.iconbtn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-2);
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink-2); cursor: pointer;
}
.iconbtn:hover { color: var(--ink-1); border-color: var(--line-3); background: var(--bg-3); }
.iconbtn.on { color: var(--amber-2); border-color: rgba(243,181,10,0.55); background: var(--amber-wash); }
.menu {
  position: absolute; right: 0; top: 40px; min-width: 220px; padding: 6px; border-radius: var(--r-3);
  background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); z-index: 60;
}
.menu .who { padding: 8px 10px; color: var(--ink-3); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: var(--r-1); cursor: pointer; text-align: left; }
.menu button:hover { background: var(--bg-3); }

/* nav */
.nav {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--header-h)); z-index: 40;
  height: var(--nav-h); display: flex; align-items: stretch; gap: 2px; padding: 0 14px;
  background: rgba(8, 12, 19, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--ink-2); font-weight: 500;
  border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none;
}
.nav a small { color: var(--ink-3); font-size: 11px; font-weight: 400; letter-spacing: 0.03em; }
.nav a:hover { color: var(--ink-1); background: rgba(255,255,255,0.02); }
.nav a.active { color: var(--ink-1); border-bottom-color: var(--amber); }
.nav a.active svg { color: var(--amber-2); }
.nav .grow { flex: 1; }
.nav .navtools { display: flex; align-items: center; gap: 8px; }
.conn { display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1 var(--mono); color: var(--ink-3); letter-spacing: 0.06em; white-space: nowrap; }
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.conn.bad .dot { background: var(--crit); }
.conn.bad { color: var(--crit-ink); }

main { flex: 1; padding: 14px 16px calc(var(--player-h) + var(--status-h) + 16px); }
.view { display: none; }
.view.active { display: block; animation: fade 160ms ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* banner */
.banner {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--header-h) + var(--nav-h) + 10px); z-index: 70;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r-3);
  background: #2a0f12; border: 1px solid rgba(208,59,59,0.6); color: #ffd7d7; box-shadow: var(--shadow); font-weight: 500;
}
.banner .spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------------------------------------------------------------- panels */
.panel {
  background: linear-gradient(180deg, var(--bg-1), #0a0f18); border: 1px solid var(--line); border-radius: var(--r-3);
  box-shadow: var(--shadow); min-width: 0;
}
.panel-h {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.panel-h h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.01em; display: flex; align-items: baseline; gap: 8px; }
.panel-h h2 .en { font: 500 10.5px/1 var(--mono); color: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase; }
.panel-h .tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-b { padding: 12px 14px; }
.kicker { font: 600 10.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }

/* grid: overview */
.ov-grid { display: grid; grid-template-columns: 400px minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.ov-left, .ov-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ov-center { min-width: 0; }

/* ---------------------------------------------------------------- live strip */
.live {
  margin-bottom: 14px; display: grid; grid-template-columns: 148px minmax(0, 1fr) 470px; gap: 0; overflow: hidden;
}
.live-recent { border-left: 1px solid var(--line); padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; background: rgba(255,255,255,0.01); }
.recent-list { display: flex; flex-direction: column; gap: 3px; }
.rc { display: grid; grid-template-columns: 24px 64px 72px minmax(0, 1fr) 48px; align-items: center; gap: 8px; font-size: 12.5px; padding: 2px 4px; border-radius: 4px; }
.rc:hover { background: rgba(255,255,255,0.03); }
.rc.playing { background: var(--amber-wash); }
.rc-play { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-3); background: var(--bg-3); color: var(--ink-1); cursor: pointer; padding: 0; }
.rc-play svg.i { width: 11px; height: 11px; }
.rc-play:hover { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.rc-t { color: var(--ink-2); font-size: 12px; }
.rc-s { display: inline-flex; align-items: center; gap: 5px; font: 600 10px/1 var(--mono); letter-spacing: 0.04em; color: var(--ink-2); }
.rc-s i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.rc-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.rc-d { text-align: right; color: var(--ink-2); font-size: 12px; }
.live-tag {
  display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 12px 16px;
  border-right: 1px solid var(--line); background: linear-gradient(180deg, #0f1826, #0b111b);
}
.live-tag .k { display: flex; align-items: center; gap: 8px; font: 700 13px/1 var(--mono); letter-spacing: 0.18em; color: var(--ink-2); }
.live-tag .k .lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-4); box-shadow: 0 0 0 3px rgba(255,255,255,0.04); }
.live.on .live-tag .k { color: #fff; }
.live.on .live-tag .k .lamp { background: var(--live); box-shadow: 0 0 0 3px rgba(255,59,59,0.22), 0 0 14px rgba(255,59,59,0.7); animation: pulse 1.2s ease-in-out infinite; }
.live-tag .s { font-size: 12px; color: var(--ink-3); }
@keyframes pulse { 50% { opacity: 0.55; } }
.live-cards { display: flex; gap: 12px; padding: 12px; overflow-x: auto; min-height: 104px; align-items: stretch; }
.live-idle { display: flex; align-items: center; gap: 18px; padding: 0 8px; color: var(--ink-2); flex-wrap: wrap; }
.live-idle .big { font-size: 16px; font-weight: 600; color: var(--ink-1); }
.live-idle .last { font-size: 12.5px; color: var(--ink-3); }
.lcard {
  position: relative; flex: 0 1 560px; min-width: 380px; max-width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px;
  padding: 10px 14px 10px 16px; border-radius: var(--r-2); background: var(--bg-2); border: 1px solid var(--line-2);
  animation: slidein 240ms ease-out;
}
.lcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 6px 0 0 6px; background: var(--c, var(--amber)); }
.lcard .from { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.lcard .from b { color: var(--ink-1); font-weight: 600; }
.lcard .talker { font-size: 20px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard .talker.unknown { color: var(--ink-2); font-weight: 500; font-size: 17px; }
.lcard .rec { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rec-badge { display: inline-flex; align-items: center; gap: 6px; font: 700 12px/1 var(--mono); letter-spacing: 0.12em; color: #fff; padding: 5px 8px; border-radius: 4px; background: rgba(255,59,59,0.16); border: 1px solid rgba(255,59,59,0.55); }
.rec-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: blink 1s steps(2) infinite; }
.lcard .timer { font: 600 24px/1 var(--mono); font-variant-numeric: tabular-nums; }
.lcard .foot { grid-column: 1 / span 2; display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.lcard .note { font-size: 11.5px; color: var(--ink-3); grid-column: 1 / span 2; }
.bridges { display: flex; gap: 6px; flex-wrap: wrap; }
.bchip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 11.5px; background: var(--bg-3); border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.bchip .sw { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.bchip.ok { color: var(--ink-1); }
.bchip.ok svg { color: var(--ok-ink); }
.bchip.fail svg { color: var(--crit-ink); }
.bchip.skip { color: var(--ink-3); }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* meters */
.meter { position: relative; height: 10px; flex: 1; min-width: 80px; border-radius: 2px; background: #0a0f17; border: 1px solid var(--line); overflow: hidden; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg, #1f9d55 0%, #1f9d55 70%, #d6a409 84%, #d64545 96%); transition: width 90ms linear; }
.meter .peak { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; opacity: 0.85; left: 0; transition: left 120ms linear; }
.meter .ticks { position: absolute; inset: 0; background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0,0,0,0.55) calc(10% - 1px) 10%); pointer-events: none; }
.meter-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 48px; align-items: center; gap: 8px; font-size: 11.5px; }
.meter-row .lbl { color: var(--ink-3); white-space: nowrap; }
.meter-row .db { font: 500 11px/1 var(--mono); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- port cards */
.port {
  position: relative; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-3); overflow: hidden;
}
.port.tx { border-color: rgba(255,59,59,0.5); box-shadow: 0 0 0 1px rgba(255,59,59,0.14); }
.port.rx { border-color: rgba(12,163,12,0.55); box-shadow: 0 0 0 1px rgba(12,163,12,0.14); }
.port-h { display: flex; align-items: center; gap: 10px; padding: 8px 12px 7px; border-bottom: 1px solid var(--line); }
.port-h .chno { font: 700 11px/1 var(--mono); letter-spacing: 0.08em; color: var(--c); border: 1px solid var(--c); padding: 4px 5px 3px; border-radius: 3px; }
.port-h .nm { font-weight: 600; font-size: 14.5px; line-height: 1.15; min-width: 0; }
.port-h .nm small { display: block; font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.port-h .health { margin-left: auto; }
.st { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--mono); letter-spacing: 0.08em; padding: 5px 7px; border-radius: 4px; border: 1px solid var(--line-2); white-space: nowrap; }
.st svg.i { width: 13px; height: 13px; vertical-align: 0; }
.st.ok { color: var(--ok-ink); border-color: rgba(12,163,12,0.45); background: rgba(12,163,12,0.08); }
.st.warn { color: var(--warn); border-color: rgba(250,178,25,0.5); background: rgba(250,178,25,0.08); }
.st.crit { color: var(--crit-ink); border-color: rgba(208,59,59,0.6); background: rgba(208,59,59,0.12); }
.st.idle { color: var(--ink-2); }
.port-b { padding: 7px 12px 9px; display: flex; flex-direction: column; gap: 6px; }
.lamps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lamp { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 4px; font: 600 11px/1 var(--mono); letter-spacing: 0.06em; background: #0b111a; border: 1px solid var(--line); color: var(--ink-4); }
.lamp i { width: 8px; height: 8px; border-radius: 50%; background: #243044; }
.lamp.tx { color: #fff; border-color: rgba(255,59,59,0.6); background: rgba(255,59,59,0.14); }
.lamp.tx i { background: var(--live); box-shadow: 0 0 8px rgba(255,59,59,0.9); }
.lamp.rx { color: #eaffea; border-color: rgba(12,163,12,0.6); background: rgba(12,163,12,0.14); }
.lamp.rx i { background: #22c022; box-shadow: 0 0 8px rgba(34,192,34,0.9); }
.lamp.gate { color: var(--warn); border-color: rgba(250,178,25,0.45); }
.lamp.gate i { background: var(--warn); }
.lamp.state { color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fact { display: flex; flex-direction: column; gap: 1px; padding: 4px 7px; background: #0b111a; border: 1px solid var(--line); border-radius: var(--r-1); min-width: 0; }
.fact .k { font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact .v { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact .v svg.i { width: 13px; height: 13px; vertical-align: 0; }
.fact .v.ok svg { color: var(--ok-ink); }
.fact .v.warn { color: var(--warn); }
.fact .v.crit { color: var(--crit-ink); }
.fact .v.na { color: var(--ink-3); }
.port .inhibit { font-size: 11.5px; color: var(--warn); display: flex; gap: 6px; align-items: center; }

/* ---------------------------------------------------------------- call log */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.01); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-2); overflow: hidden; background: var(--bg-2); }
.seg button { border: 0; background: none; padding: 0 11px; height: 30px; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button .sw { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.seg button:hover { color: var(--ink-1); background: var(--bg-3); }
.seg button.on { color: var(--ink-1); background: var(--bg-4); box-shadow: inset 0 -2px 0 var(--amber); }
.field { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--bg-2); color: var(--ink-2); }
.field:focus-within { border-color: rgba(243,181,10,0.6); }
.field input, .field select { border: 0; outline: 0; background: transparent; height: 28px; min-width: 0; color: var(--ink-1); }
.field input[type=search] { width: 132px; }
.field input[type=date] { width: 118px; color-scheme: dark; }
.field select { padding-right: 2px; }
.field select option { background: var(--bg-2); }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: var(--r-2); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink-1); cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.btn:hover { background: var(--bg-3); border-color: var(--line-3); }
.btn.primary { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); font-weight: 600; }
.btn.primary:hover { background: var(--amber-2); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: 0.45; cursor: default; }

.hist { padding: 10px 14px 6px; border-bottom: 1px solid var(--line); }
.hist-top { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; flex-wrap: wrap; }
.hist-top .kpis { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.kpi { display: flex; flex-direction: column; align-items: flex-end; }
.kpi .v { font: 600 16px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.kpi .k { font-size: 10.5px; color: var(--ink-3); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.hist svg { display: block; width: 100%; height: 86px; overflow: visible; }
.calls.compact .hist svg { height: 60px; }
.calls.compact .hist { padding-bottom: 4px; }
.hist .bar { cursor: pointer; }
.hist .hour-l { font: 500 9.5px/1 var(--mono); fill: var(--ink-3); }
.hist .gridl { stroke: rgba(150,175,210,0.08); }
.hist .base { stroke: rgba(150,175,210,0.22); }
.hist .sel { fill: rgba(243,181,10,0.08); stroke: rgba(243,181,10,0.5); stroke-dasharray: 3 3; }

.calls { position: relative; }
.newpill { position: sticky; top: calc(var(--header-h) + var(--nav-h) + 6px); z-index: 5; display: flex; justify-content: center; height: 0; }
.newpill button { transform: translateY(6px); box-shadow: var(--shadow); }
.day-h { position: sticky; top: calc(var(--header-h) + var(--nav-h)); z-index: 4; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #0c1320; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.day-h .en { font: 500 10.5px/1 var(--mono); color: var(--ink-3); letter-spacing: 0.1em; }
.day-h .sum { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.hour-h { display: flex; align-items: center; gap: 10px; padding: 6px 14px; background: rgba(255,255,255,0.015); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.hour-h .hh { font: 600 12px/1 var(--mono); color: var(--amber-2); letter-spacing: 0.04em; }
.hour-h .sum { margin-left: auto; color: var(--ink-3); }
.row {
  display: grid; grid-template-columns: 36px 86px 132px minmax(140px, 1fr) 64px minmax(120px, 340px) 214px 56px 70px;
  align-items: center; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--line); min-height: 50px;
}
.row:hover { background: rgba(255,255,255,0.025); }
.row.playing { background: linear-gradient(90deg, rgba(243,181,10,0.10), rgba(243,181,10,0.02) 60%, transparent); box-shadow: inset 3px 0 0 var(--amber); }
.row.fresh { animation: fresh 4.5s ease-out; }
@keyframes fresh { 0% { background: rgba(243,181,10,0.24); } 100% { background: transparent; } }
.row.entering { animation: rowin 380ms ease-out, fresh 4.5s ease-out; }
@keyframes rowin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.row .playbtn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-3); background: var(--bg-3); cursor: pointer; color: var(--ink-1); }
.row .playbtn:hover { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.row.playing .playbtn { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.row .tm { display: flex; flex-direction: column; line-height: 1.15; }
.row .tm .t { font: 500 13.5px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.row .tm .r { font-size: 11px; color: var(--ink-3); }
.sysb { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; }
.sysb .sw { width: 4px; height: 26px; border-radius: 2px; background: var(--c); flex: none; }
.sysb .n { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sysb .n b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sysb .n small { color: var(--ink-3); font: 500 10px/1.2 var(--mono); letter-spacing: 0.06em; }
.talk { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.talk b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talk b.unknown { color: var(--ink-3); font-weight: 400; font-style: normal; }
.talk small { color: var(--ink-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.talk small a { color: var(--ink-2); display: inline-flex; gap: 3px; align-items: center; }
.row .dur { font: 500 13px/1 var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.row canvas.mini { width: 100%; height: 30px; display: block; }
.row .deliv { display: flex; gap: 3px; flex-wrap: wrap; }
.dchip { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 4px; border-radius: 3px; font: 600 9.5px/1 var(--mono); letter-spacing: 0; border: 1px solid var(--line-2); background: #0b111a; color: var(--ink-3); }
.dchip .sw { width: 5px; height: 5px; border-radius: 1px; background: var(--c); }
.dchip svg.i { width: 11px; height: 11px; vertical-align: 0; stroke-width: 2.4; }
.dchip.ok { color: var(--ink-1); }
.dchip.ok svg { color: var(--ok-ink); }
.dchip.fail { color: var(--crit-ink); border-color: rgba(208,59,59,0.5); }
.dchip.busy { color: var(--warn); border-color: rgba(250,178,25,0.45); }
.row .pk { font: 500 11.5px/1 var(--mono); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.row .acts { display: flex; gap: 4px; justify-content: flex-end; }
.row .acts .iconbtn { width: 30px; height: 30px; }
.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 14px; flex-wrap: wrap; }
.pager .info { color: var(--ink-3); font-size: 12px; }
.pager .pages { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.pager .pages button { min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--r-1); border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; font: 500 12px/1 var(--mono); }
.pager .pages button.on { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.pager .pages button:hover:not(.on):not([disabled]) { background: var(--bg-3); }
.pager .pages button[disabled] { opacity: 0.4; cursor: default; }
.colhead { display: grid; grid-template-columns: 36px 86px 132px minmax(140px, 1fr) 64px minmax(120px, 340px) 214px 56px 70px; gap: 10px; padding: 7px 14px; font: 600 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.colhead .r { text-align: right; }
.skel { height: 50px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- right column widgets */
.alist { display: flex; flex-direction: column; }
.aitem { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.aitem:last-child { border-bottom: 0; }
.aitem svg.i { margin-top: 2px; }
.aitem.urgent svg { color: var(--crit-ink); }
.aitem.warn svg { color: var(--warn); }
.aitem.okk svg { color: var(--ok-ink); }
.aitem.info svg { color: var(--ink-3); }
.aitem .m { color: var(--ink-1); overflow-wrap: anywhere; }
.aitem .w { color: var(--ink-3); font-size: 11px; margin-top: 2px; font-family: var(--mono); }
.mini-res { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { padding: 9px 10px 8px; border-radius: var(--r-2); background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.tile .k { font-size: 11px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 6px; }
.tile .v { font: 600 19px/1.15 var(--mono); font-variant-numeric: tabular-nums; margin-top: 3px; }
.tile .v small { font-size: 11px; color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.tile svg.spark { display: block; width: 100%; height: 28px; margin-top: 4px; overflow: visible; }
.tile.warn .v { color: var(--warn); }
.tile.crit .v { color: var(--crit-ink); }

/* ---------------------------------------------------------------- player */
.player {
  position: fixed; left: 0; right: 0; bottom: var(--status-h); z-index: 45; display: none;
  background: linear-gradient(180deg, #0e1623, #0a1019); border-top: 1px solid var(--line-2);
  box-shadow: 0 -10px 28px rgba(0,0,0,0.45); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.player.open { display: block; }
.player::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--amber) 20%, var(--amber) 80%, transparent); opacity: 0.55; }
.pl-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) 520px; gap: 14px; padding: 10px 16px; align-items: stretch; }
.pl-info { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.pl-info .t1 { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.pl-info .t2 { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-info .t3 { font: 500 12px/1.2 var(--mono); color: var(--ink-3); }
.pl-ctrl { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pl-ctrl .big { width: 42px; height: 42px; border-radius: 50%; background: var(--amber); color: var(--amber-ink); border: 0; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 4px rgba(243,181,10,0.15); }
.pl-ctrl .big:hover { background: var(--amber-2); }
.pl-ctrl .big svg.i { width: 20px; height: 20px; }
.pl-ctrl select { height: 30px; border-radius: var(--r-2); background: var(--bg-2); border: 1px solid var(--line-2); padding: 0 6px; }
.pl-wave { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pl-wave .wv { position: relative; height: 74px; border-radius: var(--r-2); background: #080d15; border: 1px solid var(--line); cursor: pointer; overflow: hidden; }
.pl-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pl-wave .hover-t { position: absolute; top: 4px; transform: translateX(-50%); font: 500 10.5px/1 var(--mono); padding: 3px 5px; border-radius: 3px; background: var(--bg-4); color: var(--ink-1); pointer-events: none; white-space: nowrap; }
.pl-wave .times { display: flex; justify-content: space-between; gap: 12px; font: 500 11px/1 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pl-wave .queue { color: var(--ink-3); font-size: 11.5px; font-family: var(--sans); }
.pl-an { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.an { position: relative; border-radius: var(--r-2); background: #080d15; border: 1px solid var(--line); overflow: hidden; min-height: 96px; }
.an canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.an .lab { position: absolute; left: 5px; top: 5px; padding: 3px 5px; border-radius: 3px; background: rgba(8,13,21,0.78); font: 600 9.5px/1 var(--mono); letter-spacing: 0.12em; color: var(--ink-2); text-transform: uppercase; z-index: 2; pointer-events: none; }
.an .ax { position: absolute; right: 6px; bottom: 4px; font: 500 9px/1 var(--mono); color: var(--ink-4); z-index: 2; pointer-events: none; }
.pl-close { margin-left: auto; }
.pl-vu { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* status bar */
.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; height: var(--status-h); display: flex; align-items: center; gap: 14px;
  padding: 0 14px; background: #070b12; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); overflow: hidden; white-space: nowrap;
}
.statusbar .credit { display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; }
.statusbar .credit b { color: var(--ink-2); font-weight: 500; }
.statusbar .right { margin-left: auto; display: flex; gap: 14px; font-family: var(--mono); font-size: 11px; }

/* ---------------------------------------------------------------- system / stats / map */
.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.chartgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px 14px; }
.chart { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 9px 10px 6px; min-width: 0; }
.chart .ct { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chart .ct b { font-weight: 600; font-size: 12.5px; }
.chart .ct .cur { font: 600 15px/1 var(--mono); font-variant-numeric: tabular-nums; }
.chart .ct .cur small { font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.chart svg { display: block; width: 100%; height: 96px; margin-top: 6px; overflow: visible; }
.chart .axis-t { font: 500 9px/1 var(--mono); fill: var(--ink-3); }
.chart .gridl { stroke: rgba(150,175,210,0.07); }
.tip { position: fixed; z-index: 90; pointer-events: none; padding: 7px 9px; border-radius: var(--r-2); background: #1a2638; border: 1px solid var(--line-3); box-shadow: var(--shadow); font-size: 12px; color: var(--ink-1); max-width: 280px; }
.tip .tt { font: 600 11px/1.2 var(--mono); color: var(--ink-2); margin-bottom: 4px; }
.tip .tr { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-variant-numeric: tabular-nums; }
.tip .tr i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); display: inline-block; margin-right: 6px; }
.tip .tr span:last-child { font-family: var(--mono); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th { text-align: left; font: 600 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl td.n, table.tbl th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.tbl tr:hover td { background: rgba(255,255,255,0.02); }
.tblwrap { overflow-x: auto; }
.bar-in { position: relative; height: 8px; border-radius: 2px; background: #0a0f17; overflow: hidden; min-width: 60px; }
.bar-in i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 2px 2px 0; background: var(--c, var(--sys-1)); }
.statgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; border-radius: var(--r-3); background: var(--bg-2); border: 1px solid var(--line-2); min-width: 0; }
.stat .k { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.stat .v { font: 600 30px/1.1 var(--mono); margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.stat .s { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
#map { height: calc(100vh - var(--header-h) - var(--nav-h) - var(--player-h) - var(--status-h) - 60px); min-height: 420px; border-radius: var(--r-3); border: 1px solid var(--line-2); background: #0a0f17; }
.unitlist { max-height: calc(100vh - var(--header-h) - var(--nav-h) - var(--player-h) - var(--status-h) - 150px); overflow: auto; }
.unit { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 12.5px; }
.unit:hover { background: rgba(255,255,255,0.03); }
.unit .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--bg-1); }
.unit .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit .n small { display: block; color: var(--ink-3); font-size: 11px; }
.unit .age { font: 500 11px/1 var(--mono); color: var(--ink-3); }
.leaflet-container { background: #0a0f17; font-family: var(--sans); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #152033; color: var(--ink-1); border: 1px solid var(--line-3); }
.leaflet-popup-content { margin: 10px 12px; font-size: 12.5px; }
.leaflet-control-attribution { background: rgba(6,10,16,0.75) !important; color: var(--ink-3) !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.leaflet-bar a { background: #152033 !important; color: var(--ink-1) !important; border-color: var(--line-2) !important; }
.pulse-ring { border-radius: 50%; border: 2px solid var(--amber); animation: ring 1.4s ease-out infinite; }
@keyframes ring { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.map-note { position: absolute; z-index: 500; left: 50%; top: 12px; transform: translateX(-50%); padding: 6px 10px; border-radius: var(--r-2); background: rgba(6,10,16,0.85); border: 1px solid var(--line-2); font-size: 12px; color: var(--ink-2); }

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr); position: relative; z-index: 1; }
.login-hero {
  position: relative; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  background: radial-gradient(1200px 600px at 10% 0%, rgba(243,181,10,0.10), transparent 60%), linear-gradient(160deg, #0d1624, #060a10);
  border-right: 1px solid var(--line-2);
}
.login-hero .logos { display: flex; gap: 14px; align-items: center; }
.login-hero .logos .logo-tile { width: 72px; height: 72px; border-radius: 12px; }
.login-hero h1 { margin: 0; font-size: 60px; letter-spacing: 0.16em; line-height: 1; font-weight: 700; }
.login-hero h1 span { display: block; font-size: 26px; letter-spacing: 0; color: var(--amber-2); font-weight: 600; margin-top: 14px; }
.login-hero .tag { font-size: 17px; color: var(--ink-2); max-width: 560px; margin-top: 18px; line-height: 1.6; }
.login-hero .lines { position: absolute; right: -80px; bottom: -40px; width: 560px; opacity: 0.35; }
.login-hero .credits { font-size: 13px; color: var(--ink-3); line-height: 1.7; max-width: 620px; }
.login-hero .credits b { color: var(--ink-2); font-weight: 500; }
.login-card { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-card form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-card h2 { margin: 0 0 4px; font-size: 22px; }
.login-card p { margin: 0 0 8px; color: var(--ink-3); font-size: 13px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.login-card input { height: 42px; padding: 0 12px; border-radius: var(--r-2); border: 1px solid var(--line-3); background: var(--bg-2); color: var(--ink-1); font-size: 15px; }
.login-card input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(243,181,10,0.18); }
.login-card .btn.primary { height: 44px; justify-content: center; font-size: 15px; }
.login-card .err { color: var(--crit-ink); font-size: 13px; min-height: 18px; }
.login-card .fine { font-size: 11.5px; color: var(--ink-4); margin-top: 6px; line-height: 1.6; }

/* ---------------------------------------------------------------- wall (TV) mode */
body.wall { --header-h: 76px; }
body.wall .nav, body.wall .filters, body.wall .pager, body.wall .ov-right .hide-wall, body.wall .row .acts, body.wall .colhead .acts-h { display: none !important; }
body.wall .wordmark .name { font-size: 26px; }
body.wall .clock .t { font-size: 32px; }
body.wall .lcard { flex-basis: 640px; }
body.wall .lcard .talker { font-size: 26px; }
body.wall .lcard .timer { font-size: 30px; }
body.wall main { padding-top: 16px; }
body.wall .ov-grid { grid-template-columns: 460px minmax(0, 1fr) 400px; }
body.wall .row { min-height: 56px; font-size: 15px; }

/* ---------------------------------------------------------------- toast / help */
.toast { position: fixed; right: 16px; bottom: calc(var(--player-h) + var(--status-h) + 16px); z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast div { padding: 10px 14px; border-radius: var(--r-2); background: #152033; border: 1px solid var(--line-3); box-shadow: var(--shadow); font-size: 13px; animation: slidein 200ms ease-out; max-width: 360px; }
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(2,4,8,0.7); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 520px; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--r-3); box-shadow: var(--shadow); }
.kbd { display: inline-block; min-width: 24px; padding: 3px 6px; border-radius: 4px; border: 1px solid var(--line-3); background: var(--bg-3); font: 600 11px/1 var(--mono); text-align: center; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; font-size: 13px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1680px) {
  .ov-grid { grid-template-columns: 360px minmax(0, 1fr) 330px; }
  .pl-grid { grid-template-columns: 260px minmax(0, 1fr) 440px; }
  .row, .colhead { grid-template-columns: 36px 80px 118px minmax(120px, 1fr) 58px minmax(90px, 300px) 204px 56px 66px; }
}
@media (max-width: 1440px) {
  .live { grid-template-columns: 148px minmax(0, 1fr) 380px; }
  .rc { grid-template-columns: 24px 60px 62px minmax(0, 1fr) 44px; }
  .ov-grid { grid-template-columns: 340px minmax(0, 1fr); }
  .ov-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wordmark .sub { max-width: 380px; }
  .row, .colhead { grid-template-columns: 34px 76px 112px minmax(110px, 1fr) 56px minmax(80px, 260px) 204px 64px; }
  .row .pk, .colhead .pk-h { display: none; }
  .pl-grid { grid-template-columns: 240px minmax(0, 1fr) 380px; }
  .chartgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .live { grid-template-columns: 148px minmax(0, 1fr); }
  .live-recent { display: none; }
  .hdr .vra, .clock .d .en, #btn-help { display: none; }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-left { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-right { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .map-wrap { grid-template-columns: minmax(0, 1fr); }
  .three { grid-template-columns: minmax(0, 1fr); }
  .pl-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .pl-an { grid-column: 1 / -1; }
  .an { min-height: 70px; }
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-hero { padding: 28px; }
  .login-hero h1 { font-size: 40px; }
}
@media (max-width: 760px) {
  :root { --header-h: 56px; --nav-h: 40px; }
  .hdr { gap: 10px; padding: 0 12px; }
  #btn-sound, #btn-wall, #btn-help, .usermenu { display: none; }
  .pl-an .an:nth-child(2) { display: none; }
  .pl-an { grid-template-columns: minmax(0, 1fr); }
  .pl-wave .kicker, .pl-wave .queue.mono { display: none; }
  .logo-tile { width: 36px; height: 36px; }
  .wordmark .name { font-size: 17px; }
  .wordmark .name .th, .wordmark .sub, .badge-poc, .hdr .pill.overall .txt, .clock .d { display: none; }
  .clock { padding-left: 10px; }
  .clock .t { font-size: 18px; }
  .hdr-stat { gap: 6px; }
  .pill { height: 28px; padding: 0 9px; }
  .nav a { padding: 0 10px; }
  .nav a small { display: none; }
  main { padding: 10px 10px calc(var(--player-h) + var(--status-h) + 12px); }
  .live { grid-template-columns: minmax(0, 1fr); }
  .live-tag { flex-direction: row; align-items: center; justify-content: space-between; padding: 9px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .live-cards { padding: 10px; }
  .lcard { width: 100%; min-width: 0; flex-basis: 100%; }
  .lcard .talker { font-size: 17px; }
  .ov-left, .ov-right { grid-template-columns: minmax(0, 1fr); }
  .colhead { display: none; }
  .row { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "p t d" "p w w" "p x x"; gap: 4px 10px; padding: 9px 12px; }
  .row .playbtn { grid-area: p; align-self: start; }
  .row .tm { display: none; }
  .row .sysb { display: none; }
  .row .talk { grid-area: t; }
  .row .talk .m-meta { display: flex; }
  .row .dur { grid-area: d; align-self: start; }
  .row .wcell { grid-area: w; }
  .row .deliv { grid-area: x; }
  .row .acts { display: none; }
  .filters { padding: 8px 10px; }
  .field input[type=search] { width: 120px; }
  .seg button { padding: 0 8px; }
  .pl-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px 10px; }
  .pl-info .t2 { font-size: 15px; }
  .pl-wave .wv { height: 56px; }
  .pl-an { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-an .an.osc { display: none; }
  .an { min-height: 58px; }
  .statusbar .credit { display: none; }
  .statusbar .right { margin-left: 0; }
  .chartgrid { grid-template-columns: minmax(0, 1fr); }
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .v { font-size: 22px; }
  .login-hero h1 { font-size: 34px; }
  .login-hero .lines { display: none; }
  .hist svg { height: 70px; }
  .panel-h { flex-wrap: wrap; padding: 9px 12px; }
  .panel-h h2 { white-space: nowrap; }
  .panel-h h2 .en { display: none; }
  .panel-h .tools { margin-left: auto; }
  .stat { padding: 11px 12px; }
  .hist-top .kpis { margin-left: 0; }
}
@media (min-width: 761px) { .row .talk .m-meta { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .meter .fill { background: Highlight; } }

/* OSM tiles rendered as a dark basemap (invert + re-hue); markers stay true-color */
.dark-tiles { filter: invert(1) hue-rotate(185deg) brightness(0.78) contrast(0.92) saturate(0.45); }

/* auto-play toggle + queue indicator */
#btn-auto { width: auto; padding: 0 10px; gap: 6px; }
#btn-auto .lbl { font: 600 11px/1 var(--mono, 'Plex Mono', monospace); letter-spacing: .08em; }
#btn-auto:not(.on) .lbl { color: var(--ink-3, #75829a); }
.queue.auto-on { color: var(--amber-2); }
#player.auto-playing .pl-info .t1::after { content: "AUTO"; margin-left: 8px; padding: 1px 6px; border-radius: 3px;
  font: 600 10px/1.4 var(--mono, 'Plex Mono', monospace); letter-spacing: .08em; color: #1a1300; background: var(--amber-2); }
