/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Copyright (C) 2026 the OpenRSP authors
 *
 * This file is part of OpenRSP.
 *
 * OpenRSP is free software: you can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation, either version 3
 * of the License, or (at your option) any later version.
 *
 * OpenRSP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with OpenRSP. If
 * not, see <https://www.gnu.org/licenses/>.
 */

:root {
  --bg: #101114;
  --panel: #1a1c21;
  --panel2: #23262c;
  --line: #2f333b;
  --text: #e3e5e8;
  --dim: #8b919b;
  --accent: #ffb300;
  --accent-dim: #8a6200;
  --err: #ff5c5c;
  --ok: #5fd38a;
  --state-ok: #1d3a27; --state-wait: #3a3215; --state-err: #3d1d1d;
  --notice-bg: #2a1616; --notice-text: #ffd0d0;
  --plot-bg: #0a0b0d; --plot-grid: #1d2026; --plot-label: #5c626c; --plot-freq: #8b919b; --plot-axis: #2f333b;
  --plot-trace: #ffb300; --plot-band: rgba(255, 179, 0, 0.13); --plot-band2: rgba(255, 179, 0, 0.10);
  --plot-peak: rgba(255, 255, 255, 0.45); --plot-dial: #ffffff;
  --plot-decode: #33d6ff; --plot-decode-band: rgba(51, 214, 255, 0.16); --plot-decode-bg: rgba(0, 40, 52, 0.92); --plot-decode-text: #9beeff;
  --plot-mark-fav: #ffd54f; --plot-mark-list: #6fd0ff; --plot-mark-eibi: #d2a8ff; --plot-mark-more: #c6cbd3; --plot-mark-bg: rgba(16, 18, 22, 0.92);
  color-scheme: dark;
}
/* Themes (Display dialog, Appearance); the spectrum, waterfall and meters stay dark in all of them. */
html[data-theme=light] {
  --bg: #eef0f3; --panel: #ffffff; --panel2: #f4f5f7; --line: #cfd3da; --text: #1b1e23; --dim: #5d6470;
  --accent: #a86b00; --accent-dim: #e0b45a; --err: #c62828; --ok: #1e7e45;
  --state-ok: #dcf1e3; --state-wait: #f6ecd2; --state-err: #f8dddd; --notice-bg: #fbe9e9; --notice-text: #7a1c1c;
  --plot-bg: #ffffff; --plot-grid: #e8eaee; --plot-label: #8a919b; --plot-freq: #5d6470; --plot-axis: #cfd3da;
  --plot-trace: #b86e00; --plot-band: rgba(184, 110, 0, 0.12); --plot-band2: rgba(184, 110, 0, 0.09);
  --plot-peak: rgba(0, 0, 0, 0.35); --plot-dial: #1b1e23;
  --plot-decode: #00838f; --plot-decode-band: rgba(0, 131, 143, 0.14); --plot-decode-bg: rgba(224, 247, 250, 0.95); --plot-decode-text: #005662;
  --plot-mark-fav: #8a6100; --plot-mark-list: #0068a8; --plot-mark-eibi: #7b3fc4; --plot-mark-more: #4a515c; --plot-mark-bg: rgba(255, 255, 255, 0.95);
  color-scheme: light;
}
html[data-theme=grey] {
  --bg: #2b2d31; --panel: #35383d; --panel2: #3e4147; --line: #4c5058; --text: #eceef1; --dim: #a6acb5;
  --accent: #ffc23d; --accent-dim: #9a7420;
  --plot-bg: #1c1e22; --plot-grid: #2a2d33; --plot-label: #737a84; --plot-freq: #a6acb5; --plot-axis: #3d4148;
  --plot-trace: #ffc23d; --plot-band: rgba(255, 194, 61, 0.13); --plot-band2: rgba(255, 194, 61, 0.10);
}
html[data-theme=contrast] {
  --bg: #000000; --panel: #000000; --panel2: #0d0d0d; --line: #ffffff; --text: #ffffff; --dim: #e6e6e6;
  --accent: #ffff00; --accent-dim: #b3b300; --err: #ff4d4d; --ok: #33ff99;
  --state-ok: #003d1f; --state-wait: #3d3d00; --state-err: #4d0000; --notice-bg: #330000; --notice-text: #ffffff;
  --plot-bg: #000000; --plot-grid: #333333; --plot-label: #cccccc; --plot-freq: #ffffff; --plot-axis: #ffffff;
  --plot-trace: #ffff00; --plot-band: rgba(255, 255, 0, 0.16); --plot-band2: rgba(255, 255, 0, 0.12);
  --plot-peak: rgba(255, 255, 255, 0.7); --plot-dial: #ffffff;
  --plot-decode: #00ffff; --plot-decode-band: rgba(0, 255, 255, 0.18); --plot-decode-bg: #000000; --plot-decode-text: #00ffff;
  --plot-mark-fav: #ffff00; --plot-mark-list: #00ffff; --plot-mark-eibi: #ff80ff; --plot-mark-more: #ffffff; --plot-mark-bg: #000000;
}
html[data-theme=contrast] button, html[data-theme=contrast] select, html[data-theme=contrast] input { border-width: 2px; }
/* Large controls for touch screens. */
html.big body { font-size: 16px; }
html.big button, html.big select, html.big input[type=text], html.big input[type=number] { padding: 8px 12px; min-height: 40px; }
html.big .seg button { padding: 8px 11px; font-size: 15px; }
html.big input[type=range] { width: 150px; height: 28px; }
html.big input[type=checkbox] { width: 20px; height: 20px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 2px solid var(--accent);
}

h1 { font-size: 18px; margin: 0; font-weight: 600; }

.rds {
  flex: 1 1 0; min-width: 0; height: 56px;
  display: flex; align-items: center; gap: 10px;
}
.rds.off { visibility: hidden; }
.rds-logo {
  flex: none; height: 40px; width: auto; max-width: 96px; object-fit: contain;
  border-radius: 3px;
}
.rds-logo[hidden] { display: none; }
.rds-text {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
}
.rds-top { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.rds-ps {
  font: 600 18px/1.1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text); white-space: pre; margin-right: 6px;
}
.rds-ps.learned { color: var(--dim); font-style: italic; font-weight: 500; }
.rds-ps.dynamic { text-decoration: underline dotted var(--accent-dim); text-underline-offset: 3px; }
.rds-rt {
  font-size: 12px; line-height: 15px; height: 15px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* the broadcast on the tuned frequency (eibi.js): in the RDS line's place when there is no RDS */
.rds.eibi-now { cursor: pointer; }
.rds.eibi-now.off { display: none; }
header:has(.eibi-now:not(.off)) #rds.off { display: none; }
.eibi-now .rds-ps { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }

.badge {
  font-size: 10px; line-height: 1; letter-spacing: 0.5px; white-space: nowrap;
  padding: 2px 5px; border: 1px solid var(--line); border-radius: 3px;
  color: var(--dim); opacity: 0.45;
}
.badge.on { opacity: 1; color: var(--accent); border-color: var(--accent-dim); }
.badge.next { opacity: 1; color: var(--text); }
.badge:empty { display: none; }
.smeter { width: 210px; height: 60px; margin-left: auto; cursor: pointer; flex: none; }
.smeter + .dial { margin-left: 0; }
/* the header frequency: the wheel over a digit tunes by it, a click opens it for typing */
.dial { cursor: text; border-radius: 4px; }
.dial .dg { display: inline-block; cursor: ns-resize; border-radius: 3px; padding: 0 0.5px; }
.dial .dg:hover { background: var(--accent); color: var(--bg); }
.dial:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dial .dial-edit { font: inherit; color: inherit; letter-spacing: inherit; width: 12ch; padding: 0 4px; background: var(--panel); border: 1px solid var(--accent); border-radius: 4px; }
.dial {
  font: 600 24px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--accent);
  margin-left: auto;
  letter-spacing: 0.5px;
}

.state {
  min-width: 90px; text-align: center;
  padding: 3px 10px; border-radius: 12px;
  background: var(--panel2); color: var(--dim);
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
}
.state.streaming { background: var(--state-ok); color: var(--ok); }
.state.starting { background: var(--state-wait); color: var(--accent); }
.state.error { background: var(--state-err); color: var(--err); }

.notice {
  margin: 10px 16px 0; padding: 8px 12px;
  border: 1px solid var(--err); border-radius: 4px;
  background: var(--notice-bg); color: var(--notice-text);
}
.notice div + div { margin-top: 4px; }
.notice button { margin: 4px 6px 0 0; }
.notice form { margin-top: 4px; }
.notice form input { width: min(22em, 60vw); }

.controls {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.steps { display: inline-flex; gap: 3px; }

label { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); }
label.check { color: var(--text); }

button, select, input[type=text], input[type=number] {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px;
  font: inherit; padding: 4px 9px;
}
input[type=text], input[type=number] { font-family: ui-monospace, Menlo, Consolas, monospace; }
input.num { width: 84px; }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.4; cursor: default; }
button.primary { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: #ffc53d; }
input:focus, select:focus, button:focus-visible { outline: 1px solid var(--accent); outline-offset: 0; }
input[type=range] { accent-color: var(--accent); width: 120px; }
input[type=checkbox] { accent-color: var(--accent); }
.val { min-width: 44px; color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

.seg { display: inline-flex; }
.seg button { border-radius: 0; margin-left: -1px; padding: 4px 8px; font-size: 13px; }
.seg button:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.seg button:last-child { border-radius: 0 4px 4px 0; }
.seg button:hover:not(:disabled) { position: relative; z-index: 1; }
.seg button[aria-pressed=true] {
  background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600;
  position: relative; z-index: 1;
}

.controls .radio { flex-basis: 100%; }
.radio[hidden] { display: none; }
.radio-btns { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.radio-btns button[hidden] { display: none; }
#btnCancel { border-color: var(--accent-dim); color: var(--accent); }
.radio-status { display: inline-flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 160px; }
.radio-text { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { display: block; height: 3px; max-width: 320px; background: var(--panel2); border-radius: 2px; overflow: hidden; }
.progress[hidden] { display: none; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s linear; }

.display { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.plots { position: relative; min-width: 0; padding-right: 18px; }
.fmpanel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  display: flex; flex-direction: column; min-width: 0;
}
.fmpanel[hidden] { display: none; }
.fmpanel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 6px 8px; border-bottom: 1px solid var(--line);
}
.fmpanel-title { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
/* the station lists' search boxes */
.list-search { flex: 1 1 90px; min-width: 70px; max-width: 170px; font-size: 12px; padding: 3px 6px; }
.list-search-row { padding: 6px 0 4px; }
.list-search-row .list-search { max-width: 420px; width: 100%; }
.panel-search { padding: 4px 4px 0; }
.panel-search .list-search { max-width: none; }
.list-nomatch { color: var(--dim); font-size: 12px; padding: 6px 4px; }
.stn[hidden], .strow[hidden], .dabrow[hidden] { display: none; }
.fmbtns { overflow-y: auto; max-height: 260px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.fmbtns .empty, .stlist .empty { color: var(--dim); font-size: 12px; padding: 6px 4px; }
.stn { display: flex; align-items: stretch; gap: 3px; min-width: 0; }
.stn .star {
  flex: none; width: 30px; padding: 0; font-size: 15px; line-height: 1; color: var(--dim);
}
.stn .star[aria-pressed=true] { color: var(--accent); }
.stn-main {
  flex: 1 1 0; min-width: 0; text-align: left; padding: 4px 8px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 8px; align-items: center;
}
.stn-main.tuned { border-color: var(--accent); }
.row-logo { display: none; }
.has-logos .row-logo { display: flex; align-items: center; justify-content: center; width: 42px; height: 28px; }
.row-logo img { display: block; max-width: 42px; height: 28px; width: auto; object-fit: contain; border-radius: 4px; }
.fmbtns.has-logos .stn-main { grid-template-columns: 42px minmax(0, 1fr) auto auto; }
.fmbtns.has-logos .row-logo { grid-row: 1 / span 2; }
.fmbtns.has-logos .stn-now { grid-column: 2 / -1; }
.stn-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stn-main.tuned .stn-name { font-weight: 700; color: var(--accent); }
.stn-mhz { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--text); }
.stn-now {
  grid-column: 1 / -1; font-size: 11px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stn-now:empty { display: none; }
.bars { display: inline-flex; align-items: flex-end; gap: 1px; height: 12px; }
.bars i { display: block; width: 3px; background: var(--line); border-radius: 1px; }
.bars i:nth-child(1) { height: 20%; } .bars i:nth-child(2) { height: 40%; }
.bars i:nth-child(3) { height: 60%; } .bars i:nth-child(4) { height: 80%; }
.bars i:nth-child(5) { height: 100%; }
.bars i.on { background: var(--ok); }
.bars.dim i.on { background: var(--dim); }

.tools { display: inline-flex; gap: 8px; margin-left: auto; }
.tools button.on, #btnAudio.on, #btnSqlAuto.on { border-color: var(--accent); color: var(--accent); }
.tools button.tx { background: var(--err); border-color: var(--err); color: #fff; }
.tool-dlg { width: min(600px, calc(100vw - 32px)); }
.dlg-sec { padding: 8px 0; border-top: 1px solid var(--line); }
.dlg-sec-head { font-weight: 600; margin-bottom: 6px; }
.dlg-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 3px 0; }
.dlg-help { color: var(--dim); font-size: 12px; margin-top: 4px; }
.out-dev { min-width: 0; max-width: 100%; }
#outDevSel { max-width: min(320px, 100%); min-width: 0; text-overflow: ellipsis; }
#rigModel { max-width: min(320px, 70vw); }
.rig-read { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 6px 0 2px; color: var(--dim); }
.rig-read b { color: var(--text); font-variant-numeric: tabular-nums; }
.rig-tx b { padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; }
.rig-tx.on b { background: var(--err); border-color: var(--err); color: #fff; }
.rig-status { padding: 4px 0; color: var(--dim); font-size: 12px; }
.rig-status.w { color: var(--accent); }
.rig-status.e { color: var(--err); }
.rig-credit { padding-top: 6px; border-top: 1px solid var(--line); color: var(--dim); font-size: 11px; }
/* the Surface dialog: game controller, MIDI and keyboard */
.surf-tabs { display: flex; flex-wrap: wrap; margin: 2px 0 8px; }
.surf-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.surf-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.surf-tabs button.live .surf-dot, .surf-dot.on { background: var(--ok); }
.surf-hint { margin: 0 0 8px; }
.surf-msg { font-size: 12px; color: var(--dim); min-height: 0; }
.surf-msg:not(:empty) { padding: 2px 0 6px; }
.surf-msg.good { color: var(--ok); }
.surf-msg.warn { color: var(--accent); }
.surf-msg.error { color: var(--err); }
.surf-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); }
.surf-status .surf-dot { width: 10px; height: 10px; }
.surf-state { font-weight: 600; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.surf-status select { max-width: min(260px, 100%); min-width: 0; }
.surf-activity { padding: 6px 0; font-size: 13px; color: var(--dim); overflow-wrap: anywhere; }
.surf-activity b { color: var(--text); }
.surf-act-lbl { display: inline-block; margin-right: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.surf-ok { color: var(--ok); font-weight: 700; }
.surf-no { color: var(--accent); }
.surf-warn { padding: 8px 10px; border: 1px solid var(--accent); border-radius: 6px; color: var(--text); }
.surf-learn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border: 1px dashed var(--accent); border-radius: 6px; }
.surf-learn-msg { flex: 1 1 220px; color: var(--accent); font-weight: 600; }
.surf-dlg select { min-width: 0; max-width: 100%; }
.surf-map { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; }
.surf-row { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) auto auto; gap: 2px 10px; align-items: center;
  padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.surf-row:last-child { border-bottom: 0; }
.surf-row.gone .surf-fn { color: var(--dim); text-decoration: line-through; }
.surf-key { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--accent); overflow-wrap: anywhere; }
.surf-fn { overflow-wrap: anywhere; }
.surf-grp { margin-left: 6px; color: var(--dim); font-size: 11px; }
.surf-tags { display: inline-flex; gap: 4px; align-items: center; }
.surf-tag { padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; font-size: 11px; color: var(--dim); }
button.surf-tag.on { border-color: var(--accent); color: var(--accent); }
.surf-rate { font-size: 11px; padding: 1px 2px; }
.surf-del { padding: 0 8px; }
.surf-tools { padding-top: 8px; }
.surf-rumble summary { cursor: pointer; }
@media (max-width: 600px) {
  .surf-row { grid-template-columns: minmax(0, 1fr) auto; }
  .surf-key { grid-column: 1; grid-row: 1; }
  .surf-del { grid-column: 2; grid-row: 1; justify-self: end; }
  .surf-fn { grid-column: 1; grid-row: 2; }
  .surf-tags { grid-column: 2; grid-row: 2; flex-wrap: wrap; justify-content: flex-end; }
}
.stations { padding: 8px 16px 0; }
.stations[hidden] { display: none; }
.stations details { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.stations summary { cursor: pointer; padding: 6px 10px; color: var(--text); }
.stations summary:focus-visible { outline: 1px solid var(--accent); }
.stlist { max-height: 320px; overflow-y: auto; border-top: 1px solid var(--line); }
.strow {
  display: grid; width: 100%; text-align: left; border: none; border-radius: 0;
  border-bottom: 1px solid var(--line); background: transparent; padding: 5px 10px;
  grid-template-columns: 18px minmax(0, 260px) 84px 48px minmax(0, 150px) minmax(0, 1fr) 90px; column-gap: 10px; align-items: center;
}
.stlist.has-logos .strow { grid-template-columns: 18px 42px minmax(0, 260px) 84px 48px minmax(0, 150px) minmax(0, 1fr) 90px; }
.strow:last-child { border-bottom: none; }
.strow:hover:not(:disabled) { background: var(--panel2); }
.strow.tuned .st-name { color: var(--accent); font-weight: 700; }
.strow > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-fav { color: var(--accent); }
.st-mhz, .st-pi { font: 12px ui-monospace, Menlo, Consolas, monospace; }
.st-pty, .st-last, .st-tx { font-size: 12px; color: var(--dim); }
.st-last { text-align: right; }

@media (min-width: 1100px) {
  .display { flex-direction: row; align-items: stretch; }
  .plots { flex: 1 1 0; }
  .fmpanel { flex: none; width: 300px; }
  .fmbtns { max-height: none; flex: 1 1 0; min-height: 0; }
}
canvas { display: block; width: 100%; background: var(--plot-bg); }
#spectrum { height: 220px; cursor: grab; touch-action: none; border: 1px solid var(--line); border-bottom: none; }
.wfwrap { position: relative; }
#waterfall { height: 280px; cursor: grab; touch-action: none; border: 1px solid var(--line); }
/* the separator between the spectrum and the waterfall: drag to share the height */
.psplit { position: relative; z-index: 2; height: 9px; margin: -4px 0; cursor: row-resize; touch-action: none; outline: none; }
.psplit::before { content: ''; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--line); }
.psplit:hover::before, .psplit:focus-visible::before, .psplit.dragging::before { top: 3px; height: 3px; background: var(--accent); opacity: 0.7; }
#wfOverlay { position: absolute; inset: 0; height: 100%; background: transparent; pointer-events: none; }
#spectrum.dragging, #waterfall.dragging { cursor: grabbing; }
.ptags {
  position: absolute; right: 26px; top: 3px; z-index: 2; height: 17px;
  display: flex; align-items: center; gap: 10px; pointer-events: none;
}
.zoomtag {
  font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--accent);
  background: rgba(10, 11, 13, 0.7); padding: 0 5px; border-radius: 3px;
}
.zoomtag[hidden] { display: none; }
.cursor { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); }
#spectrum.onbadge { cursor: pointer; }
/* The label strip above the spectrum: named marks on the spectrum's frequency axis. */
#labelStrip { height: 40px; border: 1px solid var(--line); border-bottom: none; touch-action: manipulation; }
#labelStrip[hidden] { display: none; }
#labelStrip.onmark { cursor: pointer; }
.plots.has-strip .ptags { top: 44px; }
@media (max-width: 600px) { #labelStrip { height: 24px; } .plots.has-strip .ptags { top: 28px; } }
.lstrip-tip {
  position: absolute; z-index: 6; max-width: min(440px, 100%); padding: 5px 8px; pointer-events: none;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 4px;
  font: 12px/1.35 system-ui, sans-serif; white-space: pre-wrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.lstrip-tip[hidden], .lstrip-pick[hidden] { display: none; }
.lstrip-pick {
  position: absolute; z-index: 7; display: flex; flex-direction: column; max-height: 50vh; max-width: min(360px, 100%); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 3px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.lstrip-pick button { text-align: left; border: none; background: none; padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 12px ui-monospace, Menlo, Consolas, monospace; }
.lstrip-pick button:hover, .lstrip-pick button:focus-visible { background: var(--panel2); }
.lstrip-fav { color: var(--plot-mark-fav) !important; }
.lstrip-list { color: var(--plot-mark-list) !important; }
.lstrip-eibi { color: var(--plot-mark-eibi) !important; }
.lstrip-key { font-weight: 600; }
/* The level slider at the right of the spectrum and waterfall: top and bottom handles, the band between them, Auto/Manual. */
.lvl {
  position: absolute; top: 0; right: 0; bottom: 0; width: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: 0.6; transition: opacity 0.15s;
}
.lvl:hover, .lvl:focus-within, .lvl.active { opacity: 1; }
.lvl .lvl-auto {
  flex: none; width: 16px; height: 16px; min-height: 0; padding: 0; border: 1px solid var(--line); border-radius: 3px;
  font: 600 10px/14px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); background: transparent;
}
.lvl .lvl-auto[aria-pressed=true] { color: var(--accent); border-color: var(--accent-dim); }
.lvl .lvl-auto:hover { color: var(--text); }
.lvl-track { position: relative; flex: 1 1 0; width: 16px; touch-action: none; cursor: pointer; }
.lvl-track::before {
  content: ''; position: absolute; left: 7px; width: 2px; top: 0; bottom: 0;
  background: var(--line); border-radius: 1px;
}
.lvl-band {
  position: absolute; left: 5px; width: 6px; border-radius: 2px; cursor: ns-resize;
  background: var(--accent); opacity: 0.28;
}
.lvl:hover .lvl-band, .lvl.active .lvl-band { opacity: 0.45; }
.lvl-h {
  position: absolute; left: 1px; width: 14px; height: 6px; margin-top: -3px; border-radius: 3px;
  background: var(--dim); cursor: ns-resize; outline: none;
}
.lvl-h::before { content: ''; position: absolute; inset: -9px -2px; }
.lvl-h:hover, .lvl-h.drag { background: var(--accent); }
.lvl-h:focus-visible { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.lvl-tip {
  position: absolute; right: 20px; margin-top: -9px; z-index: 3; pointer-events: none; white-space: nowrap;
  font: 11px/16px ui-monospace, Menlo, Consolas, monospace; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); padding: 0 5px; border-radius: 3px;
}
.lvl-tip[hidden] { display: none; }
html.big .plots { padding-right: 24px; }
html.big .lvl, html.big .lvl-track { width: 22px; }
html.big .lvl .lvl-auto { width: 22px; height: 22px; line-height: 20px; font-size: 12px; }
html.big .lvl-track::before { left: 10px; }
html.big .lvl-band { left: 7px; width: 8px; }
html.big .lvl-h { left: 1px; width: 20px; height: 8px; margin-top: -4px; }
html.big .ptags { right: 32px; }

.info { padding: 8px 16px 16px; }
.line {
  font: 12px/1.6 ui-monospace, Menlo, Consolas, monospace;
  color: var(--dim); white-space: pre-wrap; word-break: break-all;
}
.line b { color: var(--text); font-weight: 500; }
.log {
  margin-top: 6px; height: 130px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: 6px 8px;
  font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace;
}
.log .e { color: var(--err); }
.log .w { color: var(--accent); }
.log .t { color: var(--dim); }

/* the header narrower: the station (RDS) on a row of its own (and gone when there is none), then a
   grid: title, views and state; the S-meter beside the frequency; on a phone the frequency and state,
   then the S-meter */
@media (max-width: 1250px) {
  header { flex-wrap: wrap; row-gap: 6px; }
  .rds { order: 3; flex: 1 1 100%; height: auto; min-height: 0; }
  .rds.off { display: none; }
}
@media (max-width: 900px) {
  header {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 14px;
    grid-template-areas: "title views state" "meter dial dial" "rds rds rds";
  }
  header h1 { grid-area: title; }
  header .views { grid-area: views; justify-self: start; }
  header .state { grid-area: state; }
  header .smeter { grid-area: meter; margin: 0; }
  header .dial { grid-area: dial; margin: 0; justify-self: start; }
  header .rds { grid-area: rds; }
  #spectrum { height: 180px; }
  #waterfall { height: 240px; }
}
@media (max-width: 600px) {
  header {
    grid-template-columns: 1fr auto; gap: 6px 10px; padding: 8px 12px;
    grid-template-areas: "title views" "dial state" "meter meter" "rds rds";
  }
  header h1 { font-size: 16px; }
  header .dial { font-size: clamp(17px, 5.6vw, 22px); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  header .state { padding: 3px 8px; }
  header .state { min-width: 0; }
  header .smeter { justify-self: center; }
  .strow { grid-template-columns: 18px minmax(0, 1fr) 70px minmax(0, 90px) 64px; }
  .stlist.has-logos .strow { grid-template-columns: 18px 42px minmax(0, 1fr) 70px minmax(0, 90px) 64px; }
  .st-pi, .st-pty { display: none; }
  /* the mode buttons go on to a second row rather than past the screen's edge */
  #modeSeg { flex-wrap: wrap; row-gap: 4px; }
}
h1 a.home { color: inherit; text-decoration: none; }

/* DAB / DAB+ mode: the FM-only controls hide, the DAB panel shows */
body.dab-mode .fm-only { display: none !important; }
body:not(.dab-mode) .dab-only { display: none !important; }
body.dab-mode .rds { display: none; }
/* AIS mode: the FM, DAB and audio controls hide, the AIS panels show */
body.ais-mode .fm-only, body.ais-mode .dab-only, body.ais-mode .no-ais { display: none !important; }
body:not(.ais-mode) .ais-only { display: none !important; }
body.ais-mode .rds { display: none; }
/* ADS-B mode: as AIS, with the ADS-B panels */
body.adsb-mode .fm-only, body.adsb-mode .dab-only, body.adsb-mode .no-ais, body.adsb-mode .ais-only { display: none !important; }
body:not(.adsb-mode) .adsb-only { display: none !important; }
body.adsb-mode .rds { display: none; }
#adsbState.on { color: var(--ok); border-color: var(--ok); }
/* ISM mode: as AIS, with the ISM panels */
body.ism-mode .fm-only, body.ism-mode .dab-only, body.ism-mode .no-ais, body.ism-mode .ais-only { display: none !important; }
body:not(.ism-mode) .ism-only { display: none !important; }
body.ism-mode .rds { display: none; }
#ismState.on { color: var(--ok); border-color: var(--ok); }
.ismlist { max-height: 360px; min-height: 120px; }
.ismrow[aria-expanded=true] { background: var(--panel2); }
.ismdetail { padding: 4px 8px 6px 18px; border-bottom: 1px solid var(--line); font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.ism-pills { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; max-height: 92px; overflow-y: auto; border-bottom: 1px solid var(--line); }
.ism-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 20px;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; max-width: 100%;
}
.ism-pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ism-pill b { font: 600 11px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); }
.ism-pill:hover { border-color: var(--accent); }
.ism-pill[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #111; }
.ism-pill[aria-pressed=true] b { color: #111; }
.ism-kv { display: flex; gap: 8px; }
.ism-k { color: var(--dim); min-width: 120px; }
.ism-v { color: var(--text); overflow-wrap: anywhere; }
.ism-range { color: var(--dim); margin-left: auto; white-space: nowrap; }
/* LoRa mode: as ISM, with the LoRa panels */
body.lora-mode .fm-only, body.lora-mode .dab-only, body.lora-mode .no-ais, body.lora-mode .ais-only { display: none !important; }
body:not(.lora-mode) .lora-only { display: none !important; }
#loraPlanSel { max-width: min(320px, 70vw); }
body.lora-mode .rds { display: none; }
#loraState.on { color: var(--ok); border-color: var(--ok); }
.lorarow[aria-expanded=true] { background: var(--panel2); }
.lorarow.bad .ais-name { color: var(--dim); }
.lora-tabs button { font-size: 12px; padding: 2px 8px; }
.lora-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.lora-view[hidden] { display: none; }
.mc-view { overflow: auto; padding: 6px 8px 8px; gap: 6px; }
.mc-head { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.mc-head button { margin-left: auto; font-size: 11px; padding: 1px 8px; }
.mc-head .mc-direct { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 12px; }
.mc-head .mc-direct + button { margin-left: 0; }
.mc-count { text-transform: none; letter-spacing: 0; }
.mc-note { color: var(--dim); font-size: 12px; overflow-wrap: anywhere; }
.mc-chans { display: flex; flex-direction: column; gap: 4px; }
.mc-chan { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; text-align: left; padding: 6px 8px; border-radius: 4px; }
.mc-chan .mc-cname { color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.mc-chan .mc-cmeta { color: var(--dim); font-size: 11px; white-space: nowrap; }
.mc-chan .mc-clast { grid-column: 1 / -1; color: var(--text); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mc-chan .mc-clast.dim { color: var(--dim); }
.mc-chan-x { display: flex; gap: 4px; }
.mc-chan-x .mc-chan { flex: 1; min-width: 0; }
.mc-chan-x .mc-x { padding: 0 8px; }
.mc-more summary { cursor: pointer; color: var(--dim); font-size: 12px; padding: 2px 0; }
.mc-more[open] { padding-bottom: 4px; }
.mc-more > * + * { margin-top: 6px; }
.mc-add { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-add input { flex: 1 1 140px; min-width: 0; }
.mc-more .check { font-size: 12px; color: var(--dim); display: block; }
.mc-list { max-height: 260px; min-height: 40px; overflow: auto; border: 1px solid var(--line); border-radius: 4px; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; }
.mc-list .empty { color: var(--dim); padding: 8px; font-family: inherit; }
.mc-row { display: flex; gap: 8px; padding: 3px 8px; border-bottom: 1px solid var(--line); align-items: baseline; }
.mc-row:last-child { border-bottom: 0; }
.mc-t { color: var(--dim); white-space: nowrap; }
.mc-ch { color: var(--accent); white-space: nowrap; }
.mc-txt { color: var(--text); overflow-wrap: anywhere; flex: 1; }
.mc-meta { color: var(--dim); white-space: nowrap; margin-left: auto; }
/* a channel's messages: a modal over the page, as the AIS application data */
.mc-dlg { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  width: min(620px, calc(100vw - 32px)); max-height: 80vh; overflow: auto; padding: 12px 14px; }
.mc-dlg::backdrop { background: rgba(0, 0, 0, 0.45); }
.mc-dlg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mc-dlg-title { font-weight: 600; color: var(--accent); }
.mc-dlg-head button { margin-left: auto; padding: 0 10px; font-size: 16px; }
.mc-dlg-sub { color: var(--dim); font-size: 12px; margin-bottom: 8px; overflow-wrap: anywhere; }
.mc-msg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mc-msg:last-child { border-bottom: 0; }
.mc-msg .mc-t { font: 12px ui-monospace, Menlo, Consolas, monospace; }
.mc-msg .mc-from { color: var(--accent); font-weight: 600; }
.mc-msg .mc-meta { font-size: 11px; }
.mc-msg .mc-body { grid-column: 2 / -1; overflow-wrap: anywhere; }
button.mc-row.mc-node { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font: inherit; color: inherit; cursor: pointer; }
button.mc-row.mc-node:hover { background: var(--panel2); }
.mc-kvs { margin: 4px 0 8px; font-size: 12px; }
.mc-map { margin: 0 0 8px; }
.mc-dlg .mc-head { margin-top: 10px; }
.adsb-msg { font-size: 12px; color: var(--dim); display: inline-flex; align-items: center; }
.adsb-msg .ais-led { --m-dim: var(--dim); }
.ac-row-alt { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); text-align: right; }
.aisrow .ac-flag { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.aischan { color: var(--dim); }
.aischan b { color: var(--text); font-weight: 500; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.aisnow { padding: 8px 16px 0; }
.ais-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; }
.ais-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ais-counts { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--text); }
#aisState.on { color: var(--ok); border-color: var(--ok); }
.aislist { overflow-y: auto; max-height: 260px; display: flex; flex-direction: column; }
.aislist .empty { color: var(--dim); font-size: 12px; padding: 6px 8px; }
.aisrow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; text-align: left; border: none;
  border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 4px 8px;
}
.aisrow:hover { background: var(--panel2); }
.ais-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ais-type { grid-column: 1; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ais-age { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); text-align: right; }
.aisnmea { padding: 8px 16px 0; }
.aisnmea details { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.aisnmea summary { cursor: pointer; padding: 6px 10px; }
.aisnmea-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 4px 10px; border-top: 1px solid var(--line); }
.aisnmea-tools > label, .aisnmea-tools > button { white-space: nowrap; }
.aisnmea-log {
  margin: 0; padding: 6px 10px; max-height: 260px; overflow: auto; border-top: 1px solid var(--line);
  font: 11px/1.45 ui-monospace, Menlo, Consolas, monospace; color: var(--text); white-space: pre;
}
.dabblock { display: inline-flex; align-items: center; gap: 6px; }
.dabrate { color: var(--dim); }
.dabrate b { color: var(--text); font-weight: 500; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
#dabBlockSel { font-family: ui-monospace, Menlo, Consolas, monospace; max-width: 260px; }

.dabnow { padding: 8px 16px 0; }
.dab-ens { font-size: 12px; color: var(--dim); margin-bottom: 6px; overflow-wrap: anywhere; }
.dab-card {
  display: flex; gap: 14px; align-items: flex-start; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px;
}
.dab-pic { flex: none; display: flex; align-items: center; justify-content: center; }
.dab-pic[hidden] { display: none; }
.dab-pic img { display: block; max-width: 240px; max-height: 180px; width: auto; height: auto; border-radius: 4px; }
.dab-pic.logo img { max-width: 120px; max-height: 96px; }
.dab-text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dab-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.dab-title { font-size: 24px; line-height: 1.15; font-weight: 700; color: var(--accent); margin-right: 6px; overflow-wrap: anywhere; }
.dab-dls { font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.dab-dlp { font-size: 13px; color: var(--accent); overflow-wrap: anywhere; }
.dab-ann { font-size: 13px; color: var(--accent); }
.dab-ann.alarm { color: var(--err); }
.dab-epg { font-size: 12px; color: var(--dim); white-space: pre-line; }
.dab-status { font-size: 12px; color: var(--accent); }
.dab-sig { font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--dim); overflow-wrap: anywhere; }
.dab-sig .q3 { color: var(--ok); } .dab-sig .q2 { color: var(--accent); } .dab-sig .q1 { color: var(--err); }
.dab-dls:empty, .dab-dlp:empty, .dab-ann:empty, .dab-epg:empty, .dab-status:empty, .dab-ens:empty { display: none; }
.badge.q3 { opacity: 1; color: var(--ok); border-color: #2f6b45; }
.badge.q2 { opacity: 1; color: var(--accent); border-color: var(--accent-dim); }
.badge.q1 { opacity: 1; color: var(--err); border-color: #7a3030; }

.dablist { overflow-y: auto; max-height: 320px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.dablist .empty { color: var(--dim); font-size: 12px; padding: 6px 4px; }
.dabrow {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; text-align: left; padding: 4px 8px;
}
.dabrow.playing { border-color: var(--accent); }
.dabrow.off { color: var(--dim); }
.dabrow.off .row-logo img { opacity: 0.5; }
.dablist.has-logos .row-logo { flex: none; width: 42px; height: 36px; }
.dablist .row-logo img { max-width: 42px; height: 36px; }
.dab-rtext { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.dab-rtext > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dab-name { font-size: 14px; }
.dabrow.playing .dab-name { font-weight: 700; color: var(--accent); }
.dab-meta, .dab-on, .dab-rdls { font-size: 11px; color: var(--dim); }
.dab-on { color: var(--text); }
.dabrow.off .dab-on { color: var(--dim); }
.dab-on:empty, .dab-rdls:empty { display: none; }

.dabinfo { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 4px; }
.dabinfo details { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; min-width: 0; }
.dabinfo summary { cursor: pointer; padding: 5px 10px; color: var(--text); }
.dabinfo summary:focus-visible { outline: 1px solid var(--accent); }
.dabinfo pre {
  margin: 0; padding: 6px 10px 8px; border-top: 1px solid var(--line);
  font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
/* broadcast FM: the signal line and the RDS section's parts */
.rdsnow { padding: 6px 16px 0; }
.rdsnow:has(.dab-sig:empty) { display: none; }
.rds-sigrow { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--line); padding: 8px 0 0 10px; }
.rds-sigrow pre { flex: 1 1 0; min-width: 0; border-top: 0; padding-top: 0; }
.rds-const { flex: none; width: 140px; height: 140px; border: 1px solid var(--line); border-radius: 3px; background: var(--plot-bg); }
.rds-opt { display: flex; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.rds-loghead { padding: 4px 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--dim); }
.rdsinfo pre.rds-log { max-height: 220px; overflow-y: auto; white-space: pre; overflow-wrap: normal; color: var(--dim); }
@media (max-width: 600px) {
  .rds-sigrow { flex-direction: column; padding-left: 0; }
  .rds-const { align-self: center; }
}
@media (min-width: 1100px) {
  .dablist, .dabfoundlist, .aislist { max-height: none; flex: 1 1 0; min-height: 0; }
}
@media (max-width: 600px) {
  .dab-card { flex-direction: column; }
  .dab-pic { align-self: center; }
  .dab-pic img { max-width: 100%; }
  .dab-title { font-size: 20px; }
}
.dabscan { padding: 5px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.dabscan[hidden] { display: none; }
#btnDabScanCancel { border-color: var(--accent-dim); color: var(--accent); }
.dabfoundlist { overflow-y: auto; max-height: 320px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.dabfoundlist .empty { color: var(--dim); font-size: 12px; padding: 6px 4px; }
#dabPanel .dab-svc-view[hidden], .dabfoundlist[hidden] { display: none !important; }
.dab-tabs button { font-size: 12px; padding: 2px 10px; }
.tvweak > summary { padding: 4px 4px; text-transform: none; letter-spacing: 0; }
.tvweak > div { display: flex; flex-direction: column; gap: 3px; }
.dabens {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 8px; row-gap: 1px; align-items: baseline;
  width: 100%; text-align: left; padding: 4px 8px;
}
.dabens.tuned { border-color: var(--accent); }
.dabens.tuned .dabens-label { color: var(--accent); font-weight: 700; }
.dabens-block { font: 12px ui-monospace, Menlo, Consolas, monospace; }
.dabens-label { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.dabens-n { grid-column: 2; min-width: 0; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tag { font-size: 10px; letter-spacing: 0.5px; padding: 1px 4px; border: 1px solid var(--accent-dim); border-radius: 3px; color: var(--accent); margin-right: 4px; }

/* views: the receiver and the transmitter map */
.views button { padding: 4px 12px; }
#rxView[hidden], .mapview[hidden] { display: none; }
.badge.tx { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.badge[hidden] { display: none; }

.mapview {
  --m-bg: #f4f5f7; --m-panel: #ffffff; --m-panel2: #eceef2; --m-line: #d3d7de; --m-text: #1d2128;
  --m-dim: #5d6573; --m-fm: #1565d8; --m-dab: #c2185b; --m-user: #111418; --m-user-ring: #ffffff;
  --m-accent: #b26a00; --m-s3: #1e8e3e; --m-s2: #d18b00; --m-s1: #d93025; --m-s0: #80868b;
  --m-pos: #1e7e34; --m-neg: #c5221f;
  background: var(--m-bg); color: var(--m-text);
  padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 8px;
  min-height: calc(100vh - 62px); color-scheme: light;
}
.mapview[data-theme=dark] {
  --m-bg: #101114; --m-panel: #1a1c21; --m-panel2: #23262c; --m-line: #2f333b; --m-text: #e3e5e8;
  --m-dim: #9aa1ab; --m-fm: #5aa2ff; --m-dab: #ff5c9d; --m-user: #ffffff; --m-user-ring: #101114;
  --m-accent: #ffb300; --m-s3: #4cd07a; --m-s2: #ffc233; --m-s1: #ff6b6b; --m-s0: #9aa1ab;
  --m-pos: #5fd38a; --m-neg: #ff7b7b;
  color-scheme: dark;
}
.mapview button, .mapview select {
  background: var(--m-panel2); color: var(--m-text); border-color: var(--m-line);
}
.mapview button:hover:not(:disabled) { border-color: var(--m-accent); }
.mapview button[aria-pressed=true] { background: var(--m-accent); color: #111; border-color: var(--m-accent); font-weight: 600; }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.map-tools label { display: inline-flex; align-items: center; gap: 6px; color: var(--m-dim); }
.map-tools .radio-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.map-pos { font-size: 12px; color: var(--m-dim); flex: 1 1 260px; min-width: 0; }
.map-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.map-box {
  height: min(62vh, 640px); min-height: 320px; border: 1px solid var(--m-line); border-radius: 4px;
  background: var(--m-panel2); z-index: 0;
}
.map-box.picking { cursor: crosshair; }
.map-side { background: var(--m-panel); border: 1px solid var(--m-line); border-radius: 4px; display: flex; flex-direction: column; min-width: 0; }
.map-side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; border-bottom: 1px solid var(--m-line);
}
.map-side .fmpanel-title { color: var(--m-dim); }
.map-side-head button { font-size: 12px; padding: 2px 8px; }
.map-side-head .fmpanel-title { flex: 1; }
.map-tune { font-size: 12px; color: var(--m-dim); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.live-read::before { content: "\25CF"; color: var(--m-s3); font-size: 9px; margin-right: 4px; vertical-align: 1px; }
.map-list { overflow-y: auto; max-height: 320px; }
.map-list .empty { color: var(--m-dim); font-size: 12px; padding: 8px; }
.txrow {
  display: grid; width: 100%; text-align: left; border: none; border-radius: 0; background: transparent;
  border-bottom: 1px solid var(--m-line); padding: 5px 8px; color: var(--m-text);
  grid-template-columns: 38px minmax(0, 1.4fr) 70px 78px minmax(0, 1.6fr) 58px 92px 70px; column-gap: 8px; align-items: center;
}
.mapview .txrow { background: transparent; border-color: var(--m-line); }
.txrow:last-child { border-bottom: none; }
.mapview .txrow:hover:not(:disabled) { background: var(--m-panel2); }
.txrow:disabled { opacity: 0.7; cursor: default; }
.txrow.focus { box-shadow: inset 3px 0 0 var(--m-accent); }
.txrow > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txrow:not(.live) .tx-name { color: var(--m-dim); }
.txrow.live .tx-last { color: var(--m-text); font-weight: 600; }
.tx-freq, .tx-id, .tx-km, .tx-sig { font: 12px ui-monospace, Menlo, Consolas, monospace; }
.tx-site, .tx-last { font-size: 12px; color: var(--m-dim); }
.tx-last, .tx-km { text-align: right; }
.tx-kind {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-align: center;
  padding: 1px 4px; border-radius: 3px; color: #fff; min-width: 32px;
}
.tx-kind.fm { background: var(--m-fm); }
.tx-kind.dab { background: var(--m-dab); }
.mapview[data-theme=dark] .tx-kind { color: #101114; }
.map-note { font-size: 12px; color: var(--m-dim); }
.map-note[hidden] { display: none; }
.map-credits-box summary { cursor: pointer; font-size: 11px; color: var(--m-dim); }
.map-credits { font-size: 11px; color: var(--m-dim); display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
@media (min-width: 1100px) {
  /* the map and the list fill the window below the header and tools; the credits line stays under them */
  body:has(> #mapView:not([hidden])) { display: flex; flex-direction: column; height: 100vh; }
  body:has(> #mapView:not([hidden])) > .mapview { flex: 1 1 auto; min-height: 0; }
  .map-main { flex-direction: row; align-items: stretch; flex: 1 1 auto; min-height: 0; }
  .map-wrap { flex: 1 1 0; }
  .map-box { height: auto; flex: 1 1 auto; min-height: 320px; }
  .map-side { max-height: none; }
  .map-side { flex: none; width: 400px; }
  .map-list { max-height: none; flex: 1 1 0; min-height: 0; }
  .txrow { grid-template-columns: 38px minmax(0, 1fr) 72px 72px 56px; grid-template-areas: "k n f i d" "k s g g l"; row-gap: 1px; }
  .txrow .tx-kind { grid-area: k; } .txrow .tx-name { grid-area: n; } .txrow .tx-freq { grid-area: f; }
  .txrow .tx-id { grid-area: i; } .txrow .tx-km { grid-area: d; } .txrow .tx-site { grid-area: s; }
  .txrow .tx-sig { grid-area: g; text-align: right; } .txrow .tx-last { grid-area: l; }
}
@media (max-width: 700px) {
  .mapview { padding: 8px 8px 12px; }
  .txrow { grid-template-columns: 38px minmax(0, 1fr) 66px 64px; grid-template-areas: "k n f l" "k s s d"; row-gap: 1px; }
  .txrow .tx-kind { grid-area: k; } .txrow .tx-name { grid-area: n; } .txrow .tx-freq { grid-area: f; }
  .txrow .tx-last { grid-area: l; } .txrow .tx-site { grid-area: s; } .txrow .tx-km { grid-area: d; }
  .txrow .tx-id, .txrow .tx-sig { display: none; }
}

/* the map's layers: transmitters or ships */
.mapview[data-layer=ships] .tx-only, .mapview[data-layer=aircraft] .tx-only, .mapview[data-layer=spots] .tx-only { display: none !important; }
.mapview:not([data-layer=ships]) .ships-only { display: none !important; }
.mapview[data-layer=ships] .map-note, .mapview[data-layer=aircraft] .map-note, .mapview[data-layer=spots] .map-note { display: none; }
.map-wrap { position: relative; display: flex; flex-direction: column; min-width: 0; }
.map-wrap.map-full { background: var(--m-bg); }
.map-wrap.map-full .map-box { flex: 1 1 auto; height: auto; min-height: 0; border: none; border-radius: 0; }
.map-wrap.map-full-window { position: fixed; inset: 0; z-index: 1000; }
.map-full-ctl a { display: flex; align-items: center; justify-content: center; }
.map-full-ctl svg { width: 16px; height: 16px; }
.ship-side { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.ship-side[hidden] { display: none; }
.ship-ch { font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--m-dim); }
.ship-ch.lora-cover { display: block; padding: 4px 8px; }
.ship-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; border-bottom: 1px solid var(--m-line); }
.ship-tools label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--m-dim); }
.ship-tools input[type=search] {
  flex: 1 1 100%; min-width: 0; background: var(--m-panel2); color: var(--m-text); border: 1px solid var(--m-line);
  border-radius: 4px; padding: 4px 8px; font: inherit; font-size: 13px;
}
.ship-chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 100%; }
.mapview .chip { font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.shiprow {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: 8px; width: 100%; text-align: left;
  border: none; border-radius: 0; border-bottom: 1px solid var(--m-line); padding: 5px 8px; color: var(--m-text);
}
.mapview .shiprow { background: transparent; }
.mapview .shiprow:hover { background: var(--m-panel2); }
.shiprow.focus { box-shadow: inset 3px 0 0 var(--m-accent); }
.shiprow.st1 { opacity: 0.75; }
.shiprow.st2 { opacity: 0.5; }
.ship-sw { grid-row: 1 / span 3; display: flex; align-items: center; justify-content: center; width: 28px; }
.ship-sw svg { display: block; max-width: 26px; max-height: 26px; }
.ship-name { font-weight: 700; text-decoration: underline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ship-sub { grid-column: 2 / -1; font-size: 12px; color: var(--m-dim); display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; }
.ship-last { grid-column: 2 / -1; font-size: 11px; color: var(--m-dim); }
.ship-met { grid-column: 2 / -1; font-size: 11px; color: var(--m-text, inherit); }
img.flag { display: inline-block; vertical-align: middle; border: 1px solid rgba(0, 0, 0, 0.45); object-fit: cover; flex: none; }
.flag-code {
  display: inline-block; font: 600 9px/1 ui-monospace, Menlo, Consolas, monospace; padding: 2px 3px; border-radius: 2px;
  border: 1px solid currentColor; color: var(--m-dim); vertical-align: middle;
}
.ship-card {
  position: absolute; right: 10px; bottom: 28px; z-index: 1000; width: 320px; max-height: calc(100% - 40px); overflow-y: auto;
  background: var(--m-panel); color: var(--m-text); border: 1px solid var(--m-line); border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); padding: 8px 10px; font-size: 13px;
}
.ship-card[hidden] { display: none; }
.sc-head { display: flex; align-items: center; gap: 8px; }
.sc-icon { grid-row: auto; width: 26px; flex: none; }
.sc-title { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.mapview .sc-close { flex: none; border: none; background: transparent; font-size: 20px; line-height: 1; padding: 0 4px; color: var(--m-dim); }
.sc-sub { display: flex; align-items: center; gap: 4px; color: var(--m-dim); font-size: 12px; margin: 2px 0 4px; }
.sc-link { display: inline-block; font-size: 12px; color: var(--m-fm); margin-bottom: 4px; }
.sc-body { display: flex; flex-direction: column; }
.sc-row { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--m-line); padding: 2px 0; min-width: 0; }
.sc-k { color: var(--m-dim); white-space: nowrap; }
.sc-v { text-align: right; overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.sc-sec { margin-top: 8px; }
.sc-sec-head { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--m-dim); margin-bottom: 2px; }
.sc-windrow { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.sc-wind { color: #0078ff; display: inline-flex; }
.sc-wind-t { font-weight: 600; }
@media (max-width: 640px) {
  .ship-card { left: 6px; right: 6px; width: auto; bottom: 22px; max-height: 60%; }
}
/* ship markers (Leaflet): only the drawn shape takes the pointer */
.ship-icon { background: none; border: none; pointer-events: none !important; }
.ship-icon .ship-hit { pointer-events: visiblePainted; cursor: pointer; }
.ship-icon svg { display: block; overflow: visible; filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.9)); }
.mapview[data-theme=dark] .ship-icon .ship-ahead, .mapview[data-theme=dark] .ship-icon .ship-line,
.mapview[data-theme=dark] .ship-icon .ship-barb { stroke: #e3e5e8; }
.mapview[data-theme=dark] .ship-icon .ship-barb path { fill: #e3e5e8; }
.mapview[data-theme=dark] .ship-icon svg { filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.9)); }
.ship-icon.sel svg { filter: drop-shadow(0 0 3px var(--m-accent)) drop-shadow(0 0 1px var(--m-accent)); }
.ship-dot { display: block; width: 12px; height: 12px; border-radius: 50%; }
.ship-icon.sel .ship-dot { box-shadow: 0 0 0 2px var(--m-accent); }
.ship-sym { display: block; width: 30px; height: 30px; }
.ship-temp {
  position: absolute; right: -16px; bottom: -10px; background: #fff; color: #111; border-radius: 9px; padding: 1px 4px;
  font: 600 10px/1.3 system-ui, sans-serif; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); white-space: nowrap; pointer-events: none;
}
.leaflet-tooltip.ship-label {
  font: 700 10px/1.2 system-ui, sans-serif; padding: 1px 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.9);
  color: #111; border: 1px solid #aaa; box-shadow: none;
}
.ship-label-in { display: inline-flex; align-items: center; gap: 3px; }
.ship-label-in img.flag { width: 12px; height: 9px; }
.ship-hover .leaflet-popup-content { margin: 6px 10px; }
.ship-pop { font: 12px/1.35 system-ui, sans-serif; }
.ship-pop div { overflow-wrap: anywhere; }
.ship-legend { max-height: 46vh; overflow-y: auto; max-width: 230px; }
.ship-lg-box summary { cursor: pointer; }
.lg-shapes { display: grid; grid-template-columns: 1fr; gap: 1px; margin: 2px 0 4px; }
.lg-shape { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; flex: none; }
.lg-shape svg { max-width: 20px; max-height: 20px; }
.lg-colour { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border: 1px solid rgba(0, 0, 0, 0.5); }
.ship-lg input { margin: 0; }

/* map markers, coverage and lines (Leaflet) */
.tx-icon { background: none; border: none; }
.tx-dot {
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  width: 24px; height: 24px; border-radius: 50%; font: 700 11px/1 system-ui, sans-serif; color: #fff;
  border: 2px solid var(--m-user-ring); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.tx-dot.fm { background: var(--m-fm); }
.tx-dot.dab { background: var(--m-dab); }
.tx-dot.both { background: linear-gradient(90deg, var(--m-fm) 50%, var(--m-dab) 50%); }
.tx-dot.old { opacity: 0.55; border-style: dashed; transform: scale(0.8); }
.map-user span {
  display: block; width: 18px; height: 18px; border-radius: 50%; box-sizing: border-box;
  background: var(--m-user); border: 4px solid var(--m-user-ring); box-shadow: 0 0 0 2px var(--m-user), 0 1px 5px rgba(0, 0, 0, 0.5);
}
.leaflet-container path.tx-cover.fm { stroke: var(--m-fm); fill: var(--m-fm); }
.leaflet-container path.tx-cover.dab { stroke: var(--m-dab); fill: var(--m-dab); }
.leaflet-container path.tx-cover.other { stroke-opacity: 0.5; fill-opacity: 0.02; }
.leaflet-container path.tx-line { stroke: var(--m-s0); stroke-opacity: 0.95; }
.leaflet-container path.tx-line.s3 { stroke: var(--m-s3); }
.leaflet-container path.tx-line.s2 { stroke: var(--m-s2); }
.leaflet-container path.tx-line.s1 { stroke: var(--m-s1); }
.map-legend {
  background: color-mix(in srgb, var(--m-panel) 92%, transparent); color: var(--m-text);
  border: 1px solid var(--m-line); border-radius: 4px; padding: 5px 8px; font: 11px/1.5 system-ui, sans-serif;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.map-legend .lg-head { color: var(--m-dim); }
/* the legend's hide / show button (map.js); hidden, the legend slides left leaving the button */
.map-legend { position: relative; padding-right: 24px; transition: transform 0.25s ease, opacity 0.25s ease; }
.map-legend:not(.lg-hidden) { animation: lg-in 0.25s ease; }
@keyframes lg-in { from { transform: translateX(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
.map-legend.lg-closing { transform: translateX(-100%); opacity: 0; }
.map-legend .lg-toggle {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; margin: 0;
  border: 1px solid var(--m-line); border-radius: 3px; background: var(--m-panel); color: var(--m-text);
  font: 12px/18px system-ui, sans-serif; cursor: pointer;
}
.map-legend .lg-toggle:hover { border-color: var(--m-accent, #ffb300); }
/* folded: only a map button (like the zoom buttons), no panel behind it */
.map-legend.lg-hidden { padding: 0; background: none; border: 0; box-shadow: none; }
.map-legend.lg-hidden > :not(.lg-toggle) { display: none; }
.map-legend.lg-hidden .lg-toggle {
  position: static; width: auto; height: 30px; padding: 0 10px; border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px; background: var(--m-panel); color: var(--m-text); font: 600 12px/26px system-ui, sans-serif;
  box-shadow: none; background-clip: padding-box;
}
.map-legend.lg-hidden .lg-toggle:hover { background: var(--m-line); }
@media (prefers-reduced-motion: reduce) { .map-legend { transition: none; animation: none; } }
.lg-row { display: flex; align-items: center; gap: 5px; }
.lg-sw { display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--m-s0); }
.lg-sw.s3 { border-top-color: var(--m-s3); }
.lg-sw.s2 { border-top-color: var(--m-s2); }
.lg-sw.s1 { border-top-color: var(--m-s1); }
.lg-sw.kind { border-top-color: var(--m-text); width: 18px; }
.lg-sw.kind.dab { border-top-style: dashed; margin-left: 6px; }
.map-sec {
  position: sticky; top: 0; z-index: 1; background: var(--m-panel2); color: var(--m-dim);
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 4px 8px; border-bottom: 1px solid var(--m-line);
}
.rxcard {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: none; border-radius: 0;
  border-bottom: 1px solid var(--m-line); padding: 7px 8px; color: var(--m-text);
}
.mapview .rxcard { background: transparent; border-color: var(--m-line); }
.mapview .rxcard:hover:not(:disabled) { background: var(--m-panel2); }
.rxcard.focus { box-shadow: inset 3px 0 0 var(--m-accent); }
.rxcard:not(.live) { opacity: 0.8; }
.rx-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rx-name { font-weight: 600; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-freq { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--m-dim); }
.rx-sig {
  font: 600 12px ui-monospace, Menlo, Consolas, monospace; white-space: nowrap;
  padding: 1px 6px; border-radius: 3px; border: 1px solid currentColor; color: var(--m-s0);
}
.rx-sig.s3 { color: var(--m-s3); }
.rx-sig.s2 { color: var(--m-s2); }
.rx-sig.s1 { color: var(--m-s1); }
.rx-geo, .rx-pred, .rx-last { font-size: 12px; color: var(--m-dim); padding-left: 46px; }
.rx-pred b.pos { color: var(--m-pos); }
.rx-pred b.neg { color: var(--m-neg); }
.rx-last { font-size: 11px; }
.tx-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase;
  padding: 1px 5px; border-radius: 3px; margin-top: 2px;
}
.tx-badge.beyond { background: var(--m-s2); color: #111; }
.tx-badge.missing { background: transparent; color: var(--m-s1); border: 1px solid currentColor; }
.tx-pop { font: 12px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--m-text); min-width: 200px; }
.tx-pop-site { font-size: 14px; font-weight: 700; }
.tx-pop-area { font-weight: 400; color: var(--m-dim); }
.tx-pop-dist { color: var(--m-dim); margin-bottom: 2px; }
.tx-pop-row { border-top: 1px solid var(--m-line); padding-top: 4px; margin-top: 4px; }
.tx-pop-row:not(.live) { opacity: 0.8; }
.tx-pop-top { display: flex; align-items: center; gap: 6px; }
.tx-live { font-size: 10px; font-weight: 700; color: var(--m-accent); text-transform: uppercase; }
.tx-warn { color: var(--m-accent); }
.tx-src { color: var(--m-dim); font-size: 11px; }
.mapview .leaflet-container { background: var(--m-panel2); font: 12px/1.4 system-ui, sans-serif; }
.mapview .leaflet-container canvas { background: transparent; }
.mapview .leaflet-popup-content-wrapper, .mapview .leaflet-popup-tip { background: var(--m-panel); color: var(--m-text); }
.mapview .leaflet-container a.leaflet-popup-close-button { color: var(--m-dim); }
.mapview .leaflet-container .leaflet-control-attribution { background: color-mix(in srgb, var(--m-panel) 85%, transparent); color: var(--m-dim); }
.mapview .leaflet-container .leaflet-control-attribution a { color: var(--m-fm); }
.mapview .leaflet-bar a, .mapview .leaflet-bar a:hover { background: var(--m-panel); color: var(--m-text); border-bottom-color: var(--m-line); }
.mapview .leaflet-bar a.leaflet-disabled { background: var(--m-panel2); color: var(--m-dim); }
.mapview .leaflet-control-scale-line { background: color-mix(in srgb, var(--m-panel) 80%, transparent); color: var(--m-text); border-color: var(--m-dim); }
/* dark theme: the OSM tiles inverted to a dark map; markers, shapes and popups unfiltered */
.mapview[data-theme=dark] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.6); }

/* AIS channel lights: dim at rest, a brief green flash per decoded packet */
.ais-led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin: 0 4px 0 6px; vertical-align: 0;
  background: var(--m-dim); opacity: 0.35; }
.ais-led.on { animation: ais-led 400ms ease-out; }
@keyframes ais-led {
  0% { background: #3ddc84; opacity: 1; box-shadow: 0 0 5px #3ddc84; }
  100% { background: var(--m-dim); opacity: 0.35; box-shadow: 0 0 0 transparent; }
}

/* decoded application data in full (weather, AtoN status, text): a modal over the map view */
.ship-dlg { background: var(--m-panel); color: var(--m-text); border: 1px solid var(--m-line); border-radius: 8px;
  width: min(460px, calc(100vw - 32px)); max-height: 80vh; overflow: auto; padding: 12px 14px; }
.ship-dlg::backdrop { background: rgba(0, 0, 0, 0.45); }
.sc-sum { font-size: 12px; margin: 2px 0 4px; }
.mapview .sc-more { font-size: 12px; padding: 2px 10px; margin-top: 2px; }

/* ---- aircraft (ADS-B layer) */
.ac-icon { background: none; border: none; pointer-events: none !important; }
.ac-icon .ac-hit { pointer-events: visiblePainted; cursor: pointer; }
.ac-icon svg { display: block; overflow: visible; filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)); }
/* dark maps and lists: a light halo around the dark outline */
.mapview[data-theme=dark] .ac-icon svg, .mapview[data-theme=dark] .ac-sw svg, .aisrow .ac-sw svg { filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.75)); }
.ac-icon.sel svg { filter: drop-shadow(0 0 3px var(--m-accent)) drop-shadow(0 0 1px var(--m-accent)); }
.ac-wrap { position: relative; display: block; }
.ac-ring {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 2px solid #e31b1b; pointer-events: none; animation: ac-pulse 1.4s ease-out infinite;
}
@keyframes ac-pulse {
  0% { transform: scale(0.7); opacity: 1; }
  100% { transform: scale(1.9); opacity: 0; }
}
.leaflet-tooltip.ac-label {
  font: 700 10px/1.2 system-ui, sans-serif; padding: 1px 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.9);
  color: #111; border: 1px solid #aaa; box-shadow: none; white-space: nowrap;
}
.ac-label-in { display: inline-flex; flex-direction: column; align-items: flex-start; }
.ac-label-in .ac-l2 { font-weight: 500; font-family: ui-monospace, Menlo, Consolas, monospace; }
.ac-label-in.emerg { color: #c40000; }
.acrow {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: 8px; width: 100%; text-align: left;
  border: none; border-radius: 0; border-bottom: 1px solid var(--m-line); padding: 5px 8px; color: var(--m-text);
}
.mapview .acrow { background: transparent; }
.mapview .acrow:hover { background: var(--m-panel2); }
.acrow.focus { box-shadow: inset 3px 0 0 var(--m-accent); }
.acrow.st1 { opacity: 0.75; }
.acrow.st2 { opacity: 0.5; }
.acrow.emerg .ac-name { color: #e31b1b; }
.ac-name { font-weight: 700; display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-alt { font: 600 12px ui-monospace, Menlo, Consolas, monospace; text-align: right; white-space: nowrap; }
.ac-sub { grid-column: 2; font-size: 11px; color: var(--m-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-age { grid-column: 3; font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--m-dim); text-align: right; }
.ac-tag { font: 700 9px/1 system-ui, sans-serif; padding: 2px 3px; border-radius: 2px; border: 1px solid currentColor; color: var(--m-dim); flex: none; }
.ac-tag.em { color: #fff; background: #e31b1b; border-color: #e31b1b; }
.ac-up { color: #2e9d4f; }
.ac-down { color: #d2691e; }
.sc-v.emerg, .sc-emerg { color: #e31b1b; font-weight: 700; }
.ac-card .sc-title { font-family: ui-monospace, Menlo, Consolas, monospace; }
.ac-photo { margin: 2px 0 6px; }
.ac-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; background: var(--m-panel2); }
.ac-photo figcaption { font-size: 11px; color: var(--m-dim); margin-top: 2px; overflow-wrap: anywhere; }
.ac-photo figcaption a { color: inherit; }
.ac-info { margin: 0 0 6px; }
.ac-info-src { font-size: 11px; color: var(--m-dim); margin-top: 2px; }
.ac-alt-bar { display: block; height: 10px; border-radius: 2px; border: 1px solid rgba(0, 0, 0, 0.5); margin: 3px 0 0; }
.ac-alt-ticks { display: flex; justify-content: space-between; font: 9px/1.2 ui-monospace, Menlo, Consolas, monospace; color: var(--m-dim); }
.ac-legend { max-height: 52vh; overflow-y: auto; max-width: 250px; }
.ac-legend .lg-shapes { grid-template-columns: 1fr 1fr; column-gap: 6px; }
.ac-legend .lg-shape { width: 26px; height: 26px; }
.ac-legend .lg-shape svg { max-width: 24px; max-height: 24px; }
.ac-sw svg { max-width: 26px; max-height: 26px; }
.mapview .chip.chip-em { border-color: #e31b1b; color: #e31b1b; }

/* Digital mode (FT8 / FT4 / FT2): its controls, status card and decodes panel show */
body:not(.digi-mode) .digi-only { display: none !important; }
body.digi-mode .rds { display: none; }
#digiState.on { color: var(--ok); border-color: var(--ok); }
.digi-prog { max-width: none; margin: 2px 0; }
.digi-hint { font-size: 12px; color: var(--dim); }
.digi-hint:empty { display: none; }
.digi-hint.warn { color: var(--accent); }
.digi-tools { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.digi-tools input[type=search] {
  flex: 1 1 auto; min-width: 0; background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 4px; padding: 3px 8px; font: inherit; font-size: 13px;
}
.digi-tools .check { font-size: 12px; color: var(--dim); white-space: nowrap; }
.digi-cols, .digi-row {
  display: grid; grid-template-columns: 52px 30px 30px 38px minmax(0, 1fr); column-gap: 6px; padding: 1px 8px;
  font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace;
}
.digi-cols { color: var(--dim); font-size: 11px; border-bottom: 1px solid var(--line); padding-top: 3px; padding-bottom: 3px; }
.digi-cols span:nth-child(-n+4), .digi-row > span:nth-child(-n+4) { text-align: right; }
.digilist { overflow-y: auto; max-height: 360px; min-height: 120px; }
.digilist .empty { color: var(--dim); font-size: 12px; padding: 6px 8px; }
.digi-row { color: var(--text); }
.digi-row:hover { background: var(--panel2); }
.digi-row.cq { color: var(--ok); }
.digi-row.cq .dg-msg { font-weight: 600; }
.dg-utc { color: var(--dim); }
.dg-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.dg-msg .flag { flex: none; }
.dg-tag { font-size: 10px; color: var(--dim); border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; }
.digi-sep {
  display: flex; gap: 8px; align-items: baseline; padding: 3px 8px; margin-top: 2px;
  background: var(--panel2); border-top: 1px solid var(--line); font-size: 11px; color: var(--dim);
}
.digi-sep .dg-t { color: var(--text); font: 600 12px ui-monospace, Menlo, Consolas, monospace; }
.digi-sep .dg-n { margin-left: auto; text-align: right; }
.digi-sep.skipped .dg-n, .digi-sep.failed .dg-n { color: var(--accent); }
.digi-sep.decoding .dg-n { color: var(--ok); }
.digi-credit { font-size: 10px; color: var(--dim); padding: 4px 8px; border-top: 1px solid var(--line); }
@media (min-width: 1100px) {
  .fmpanel.digipanel { width: 440px; }
  .fmpanel.aprspanel { width: 400px; }
  .digilist { max-height: none; flex: 1 1 0; }
}
/* the map's Spots layer */
.spot-icon { background: transparent; border: none; }
.spot-dot, .lg-shape, .spot-mark { display: inline-flex; line-height: 0; }
.spot-shape { display: block; overflow: visible; }
.spotrow { grid-template-columns: 14px minmax(0, 1fr); align-items: center; }
.spotrow .spot-dot { flex: none; }
.spotrow .ship-name { text-decoration: none; display: flex; align-items: center; gap: 4px; }
.spot-cq { font-size: 10px; font-weight: 700; color: var(--m-s3); border: 1px solid var(--m-s3); border-radius: 3px; padding: 0 3px; margin-left: 4px; }
.spot-label { background: rgba(16, 17, 20, 0.75); color: #fff; border: none; box-shadow: none; padding: 0 4px; font: 11px ui-monospace, Menlo, Consolas, monospace; }
.spot-label::before { display: none; }
.spot-card .sc-icon { width: 18px; height: 18px; }
/* ---- LoRa nodes (LoRa layer) */
.lora-icon { background: transparent; border: none; }
.lora-mk { display: inline-flex; line-height: 0; }
.lora-mk svg { display: block; overflow: visible; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.7)); }
.lg-mk { margin-right: 4px; vertical-align: middle; }
.lorarow-map { grid-template-columns: 14px minmax(0, 1fr); align-items: center; }
.lorarow-map .ship-name { text-decoration: none; }
.lorarow-wrap { position: relative; }
.lorarow-wrap .lorarow-map { padding-right: 34px; }
.lorarow-map.muted { opacity: 0.55; }
.lora-mute {
  position: absolute; top: 4px; right: 6px; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 22px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--m-dim); cursor: pointer;
}
.lora-mute:hover { color: var(--m-text); border-color: var(--m-line); background: var(--m-panel2); }
.lora-mute[aria-pressed=true] { color: #ef6c00; }
.lora-muted { margin-top: 4px; color: #ef6c00; }
.lora-muted .linkbtn { padding: 0; border: none; background: none; color: var(--m-accent); text-decoration: underline; cursor: pointer; font: inherit; }
.mapview .chip .lg-colour { width: 9px; height: 9px; display: inline-block; border-radius: 2px; vertical-align: middle; }
.lora-card .sc-icon { line-height: 0; }

/* station badges only in broadcast FM; station logos in broadcast FM and DAB */
body:not(.wfm-mode) .wfm-only { display: none !important; }
/* CTCSS / DCS: NFM only */
body:not(.nfm-mode) .nfm-only { display: none !important; }
body:not(.iq-mode) .iq-only { display: none !important; }
body.iq-mode .no-iq { display: none !important; }
.iq-peak { min-width: 7.5em; }
.iq-peak.clip { color: var(--bad, #ff5252); font-weight: 600; }
#toneSel.on { border-color: var(--accent); color: var(--accent); }
.tone-heard { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; min-width: 9.5em; color: var(--dim); }
.tone-heard.on { color: var(--ok); border-color: var(--ok); }
.tone-heard:disabled { opacity: 1; cursor: default; }
body.wfm-mode .no-wfm { display: none !important; }
body:not(.wfm-mode):not(.dab-mode):not(.tv-mode) .logos-only { display: none !important; }
.digi-dial { font-size: 12px; max-width: 150px; }

/* APRS mode: its controls, status card, station panel and packet list show */
body:not(.aprs-mode) .aprs-only { display: none !important; }
body.aprs-mode .rds { display: none; }
#aprsState.on { color: var(--ok); border-color: var(--ok); }
#aprsFreqSel { max-width: min(340px, calc(100vw - 110px)); }
.aprs-lvl { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin: 0 4px 0 6px; background: var(--dim); opacity: 0.35; }
.aprs-lvl.q3 { background: #3ddc84; opacity: 1; }
.aprs-lvl.q2 { background: var(--accent); opacity: 1; }
.aprs-lvl.q1 { background: var(--err); opacity: 1; }
.aisrow .aprs-sw { display: inline-flex; flex: none; }
.aisrow .aprs-sw svg { display: block; }
.aprs-pk-filter {
  flex: 1 1 160px; min-width: 0; max-width: 360px; background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 4px; padding: 3px 8px; font: inherit; font-size: 13px;
}
.aprs-pk { max-height: 300px; overflow-y: auto; border-top: 1px solid var(--line); }
.aprs-pk .empty { color: var(--dim); font-size: 12px; padding: 6px 10px; }
.aprs-pk-row {
  display: grid; grid-template-columns: 60px 76px minmax(0, 1fr); column-gap: 8px; padding: 2px 10px;
  font: 11px/1.45 ui-monospace, Menlo, Consolas, monospace; border-bottom: 1px solid var(--line);
}
.aprs-pk-row:hover { background: var(--panel2); }
.aprs-pk-row.dup { opacity: 0.55; }
.aprs-pk-t { color: var(--dim); }
.aprs-pk-k { color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aprs-pk-raw { color: var(--text); overflow-wrap: anywhere; }
.aprs-pk-sum { grid-column: 3; color: var(--dim); font-family: system-ui, sans-serif; overflow-wrap: anywhere; }
.aprs-pk-sum:empty { display: none; }
@media (max-width: 600px) {
  .aprs-pk-row { grid-template-columns: 56px minmax(0, 1fr); }
  .aprs-pk-k { display: none; }
  .aprs-pk-sum { grid-column: 2; }
}
/* the map's APRS layer */
.mapview[data-layer=aprs] .tx-only, .mapview[data-layer=lora] .tx-only { display: none !important; }
.mapview[data-layer=aprs] .map-note, .mapview[data-layer=lora] .map-note { display: none; }
.aprs-icon { background: none; border: none; pointer-events: none !important; }
.aprs-icon .aprs-hit { pointer-events: auto; cursor: pointer; }
/* an APRS symbol (aprs.js symbolHtml): the sheet's cell, an overlay character over it, the course
   pointer, an object's outline, a killed cross, an emergency glow */
.aprs-sym { position: relative; display: inline-block; vertical-align: middle; flex: none; }
.aprs-sym > .sym, .aprs-sym > svg { position: absolute; inset: 0; background-repeat: no-repeat; }
.aprs-sym > svg { overflow: visible; pointer-events: none; }
.aprs-icon .aprs-sym { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45)); }
.aprs-icon.sel .aprs-sym { filter: drop-shadow(0 0 3px var(--m-accent)) drop-shadow(0 0 1px var(--m-accent)); }
.aprs-sym.obj { outline: 1.5px solid rgba(17, 17, 17, 0.7); outline-offset: 1px; border-radius: 2px; }
.aprs-sym.killed > .sym { opacity: 0.45; filter: grayscale(1); }
.aprs-sym.alarm { border-radius: 50%; box-shadow: 0 0 0 2px #e31b1b, 0 0 8px 2px rgba(227, 27, 27, 0.8); }
.leaflet-container path.aprs-path { stroke-opacity: 0.85; }
.leaflet-container path.aprs-path.direct { stroke: var(--m-s3); }
.leaflet-container path.aprs-path.via { stroke: var(--m-accent); }
.lg-sw.aprs-lg.direct { border-top-color: var(--m-s3); }
.lg-sw.aprs-lg.via { border-top: 3px dashed var(--m-accent); }
#aprsSide .ship-tools select { padding: 3px 4px; }
.aprs-legend { max-height: 52vh; overflow-y: auto; max-width: 250px; }
.aprs-legend .lg-shapes { grid-template-columns: 1fr 1fr; column-gap: 6px; }
.aprs-cmt { grid-column: 2 / -1; font-size: 11px; color: var(--m-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }
.aprs-card .sc-title { font-family: ui-monospace, Menlo, Consolas, monospace; }
.aprs-raw { font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; border-bottom: 1px solid var(--m-line); padding: 2px 0; }
.aprs-msg { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; border-bottom: 1px solid var(--m-line); padding: 2px 0; font-size: 12px; }
.aprs-msg-h { color: var(--m-dim); font-family: ui-monospace, Menlo, Consolas, monospace; }
.aprs-msg-a { color: var(--m-dim); font-size: 11px; text-align: right; }
.aprs-msg-t { grid-column: 1 / -1; overflow-wrap: anywhere; }
.rec { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); }
.rec-audio { display: inline-flex; gap: 8px; align-items: center; }
.rec-audio[hidden] { display: none; }
#btnRec.rec-on, #btnIqRec.rec-on { background: var(--err); border-color: var(--err); color: #fff; }
@media (max-width: 600px) {
  .rec { margin-left: 0; padding-left: 0; border-left: 0; }
  .tools { margin-left: 0; }
}
#recInfo:empty, #iqInfo:empty { display: none; }
#spectrum.placing { cursor: crosshair; }
.notch-row .num { width: 90px; }
.audioviz { padding: 8px 16px 0; }
.audioviz details { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.audioviz summary { cursor: pointer; padding: 6px 10px; color: var(--text); }
.audioviz summary:focus-visible { outline: 1px solid var(--accent); }
.av-tools { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 0 10px 6px; }
.av-tools [hidden] { display: none; }
#avCanvas { display: block; width: 100%; height: 240px; background: #0b0c0f; border-top: 1px solid var(--line); border-radius: 0 0 4px 4px; }
@media (max-width: 600px) { #avCanvas { height: 180px; } }
body.dab-mode .smeter { display: none; }
#spectrum.onlevels { cursor: ns-resize; }
#spectrum.onedge, #waterfall.onedge, #wfOverlay.onedge { cursor: ew-resize; }
#palettePreview { width: 160px; height: 12px; border: 1px solid var(--line); border-radius: 2px; }
.memsec { padding: 8px 16px 0; }
.memsec details { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.memsec summary { cursor: pointer; padding: 6px 10px; color: var(--text); }
.memsec summary:focus-visible { outline: 1px solid var(--accent); }
.mem-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.mem-tabs button { border-radius: 4px 4px 0 0; border-bottom: 0; }
.mem-tabs button[aria-selected="true"] { background: var(--accent); color: #111; border-color: var(--accent); }
.mem-tools { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 6px 10px; }
.mem-right { margin-left: auto; display: inline-flex; gap: 6px; }
.mem-list { max-height: 320px; overflow: auto; padding: 0 10px 8px; }
.mem-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 64px 80px auto; gap: 8px; align-items: center; padding: 4px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mem-row:hover { background: var(--panel2); }
.mem-row.on { color: var(--accent); }
.mem-row .mem-f { font: 13px ui-monospace, Menlo, Consolas, monospace; text-align: right; }
.mem-row .mem-m, .mem-row .mem-b { color: var(--dim); font-size: 12px; }
.mem-row input, .mem-row select { width: 100%; min-width: 0; }
.mem-row .mem-note { grid-column: 1 / -1; color: var(--dim); font-size: 12px; }
.mem-empty { color: var(--dim); padding: 8px 6px; }
@media (max-width: 600px) { .mem-row { grid-template-columns: minmax(0, 1fr) 110px auto; } .mem-row .mem-m, .mem-row .mem-b { display: none; } .mem-right { margin-left: 0; } }
.act-head, .act-row { display: grid; grid-template-columns: 120px 64px 56px minmax(0, 1fr) 100px auto; gap: 8px; align-items: center; padding: 4px 6px; }
.act-head { margin: 0 10px; color: var(--dim); font-size: 12px; border-bottom: 1px solid var(--line); }
.act-row { border-bottom: 1px solid var(--line); cursor: pointer; font-size: 12px; color: var(--dim); }
.act-row:hover { background: var(--panel2); }
.act-row .act-f { font: 13px ui-monospace, Menlo, Consolas, monospace; text-align: right; color: var(--text); white-space: nowrap; }
.act-row .act-f::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.act-row.live .act-f::before { background: #ffb340; }
.act-row.tuned .act-f { color: var(--accent); }
.act-row .act-btns { display: inline-flex; gap: 4px; }
.act-row .act-btns button { padding: 1px 6px; font-size: 12px; }
@media (max-width: 600px) { .act-head, .act-row { grid-template-columns: 110px 44px minmax(0, 1fr) auto; } .act-head > :nth-child(2), .act-head > :nth-child(5), .act-row .act-w, .act-row .act-n { display: none; } }
.band-group { margin: 8px 0; }
.band-group-head { font-weight: 600; margin-bottom: 4px; }
.band-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.band-btns button.on { border-color: var(--accent); color: var(--accent); }
.keypad-dlg { width: min(300px, calc(100vw - 32px)); }
.keypad-show { font: 600 24px/1.2 ui-monospace, Menlo, Consolas, monospace; color: var(--plot-trace); text-align: right; padding: 8px; background: var(--plot-bg); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 8px; min-height: 30px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keypad button { font-size: 20px; padding: 12px 0; }
.keypad .kp-unit { font-size: 15px; }
#profName { flex: 1; min-width: 160px; }
.prof-row { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.prof-row .prof-name { flex: 1; overflow-wrap: anywhere; }
.prof-row .prof-sub { color: var(--dim); font-size: 12px; }
.dlg-help.warn { color: var(--accent); }
.vrx-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 6px; border-bottom: 1px solid var(--line); }
.vrx-row .vrx-name { font-weight: 600; color: #4cd07a; width: 90px; font-family: inherit; }
.vrx-row .vrx-name::placeholder { color: #4cd07a; opacity: 0.8; }
.vrx-row .vrx-f { width: 120px; }
.vrx-row .vrx-lvl { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); min-width: 70px; }
.vrx-row.off { opacity: 0.6; }
.vrx-row .vrx-dec { flex-basis: 100%; color: var(--dim); font-size: 12px; padding-left: 26px; overflow-wrap: anywhere; }
.vrx-row .vrx-set { flex-basis: 100%; padding-left: 26px; font-size: 12px; min-width: 0; }
.vrx-row .vrx-set > summary { cursor: pointer; color: var(--dim); overflow-wrap: anywhere; }
.vrx-row .vrx-set-sum { color: var(--accent); }
.vrx-row .vrx-set-body { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 6px 0 2px; }
.vrx-row .vrx-set-body label { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.vrx-row .vrx-set-body input[type="range"] { width: 110px; max-width: 40vw; }
.vrxdec-dlg { width: min(720px, calc(100vw - 32px)); }
.vrxdec-dlg .digilist { max-height: 60vh; }
.vrxdec-cols, .vrxdec-dlg .digi-row { grid-template-columns: 60px 30px 30px 38px minmax(0, 1fr); }
.mute-btn { padding: 2px 6px; line-height: 0; }
.mute-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mute-btn[aria-pressed="true"] { color: var(--err); border-color: var(--err); }
.vrx-row.oob { background: color-mix(in srgb, var(--err) 10%, transparent); }
.vrx-row .vrx-tg[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.vrx-row.muted .vrx-name { text-decoration: line-through; }
.vrx-row .vrx-cpu { color: var(--dim); }
.vrx-row select { max-width: 100%; text-overflow: ellipsis; }
.vrx-limit { white-space: nowrap; }
.vrxdec-dlg .digi-row.vrx-ev { grid-template-columns: 70px minmax(0, 1fr); }
.dv-rx-b { opacity: 1; color: #4cd07a; border-color: #4cd07a; margin-right: 6px; margin-left: 0; }
.vrx-row.oob .vrx-lvl { color: var(--err); font-weight: 600; }
.tuner2 { padding: 8px 16px 0; }
.tuner2 .t2-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 6px 10px; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 4px 4px 0 0; }
.tuner2 .t2-cursor { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); min-width: 110px; }
#t2Spec { height: 150px; border: 1px solid var(--line); border-radius: 0 0 4px 4px; cursor: crosshair; touch-action: pan-y; }
#divCanvas { height: 190px; border: 1px solid var(--line); border-radius: 0 0 4px 4px; }
.div-manual { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.div-manual input[type=range] { width: 160px; }

/* Digital voice: the panel (dv-only), the Details window and the names window */
body:not(.dv-mode) .dv-only { display: none !important; }
body.dv-mode .rds { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dvnow { padding: 8px 16px 0; }
.dv-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.dv-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.dv-head .dab-title { font-size: 20px; margin-right: 2px; }
.dv-kv { font-size: 12px; color: var(--dim); white-space: nowrap; }
.dv-kv b { font: 600 13px ui-monospace, Menlo, Consolas, monospace; color: var(--text); font-variant-numeric: tabular-nums; display: inline-block; min-width: 3ch; }
.dv-kv b.q3 { color: var(--ok); } .dv-kv b.q2 { color: var(--accent); } .dv-kv b.q1 { color: var(--err); }
#dvBer { min-width: 6ch; } #dvLvl { min-width: 6ch; }
.dv-tools { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-left: auto; }
.dv-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dv-cards.one, .dv-hero.one { grid-template-columns: minmax(0, 1fr); }
.dvc-kind.emerg { color: var(--err, #ff5c5c); }

/* a time slot's card: fixed rows, so a call coming or going moves nothing */
.dvc {
  position: relative; min-width: 0; display: grid; grid-template-rows: auto 22px 18px 16px; row-gap: 2px;
  background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 4px; padding: 6px 10px 6px 9px;
}
.dvc.on { border-left-color: var(--accent); }
.dvc.on.voice { border-left-color: var(--ok); }
.dvc.on.enc { border-left-color: var(--err); }
.dvc-top { display: flex; align-items: center; gap: 6px; min-width: 0; height: 18px; }
.dvc-ts { font: 700 12px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); letter-spacing: 0.5px; }
.dvc.on .dvc-ts { color: var(--text); }
.dvc-kind:not(:empty) { opacity: 1; color: var(--text); }
.dvc-enc:not(:empty) { opacity: 1; color: var(--err); border-color: var(--err); }
.dvc-aud { font-size: 11px; color: var(--ok); white-space: nowrap; }
.dvc-aud.off { color: var(--dim); }
.dvc-dur { margin-left: auto; font: 600 13px ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; color: var(--text); }
.dvc-tg, .dvc-src, .dvc-meta { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dvc-tg { font-size: 17px; line-height: 22px; }
.dvc-tgid { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; margin-right: 6px; }
.dvc-tgname { color: var(--text); font-weight: 600; }
.dvc-src { font-size: 13px; line-height: 18px; }
.dvc-call { font-weight: 700; color: var(--text); margin-right: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.dvc-name { color: var(--text); margin-right: 6px; }
.dvc-id { color: var(--dim); font: 12px ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.dvc-meta { font-size: 12px; line-height: 16px; color: var(--dim); display: flex; gap: 8px; align-items: center; }
.dvc-alias { color: var(--text); font-style: italic; overflow: hidden; text-overflow: ellipsis; }
.dvc-place { overflow: hidden; text-overflow: ellipsis; }
.dvc-alias:empty, .dvc-place:empty, .dvc-call:empty, .dvc-name:empty, .dvc-tgid:empty { display: none; }
button.dvc-gps {
  padding: 0 6px; font: 11px/15px ui-monospace, Menlo, Consolas, monospace; color: var(--accent); border-color: var(--accent-dim);
  background: transparent; white-space: nowrap; flex: none;
}
.dvc-idle { position: absolute; left: 9px; right: 10px; top: 30px; font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dvc.hero { grid-template-rows: auto 34px 24px 18px; padding: 10px 14px 10px 12px; border-left-width: 4px; }
.dvc.hero .dvc-ts { font-size: 13px; }
.dvc.hero .dvc-dur { font-size: 16px; }
.dvc.hero .dvc-tg { font-size: 26px; line-height: 34px; }
.dvc.hero .dvc-src { font-size: 16px; line-height: 24px; }
.dvc.hero .dvc-id { font-size: 13px; }
.dvc.hero .dvc-meta { font-size: 13px; line-height: 18px; }
.dvc.hero .dvc-idle { top: 40px; font-size: 16px; left: 12px; }

/* the Details window: beside the page (not modal), so the spectrum and the controls stay usable */
.dv-dlg {
  position: fixed; inset: auto 16px 16px auto; margin: 0; z-index: 40;
  width: min(680px, calc(100vw - 32px)); max-height: min(860px, calc(100vh - 120px)); overflow: auto;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 0 14px 12px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}
.dv-dlg-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  margin: 0 -14px 10px; padding: 10px 14px 8px; background: var(--panel); border-bottom: 1px solid var(--line); cursor: move; touch-action: none;
}
.dv-dlg-head .mc-dlg-title { font-size: 15px; }
.dv-dlg-freq { font: 600 14px ui-monospace, Menlo, Consolas, monospace; color: var(--text); font-variant-numeric: tabular-nums; }
.dv-dlg-proto { margin-left: auto; cursor: default; }
.dv-dlg-head .dlg-close { padding: 0 10px; font-size: 16px; }
.dv-mini[aria-pressed=true] { border-color: var(--accent); color: var(--accent); }
.dv-dlg.mini > :not(.dv-dlg-head):not(.dv-hero) { display: none; }
.dv-dlg.away { display: none; }
.dv-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dv-sec { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0 0; }
.dv-sec-k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--dim); }
.dv-follow { width: 150px; min-width: 0; }
.dv-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.dv-tile { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; min-width: 0; }
.dv-tile-v { font: 600 15px/1.25 ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-tile-v.q3 { color: var(--ok); } .dv-tile-v.q2 { color: var(--accent); } .dv-tile-v.q1 { color: var(--err); }
.dv-tile-k { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.dv-fig { margin: 0; min-width: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px 8px; }
.dv-fig figcaption { display: flex; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; min-width: 0; }
.dv-fig-v { margin-left: auto; font: 11px ui-monospace, Menlo, Consolas, monospace; font-weight: 400; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dv-fig canvas { display: block; width: 100%; height: 120px; border-radius: 3px; }
.dv-fig figcaption > span:first-child { white-space: nowrap; flex: none; }
.dv-fig canvas.short { height: 80px; }
.dv-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin: 0 3px 0 6px; vertical-align: -1px; }
.dv-bars { display: flex; flex-direction: column; gap: 4px; }
.dv-bar { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 12px; min-width: 0; }
.dv-bar-k { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-bar-t { display: flex; height: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; min-width: 30px; }
.dv-bar-t i, .dv-legend i { background: var(--accent); }
.dv-bar-t i { display: block; height: 100%; transition: width 0.3s ease-out; }
.dv-bar-t i.ok, .dv-legend i.ok { background: var(--ok); }
.dv-bar-t i.warn, .dv-legend i.warn { background: var(--accent); }
.dv-bar-t i.bad, .dv-legend i.bad { background: var(--err); }
.dv-bar-t i.dim { background: var(--dim); opacity: 0.6; }
.dv-bar-v { font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; min-width: 5ch; }
#dvVf .dv-bar { grid-template-columns: 34px minmax(0, 1fr) auto; }
#dvCcSeen .dv-bar { grid-template-columns: 44px minmax(0, 1fr) auto; }
.dv-empty { color: var(--dim); font-size: 12px; padding: 4px 0; }
.dv-tops { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.dv-topbox { min-width: 0; }
.dv-topbox .dv-sec-k { margin-bottom: 4px; }
.dv-top-row { display: grid; grid-template-columns: minmax(0, 1fr) 60px auto; gap: 8px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.dv-top-k { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-top-k b { font-family: ui-monospace, Menlo, Consolas, monospace; margin-right: 6px; }
.dv-top-sub { color: var(--dim); }
.dv-top-bar { height: 6px; background: var(--panel2); border-radius: 2px; overflow: hidden; }
.dv-top-bar i { display: block; height: 100%; background: var(--accent); opacity: 0.8; }
.dv-top-n { font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dv-log { margin-top: 12px; }
.dv-log-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; }
.dv-log-bar input[type=search] { flex: 1 1 160px; min-width: 0; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font: inherit; padding: 4px 8px; }
.dv-log-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 4px; }
.dv-log-list .dv-empty { padding: 8px 10px; }
.dv-log-row {
  display: grid; grid-template-columns: 62px 30px minmax(0, 1.2fr) minmax(0, 1fr) 54px auto; gap: 8px; align-items: center;
  padding: 3px 8px; border-bottom: 1px solid var(--line); font-size: 12px;
}
.dv-log-row:last-child { border-bottom: 0; }
.dv-log-row:hover { background: var(--panel2); }
.dv-log-row.open { background: color-mix(in srgb, var(--ok) 9%, transparent); }
.dv-log-t, .dv-log-s, .dv-log-d { font-family: ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; color: var(--dim); }
.dv-log-d { text-align: right; color: var(--text); }
.dv-log-row.open .dv-log-d { color: var(--ok); }
.dv-log-dst, .dv-log-src { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-log-dst { color: var(--text); }
.dv-log-src { color: var(--text); opacity: 0.85; }
.dv-enc-b { opacity: 1; color: var(--err); border-color: var(--err); margin-left: 6px; }
button.dv-log-gps { padding: 0 5px; font-size: 11px; line-height: 15px; color: var(--accent); background: transparent; border-color: var(--accent-dim); }
.dv-foot { border-top: 1px solid var(--line); margin-top: 12px; }
.dv-foot .dlg-help { flex: 1 1 260px; margin: 0; }
.dv-names-add input[type=text] { min-width: 0; }
#dvNamesName { width: 200px; max-width: 100%; }
.dv-names-search { width: 100%; margin: 6px 0; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font: inherit; padding: 4px 8px; }
.dv-names-list { max-height: 40vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 4px; }
.dv-names-list .dv-empty { padding: 8px 10px; }
.dv-name-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.dv-name-id { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--accent); font-variant-numeric: tabular-nums; }
.dv-name-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-name-t b { font-family: ui-monospace, Menlo, Consolas, monospace; }
.dv-name-pl { color: var(--dim); }
.dv-name-del { padding: 0 8px; }
#dvNamesDlg a { color: var(--accent); }
html.big .dvc-tg { font-size: 19px; }
@media (max-width: 700px) {
  .dv-dlg { inset: auto 8px 8px 8px; width: auto; max-height: min(64vh, calc(100vh - 16px)); padding: 0 10px 10px; }
  .dv-dlg-head { margin: 0 -10px 8px; padding: 8px 10px 6px; }
  .dv-pl { display: none; }
  .dv-tile { padding: 4px 6px; }
  .dv-tile-v { font-size: 13px; }
  .dv-dlg-head { cursor: default; }
  .dv-cards, .dv-hero, .dv-charts, .dv-tops { grid-template-columns: minmax(0, 1fr); }
  .dv-tools { margin-left: 0; }
  .dvc.hero .dvc-tg { font-size: 22px; }
  .dv-log-row { grid-template-columns: 58px 28px minmax(0, 1fr) 48px auto; }
  .dv-log-src { grid-column: 3 / -1; grid-row: 2; color: var(--dim); }
}
@media (max-width: 520px) {
  .dv-dlg-freq { display: none; }
  .dv-dlg.mini .dv-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .dv-dlg.mini .dvc.hero { grid-template-rows: auto 22px 18px 16px; padding: 6px 8px; border-left-width: 3px; }
  .dv-dlg.mini .dvc.hero .dvc-tg { font-size: 16px; line-height: 22px; }
  .dv-dlg.mini .dvc.hero .dvc-src { font-size: 13px; line-height: 18px; }
  .dv-dlg.mini .dvc.hero .dvc-meta, .dv-dlg.mini .dvc.hero .dvc-id { font-size: 11px; }
  .dv-dlg.mini .dvc.hero .dvc-dur { font-size: 13px; }
  .dv-dlg.mini .dvc.hero .dvc-idle { top: 28px; left: 8px; font-size: 13px; white-space: normal; }
  .dv-dlg.mini .dvc-aud, .dv-dlg.mini .dvc-kind { display: none; }
}
.leaflet-container path.map-point { stroke: var(--m-accent); fill: var(--m-accent); fill-opacity: 0.35; }
.auto-tag { display: inline-block; margin-left: 4px; padding: 0 5px; border: 1px solid var(--accent-dim); border-radius: 3px; color: var(--accent); font-size: 11px; line-height: 15px; vertical-align: middle; }
.auto-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 4px 6px; margin: 2px 0; border-left: 3px solid transparent; border-radius: 3px; }
.auto-row select { max-width: 100%; }
.auto-row .num { width: 96px; }
.auto-row .num { appearance: textfield; -moz-appearance: textfield; }
.auto-row .num::-webkit-inner-spin-button, .auto-row .num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.auto-range { display: inline-flex; gap: 12px; align-items: center; white-space: nowrap; }
@media (max-width: 600px) { .auto-row .num { width: 70px; } .auto-range { gap: 8px; } .auto-row select { max-width: 150px; } }
.auto-row.bad { border-left-color: var(--err); background: color-mix(in srgb, var(--err) 8%, transparent); }
.auto-row.bad input[aria-invalid=true] { border-color: var(--err); }
.auto-msg { flex-basis: 100%; color: var(--dim); font-size: 12px; }
.auto-row.bad .auto-msg { color: var(--err); }
#hwAutoEmpty .dlg-help { margin: 0; }
.dlg-help.bad { color: var(--err); }
.dlg-help.ok { color: var(--ok, var(--text)); }
.cal-now { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; padding: 2px 0 4px; overflow-wrap: anywhere; }
#hwCalLevel { width: 120px; }
#hwCalProg { width: 120px; }
.cal-for { margin: 0; }
.dlg-sec-sub { color: var(--dim); font-size: 12px; margin-top: 6px; }
.cal-row { flex-wrap: nowrap; justify-content: space-between; border-top: 1px dashed var(--line); }
.cal-row span { flex: 1 1 auto; min-width: 0; }
/* TV mode: as LoRa, with the TV panels */
body.tv-mode .fm-only, body.tv-mode .dab-only, body.tv-mode .no-ais:not(.tv-audio), body.tv-mode .ais-only { display: none !important; }
/* the S-meter reads the multiplex's power in TV mode */
body.tv-mode canvas.smeter.no-ais { display: block !important; }
body:not(.tv-mode) .tv-only { display: none !important; }
body.tv-mode .rds { display: none; }
#tvState.on { color: var(--ok); border-color: var(--ok); }
#tvState.wait { color: var(--accent); border-color: var(--accent-dim); }
#tvState:empty { display: none; }
#tvFreq, #tvChSel { font-family: ui-monospace, Menlo, Consolas, monospace; }
.tv-gain { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
#tvGr, #loraGr { width: 4.5em; }
.tv-tools { margin-left: auto; display: inline-flex; gap: 6px; }
#btnTvRec[aria-pressed=true] { color: var(--err); border-color: var(--err); }
.tv-sigrow { display: flex; gap: 12px; align-items: flex-start; margin-top: 4px; }
.tv-const { flex: none; width: 150px; height: 150px; border: 1px solid var(--line); border-radius: 3px; background: var(--plot-bg); }
.tv-sigrow .dab-sig { flex: 1 1 0; min-width: 0; white-space: pre-line; }
.tv-note { font-size: 11px; color: var(--dim); }
.tvlist { min-height: 120px; }
.tvrow { grid-template-columns: 30px auto minmax(0, 1fr) auto; column-gap: 8px; }
.tvrow .tv-lcn { grid-column: 1; grid-row: 1 / span 3; align-self: center; font: 600 13px ui-monospace, Menlo, Consolas, monospace; color: var(--accent); }
.tvrow .tv-logo { grid-column: 2; grid-row: 1 / span 3; align-self: center; display: flex; }
.tvrow .ais-name { grid-column: 3; grid-row: 1; }
.tvrow .tv-kind { grid-column: 4; grid-row: 1; font-size: 11px; color: var(--dim); text-align: right; white-space: nowrap; }
.tvrow .tv-nn { grid-column: 3 / span 2; grid-row: 2; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvrow .tv-prog { grid-column: 3 / span 2; grid-row: 3; display: block; height: 3px; margin-top: 3px; background: var(--panel2); border-radius: 2px; overflow: hidden; }
.tvrow .tv-prog[hidden] { display: none; }
.tvrow .tv-prog i { display: block; height: 100%; background: var(--accent); }
.tvrow.sel { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
/* tv-logos are drawn for dark backgrounds: a dark plate in every theme */
.tv-logo img, .tvg-logo { display: block; width: 42px; height: 26px; object-fit: contain; background: #1d2026; border-radius: 4px; padding: 2px 3px; box-sizing: border-box; }
/* signal strength and quality */
.tv-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 4px 0 2px; }
.tv-meter { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 8px; font-size: 12px; min-width: 0; }
.tv-meter-k { color: var(--dim); white-space: nowrap; }
.tv-meter-t { display: block; height: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.tv-meter-t i { display: block; height: 100%; width: 0; background: var(--dim); transition: width 0.3s ease-out; }
.tv-meter-t i.q3 { background: var(--ok); } .tv-meter-t i.q2 { background: var(--accent); } .tv-meter-t i.q1 { background: var(--err); }
.tv-meter-v { font: 12px ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; min-width: 13ch; }
.tv-alert { margin: 2px 0; padding: 4px 8px; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent); font-size: 12px; cursor: pointer; }
/* programme guide */
.tv-epg-dlg { width: min(1180px, calc(100vw - 32px)); }
.tvg { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tvg-bar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.tvg-tabs, .tvg-nav { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tvg-tab[aria-selected=true] { color: var(--accent); border-color: var(--accent); }
.tvg-nav select { max-width: min(260px, 60vw); }
.tvg-search { width: min(320px, 70vw); }
.tvg-opts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--dim); align-items: center; }
.tvg-opts .check { color: var(--dim); }
.tvg-onstat { color: var(--dim); }
.tvg-sub { font-size: 12px; }
.tvg-body { min-width: 0; }
.tvg [hidden] { display: none !important; }
.tvg-grid { --chw: 170px; position: relative; height: clamp(200px, calc(100vh - 470px), 560px); overflow-y: auto; overflow-x: hidden; border: 1px solid var(--line); border-radius: 4px; outline: none; }
.tvg-ruler { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: var(--chw) minmax(0, 1fr); height: 22px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.tvg-corner { font-size: 11px; color: var(--accent); padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line); }
.tvg-rtrack { position: relative; overflow: hidden; }
.tvg-tick { position: absolute; top: 4px; font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); padding-left: 3px; border-left: 1px solid var(--line); height: 18px; }
.tvg-rows { position: relative; }
.tvg-row { position: absolute; left: 0; right: 0; height: 46px; display: grid; grid-template-columns: var(--chw) minmax(0, 1fr); border-bottom: 1px solid var(--line); box-sizing: border-box; }
.tvg-ch { display: flex; align-items: center; gap: 6px; padding: 0 6px; min-width: 0; background: var(--panel); border-right: 1px solid var(--line); }
.tvg-chname { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tvg-chname b { font: 600 12px ui-monospace, Menlo, Consolas, monospace; color: var(--accent); }
.tvg-track { position: relative; overflow: hidden; }
.tvg-none { position: absolute; left: 8px; top: 14px; font-size: 11px; color: var(--dim); }
.tvg-prog { position: absolute; top: 3px; bottom: 3px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1px; padding: 0 6px; margin: 0; min-width: 0; overflow: hidden; text-align: left; border-radius: 3px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 12px; box-sizing: border-box; cursor: pointer; }
.tvg-prog:hover { border-color: var(--dim); }
.tvg-prog.past { color: var(--dim); background: var(--panel); }
.tvg-prog.now { border-color: var(--accent-dim); background: color-mix(in srgb, var(--accent) 14%, var(--panel2)); }
.tvg-prog.sel, .tvg-prog:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.tvg-prog.rem::after { content: '⏰'; position: absolute; right: 3px; top: 2px; font-size: 10px; }
.tvg-pn { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tvg-pt { max-width: 100%; white-space: nowrap; overflow: hidden; font: 10px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); }
.tvg-now { position: absolute; top: 0; left: calc(var(--chw) + (100% - var(--chw)) * var(--f, 0)); width: 2px; margin-left: -1px; background: var(--err); z-index: 2; pointer-events: none; }
.tvg-list { height: clamp(200px, calc(100vh - 470px), 560px); overflow-y: auto; border: 1px solid var(--line); border-radius: 4px; }
.tvg-list .empty, .tvg-info .empty { color: var(--dim); font-size: 12px; padding: 8px; }
.tvg-li { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 8px; width: 100%; padding: 5px 6px; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.tvg-li:hover { background: var(--panel2); }
.tvg-li.now { background: var(--panel2); }
.tvg-li.now .tvg-li-n { color: var(--accent); }
.tvg-li.sel { box-shadow: inset 3px 0 0 var(--accent); }
.tvg-li.rem .tvg-li-n::after { content: ' ⏰'; font-size: 11px; }
.tvg-li-t { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); padding-top: 1px; }
.tvg-li-b { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tvg-li-n { font-weight: 600; overflow-wrap: anywhere; }
.tvg-li-c { font-size: 11px; color: var(--accent); }
.tvg-li-d { font-size: 12px; color: var(--dim); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tvg-flags { font-size: 10px; font-weight: 400; color: var(--dim); }
.tvg-more { margin: 6px; }
.tvg-info { border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; min-height: 64px; height: 190px; max-height: 30vh; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.tvg-i-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.tvg-i-title { font-weight: 600; font-size: 15px; }
.tvg-i-ep { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--accent); }
.tvg-i-when { font-size: 12px; color: var(--dim); }
.tvg-i-prog { display: inline-block; width: 120px; height: 4px; background: var(--panel2); border-radius: 2px; overflow: hidden; align-self: center; }
.tvg-i-prog i { display: block; height: 100%; background: var(--accent); }
.tvg-i-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tvg-tag { font-size: 11px; padding: 0 6px; border: 1px solid var(--line); border-radius: 9px; color: var(--dim); white-space: nowrap; }
.tvg-i-btns { display: flex; gap: 6px; }
.tvg-remind[aria-pressed=true] { color: var(--accent); border-color: var(--accent); }
.tvg-i-main { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.tvg-i-img { flex: none; width: 160px; height: 90px; object-fit: cover; border-radius: 4px; background: var(--panel2); }
.tvg-i-txt { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.tvg-i-txt p { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.tvg-i-online { color: var(--dim); }
.tvg-i-guid { color: var(--accent); font-size: 12px; }
.tvg-i-items { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 10px; margin: 0; font-size: 12px; }
.tvg-i-items dt { color: var(--dim); }
.tvg-i-items dd { margin: 0; overflow-wrap: anywhere; }
.tvg-i-series { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--dim); }
.tvg-link { font-size: 12px; padding: 1px 6px; }
.tvg-i-crid, .tvg-i-src { font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); overflow-wrap: anywhere; }
/* statistics */
.tvinfo pre { white-space: pre-wrap; }
.tvs-charts, .tvs-wide { margin: 6px 10px 0; }
.tvs-wide { grid-template-columns: minmax(0, 1fr); }
.tvs-wide .dv-fig canvas { height: 150px; }
.tvs-wide .dv-fig.tvs-tall canvas { height: 200px; }
.tvs-constrow { display: flex; gap: 12px; align-items: flex-start; margin: 8px 10px 0; }
.tvs-const { flex: none; width: 260px; height: 260px; border: 1px solid var(--line); border-radius: 3px; }
.tvs-constrow pre { flex: 1 1 0; min-width: 0; margin: 0; }
.tvs-tables { margin: 0 10px 8px; overflow-x: auto; }
.tvs-th { font-size: 12px; font-weight: 600; margin: 8px 0 3px; }
.tvs-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.tvs-table th { text-align: left; color: var(--dim); font-weight: 400; border-bottom: 1px solid var(--line); padding: 2px 6px; white-space: nowrap; }
.tvs-table td { padding: 2px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tvs-table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; }
.tvs-table .bar { width: 90px; }
.tvs-bar { display: block; height: 8px; width: 80px; background: var(--panel2); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.tvs-bar i { display: block; height: 100%; background: var(--accent); }
.tvs-scroll { max-height: 320px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.tvs-scroll th { position: sticky; top: 0; background: var(--panel); }
.tvs-tables pre { border-top: 0; padding: 2px 0 4px; }
.tvs-car td:nth-child(6), .tvs-chg td:nth-child(3), .tvs-pg td:nth-child(4), .tvs-dir td:first-child { overflow-wrap: anywhere; }
.tvs-mods canvas { height: 16px; }
@media (max-width: 600px) {
  .tvs-car td:nth-child(4), .tvs-car th:nth-child(4), .tvs-car td:nth-child(5), .tvs-car th:nth-child(5) { display: none; }
  .tvs-cpid td:nth-child(5), .tvs-cpid th:nth-child(5), .tvs-cpid td:nth-child(6), .tvs-cpid th:nth-child(6) { display: none; }
  .tvs-mod td:nth-child(n+8), .tvs-mod th:nth-child(n+8) { display: none; }
  .tvs-pg td:nth-child(4), .tvs-pg th:nth-child(4) { display: none; }
}
@media (max-width: 600px) {
  .tv-sigrow { flex-direction: column; }
  .tv-const { align-self: center; }
  .tv-bars { grid-template-columns: minmax(0, 1fr); }
  .tv-meter-v { min-width: 0; }
  .tvg-grid { --chw: 104px; }
  .tvg-ch .tvg-logo { display: none; }
  .tvg-li { grid-template-columns: 72px minmax(0, 1fr); }
  .tvg-i-main { flex-direction: column; }
  .tvg-i-img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .tvs-constrow { flex-direction: column; }
  .tvs-const { align-self: center; width: min(260px, 80vw); height: min(260px, 80vw); }
  .tvs-pid td:nth-child(3), .tvs-pid th:nth-child(3) { display: none; }
}

/* TV player (tvplayer.js, tvworker.js) */
.tv-main { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.tv-main .tv-sigrow { flex: 1 1 320px; min-width: 0; }
.tv-player { flex: 0 1 680px; min-width: 0; width: 680px; max-width: 100%; display: flex; flex-direction: column; gap: 4px; }
.tv-player[hidden] { display: none; }
.tv-screen { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.tv-player.radio .tv-screen { aspect-ratio: auto; height: 96px; }
.tv-player.radio .tv-canvas { display: none; }
.tv-canvas { display: block; width: 100%; height: 100%; }
.tv-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; color: #d8dbe0; font-size: 13px; white-space: pre-line; pointer-events: none; text-shadow: 0 1px 2px #000; }
.tv-over[hidden] { display: none; }
.tv-over.radio { font-size: 14px; line-height: 1.5; }
.tv-radio { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: min(640px, 92%); }
.tv-radio-logo { max-width: min(360px, 70%); max-height: 38%; object-fit: contain; }
.tv-radio-name { font-size: 22px; font-weight: 700; }
.tv-radio-msg { color: #b9bec7; }
.tv-radio-now { display: flex; flex-direction: column; font-size: 17px; }
.tv-radio-now span { font-size: 13px; opacity: 0.85; }
.tv-radio-next { font-size: 13px; color: #b9bec7; }
.tv-radio-text { font-size: 14px; max-height: 4.6em; overflow: hidden; }
@media (max-width: 600px) {
  .tv-radio { gap: 3px; }
  .tv-radio-logo { max-height: 28%; }
  .tv-radio-now { font-size: 15px; }
  .tv-radio-text { font-size: 12px; max-height: 3em; }
}
.tv-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tv-now-logo { flex: none; height: 28px; width: auto; max-width: 64px; object-fit: contain; padding: 2px 4px; border-radius: 3px; background: #15171b; }
.tv-now-logo[hidden] { display: none; }
.tv-now-box { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tv-now-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-now-prog { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tvAudioSel, #tvSubSel { max-width: min(170px, 40vw); }
.tv-bar .tv-vol { width: 70px; }
.tv-ic { display: inline-flex; align-items: center; justify-content: center; padding: 2px 6px; }
.tv-ic svg { width: 16px; height: 16px; }
.tv-cc { font: 600 11px ui-monospace, Menlo, Consolas, monospace; padding: 2px 6px; }
.tv-cc[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.tv-vol { width: 80px; }
.tv-pdetails summary { font-size: 11px; color: var(--dim); cursor: pointer; }
.tv-sync { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 6px; font-size: 12px; }
.tv-sync-k { color: var(--dim); }
.tv-sync input[type=range] { width: 140px; }
.tv-sync-v { min-width: 13ch; font-variant-numeric: tabular-nums; }
.tv-sync-v.off { color: var(--accent); }
.tv-pstats { font-size: 11px; color: var(--dim); white-space: pre-line; font-family: ui-monospace, Menlo, Consolas, monospace; }
.tvrow.playing { background: var(--panel2); }
.tvrow.playing .ais-name { color: var(--accent); }
.tv-player.full { background: #000; width: 100%; max-width: none; padding: 0; gap: 0; position: relative; }
.tv-player.full:fullscreen { width: 100%; height: 100%; }
.tv-player.winfull { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; }
.tv-player.full .tv-screen { flex: 1 1 auto; aspect-ratio: auto; border: 0; border-radius: 0; height: 100%; }
.tv-player.full .tv-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; color: #e6e8eb;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8) 40%); transition: opacity 0.3s; }
.tv-player.full .tv-now-prog { color: #b8bcc4; }
.tv-player.full .tv-bar { transition: opacity 0.25s; }
.tv-player.full.idle .tv-bar { opacity: 0; pointer-events: none; }
.tv-player.full.nocursor, .tv-player.full.nocursor * { cursor: none; }
.tv-player.full .tv-pdetails { display: none; }
@media (max-width: 700px) {
  .tv-player { flex-basis: 100%; width: 100%; }
}

/* ---- TV: red button text (tvredbutton.js), a 1024x576 stage scaled over the picture */
.tv-red-btn { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; font-weight: 600; }
.tv-red-btn[hidden] { display: none; }
.tv-red-btn i { width: 10px; height: 10px; border-radius: 50%; background: #e1241b; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.tv-red-btn:disabled i { background: #7a4644; }
.tv-red-btn[aria-pressed="true"] { border-color: #e1241b; color: #ff6a5f; }
.tv-red-btn .rb-prog { font: 500 10px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); }
.tv-red-btn .rb-prog[hidden] { display: none; }
.tv-rb { position: absolute; inset: 0; z-index: 2; background: #000; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.tv-rb[hidden] { display: none; }
.tv-player.radio.rb-open:not(.full) .tv-screen { aspect-ratio: 16 / 9; height: auto; }
.tv-player.radio.radio-screen:not(.full) .tv-screen { aspect-ratio: 16 / 9; height: auto; }
.tv-player.rb-open.rb-q .tv-canvas { position: absolute; z-index: 3; pointer-events: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18); }
.tv-player.rb-open:not(.rb-q) .tv-canvas { visibility: hidden; }
.rb-stage { position: absolute; left: 0; top: 0; width: 1024px; height: 576px; transform-origin: 0 0; color: #fff; background: #000;
  font-family: Tiresias, "Tiresias Screenfont", "Helvetica Neue", Arial, "Liberation Sans", sans-serif; font-size: 24px; line-height: 1.22;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.rb-stage button { font: inherit; color: inherit; border: 0; border-radius: 0; background: none; padding: 0; margin: 0; cursor: pointer; text-align: left; min-height: 0; box-shadow: none; }
.rb-stage button:disabled { opacity: 0.35; cursor: default; }
.rb-stage button:focus-visible { outline: 3px solid #ffd21f; outline-offset: -3px; }
.rb-head { position: absolute; left: 40px; top: 28px; width: 508px; height: 38px; display: flex; align-items: center; gap: 8px; }
.rb-stage:not(.rb-quarter) .rb-head { width: 944px; }
.rb-head-img { height: 30px; flex: none; width: auto; display: block; image-rendering: auto; }
.rb-head-title { font-size: 28px; font-weight: 700; letter-spacing: 0.04em; }
.rb-num { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.rb-num-v { min-width: 64px; padding: 2px 10px; font-size: 22px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rb-stage .rb-num-step { width: 22px; height: 30px; font-size: 26px; line-height: 28px; text-align: center; color: #d4d4d4; }
.rb-clock { font-size: 22px; font-weight: 700; min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }
.rb-title { position: absolute; left: 40px; top: 76px; height: 40px; line-height: 40px; padding: 0 14px; box-sizing: border-box; font-size: 25px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-body { position: absolute; left: 40px; top: 120px; height: 372px; box-sizing: border-box; overflow: hidden; }
.rb-list { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 6px 0; box-sizing: border-box; }
.rb-list::-webkit-scrollbar { display: none; }
.rb-stage .rb-item { display: flex; align-items: center; width: 100%; min-height: 38px; padding: 3px 14px; box-sizing: border-box; font-size: 24px; }
.rb-stage .rb-item > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-stage .rb-item.two { min-height: 62px; padding: 6px 14px; font-size: 22px; line-height: 1.2; }
.rb-stage .rb-item.two > span:first-child { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rb-stage .rb-item.dim { opacity: 0.75; }
.rb-chev { margin-left: 8px; font-weight: 700; }
.rb-side { position: absolute; left: 560px; top: 280px; width: 424px; height: 252px; display: flex; flex-direction: column; gap: 8px; }
.rb-sub { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.rb-sub-h { height: 34px; line-height: 34px; padding: 0 14px; font-size: 21px; font-weight: 700; }
.rb-sub .rb-item { min-height: 34px; font-size: 21px; }
.rb-hint { padding: 12px 14px; font-size: 20px; line-height: 1.3; cursor: default; }
.rb-hint-k { font-size: 17px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.06em; }
.rb-hint-t { font-weight: 700; margin-bottom: 4px; }
.rb-text { padding: 12px 16px; }
.rb-runs { white-space: pre-wrap; tab-size: 64px; -moz-tab-size: 64px; line-height: 29px; overflow-wrap: break-word; }
.rb-msg { padding: 24px 16px; font-size: 24px; }
.rb-index { display: grid; grid-template-columns: 1fr 1fr; align-content: start; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 6px 0; }
.rb-stage .rb-index .rb-item { min-height: 30px; font-size: 19px; padding: 2px 12px; }
.rb-pn { display: inline-block; width: 58px; font-variant-numeric: tabular-nums; }
.rb-nav { position: absolute; left: 40px; top: 498px; height: 34px; display: flex; align-items: center; gap: 12px; padding: 0 10px; box-sizing: border-box; font-size: 20px; }
.rb-stage .rb-arrow { width: 34px; height: 30px; text-align: center; font-size: 18px; }
.rb-pg { flex: 1; text-align: center; font-weight: 700; }
.rb-stage .rb-next { font-weight: 700; white-space: nowrap; }
.rb-days { flex: 1; display: flex; justify-content: center; gap: 6px; }
.rb-stage .rb-day { padding: 0 12px; height: 28px; line-height: 28px; font-size: 19px; font-weight: 700; text-align: center; }
.rb-video { position: absolute; left: 560px; top: 28px; width: 424px; height: 238.5px; }
.rb-stage .rb-video { cursor: zoom-in; }
.rb-fast { position: absolute; left: 40px; top: 540px; width: 944px; height: 28px; display: flex; gap: 8px; }
.rb-stage .rb-key { flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 10px; background: #1b1b1b; font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #e8e8e8; }
.rb-key i { flex: none; width: 16px; height: 16px; border-radius: 50%; }
.rb-red i { background: #e1241b; } .rb-green i { background: #2fa52c; } .rb-yellow i { background: #f5c400; } .rb-blue i { background: #1f6fe0; }
.rb-stage .rb-key:hover { background: #2c2c2c; }
.rb-app i { background: #8b919b; border-radius: 3px; }
/* interactive applications (tvmheg.js): the plane over the picture, the picture in its window */
.tv-mheg { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.tv-mheg[hidden] { display: none; }
.tv-mheg-plane { position: absolute; display: block; background: transparent; image-rendering: auto; }
.tv-player.mheg-open.mheg-v .tv-canvas { position: absolute; z-index: 1; }
.tv-mheg-msg { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); max-width: min(92%, 640px); box-sizing: border-box;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; border-radius: 4px;
  background: rgba(16, 18, 22, 0.92); color: #e8eaee; font-size: 14px; line-height: 1.35; pointer-events: auto; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.tv-mheg-msg[hidden] { display: none; }
.tv-mheg-msg-t { flex: 1 1 100%; }
.tv-mheg-link { color: #8cc4ff; word-break: break-all; font-size: 13px; flex: 1 1 auto; min-width: 0; }
.tv-mheg-msg-x { position: absolute; top: 2px; right: 4px; border: 0; background: none; color: #b8bcc4; padding: 2px 6px; min-height: 0; cursor: pointer; }
.tv-mheg-remote { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; padding: 4px 0; }
.tv-mheg-remote[hidden] { display: none; }
.tv-mheg-k { min-width: 34px; height: 30px; padding: 0 8px; font-weight: 600; }
.tv-mheg-k.wide { min-width: 48px; }
.tv-mheg-k.c { min-width: 30px; width: 30px; padding: 0; position: relative; }
.tv-mheg-k.c::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; }
.tv-mheg-k.red::after { background: #e1241b; } .tv-mheg-k.green::after { background: #2fa52c; }
.tv-mheg-k.yellow::after { background: #f5c400; } .tv-mheg-k.blue::after { background: #1f6fe0; }
.tv-player.full .tv-mheg-remote { position: absolute; left: 0; right: 0; bottom: 52px; z-index: 4; transition: opacity 0.25s; }
.tv-player.full.idle .tv-mheg-remote { opacity: 0; pointer-events: none; }
.rb-map { left: 0; top: 120px; height: 344px; overflow: visible; }
.rb-map-bg { position: absolute; left: 280px; top: 0; width: 720px; height: 344px; }
.rb-pt { position: absolute; width: 48px; height: 43px; }
.rb-wx { display: block; width: 48px; height: 43px; }
.rb-wx svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.rb-pt-t { position: absolute; left: 34px; top: 24px; min-width: 26px; padding: 0 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 17px; font-weight: 700; line-height: 22px; text-align: center; }
.rb-legend { position: absolute; left: 40px; top: 8px; width: 236px; border-collapse: collapse; font-size: 18px; line-height: 1.25; }
.rb-legend th, .rb-legend td { padding: 3px 8px; text-align: left; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.rb-legend th { font-weight: 700; }
.rb-legend .n { text-align: right; width: 40px; font-variant-numeric: tabular-nums; }
.rb-legend tr:nth-child(2n) td { background: rgba(255, 255, 255, 0.05); }
.rb-outlook { width: 944px !important; padding: 8px 0; }
.rb-otab { display: flex; flex-direction: column; }
.rb-orow { display: grid; grid-template-columns: 1fr 56px 120px; align-items: center; height: 42px; padding: 0 20px; font-size: 24px; }
.rb-otemp { text-align: right; font-weight: 700; }

/* ---- Utility modes: Pagers and STD-C as APRS (the receiver's audio), ACARS, VDL2 and Sondes as LoRa (a fixed plan) */
body:not(.util-mode) .util-only { display: none !important; }
body:not(.util-iq) .util-iq-only { display: none !important; }
body.util-iq .fm-only, body.util-iq .dab-only, body.util-iq .no-ais, body.util-iq .ais-only { display: none !important; }
body.util-iq .rds { display: none; }
#utilState.on { color: var(--ok); border-color: var(--ok); }
#utilPlanSel { max-width: 320px; }
.ut-note { font-size: 12px; color: var(--accent); }
.ut-note:empty { display: none; }
.utilpanel .fmpanel-head { flex-wrap: wrap; }
.ut-tabs[hidden] { display: none; }
.ut-tabs button { font-size: 12px; padding: 2px 8px; }
.ut-opts { padding: 4px 8px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.ut-opts[hidden] { display: none; }
.ut-opts-d summary { cursor: pointer; }
.ut-opts-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 0; }
.ut-opts-in label { white-space: nowrap; gap: 4px; }
.ut-opts-in select { font-size: 12px; padding: 1px 4px; }
.ut-num { width: 6em; font-size: 12px; padding: 1px 4px; }
.ut-warn { color: var(--accent); padding: 2px 0; }
.seg .seg-group { align-self: center; font-size: 11px; color: var(--dim); padding: 0 4px 0 8px; }
.seg .seg-group + button { border-radius: 4px 0 0 4px; margin-left: 0; }
.seg button:has(+ .seg-group) { border-radius: 0 4px 4px 0; }
#utilSeg { flex-wrap: wrap; row-gap: 4px; }
.ut-textsig { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ut-textsig.stale { opacity: 0.65; }
.ut-textsig.tuned { border-left: 3px solid var(--accent); }
.ut-texthead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; }
.ut-texthead .ut-time, .ut-texthead .ut-sub { color: var(--dim); }
.ut-follow { font-size: 11px; padding: 1px 8px; margin-left: auto; }
.ut-textbody { margin: 4px 0 0; font: 13px/1.35 var(--mono, ui-monospace, monospace); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 14em; overflow-y: auto; }
.ut-textbody.tall { max-height: 24em; }
.ut-hint { color: var(--dim); font-size: 12px; padding: 0 0 4px; }
.ut-faxbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.ut-faxbar button { font-size: 11px; padding: 1px 8px; }
.ut-faxbar button[aria-pressed=true] { border-color: var(--accent-dim); color: var(--text); }
.ut-faxinfo { padding: 4px 8px; font-size: 12px; color: var(--dim); }
.ut-faxwrap { padding: 4px 8px; }
.ut-fax { display: block; width: 100%; height: auto; image-rendering: auto; background: #808080; }
.ut-tools:has(> #utilFilter[hidden]) { display: none; }
.utlist[data-kind=sstv] > * { flex: none; }
.ut-sstvbar { align-items: center; }
.ut-sstvlabel { flex: 1 1 auto; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.ut-sstvwrap { padding: 4px 8px; }
.ut-sstv { display: block; width: auto; height: auto; max-width: 100%; max-height: 220px; min-height: 120px; margin: 0 auto; background: #000; outline: 1px solid var(--line); }
.ut-sstv-shift { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ut-sstv-shift button { font-size: 11px; padding: 1px 6px; }
.ut-sstvgalhead { padding: 5px 8px 0; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); }
.ut-sstvgal { display: flex; gap: 6px; padding: 5px 8px 8px; overflow-x: auto; }
.ut-sstvthumb { flex: 0 0 88px; width: 88px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 3px; text-align: left; font-size: 10px; }
.ut-sstvthumb[aria-pressed=true] { border-color: var(--accent); }
.ut-sstvthumb canvas { display: block; width: 100%; height: auto; background: #000; }
.ut-sstvcap { display: flex; flex-direction: column; line-height: 1.2; color: var(--dim); min-width: 0; }
.ut-sstvcap span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ut-sstvcap .ut-sstvmode { color: var(--text); }
.ut-sstvcap .ut-sstvcall { color: var(--accent); font-weight: 600; }
.utlist[data-kind=time] > * { flex: none; }
.ut-time { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: flex-start; padding: 8px; }
.ut-timebig { display: flex; flex-direction: column; min-width: 0; }
.ut-timeclock { font: 600 34px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 1px; color: var(--dim); }
.ut-timebig.on .ut-timeclock { color: var(--text); }
.ut-timedate { font-size: 12px; color: var(--dim); max-width: 32ch; }
.ut-timebig.on .ut-timedate { color: var(--text); font-size: 13px; }
.ut-timefacts { display: flex; flex-direction: column; gap: 2px; font-size: 12px; flex: 1 1 260px; min-width: 0; }
.ut-timefacts .ism-k { min-width: 110px; }
.ut-timefacts .ism-v.good { color: var(--ok); }
.ut-timefacts .ism-v.warn { color: var(--accent); }
.ut-timesecs { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 4px 8px 8px; font: 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ut-timesecslabel { font: 12px/1 system-ui, sans-serif; color: var(--dim); margin-right: 6px; }
.ut-timesecsnone { font: 12px/1 system-ui, sans-serif; color: var(--dim); }
.ut-sec { display: inline-block; width: 13px; padding: 2px 0; text-align: center; border-radius: 2px; background: var(--panel2); color: var(--text); }
.ut-sec.s1 { background: var(--accent-dim); }
.ut-sec.sm { background: var(--state-ok); color: var(--ok); font-weight: 700; }
.ut-sec.sq { color: var(--err); }
.ut-sec.coast { opacity: 0.55; }
.ut-timemin { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 3px 8px; font-size: 12px; border-top: 1px solid var(--line); }
.ut-timemin.bad { color: var(--dim); }
.ut-timeat { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--dim); }
.ut-timeflags { color: var(--accent); }
.ut-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.ut-chips[hidden], .ut-chips:empty { display: none; }
.ut-chips .chip { font-size: 11px; padding: 1px 8px; border-radius: 10px; color: var(--dim); }
.ut-chips .chip[aria-pressed=true] { color: var(--text); border-color: var(--accent-dim); }
.ut-chips .chip[aria-pressed=false] { text-decoration: line-through; opacity: 0.7; }
.utlist { max-height: 420px; min-height: 140px; }
.utrow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 8px; row-gap: 1px; align-items: baseline;
  width: 100%; text-align: left; border: none; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent;
  padding: 5px 8px; color: var(--text); font: inherit; font-size: 13px;
}
button.utrow:hover { background: var(--panel2); }
.utrow[aria-expanded=true] { background: var(--panel2); }
.ut-chip {
  grid-row: 1; font: 600 10px/1.6 ui-monospace, Menlo, Consolas, monospace; padding: 0 5px; border-radius: 3px;
  border: 1px solid currentColor; white-space: nowrap; color: var(--dim); text-align: center; min-width: 3.4em;
}
.ut-name { grid-row: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ut-time { grid-row: 1; font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); white-space: nowrap; }
.ut-sub { grid-column: 2 / -1; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ut-text {
  grid-column: 2 / -1; font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--text); white-space: pre-wrap;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.utrow[aria-expanded=true] .ut-text:not(.whole) { display: none; }
.ut-text.whole { display: block; -webkit-line-clamp: none; line-clamp: none; }
.utrow.doubt .ut-text { color: var(--dim); }
.ut-chip.c-pocsag, .ut-chip.c-sonde, .ut-chip.p1, .ism-v.p1 { color: var(--accent); }
.ut-chip.c-flex, .ut-chip.c-up { color: #5aa2ff; }
.ut-chip.c-tone, .ut-chip.c-xid { color: #c18cff; }
.ut-chip.c-down { color: var(--ok); }
.ut-chip.p2, .ism-v.p2 { color: #ff9a4d; }
.ut-chip.p3 { color: var(--bg); background: var(--err); border-color: var(--err); }
.ism-v.p3 { color: var(--err); font-weight: 700; }
html[data-theme=light] .ut-chip.c-flex, html[data-theme=light] .ut-chip.c-up { color: #1565c0; }
html[data-theme=light] .ut-chip.c-tone, html[data-theme=light] .ut-chip.c-xid { color: #6a1b9a; }
html[data-theme=light] .ut-chip.p2, html[data-theme=light] .ism-v.p2 { color: #b34700; }
html[data-theme=contrast] .ut-chip { color: var(--text); }
html[data-theme=contrast] .ut-chip.p3 { color: #000; }
.utdetail .ut-pre {
  margin: 4px 0; padding: 4px 6px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px; max-height: 320px; overflow-y: auto;
}
.ut-tree { padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line); }
.ut-tree-h { color: var(--accent); margin-top: 3px; }
/* sondes: a card each */
.sonde-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 8px; }
.sonde-card { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--panel2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sonde-card.stale { opacity: 0.6; }
.sonde-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sonde-serial { font: 600 14px ui-monospace, Menlo, Consolas, monospace; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sonde-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.sonde-alt { font: 600 22px ui-monospace, Menlo, Consolas, monospace; color: var(--text); }
.sonde-climb { font: 13px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); }
.sonde-climb.up { color: var(--ok); }
.sonde-climb.down { color: var(--accent); }
.sonde-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 10px; font-size: 12px; }
.sonde-kv .sk { color: var(--dim); white-space: nowrap; }
.sonde-kv .sv { text-align: right; font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.sonde-btns { display: flex; justify-content: flex-end; gap: 4px; }
.sonde-btns button { font-size: 12px; padding: 2px 10px; }
@media (min-width: 1100px) {
  .fmpanel.utilpanel { width: 460px; }
  .utlist { max-height: none; flex: 1 1 0; }
}
@media (max-width: 600px) {
  #utilPlanSel { max-width: 100%; }
  .sonde-grid { grid-template-columns: minmax(0, 1fr); padding: 6px; }
}
/* the map's Sondes layer and the aircraft heard only on ACARS / VDL2 */
.mapview[data-layer=sondes] .tx-only { display: none !important; }
.mapview[data-layer=sondes] .map-note { display: none; }
.sonde-icon { background: transparent; border: none; }
.sonde-mk { display: inline-flex; line-height: 0; }
.sonde-mk svg { display: block; overflow: visible; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.7)); }
.sonde-mk.sel svg { filter: drop-shadow(0 0 3px var(--m-accent, #ffb300)); }
.sonderow { grid-template-columns: 28px minmax(0, 1fr) auto; }
.sonderow .ship-name { grid-column: 2; grid-row: 1; }
.sonde-row-alt { grid-column: 3; grid-row: 1; font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--m-text); text-align: right; white-space: nowrap; }
.sonde-legend .lg-mk svg { vertical-align: middle; }
.ac-icon.ac-dl { border: 1.5px dashed var(--m-accent, #ffb300); border-radius: 50%; }
.ac-tag.dl { color: var(--m-accent, #ffb300); }

#hwConv, #hwConvKind { max-width: 100%; }
#hwConvSec .dlg-row label { max-width: 100%; }

/* LoRa map: MeshCore links and the network's figures */
.lora-mesh { margin: 2px 8px 6px; font-size: 12px; }
.lora-mesh summary { cursor: pointer; color: var(--muted, #9aa); padding: 2px 0; }
.lora-mesh .sc-row { display: flex; gap: 8px; padding: 2px 0; }
.lora-mesh .sc-k { flex: 0 0 9.5em; color: var(--muted, #9aa); }
.lora-mesh .sc-v { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.lora-hops { display: flex; align-items: flex-end; gap: 3px; height: 46px; margin: 4px 0 6px 9.5em; }
.lora-hops .lh-bar { position: relative; flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.lora-hops .lh-fill { display: block; background: #ff8f00; border-radius: 2px 2px 0 0; min-height: 1px; }
.lora-hops .lh-n { font-size: 10px; text-align: center; color: var(--muted, #9aa); }
.lora-nb { margin-top: 4px; }
.lora-nb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 2px 0; cursor: pointer; border-top: 1px solid rgba(127, 127, 127, 0.15); }
.lora-nb-row:hover { background: rgba(127, 127, 127, 0.12); }
.lora-nb-row .nb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lora-nb-row .nb-km { color: var(--muted, #9aa); text-align: right; }
.lora-nb-row .nb-what { grid-column: 1 / -1; font-size: 11px; color: var(--muted, #9aa); }
.lora-link-tt .llt-head { font-weight: bold; }
.lora-link-tt .llt-age { color: #888; font-size: 11px; }

/* LoRa page: the APRS view's station rows */
.ap-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.ap-row .ap-map { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin-left: 8px; }
.ap-row .ap-nopos { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin-left: 8px; color: var(--muted, #9aa); font-size: 11px; }
.ap-row .mc-txt.ap-dec { font-size: 12px; }
/* APRS station card: telemetry values and the scaling note */
.sc-v.aprs-tlm-v { font-variant-numeric: tabular-nums; }
.sc-v.aprs-tlm-note { color: var(--muted, #9aa); font-size: 11px; }
.aprs-spark { display: inline-flex; vertical-align: middle; color: var(--m-accent, #ffb300); margin-right: 6px; }
.aprs-lbl-wx { font-weight: 400; opacity: 0.9; }
.aprs-msgtag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid currentColor; border-radius: 3px; padding: 0 3px; opacity: 0.75; }
.aprs-msgack { white-space: nowrap; }
.aprs-msgack.ack { color: #43a047; }
.aprs-msgack.rej { color: #e53935; }
.aprs-msgrow.k-ack .ais-type, .aprs-msgrow.k-rej .ais-type { opacity: 0.7; }
.aprs-msgrow .ais-type { white-space: normal; overflow-wrap: anywhere; }
#aprsPanel .digi-tools { flex-wrap: wrap; }

/* up / down beside a gain list */
.gain-steps { display: inline-flex; flex-direction: column; vertical-align: middle; margin-left: 2px; }
.gain-steps button { font-size: 8px; line-height: 1; padding: 1px 4px; min-width: 0; height: 12px; }

/* ---- DAB programme guide */
.dab-guide-btn { margin-left: 4px; padding: 2px 10px; font-size: 12px; font-weight: 600; color: var(--accent); border-color: var(--accent); }
.dab-epg[role=button] { cursor: pointer; }
.dab-epg[role=button]:hover { color: var(--text); text-decoration: underline; }
.dabg-dlg { width: min(920px, calc(100vw - 32px)); }
.dabg { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 10px; min-height: 0; }
.dabg-empty { color: var(--dim); font-size: 13px; padding: 12px 4px; grid-column: 1 / -1; }
.dabg-svcs { display: flex; flex-direction: column; gap: 2px; max-height: min(64vh, 620px); overflow-y: auto; padding-right: 2px; }
.dabg-svc { display: flex; align-items: center; gap: 8px; text-align: left; padding: 5px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); min-width: 0; }
.dabg-svc:hover { background: var(--panel2); }
.dabg-svc.sel { border-color: var(--accent); background: var(--panel2); }
.dabg-logo { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; }
.dabg-logo .row-logo { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; }
.dabg-logo img { display: block; max-width: 34px; max-height: 34px; width: auto; height: auto; object-fit: contain; border-radius: 4px; }
.dabg-logo:empty, .dabg-logo .row-logo:empty { visibility: hidden; }
.dabg-svct { display: flex; flex-direction: column; min-width: 0; }
.dabg-svcname { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dabg-svcnow { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dabg-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dabg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dabg-name { font-size: 17px; font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.dabg-listen { padding: 3px 12px; font-weight: 600; }
.dabg-progs { max-height: min(64vh, 620px); overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.dabg-day { position: sticky; top: 0; z-index: 1; background: var(--panel2); color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 4px 10px; border-bottom: 1px solid var(--line); }
.dabg-prog { border-bottom: 1px solid var(--line); }
.dabg-prog:last-child { border-bottom: none; }
.dabg-pbtn { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; width: 100%; text-align: left; padding: 7px 10px; border: none; border-radius: 0; background: transparent; color: var(--text); }
.dabg-pbtn:hover { background: var(--panel2); }
.dabg-time { font: 600 13px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); }
.dabg-title { font-size: 14px; overflow-wrap: anywhere; }
.dabg-dur { font-size: 11px; color: var(--dim); white-space: nowrap; }
.dabg-prog.now { box-shadow: inset 3px 0 0 var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dabg-prog.now .dabg-time, .dabg-prog.now .dabg-dur { color: var(--accent); }
.dabg-prog.now .dabg-title { font-weight: 700; }
.dabg-bar { grid-column: 2 / -1; height: 3px; margin-top: 5px; background: var(--line); border-radius: 2px; overflow: hidden; }
.dabg-fill { display: block; height: 100%; background: var(--accent); }
.dabg-det { display: none; padding: 0 10px 10px 72px; font-size: 13px; }
.dabg-prog.open .dabg-det { display: block; }
.dabg-when { color: var(--dim); font-size: 12px; margin-bottom: 4px; }
.dabg-desc { line-height: 1.4; margin-bottom: 8px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .dabg { grid-template-columns: minmax(0, 1fr); }
  .dabg-svcs { flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; padding-bottom: 4px; }
  .dabg-svc { flex: none; max-width: 200px; }
  .dabg-progs { max-height: 58vh; }
  .dabg-det { padding-left: 10px; }
}
.dabg-filter { width: min(340px, 100%); margin: 2px 0 8px; }
.tvg-prog.dim { opacity: 0.35; }
.tv-guide-btn { padding: 2px 10px; font-weight: 600; }
/* the guide over the full-screen picture, as a television's */
.tv-epg-dlg.tv-overlay { width: min(1280px, calc(100vw - 48px)); background: rgba(14, 16, 20, 0.86); color: #e8eaee; border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.tv-epg-dlg.tv-overlay::backdrop { background: rgba(0, 0, 0, 0.25); }
.tv-epg-dlg.tv-overlay .tvg-grid { height: clamp(240px, calc(100vh - 360px), 680px); }

/* QRZ.com call sign lookups */
.qrz-on [data-qrz] { cursor: pointer; }
.qrz-on .dvc-call[data-qrz], .qrz-on .qrz-tag { text-decoration: underline dotted; text-underline-offset: 2px; }
.qrz-block { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--m-line); }
.qrz-head { font-weight: 600; font-size: 12px; color: var(--m-dim); margin-bottom: 4px; }
.qrz-note { font-size: 12px; color: var(--m-dim); }
.qrz-note.bad { color: var(--err); }
.qrz-photo { display: block; max-width: 100%; max-height: 180px; margin: 2px auto 6px; border-radius: 4px; object-fit: contain; }
.qrz-block a { color: inherit; }
.qrz-photo-link { display: block; }
.qrz-tag + .qrz-tag { margin-left: 6px; }
.qrz-map { font-size: 11px; padding: 0 6px; line-height: 16px; }
.qrz-dlg { --m-line: var(--line); --m-dim: var(--dim); width: min(380px, calc(100vw - 32px)); }
.qrz-dlg .qrz-block { margin-top: 0; border-top: 0; }
.qrz-dlg .qrz-photo { max-height: 260px; }
.qrz-dlg .sc-row { padding: 3px 0; }

/* live transcription: the switch by the volume, the Transcript panel */
.tr-sw .val:empty { display: none; }
body.dab-mode label.tr-sw, body.drm-mode label.tr-sw, body.tv-mode label.tr-sw { display: inline-flex !important; }
.tr-stat { font-size: 11px; color: var(--dim); padding: 3px 8px; border-bottom: 1px solid var(--line); }
.tr-stat:empty { display: none; }
.tr-prog { max-width: none; margin: 0 8px 4px; }
.tr-tools select { font-size: 12px; max-width: 130px; }
.trlist { max-height: 300px; min-height: 120px; }
.tr-row {
  display: grid; grid-template-columns: 58px auto auto minmax(0, 1fr); column-gap: 6px; align-items: baseline;
  padding: 2px 8px; font-size: 13px; border-bottom: 1px solid var(--line);
}
.tr-row:hover { background: var(--panel2); }
.tr-t, .tr-n { font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); white-space: nowrap; }
.tr-f {
  font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--accent); background: none; border: none;
  padding: 0; cursor: pointer; white-space: nowrap;
}
.tr-f:hover { text-decoration: underline; }
.tr-x { grid-column: 1 / -1; color: var(--text); line-height: 1.35; overflow-wrap: anywhere; }
@media (min-width: 1100px) {
  .fmpanel.trpanel { width: 380px; }
  .trlist { max-height: none; flex: 1 1 0; }
}
#trSec select, #trGetDlg select { max-width: 100%; }

/* HD Radio (hdradio.js): the toggle and panel in WFM and AM only */
body:not(.wfm-mode):not(.am-mode) .hd-able { display: none !important; }
.hdnow { padding: 6px 16px 0; }
.hdnow[hidden] { display: none; }
.hd-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.hd-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.hd-name { font-size: 18px; font-weight: 700; color: var(--text); }
.hd-slogan { font-size: 13px; color: var(--dim); overflow-wrap: anywhere; }
.hd-sig { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); margin-left: auto; }
.hd-badge[data-state=search] { opacity: 0.7; }
.hd-badge[data-state=lock] { opacity: 1; color: var(--accent); border-color: var(--accent-dim); }
.hd-badge[data-state=audio] { opacity: 1; color: var(--ok); border-color: var(--ok); }
.hd-note { font-size: 13px; color: var(--dim); }
.hd-note[hidden] { display: none; }
.hd-alert { background: var(--err); color: #fff; font-weight: 700; padding: 6px 10px; border-radius: 3px; overflow-wrap: anywhere; }
.hd-alert[hidden] { display: none; }
.hd-progs { flex-wrap: wrap; align-self: flex-start; }
.hd-progs[hidden] { display: none; }
.hd-progs small { color: var(--dim); font-size: 11px; }
.hd-play { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hd-art { width: 96px; height: 96px; object-fit: cover; border-radius: 3px; flex: none; }
.hd-logo { max-width: 96px; max-height: 64px; object-fit: contain; margin-left: auto; flex: none; }
.hd-art[hidden], .hd-logo[hidden] { display: none; }
.hd-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.hd-title { font-size: 16px; color: var(--text); overflow-wrap: anywhere; }
.hd-artist { font-size: 14px; color: var(--accent); overflow-wrap: anywhere; }
.hd-msg { font-size: 13px; color: var(--dim); overflow-wrap: anywhere; }
.hd-play:not(:has(img:not([hidden]))):has(.hd-title:empty) { display: none; }
@media (max-width: 600px) {
  .hd-art { width: 64px; height: 64px; }
  .hd-sig { margin-left: 0; flex-basis: 100%; }
}
.mapview[data-layer=hd] .tx-only { display: none !important; }
.mapview[data-layer=hd] .map-note { display: none; }
.hd-map-row { display: block; width: 100%; text-align: left; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--m-line); background: none; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.hd-map-row:hover { background: var(--m-hover, rgba(127,127,127,0.12)); }
#hdMapList .map-empty { padding: 10px; font-size: 13px; color: var(--m-dim); }
.hd-progs [aria-pressed=true] small { color: inherit; opacity: 0.8; }
/* DRM mode: as TV, with the DRM panel */
body.drm-mode .fm-only, body.drm-mode .dab-only, body.drm-mode .no-ais, body.drm-mode .ais-only { display: none !important; }
body.drm-mode canvas.smeter.no-ais { display: block !important; }
body:not(.drm-mode) .drm-only { display: none !important; }
body.drm-mode .rds { display: none; }
.drm-ctl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
#drmFreq { font-family: ui-monospace, Menlo, Consolas, monospace; }
#drmState.on { color: var(--ok); border-color: var(--ok); }
#drmState.wait { color: var(--accent); border-color: var(--accent-dim); }
#drmState:empty { display: none; }
.drm-label { font-weight: 600; }
.drm-lights { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.drm-light { font-size: 12px; padding: 1px 6px; border-radius: 9px; border: 1px solid var(--line); color: var(--dim); }
.drm-light.s1, .drm-light.s2 { color: #e66; border-color: #e66; }
.drm-light.s3 { color: var(--ok); border-color: var(--ok); }
.drm-text { margin: 6px 0; font-size: 15px; }
.drm-main { display: flex; flex-wrap: wrap; gap: 12px; }
.drm-left { flex: 1 1 360px; min-width: 0; overflow-x: auto; }
.drm-right { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.drm-services { border-collapse: collapse; width: 100%; font-size: 13px; }
.drm-services th, .drm-services td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.drm-services tbody tr { cursor: pointer; }
.drm-services tbody tr:hover, .drm-services tr.sel { background: var(--accent-dim); }
.drm-slidebox { margin: 0; }
.drm-slide { max-width: 100%; max-height: 240px; display: block; border: 1px solid var(--line); }
.drm-slidebox figcaption { font-size: 12px; color: var(--dim); }
.drm-jl { border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.drm-jl-bar { display: flex; gap: 8px; align-items: center; }
.drm-jl-title { font-weight: 600; margin: 6px 0; }
.drm-jl-items { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; outline: none; }
.drm-jl-items li { padding: 3px 4px; border-bottom: 1px dashed var(--line); white-space: pre-wrap; }
.drm-jl-items li.link { cursor: pointer; color: var(--accent); }
.drm-jl-items li[aria-selected="true"] { background: var(--accent-dim); }
.drm-jl-items li.dead { color: var(--dim); }
.drm-figures { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; margin-top: 8px; }
.drm-extra { font-size: 13px; margin-top: 6px; }
.drm-scan { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; font-size: 13px; }
.drm-stats summary, .drm-listbox summary { cursor: pointer; margin-top: 8px; }
.drm-statgrid { display: flex; flex-wrap: wrap; gap: 12px; }
.drm-statgrid figure { margin: 0; max-width: 100%; }
.drm-cv { max-width: 100%; height: auto; border: 1px solid var(--line); display: block; }
.drm-listedit { width: 100%; max-width: 520px; font-family: ui-monospace, Menlo, Consolas, monospace; }
/* HFDL in the Utility modes: the channel table, the statistics' bars and hours, the SELCAL notes */
.ut-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.ut-table th, .ut-table td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ut-table th { color: var(--dim); font-weight: 600; position: sticky; top: 0; background: var(--panel); }
.ut-table td:nth-child(2) { white-space: normal; }
.ut-table tr:not(.on) td { color: var(--dim); }
.ut-stats { margin: 6px 4px 12px; }
.ut-stats h4 { margin: 4px 0; font-size: 13px; color: var(--accent); }
.ut-statrow { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 6px; align-items: center; font-size: 12px; padding: 1px 0; }
.ut-statrow.sub { padding-left: 14px; color: var(--dim); }
.ut-statk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ut-statv { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ut-bar { display: block; height: 8px; border-radius: 2px; background: var(--accent); min-width: 0; }
.ut-bar.thin { height: 4px; opacity: 0.6; }
.ut-hours { border-collapse: collapse; font-size: 11px; margin: 4px 0 6px; width: 100%; table-layout: fixed; }
.ut-hours th { font-weight: 400; color: var(--dim); text-align: left; padding: 1px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ut-hours tr th:first-child { width: 34%; }
.ut-hours td { height: 12px; border: 1px solid var(--line); }
.ut-hours td.on { background: var(--accent); }
.ut-note { display: flex; gap: 6px; align-items: center; font-size: 12px; margin-top: 4px; grid-column: 1 / -1; }
.ut-note input { flex: 1; min-width: 0; }
.ut-note-add { display: flex; gap: 6px; margin: 4px; }
.ac-gs { background: none; border: none; }
.ac-gs .ac-gs-i { display: block; width: 14px; height: 14px; margin: 2px; clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: var(--m-dim, #8b919b); opacity: 0.55; }
.ac-gs.heard .ac-gs-i { background: var(--m-accent, #ffb300); opacity: 1; }
.ut-tablewrap { overflow-x: auto; max-width: 100%; }
/* HFDL's Channel / Ground station / Auto choices, and the channel picked */
.ut-hfdlpick select { max-width: min(46vw, 330px); }
.ut-hfdlpick .ut-auto { color: var(--text); }
.ut-hfdlpick .ut-autotext { color: var(--dim); }
.ut-table tr.pick td { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
.confirm-dlg { width: min(420px, calc(100vw - 32px)); }
.confirm-text { padding: 6px 0 10px; overflow-wrap: anywhere; }
.confirm-row { justify-content: flex-end; }

/* the Broadcasts dialog (eibi.js) */
.eibi-dlg { width: min(860px, calc(100vw - 32px)); }
.eibi-q { flex: 1 1 220px; min-width: 0; }
.eibi-count { color: var(--dim); font-size: 12px; margin: 6px 0 2px; }
.eibi-dlg .dlg-help { margin: -4px 0 6px; }
.eibi-list { max-height: min(52vh, 520px); overflow-y: auto; border-top: 1px solid var(--line); }
.eibi-row {
  display: grid; grid-template-columns: 64px 82px minmax(0, 1.2fr) minmax(0, 0.7fr) minmax(0, 1.6fr);
  gap: 8px; align-items: baseline; padding: 4px 6px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.eibi-row:hover { background: var(--panel2); }
.eibi-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eibi-f, .eibi-t { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-align: right; }
.eibi-t { color: var(--dim); }
.eibi-d { color: var(--dim); font-size: 12px; }
.eibi-row.live .eibi-t { color: var(--ok); }
.eibi-row.on { color: var(--accent); }
@media (max-width: 600px) {
  .eibi-row { grid-template-columns: 58px 76px minmax(0, 1fr); row-gap: 0; }
  .eibi-l { grid-column: 3; }
  .eibi-d { grid-column: 1 / -1; white-space: normal; }
}

/* Space weather: the indicator beside Bands and its dialog */
.swx-chip { font: 12px ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; }
.swx-chip .swx-dot::before { content: '\00b7'; margin: 0 5px; color: var(--dim); }
.swx-chip .swx-sp::before { content: ' '; white-space: pre; }
.swx-ok { color: inherit; }
.swx-warn { color: var(--accent); }
.swx-bad { color: var(--err); }
.swx-dlg { width: min(860px, calc(100vw - 32px)); }
.swx-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.swx-head .mc-dlg-sub { flex: 1 1 auto; margin: 0; }
.swx-head button { flex: none; }
.swx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 6px; margin-bottom: 10px; }
.swx-tile { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; min-width: 0; }
.swx-tile-k { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swx-tile-v { font: 600 18px ui-monospace, Menlo, Consolas, monospace; }
.swx-tile-s { font-size: 11px; color: var(--dim); overflow-wrap: anywhere; }
.swx-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.swx-charts canvas { height: 110px; }
.swx-scroll { overflow-x: auto; }
.swx-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.swx-table th { text-align: left; color: var(--dim); font-weight: 400; border-bottom: 1px solid var(--line); padding: 2px 6px; white-space: nowrap; }
.swx-table td { padding: 3px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.swx-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.swx-fc td:first-child { white-space: nowrap; }
.swx-band { font-weight: 600; white-space: nowrap; }
.swx-o { white-space: nowrap; width: 56px; }
.swx-table th.swx-cur { color: var(--text); font-weight: 600; }
.swx-table td.swx-cur { box-shadow: inset 2px 0 0 var(--accent); }
.swx-s3 { color: var(--ok); }
.swx-s2 { color: var(--text); }
.swx-s1 { color: var(--accent); }
.swx-s0 { color: var(--dim); }
.swx-heard { color: var(--dim); overflow-wrap: anywhere; }
.swx-heard.on { color: var(--text); }
.swx-beat { display: inline-block; font-size: 11px; padding: 0 5px; border: 1px solid var(--ok); color: var(--ok); border-radius: 3px; }
@media (max-width: 700px) {
  .swx-charts { grid-template-columns: minmax(0, 1fr); }
  .swx-tile-v { font-size: 16px; }
}

/* Recordings dialog (recs.js) */
.recs-dlg { width: min(760px, calc(100vw - 32px)); }
.recs-storage { color: var(--dim); font-size: 12px; margin-bottom: 6px; overflow-wrap: anywhere; }
.recs-storage.recs-low { color: var(--err); }
.recs-filter input[type=search] { flex: 1 1 200px; min-width: 0; }
.recs-list { max-height: 55vh; overflow-y: auto; }
.recs-group { font-weight: 600; margin-top: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.recs-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.recs-main { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.recs-sub { color: var(--dim); font-size: 12px; }
.recs-note { font-size: 12px; font-style: italic; white-space: pre-wrap; }
.recs-acts { display: flex; flex-wrap: wrap; gap: 4px; }
.recs-edit { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.recs-edit label { display: flex; gap: 6px; align-items: flex-start; }
.recs-edit input, .recs-edit textarea { flex: 1; min-width: 0; }
.recs-player { border: 1px solid var(--line); border-radius: 6px; padding: 6px; margin: 6px 0; }
.recs-pl-title { font-size: 12px; margin-bottom: 4px; overflow-wrap: anywhere; }
.recs-wave { display: block; width: 100%; height: 56px; cursor: pointer; }
.recs-audio { flex: 1 1 240px; min-width: 0; max-width: 100%; height: 36px; }

/* squelch lamp: main Squelch switch and each extra receiver */
.sq-lamp {
  display: inline-block; min-width: 46px; padding: 0 5px; border-radius: 3px; text-align: center;
  font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); border: 1px solid var(--line);
}
.sq-lamp.open { color: var(--ok); border-color: var(--ok); }
.sq-lamp[hidden] { display: none; }

/* A shared server receiver: who is in control, and Take control */
.iqd-ctl { display: inline-flex; align-items: center; gap: 6px; }

/* SATS (satui.js, satmap.js) */
.dop-badge { color: var(--plot-decode); border-color: var(--plot-decode); font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: none; }
.dop-badge[hidden] { display: none; }
body:not(.sat-mode) .sat-only { display: none !important; }
@media (min-width: 1100px) { .fmpanel#satPanel { width: 360px; } }
.sat-card { gap: 6px; }
.sat-where { margin-left: auto; font-size: 12px; color: var(--dim); display: inline-flex; gap: 6px; align-items: center; }
.linkish { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: 12px; }
.sat-loc { border: 1px solid var(--accent-dim); border-radius: 4px; padding: 8px 10px; background: var(--panel2); display: flex; flex-direction: column; gap: 6px; }
.sat-loc[hidden] { display: none; }
.sat-loc-text { font-size: 13px; }
.sat-loc-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sat-grid { display: inline-flex; gap: 4px; }
.sat-loc-msg { font-size: 12px; color: var(--accent); }
.sat-loc-msg:empty { display: none; }
.sat-body { display: flex; gap: 14px; align-items: flex-start; }
.sat-sky { flex: none; width: 170px; height: 170px; }
.sat-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sat-head { font-size: 15px; font-weight: 600; }
.sat-live { font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--text); }
.sat-live:empty, .sat-head:empty { display: none; }
.sat-dop { font-weight: 600; }
.sat-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sat-actions:has(button[hidden]):has(span:empty) { display: none; }
#btnSatArm[aria-pressed=true] { border-color: var(--plot-decode); color: var(--plot-decode); }
.sat-txs { display: flex; flex-direction: column; gap: 2px; }
.sat-tx { display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr) auto auto; gap: 2px 10px; align-items: center; padding: 3px 0; border-top: 1px solid var(--line); font-size: 12px; }
.sat-tx.def .sat-tx-f { color: var(--accent); }
.sat-tx-f { font: 600 13px ui-monospace, Menlo, Consolas, monospace; }
.sat-tx-m { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sat-tx-r { grid-column: 2; grid-row: 2; color: var(--dim); }
.sat-tx-d { grid-column: 3; grid-row: 1 / span 2; font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--plot-decode); white-space: nowrap; }

.sat-data { font-size: 11px; }
.sat-tx-a { grid-column: 3; grid-row: 2; font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--dim); white-space: nowrap; text-align: right; }
.sat-tx-a.on { color: var(--ok); font-weight: 700; }
.sat-tx-b { grid-column: 4; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 3px; }
.sat-pk { border-top: 1px solid var(--line); padding-top: 4px; }
.sat-pk[hidden] { display: none; }
.sat-pk-head { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.sat-pk-list { max-height: 150px; overflow-y: auto; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; }
.sat-pk-row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sat-pk-row .t { color: var(--dim); margin-right: 6px; }
.sat-pk-row .s { color: var(--accent); margin-right: 6px; }
.sat-auto { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sat-auto .check { font-weight: 600; }
.sat-tx-dec { font-size: 11px; max-width: 210px; }
.sat-dec { border-top: 1px solid var(--line); padding-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.sat-dec[hidden] { display: none; }
.sat-dec-body { display: flex; flex-direction: column; gap: 4px; }
.sat-dec-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sat-dec-picbox { max-height: min(60vh, 640px); overflow-y: auto; border: 1px solid var(--line); background: #000; }
.sat-dec-pic { display: block; width: 100%; height: auto; }
.sat-dec-last { font: 12px ui-monospace, Menlo, Consolas, monospace; }
.sat-dec-vals summary { cursor: pointer; font-size: 12px; color: var(--dim); }
.sat-dec-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 16px; font-size: 12px; max-height: 260px; overflow-y: auto; max-width: 420px; }
.sat-dec-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; font-size: 12px; }
.sat-dec-kv .k { color: var(--dim); }
.sat-dec-kv .v { font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.sat-dec-grid .v { font-family: ui-monospace, Menlo, Consolas, monospace; text-align: right; }
.sat-dec-grid .h { grid-column: 1 / -1; margin-top: 4px; color: var(--dim); font-weight: 600; }
.sat-dec-grid .v.bad, .sat-dec-table td.bad { color: var(--dim); }
.sat-dec-vals > button { margin: 4px 0; }
.sat-dec-table { max-height: 220px; overflow: auto; max-width: 100%; }
.sat-dec-table table { border-collapse: collapse; font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace; }
.sat-dec-table th { position: sticky; top: 0; background: var(--panel); font-weight: 600; text-align: right; vertical-align: bottom; padding: 0 6px; max-width: 7em; white-space: normal; }
.sat-dec-table td { text-align: right; padding: 0 6px; white-space: nowrap; }
.sat-dec-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.sat-dec-thumb { display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: var(--dim); text-decoration: none; }
.sat-dec-thumb img { width: 100%; height: 72px; object-fit: cover; object-position: top; background: #000; border: 1px solid var(--line); }
.sat-dec-pic { cursor: zoom-in; }
.sat-dec-ghead { justify-content: space-between; margin-top: 4px; }
.sat-dec-thumb button { font-size: 11px; padding: 1px 6px; }
.sat-dec-thumb img { cursor: zoom-in; }
.sat-pic-dlg { width: min(1640px, calc(100vw - 32px)); max-height: 94vh; }
.sat-pic-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.sat-pic-bar .mc-dlg-sub { margin: 0 auto 0 0; }
.sat-pic-view { overflow: auto; max-height: calc(94vh - 90px); background: #000; }
.sat-pic-view img { display: block; width: 100%; height: auto; }
.sat-pic-view.full img { width: auto; max-width: none; }
.sky-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.sky-lbl { fill: var(--dim); font: 11px sans-serif; }
.sky-el { fill: var(--plot-label); font: 9px sans-serif; }
.sky-path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.sky-aos { fill: var(--ok); }
.sky-los { fill: var(--err); }
.sky-now { fill: var(--plot-decode); stroke: var(--panel); stroke-width: 2; }
.satrow.sel { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.sat-chance { font-weight: 600; }
.sat-chance.q3 { color: var(--ok); } .sat-chance.q2 { color: var(--accent); } .sat-chance.q1, .sat-chance.q0 { color: var(--err); }
.badge.q0 { opacity: 1; color: var(--err); border-color: #7a3030; }
.sat-more summary { cursor: pointer; padding: 6px 8px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .sat-body { flex-direction: column; align-items: center; }
  .sat-main { width: 100%; }
  .sat-tx { grid-template-columns: minmax(0, 1fr) auto; }
  .sat-tx-m, .sat-tx-r { grid-column: 1 / -1; grid-row: auto; }
  .sat-tx-d { grid-column: 1; grid-row: auto; }
  .sat-tx-b { grid-column: 2; grid-row: 1; }
  .sat-tx-a { grid-column: 2; grid-row: auto; }
  .sat-where { margin-left: 0; }
}
/* the map's Satellites layer */
.sat-dot { fill: var(--m-dim, #8b919b); fill-opacity: 0.8; stroke: #000; stroke-opacity: 0.5; }
.sat-dot.feat { fill: #6fd0ff; }
.sat-dot.up { fill: #5fd38a; }
.sat-dot.sel { fill: #ffb300; fill-opacity: 1; stroke: #fff; stroke-width: 2; stroke-opacity: 1; }
.sat-track { stroke: #ffb300; fill: none; }
.sat-track.past { stroke-opacity: 0.55; }
.sat-foot { stroke: #ffb300; fill: #ffb300; fill-opacity: 0.08; }
.leaflet-tooltip.sat-label { background: rgba(16, 17, 20, 0.75); color: #fff; border: none; box-shadow: none; padding: 0 4px; font: 11px ui-monospace, Menlo, Consolas, monospace; }
.leaflet-tooltip.sat-label.sel { color: #ffb300; font-weight: 700; }
.leaflet-tooltip.sat-label::before { display: none; }
.mapview[data-layer=sats] .tx-only { display: none !important; }
.mapview[data-layer=sats] .map-note { display: none; }
.sat-sw { display: block; width: 10px; height: 10px; border-radius: 50%; background: #8b919b; }
.sat-sw.feat { background: #6fd0ff; }
.sat-sw.up { background: #5fd38a; }
.satmaprow .ship-sub { grid-column: 2 / -1; }
.sat-txmore summary { cursor: pointer; font-size: 12px; color: var(--dim); padding: 3px 0; }
.sat-txmore[hidden] { display: none; }
.sat-map-info { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); }
.sat-map-info:empty { display: none; }
.sat-map-name { font-weight: 700; color: var(--accent); }
.sat-map-hint { font-size: 12px; color: var(--accent); }
.sat-map-pass { font-weight: 700; font-size: 13px; }
.sat-map-chance { font-size: 12px; }
.sat-map-chance.q3, .sat-map-q.q3 { color: var(--ok); } .sat-map-chance.q2, .sat-map-q.q2 { color: var(--accent); }
.sat-map-chance.q1, .sat-map-chance.q0, .sat-map-q.q1, .sat-map-q.q0 { color: var(--err); }
.sat-map-q { font-weight: 700; font-size: 12px; align-self: center; }
.sat-map-sep { padding: 6px 8px 2px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--m-line, var(--line)); }
