@font-face {
  font-family: 'DSEG7';
  src: url('https://cdn.jsdelivr.net/npm/dseg@0.46.0/fonts/DSEG7-Classic/DSEG7Classic-Bold.woff2') format('woff2');
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #05080d;
  --panel: rgba(14, 20, 30, 0.86);
  --panel-2: #121a26;
  --panel-3: #18222f;
  --line: rgba(148, 163, 184, 0.11);
  --line-2: rgba(148, 163, 184, 0.2);
  --text: #e6edf6;
  --text-2: #a3b1c6;
  --text-3: #66758b;
  --cyan: #22d3ee;
  --cyan-2: #67e8f9;
  --cyan-bg: rgba(34, 211, 238, 0.1);
  --amber: #fbbf24;
  --amber-2: #fcd34d;
  --amber-glow: rgba(251, 191, 36, 0.45);
  --green: #34d399;
  --red: #f43f5e;
  --violet: #a78bfa;
  --radius: 14px;
  --topbar-h: 64px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 8% -12%, rgba(34, 211, 238, 0.09), transparent 62%),
    radial-gradient(900px 480px at 102% -6%, rgba(251, 191, 36, 0.07), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(167, 139, 250, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
::selection { background: rgba(34, 211, 238, 0.3); }

/* ---------------- scrollbars ---------------- */
* { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.22) transparent; }

/* ---------------- banner ---------------- */
.banner {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding: 10px 16px; text-align: center; font-weight: 500;
  background: linear-gradient(90deg, #7c2d12, #9a3412); color: #fff7ed;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.banner code { font-family: var(--mono); background: rgba(0, 0, 0, 0.25); padding: 1px 6px; border-radius: 4px; }

/* ---------------- top bar ---------------- */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 15, 23, 0.95), rgba(8, 12, 19, 0.8));
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex-shrink: 1; overflow: hidden; }
.brand-text { min-width: 0; }
.clock, .status-chips, #btnSettings { flex-shrink: 0; }
.logo { width: 36px; height: 36px; filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.25)); }
.brand-text h1 { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: 0.01em; display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.brand-text h1 .by { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--amber); letter-spacing: 0.04em; }
.brand-text h1 .ver { align-self: center; font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--cyan-2); background: var(--cyan-bg); border: 1px solid rgba(34, 211, 238, 0.3); border-radius: 999px; padding: 1px 7px; letter-spacing: 0.02em; }
.brand-text p { margin: 1px 0 0; font-size: 11px; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; }

.status-chips { display: flex; gap: 8px; margin-left: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px; white-space: nowrap;
}
.chip .k { color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 10.5px; }
.chip .v { color: var(--text-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #3b4657; }
.chip[data-state="on"] .dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.chip[data-state="on"] .v { color: var(--text); }
.chip[data-state="warn"] .dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.chip[data-state="err"] .dot { background: var(--red); box-shadow: 0 0 10px var(--red); }
.chip[data-state="busy"] .dot { background: var(--cyan); animation: pulse 1s ease-in-out infinite; }
.chip.tx[data-state="armed"] { border-color: rgba(244, 63, 94, 0.45); }
.chip.tx[data-state="armed"] .dot { background: var(--red); }
.chip.tx[data-state="air"] { border-color: transparent; background: var(--red); box-shadow: 0 0 18px rgba(244, 63, 94, 0.7); }
.chip.tx[data-state="air"] .k, .chip.tx[data-state="air"] .v { color: #fff; }
.chip.tx[data-state="air"] .dot { background: #fff; animation: pulse 0.8s infinite; }

.clock { text-align: right; line-height: 1.15; }
.clock-utc { font-family: var(--mono); font-size: 21px; font-weight: 500; letter-spacing: 0.04em; color: var(--text); }
.clock-utc small { font-size: 10.5px; color: var(--cyan); margin-left: 5px; letter-spacing: 0.1em; font-weight: 700; }
.clock-sub { font-size: 11px; color: var(--text-3); font-family: var(--mono); }

/* ---------------- layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 300px;
  grid-template-areas: "left center right";
  gap: 14px;
  padding: 14px;
  height: calc(100dvh - var(--topbar-h));
}
.col { min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.col-left { grid-area: left; overflow-y: auto; padding-right: 2px; margin-right: -2px; }
.col-center { grid-area: center; min-width: 0; container-type: inline-size; }
.col-right { grid-area: right; overflow-y: auto; padding-right: 2px; margin-right: -2px; }
.top-row { display: grid; grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); gap: 14px; }
@container (max-width: 900px) {
  .top-row { grid-template-columns: 1fr; }
}

.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0) 120px), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 40px -20px rgba(0, 0, 0, 0.8);
  padding: 14px 16px 16px;
}
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 28px; }
.panel-h h2 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.h-actions { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }

/* ---------------- controls ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field-l { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.select-row { display: flex; gap: 6px; }
.select-row select { flex: 1; min-width: 0; }
select, input:not([type="range"]):not([type="checkbox"]) {
  height: 34px; padding: 0 10px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 9px;
  outline: none; min-width: 0;
  transition: border-color 0.15s;
}
select { padding-right: 28px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3b1c6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
  text-overflow: ellipsis;
}
select:hover, input:hover { border-color: rgba(148, 163, 184, 0.32); }
select:focus, input:focus { border-color: var(--cyan); }
option { background: #111925; }
.hint { margin: 2px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
.hint.warn { color: var(--amber); }
.hint:empty { display: none; }

.btn, .toggle, .icon-btn, .power {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text-2);
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover, .toggle:hover, .icon-btn:hover, .power:hover { border-color: rgba(148, 163, 184, 0.35); color: var(--text); background: var(--panel-3); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.ghost { background: transparent; }
.btn.danger { color: #fda4af; }
a.btn { text-decoration: none; }
.btn.primary {
  color: #03222a; font-weight: 600; border-color: transparent;
  background: linear-gradient(180deg, #5eead4, #22d3ee);
  box-shadow: 0 6px 18px -8px rgba(34, 211, 238, 0.8);
}
.btn.primary:hover { color: #021a20; background: linear-gradient(180deg, #99f6e4, #38dcf2); }
.btn.primary.live {
  color: #fff; background: linear-gradient(180deg, #fb7185, #e11d48);
  box-shadow: 0 6px 18px -8px rgba(244, 63, 94, 0.9);
}
.icon-btn { width: 34px; padding: 0; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn svg { width: 17px; height: 17px; }
.toggle.on { color: var(--cyan-2); border-color: rgba(34, 211, 238, 0.5); background: var(--cyan-bg); box-shadow: inset 0 0 12px rgba(34, 211, 238, 0.08); }
.toggle.rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); opacity: 0.6; }
.toggle.rec.on { color: #fecdd3; border-color: rgba(244, 63, 94, 0.55); background: rgba(244, 63, 94, 0.12); }
.toggle.rec.on i { opacity: 1; animation: pulse 1s infinite; box-shadow: 0 0 8px var(--red); }

.power { height: 32px; padding: 0 14px 0 11px; font-weight: 600; color: var(--text); }
.power svg { width: 15px; height: 15px; stroke-width: 2.2; }
.power[aria-pressed="true"] {
  color: #052e1c; border-color: transparent;
  background: linear-gradient(180deg, #6ee7b7, #34d399);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15), 0 6px 20px -6px rgba(52, 211, 153, 0.8);
}

.seg { display: flex; padding: 3px; gap: 3px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; }
.seg button {
  flex: 1; height: 28px; padding: 0 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-3); cursor: pointer; font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: linear-gradient(180deg, #243245, #1b2635); color: var(--cyan-2); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 2px 6px rgba(0, 0, 0, 0.4); }
.seg.sm button { height: 26px; font-size: 11.5px; padding: 0 10px; }
.seg.xs { padding: 2px; }
.seg.xs button { height: 22px; font-size: 11px; padding: 0 8px; }

.sub { margin: 16px 0 8px; font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: 0.04em; display: flex; align-items: baseline; gap: 8px; }
.sub em { font-style: normal; font-weight: 400; color: var(--text-3); font-size: 10.5px; letter-spacing: 0; }
.panel-h + .sub { margin-top: 0; }
.chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-bottom: 10px; }
.chips button {
  height: 28px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  font-family: var(--mono); font-size: 11.5px; cursor: pointer;
}
.chips button:hover { color: var(--text); border-color: rgba(148, 163, 184, 0.35); }
.chips button.on { color: var(--amber); border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.08); }

.slider { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; margin: 6px 0 8px; }
.slider label { font-size: 12px; color: var(--text-3); }
.slider output, .row-inline output { font-family: var(--mono); font-size: 11.5px; color: var(--text); text-align: right; }
.slider input { grid-column: 1 / -1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.row-inline { display: grid; grid-template-columns: auto 1fr 60px; align-items: center; gap: 10px; }

input[type="range"] {
  --fill: 50%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 18px; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--cyan) 0 var(--fill), rgba(148, 163, 184, 0.18) var(--fill) 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: #e6f9fd; border: 2px solid var(--cyan); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15), 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(148, 163, 184, 0.18); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--cyan); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #e6f9fd; border: 2px solid var(--cyan); }

.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: 4px 0 8px; cursor: pointer; }
.check input { accent-color: var(--cyan); width: 15px; height: 15px; }

/* ---------------- knobs ---------------- */
.knobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: -2px 0 12px; }
.knob { display: flex; flex-direction: column; align-items: center; cursor: ns-resize; user-select: none; touch-action: none; border-radius: 12px; padding: 4px 0; outline: none; }
.knob:focus-visible { box-shadow: 0 0 0 2px var(--cyan); }
.knob svg { width: 70px; height: 70px; overflow: visible; }
.knob .k-track { stroke: rgba(148, 163, 184, 0.16); stroke-width: 4.5; }
.knob .k-val { stroke: var(--cyan); stroke-width: 4.5; filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.7)); }
.knob .k-cap { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6)); }
.knob .k-ptr { stroke: var(--text); stroke-width: 2.6; }
.knob.active .k-val, .knob:hover .k-val { stroke: var(--cyan-2); }
.knob .k-readout { font-family: var(--mono); font-size: 12px; margin-top: 2px; color: var(--text); }
.knob .k-label { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 1px; }
#knobVolume .k-val { stroke: var(--amber); filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6)); }
#knobVolume.active .k-val, #knobVolume:hover .k-val { stroke: var(--amber-2); }

/* ---------------- meters ---------------- */
.meters { display: flex; flex-direction: column; gap: 7px; }
.meter { display: grid; grid-template-columns: 34px 1fr 56px; align-items: center; gap: 8px; }
.ml { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-3); }
.mv { font-family: var(--mono); font-size: 11px; color: var(--text-2); text-align: right; }
.mbar { position: relative; height: 8px; border-radius: 5px; overflow: hidden; background: rgba(148, 163, 184, 0.1); }
.mbar .fill {
  position: absolute; inset: 0; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, #0ea5e9 0%, #22d3ee 55%, #a3e635 78%, #fbbf24 88%, #f43f5e 100%);
  background-size: var(--w, 100%) 100%;
  transition: transform 0.06s linear;
}
.mbar .peak { position: absolute; top: 0; bottom: 0; width: 2px; left: 0; background: #fff; opacity: 0.8; transition: left 0.1s; }
.meter.agc .fill { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.meter.agc .peak { display: none; }

.vadbar { position: relative; height: 22px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line-2); overflow: hidden; }
.vad-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, rgba(34, 211, 238, 0.15), rgba(34, 211, 238, 0.45)); transition: transform 0.08s linear; }
.vadbar.active .vad-fill { background: linear-gradient(90deg, rgba(52, 211, 153, 0.25), rgba(52, 211, 153, 0.7)); }
.vad-thr { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.vadbar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.vadbar.active span { color: #d1fae5; }

/* ---------------- VFO ---------------- */
.vfo { display: flex; flex-direction: column; gap: 12px; }
.vfo-head { display: flex; align-items: center; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-2); background: rgba(148, 163, 184, 0.1); border: 1px solid var(--line);
}
.badge.mode { font-family: var(--mono); font-weight: 700; color: var(--amber); background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.25); text-shadow: 0 0 8px var(--amber-glow); letter-spacing: 0.08em; }
.badge.band { color: var(--cyan-2); background: var(--cyan-bg); border-color: rgba(34, 211, 238, 0.25); }
.badge.warn { color: var(--amber); }
.txrx {
  height: 22px; padding: 0 10px; border-radius: 6px; display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  color: #052e1c; background: var(--green); box-shadow: 0 0 12px rgba(52, 211, 153, 0.45);
}
.txrx[data-tx="1"] { color: #fff; background: var(--red); box-shadow: 0 0 14px rgba(244, 63, 94, 0.7); }
.txrx[data-tx="off"] { color: var(--text-3); background: rgba(148, 163, 184, 0.12); box-shadow: none; }

.lcd {
  position: relative; display: flex; align-items: baseline; justify-content: flex-end; gap: 10px;
  padding: 14px 18px 12px;
  border-radius: 12px;
  background: radial-gradient(130% 160% at 50% -10%, #1c1504 0%, #0d0a03 55%, #080601 100%);
  border: 1px solid rgba(251, 191, 36, 0.18);
  box-shadow: inset 0 0 40px rgba(251, 191, 36, 0.05), inset 0 2px 0 rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.4);
  cursor: ns-resize; user-select: none; overflow: hidden;
}
.lcd::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.lcd-num { position: relative; font-family: 'DSEG7', var(--mono); font-size: clamp(36px, 3.3vw, 52px); line-height: 1; white-space: nowrap; }
.lcd-ghost { position: absolute; right: 0; top: 0; color: rgba(251, 191, 36, 0.07); white-space: pre; }
.lcd-digits { position: relative; white-space: pre; color: var(--amber); text-shadow: 0 0 14px var(--amber-glow), 0 0 2px rgba(255, 243, 200, 0.6); }
.lcd-digits .d { transition: color 0.1s; border-radius: 3px; }
.lcd-digits .d:hover { color: #fff3c4; background: rgba(251, 191, 36, 0.08); }
.lcd-digits.dim { color: rgba(251, 191, 36, 0.35); text-shadow: none; }
.lcd-unit { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: rgba(251, 191, 36, 0.6); }
.lcd-edit { position: absolute; inset: 8px; display: flex; z-index: 2; }
.lcd-edit input { flex: 1; height: auto !important; font-family: var(--mono); font-size: 24px; text-align: right; color: var(--amber) !important; background: rgba(8, 6, 1, 0.95) !important; border-color: var(--amber) !important; }

.smeter { display: grid; grid-template-columns: 1fr 88px; align-items: end; gap: 10px; }
.smeter canvas { width: 100%; height: 34px; display: block; }
.smeter-v { font-family: var(--mono); font-size: 13px; color: var(--text); text-align: right; padding-bottom: 2px; white-space: nowrap; }
.smeter-v small { color: var(--text-3); font-size: 10.5px; }

.vfo-foot { display: flex; flex-direction: column; gap: 10px; }
.bands { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.bands button {
  height: 26px; border-radius: 7px; border: 1px solid var(--line-2); background: transparent; color: var(--text-3);
  font-family: var(--mono); font-size: 11px; cursor: pointer; padding: 0;
}
.bands button:hover { color: var(--text); border-color: rgba(148, 163, 184, 0.35); }
.bands button.on { color: var(--cyan-2); border-color: rgba(34, 211, 238, 0.55); background: var(--cyan-bg); }
.vfo-actions { display: flex; gap: 8px; align-items: center; }
.vfo-actions .seg { flex: 1; }

/* band plan */
.bandplan { display: flex; flex-direction: column; gap: 6px; margin-top: -2px; }
.bp-strip { position: relative; height: 22px; border-radius: 6px; overflow: hidden; background: #060a10; border: 1px solid var(--line); cursor: pointer; }
.bp-strip:hover { border-color: var(--line-2); }
.bp-segs { position: absolute; inset: 0; }
.bp-segs i { position: absolute; top: 0; bottom: 0; box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.55); }
.bp-segs b { position: absolute; top: 0; width: 1px; height: 7px; background: rgba(255, 255, 255, 0.75); }
.t-cw { background: linear-gradient(180deg, rgba(56, 189, 248, 0.55), rgba(56, 189, 248, 0.2)); }
.t-nb { background: linear-gradient(180deg, rgba(167, 139, 250, 0.55), rgba(167, 139, 250, 0.2)); }
.t-digi { background: repeating-linear-gradient(135deg, rgba(167, 139, 250, 0.45) 0 4px, rgba(167, 139, 250, 0.2) 4px 8px); }
.t-all, .t-ssb { background: linear-gradient(180deg, rgba(251, 191, 36, 0.5), rgba(251, 191, 36, 0.18)); }
.t-beacon { background: rgba(244, 63, 94, 0.55); }
.t-fm { background: linear-gradient(180deg, rgba(45, 212, 191, 0.5), rgba(45, 212, 191, 0.18)); }
.t-sat { background: repeating-linear-gradient(135deg, rgba(100, 116, 139, 0.5) 0 4px, rgba(100, 116, 139, 0.2) 4px 8px); }
.bp-sig { position: absolute; top: 4px; bottom: 4px; min-width: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.45); }
.bp-cursor { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.9); }
.bandplan.bad .bp-sig { background: rgba(244, 63, 94, 0.85); }
.bandplan.bad .bp-cursor { background: #fecdd3; box-shadow: 0 0 10px var(--red); }
.bandplan.off .bp-strip, .bandplan.off .bp-scale { display: none; }
.bp-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--text-3); margin-top: -2px; }
.bp-scale span:nth-child(2) { color: var(--text-2); }
.bp-info { display: flex; align-items: baseline; gap: 8px; min-height: 17px; }
.bp-seg { font-size: 12.5px; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.bp-seg i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.bp-spot { font-family: var(--mono); font-size: 11px; color: var(--cyan-2); }
.bp-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bp-modes { display: flex; gap: 4px; flex-wrap: wrap; }
.mchip { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 5px; color: var(--text-2); background: rgba(148, 163, 184, 0.1); border: 1px solid var(--line); }
.mchip.on { color: #052e1c; background: var(--green); border-color: transparent; box-shadow: 0 0 10px rgba(52, 211, 153, 0.4); }
.mchip.bad { color: #fff; background: var(--red); border-color: transparent; }
.mchip.none { color: var(--text-3); font-family: var(--font); font-weight: 500; font-style: italic; letter-spacing: 0; }
.pill { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-3); font-size: 11.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pill:hover { color: var(--text); border-color: rgba(148, 163, 184, 0.35); }
.pill svg { width: 13px; height: 13px; stroke-width: 2; }
.pill.on { color: var(--cyan-2); border-color: rgba(34, 211, 238, 0.5); background: var(--cyan-bg); }
.pill.guard.on { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.09); }
.badge.guard { color: #fff; background: var(--red); border-color: transparent; }

/* voice guard note in the transmit panel */
.guard-note { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: start; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; border: 1px solid rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.08); font-size: 12px; }
.guard-note svg { width: 18px; height: 18px; color: var(--amber); }
.gn-text b { display: block; color: var(--amber); font-size: 12.5px; margin-bottom: 2px; }
.gn-text span { color: #fde68a; opacity: 0.85; line-height: 1.4; }
.guard-note .btn { grid-column: 1 / -1; justify-self: end; }
.guard-note.over { border-color: rgba(244, 63, 94, 0.5); background: rgba(244, 63, 94, 0.08); }
.guard-note.over svg, .guard-note.over .gn-text b { color: #fda4af; }
.guard-note.flash { animation: noteFlash 0.5s 3; }
@keyframes noteFlash { 50% { box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.55); } }
.ptt.guarded:not(.live):not(:disabled) { border-color: rgba(251, 191, 36, 0.65); color: #fde68a; background: radial-gradient(120% 140% at 50% 0%, rgba(251, 191, 36, 0.14), rgba(251, 191, 36, 0.03) 70%), var(--panel-2); }
.btn.cat { height: 32px; }
.btn.cat.on { color: var(--green); border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.08); }

/* ---------------- scope ---------------- */
.scope { display: flex; flex-direction: column; min-width: 0; padding-bottom: 10px; }
.scope .panel-h { margin-bottom: 8px; flex-wrap: wrap; row-gap: 6px; }
.scope .h-actions { flex-wrap: wrap; justify-content: flex-end; }
.scope-wrap { position: relative; flex: 1; min-height: 210px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #02040a; }
.scope-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.scope-hint { margin: 7px 2px 0; font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-readout { font-family: var(--mono); font-size: 11.5px; color: var(--cyan-2); white-space: nowrap; }
.legend { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; margin-left: 4px; }
.lg-in { background: #38bdf8; }
.lg-out { background: var(--amber); box-shadow: 0 0 6px var(--amber); }

/* ---------------- transcript ---------------- */
.col-center { display: flex; flex-direction: column; }
.transcript { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 0; overflow: hidden; }
.tr-head { flex-wrap: wrap; }
.tr-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tr-controls select { height: 32px; font-size: 12.5px; max-width: 220px; }
.tr-tools { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.search { position: relative; display: flex; align-items: center; width: min(320px, 100%); }
.search svg { position: absolute; left: 10px; color: var(--text-3); width: 15px; height: 15px; pointer-events: none; }
.search input { width: 100%; height: 30px !important; padding-left: 32px !important; padding-right: 28px !important; font-size: 12.5px; }
.search button { position: absolute; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); cursor: pointer; font-size: 16px; line-height: 1; }
.search button:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.tr-count { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }

.tr-feed { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 4px 14px; margin: 0 -8px; scroll-behavior: auto; }
.empty { margin: auto; max-width: 420px; text-align: center; color: var(--text-3); padding: 44px 20px; }
.empty svg { width: 40px; height: 40px; color: var(--cyan); opacity: 0.6; stroke-width: 1.5; }
.empty h3 { margin: 10px 0 6px; font-size: 14px; color: var(--text-2); font-weight: 600; }
.empty p { margin: 0; line-height: 1.6; font-size: 12.5px; }
.empty b { color: var(--text-2); font-weight: 600; }
.empty.sm { padding: 18px 8px; font-size: 12px; line-height: 1.5; }

.daysep { display: flex; align-items: center; gap: 10px; margin: 12px 12px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.daysep::before, .daysep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.entry {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 2px 14px;
  margin: 2px 4px; padding: 10px 12px; border-radius: 11px; border: 1px solid transparent;
  animation: entryIn 0.35s ease-out;
}
.entry:hover { background: rgba(255, 255, 255, 0.022); border-color: var(--line); }
.entry.hl { background: rgba(251, 191, 36, 0.05); border-color: rgba(251, 191, 36, 0.22); }
.when { font-family: var(--mono); line-height: 1.3; padding-top: 1px; }
.when b { display: block; font-size: 14px; font-weight: 500; color: var(--text); }
.when span { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.06em; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.m-freq { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--amber); text-shadow: 0 0 10px rgba(251, 191, 36, 0.25); }
.m-mode, .m-band, .m-dur, .m-eng { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-3); padding: 1px 6px; border-radius: 5px; background: rgba(148, 163, 184, 0.08); }
.m-band { color: var(--cyan-2); background: var(--cyan-bg); }
.m-dur, .m-eng { font-family: var(--mono); font-weight: 500; letter-spacing: 0; background: transparent; padding: 0 2px; }
.m-spk { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: #1a1205; background: linear-gradient(180deg, #fde68a, #fbbf24); padding: 1px 7px 1px 5px; border-radius: 5px; cursor: pointer; }
.m-spk svg { width: 12px; height: 12px; stroke-width: 2.4; }
.m-play { margin-left: auto; height: 22px; width: 26px; border-radius: 6px; border: 1px solid var(--line-2); background: transparent; color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s; }
.m-play svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.m-dl { height: 22px; width: 26px; border-radius: 6px; border: 1px solid var(--line-2); background: transparent; color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s; }
.m-dl svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.entry:hover .m-dl { opacity: 1; }
.m-dl:hover { color: var(--cyan-2); border-color: rgba(34, 211, 238, 0.5); }
.entry:hover .m-play, .m-play.playing { opacity: 1; }
.m-play:hover, .m-play.playing { color: var(--cyan-2); border-color: rgba(34, 211, 238, 0.5); }
.text { font-size: 15.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.entry.tx { background: linear-gradient(90deg, rgba(244, 63, 94, 0.07), rgba(244, 63, 94, 0) 60%); border-left: 2px solid rgba(244, 63, 94, 0.6); border-radius: 4px 11px 11px 4px; }
.m-tx { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; color: #fff; background: var(--red); padding: 1px 6px; border-radius: 5px; }
.entry.pending .text { color: var(--text-3); font-style: italic; font-size: 13px; }
.entry.pending .text::after { content: ''; display: inline-block; width: 120px; height: 9px; margin-left: 8px; border-radius: 5px; vertical-align: middle; background: linear-gradient(90deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.25), rgba(148, 163, 184, 0.08)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }

.tag { display: inline-block; padding: 0 6px; margin: 0 1px; border-radius: 5px; font-family: var(--mono); font-size: 0.86em; font-weight: 600; line-height: 1.6; vertical-align: 0.05em; border: 1px solid transparent; }
.tag.call { cursor: pointer; font-weight: 700; color: #1a1205; background: linear-gradient(180deg, #fde68a, #f59e0b); border: 0; box-shadow: 0 0 12px -3px rgba(251, 191, 36, 0.7); }
.tag.call:hover { filter: brightness(1.12); }
.tag.call.spk { box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3), 0 0 14px -2px rgba(251, 191, 36, 0.8); }
.tag.call.phon { background: linear-gradient(180deg, #fde68a, #fbbf24); }
.tag.call.mine { color: #2e1065; background: linear-gradient(180deg, #ddd6fe, #a78bfa); box-shadow: 0 0 12px -3px rgba(167, 139, 250, 0.8); }
.tag.q { color: var(--cyan-2); background: var(--cyan-bg); border-color: rgba(34, 211, 238, 0.3); }
.tag.rpt { color: #6ee7b7; background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.35); }
.tag.loc { color: #c4b5fd; background: rgba(167, 139, 250, 0.1); border-color: rgba(167, 139, 250, 0.35); }

.jump {
  position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); z-index: 3;
  height: 30px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(34, 211, 238, 0.5);
  background: rgba(8, 20, 28, 0.92); color: var(--cyan-2); font-weight: 600; font-size: 12px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.tr-live {
  display: flex; align-items: center; gap: 10px; min-height: 46px;
  margin: 0 -16px; padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(6, 10, 16, 0.4), rgba(6, 10, 16, 0.85));
  border-radius: 0 0 var(--radius) var(--radius);
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #3b4657; flex: none; }
.tr-live[data-state="listen"] .live-dot { background: var(--cyan); box-shadow: 0 0 8px rgba(34, 211, 238, 0.6); }
.tr-live[data-state="voice"] .live-dot { background: var(--green); box-shadow: 0 0 12px var(--green); animation: pulse 0.8s ease-in-out infinite; }
.tr-live[data-state="busy"] .live-dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: pulse 1s ease-in-out infinite; }
.tr-live[data-state="err"] .live-dot { background: var(--red); }
.live-state { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.live-text { flex: 1; min-width: 0; color: var(--text-2); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-prog { width: 160px; height: 6px; border-radius: 4px; background: rgba(148, 163, 184, 0.14); overflow: hidden; flex: none; }
.live-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--amber)); transition: width 0.2s; }

/* ---------------- transmit ---------------- */
.txp { flex: none; }
.txp .knobs { margin: 2px 0 10px; }
.txp .seg { margin-bottom: 12px; }
.tx-meters { margin-bottom: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.row3 .toggle { padding: 0 6px; font-size: 12px; }
.arm { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px 0 11px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 600; cursor: pointer; }
.arm svg { width: 15px; height: 15px; stroke-width: 2.2; }
.arm:hover { border-color: rgba(244, 63, 94, 0.5); color: #fecdd3; }
.arm[aria-pressed="true"] { color: #fff; border-color: transparent; background: linear-gradient(180deg, #fb7185, #e11d48); box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15), 0 6px 20px -6px rgba(244, 63, 94, 0.8); }
.ptt {
  position: relative; width: 100%; min-height: 92px; padding: 12px; border-radius: 14px; cursor: pointer;
  display: grid; justify-items: center; align-content: center; gap: 4px; user-select: none; touch-action: none;
  color: #fecdd3; border: 1.5px solid rgba(244, 63, 94, 0.55);
  background: radial-gradient(120% 140% at 50% 0%, rgba(244, 63, 94, 0.16), rgba(244, 63, 94, 0.04) 70%), var(--panel-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 26px -14px rgba(244, 63, 94, 0.8);
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s;
}
.ptt svg { width: 24px; height: 24px; stroke-width: 2; }
.ptt-label { font-size: 14px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.ptt-sub { font-size: 11px; color: rgba(254, 205, 211, 0.7); font-family: var(--mono); }
.ptt:hover:not(:disabled) { background: radial-gradient(120% 140% at 50% 0%, rgba(244, 63, 94, 0.26), rgba(244, 63, 94, 0.06) 70%), var(--panel-2); }
.ptt:disabled { cursor: not-allowed; color: var(--text-3); border-color: var(--line-2); background: var(--panel-2); box-shadow: none; }
.ptt:disabled .ptt-sub { color: var(--text-3); }
.ptt.live {
  color: #fff; border-color: transparent; transform: scale(0.985);
  background: radial-gradient(120% 140% at 50% 0%, #fb7185, #be123c);
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.25), 0 0 40px rgba(244, 63, 94, 0.65);
}
.ptt.live .ptt-sub { color: #ffe4e6; }
.ptt.live svg { animation: pulse 0.9s ease-in-out infinite; }
.tx-stats { display: flex; justify-content: space-between; margin-top: 10px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--text-3); }
.tx-stats b { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--text); letter-spacing: 0; margin-left: 4px; }
body.on-air::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 40;
  box-shadow: inset 0 0 0 3px rgba(244, 63, 94, 0.9), inset 0 0 90px rgba(244, 63, 94, 0.28);
  animation: airGlow 1.4s ease-in-out infinite;
}
@keyframes airGlow { 50% { box-shadow: inset 0 0 0 3px rgba(244, 63, 94, 0.6), inset 0 0 60px rgba(244, 63, 94, 0.18); } }

/* ---------------- stations ---------------- */
.col-right .stations { flex: 1; min-height: 220px; display: flex; flex-direction: column; }
.count { font-family: var(--mono); font-size: 10.5px; color: var(--cyan-2); background: var(--cyan-bg); padding: 1px 7px; border-radius: 999px; letter-spacing: 0; }
.st-list { list-style: none; margin: 0 -8px; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.st {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; align-items: center;
  padding: 9px 10px; margin: 0 2px 2px; border-radius: 10px; cursor: pointer; border: 1px solid transparent;
  animation: entryIn 0.3s ease-out;
}
.st:hover { background: rgba(255, 255, 255, 0.03); border-color: var(--line); }
.st.on { background: rgba(251, 191, 36, 0.06); border-color: rgba(251, 191, 36, 0.3); }
.st-call { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--amber); letter-spacing: 0.02em; display: flex; align-items: center; gap: 6px; }
.st.mine .st-call { color: var(--violet); }
.st-call svg { width: 12px; height: 12px; color: var(--text-3); }
.st-cc { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--text-2); background: rgba(148, 163, 184, 0.12); border-radius: 4px; padding: 1px 5px; }
.st-country { font-size: 12px; color: var(--text-2); grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-meta { font-size: 11px; color: var(--text-3); font-family: var(--mono); grid-column: 1 / -1; }
.st-look { grid-row: 1 / 3; grid-column: 2; height: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 11px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.st-look:hover { color: var(--cyan-2); border-color: rgba(34, 211, 238, 0.45); }
.st-look svg { width: 11px; height: 11px; }

.rigcon { flex: none; padding-bottom: 12px; }
.rigcon summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.rigcon summary::-webkit-details-marker { display: none; }
.rigcon details[open] summary { margin-bottom: 10px; }
.rigcon .chev { width: 13px; height: 13px; transition: transform 0.15s; }
.rigcon details[open] .chev { transform: rotate(90deg); }
.rig-id { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.console {
  margin: 0; height: 170px; overflow-y: auto; padding: 8px 10px; border-radius: 9px;
  background: #03060b; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; line-height: 1.55; color: var(--text-3); white-space: pre-wrap; word-break: break-all;
}
.console .tx { color: var(--cyan-2); }
.console .rx { color: #a7f3d0; }
.console .err { color: #fda4af; }
.console .t { color: #3d4a5c; }

/* ---------------- dialog ---------------- */
dialog {
  padding: 0; border: 1px solid var(--line-2); border-radius: 16px; color: var(--text);
  background: #0d141e; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); width: min(1040px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(2, 4, 8, 0.6); backdrop-filter: blur(4px); }
.dlg header, .dlg footer { display: flex; align-items: center; gap: 8px; padding: 14px 18px; }
.dlg header { border-bottom: 1px solid var(--line); justify-content: space-between; }
.dlg header h2 { margin: 0; font-size: 15px; }
.dlg footer { border-top: 1px solid var(--line); }
.dlg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 18px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan-2); margin-bottom: 10px; padding: 0; }

/* ---------------- toasts ---------------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  padding: 11px 14px 11px 12px; border-radius: 11px; border: 1px solid var(--line-2); border-left: 3px solid var(--cyan);
  background: rgba(13, 20, 30, 0.97); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); font-size: 12.5px; line-height: 1.45;
  animation: toastIn 0.25s ease-out;
}
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast.ok { border-left-color: var(--green); }
.toast.out { opacity: 0; transform: translateY(6px); transition: 0.3s; }

/* ---------------- animations ---------------- */
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes entryIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 1500px) {
  .status-chips .chip .v { max-width: 130px; }
}
@media (max-width: 1360px) {
  body { overflow: auto; }
  .layout { grid-template-columns: 320px minmax(0, 1fr); grid-template-areas: "left center" "left right"; height: auto; }
  .col-left { overflow: visible; }
  .transcript { height: 72vh; flex: none; }
  .col-right { flex-direction: row; flex-wrap: wrap; align-items: flex-start; overflow: visible; }
  .col-right > .panel { flex: 1 1 300px; min-width: 0; }
  .st-list { max-height: 260px; }
}
@media (max-width: 1000px) {
  /* small screens: only the chips you act on (hub sign-in, uplink, transmit) */
  .status-chips > .chip:not(#chipHub):not(#chipUplink):not(#chipTx) { display: none; }
  .dlg-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .topbar { gap: 10px; padding: 0 16px; }
  .brand-text p, .clock-sub { display: none; }
  .brand-text h1 .by { display: none; }
  .clock { margin-left: auto; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "center" "left" "right"; padding: 12px 16px; }
  .top-row { grid-template-columns: minmax(0, 1fr); }
  .col-right { flex-direction: column; align-items: stretch; }
  .col-right > .panel { flex: none; }
  .dlg-grid { grid-template-columns: 1fr; }
  .bands { grid-template-columns: repeat(5, 1fr); }
  .entry { grid-template-columns: 1fr; }
  .when { display: flex; gap: 6px; align-items: baseline; }
  .when b { display: inline; }
  .scope-hint, .legend { display: none; }
}

/* ---------------- CW decoder ---------------- */
#bwPresets { grid-template-columns: repeat(4, 1fr); }
#bwPresets button[data-cw] { color: #6ee7b7; }
#bwPresets button[data-cw].on { color: #34d399; border-color: rgba(52, 211, 153, 0.55); background: rgba(52, 211, 153, 0.08); }
.cwseg { align-items: center; }
.cwseg .seg-l { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: #6ee7b7; padding: 0 4px 0 6px; }
.cwseg button.on { color: #34d399; }
.m-cw { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: #34d399; padding: 1px 6px; border-radius: 5px; background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.3); }
.text.cw { font-family: var(--mono); font-size: 14.5px; letter-spacing: 0.04em; }
.text.live::after { content: ''; display: inline-block; width: 8px; height: 1.05em; margin-left: 3px; vertical-align: -0.15em; background: #34d399; border-radius: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tr-live[data-state="cw"] .live-dot { background: #34d399; box-shadow: 0 0 12px #34d399; }
.tr-live.cw .live-text { font-family: var(--mono); font-style: normal; color: var(--text); letter-spacing: 0.03em; }
.st-dist { font-family: var(--mono); font-size: 11px; color: var(--cyan-2); }
.entry.weak .text.cw { color: var(--text-2); }
.entry.weak .m-cw { opacity: 0.7; }

/* ---------------- antenna SWR ---------------- */
.swr-open { width: 100%; justify-content: center; margin: 2px 0 10px; }
.swr-open svg { width: 16px; height: 16px; }
.swr-dlg { width: min(860px, calc(100vw - 32px)); }
.swr-band { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--cyan-2); margin-left: 8px; }
.swr-ctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px 0; }
.swr-steps { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.swr-plot { margin: 12px 18px 0; height: 300px; border: 1px solid var(--line); border-radius: 12px; background: #070c14; overflow: hidden; }
.swr-plot canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.swr-read { display: flex; align-items: center; gap: 18px; padding: 12px 18px 0; min-height: 52px; }
.swr-big { font-family: var(--mono); font-size: 34px; font-weight: 700; min-width: 92px; color: var(--text-3); }
.swr-big.good { color: #34d399; } .swr-big.ok { color: var(--amber); } .swr-big.bad { color: var(--red); }
.swr-facts { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.swr-facts b { color: var(--text); font-family: var(--mono); }
.swr-hint { margin: 10px 18px 16px; font-size: 12px; color: var(--text-3); }
.swr-hint.warn { color: var(--amber); }
#btnSwrSweep.stop, #btnSwrTune.stop { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------------- hub: account, radios, uplink ---------------- */
button.chip { font: inherit; font-size: 12px; cursor: pointer; background: transparent; }
button.chip:hover { border-color: rgba(148, 163, 184, 0.35); }
.hub-dlg { width: min(720px, calc(100vw - 32px)); }
.hub-dlg .dlg > :not(header) { margin-left: 18px; margin-right: 18px; }
.hub-dlg .dlg > :last-child { margin-bottom: 18px; }
.hub-dlg h3 { margin: 18px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan-2); }
.hub-dlg .hint { margin-top: 12px; font-size: 12.5px; }
.hub-dlg .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hub-dlg .row input { flex: 1 1 180px; min-width: 0; }
.hub-dlg .spacer { flex: 1; }
.hub-more { margin-top: 16px; font-size: 12.5px; color: var(--text-2); }
.hub-more summary { cursor: pointer; color: var(--text-3); }
.acct-who { margin: 16px 0 0; font-size: 14px; }
.acct-keys, .radio-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.acct-keys li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.acct-keys li small { color: var(--text-3); flex: 1; }
.acct-code, .key-box { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 12px; background: rgba(251, 191, 36, 0.06); font-size: 13px; }
.acct-code p, .key-box p { margin: 0 0 8px; color: var(--text-2); line-height: 1.5; }
.acct-code code, .key-box code { display: block; font-family: var(--mono); font-size: 15px; color: var(--amber-2); word-break: break-all; user-select: all; }
.key-box code { font-size: 12.5px; }
.radios-dlg .radio-list { margin-top: 12px; }
.radio-item { display: grid; grid-template-columns: 14px 1fr auto; gap: 4px 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.radio-item.on { border-color: rgba(34, 211, 238, 0.45); background: var(--cyan-bg); }
.bullet { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; }
.bullet.live { background: var(--green); box-shadow: 0 0 9px var(--green); }
.bullet.dead { background: var(--red); box-shadow: 0 0 9px rgba(244, 63, 94, 0.6); }
.ri-name { font-size: 14px; }
.ri-name small { color: var(--text-3); font-size: 12px; margin-left: 4px; }
.ri-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); }
.ri-status { margin-top: 5px; font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.ri-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 300px; }
.share-box { grid-column: 2 / -1; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.share-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; }
.share-row b { min-width: 90px; font-family: var(--mono); }
.share-row label { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); cursor: pointer; }
.share-row .share-name { flex: 1 1 160px; min-width: 120px; }
.uplink-box { margin-top: 16px; padding: 12px 14px; border: 1px solid rgba(52, 211, 153, 0.35); border-radius: 12px; background: rgba(52, 211, 153, 0.05); }
.uplink-box h3 { margin-top: 0; }
.uplink-state { margin: 0; font-size: 13px; line-height: 1.55; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; cursor: pointer; }
.txt-red { color: var(--red); } .txt-amber { color: var(--amber); }
@media (max-width: 640px) {
  .radio-item { grid-template-columns: 14px 1fr; }
  .ri-act { grid-column: 2; justify-content: flex-start; max-width: none; }
}
.acct-invite { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(34, 211, 238, 0.45); border-radius: 12px; background: var(--cyan-bg); font-size: 13.5px; line-height: 1.5; }
.acct-invite p { margin: 0; }
.key-box .key-how { margin: 14px 0 6px; }
.key-box code.cmd { font-size: 12.5px; color: var(--cyan-2); }
/* ---------------- touch and small screens ---------------- */
.lcd { touch-action: pan-y; }
.lcd-digits .d.hot { color: #fff7d6; background: rgba(251, 191, 36, 0.18); }
.tune-row { display: none; align-items: center; gap: 8px; margin: 10px 0 2px; }
.tune-btn { width: 56px; height: 44px; font-size: 24px; font-weight: 600; padding: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tune-steps { flex: 1; }
.tune-steps button { flex: 1; height: 44px; }
.ptt { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (hover: none), (max-width: 860px) {
  .tune-row { display: flex; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-text h1 { font-size: 15px; }
  .status-chips { gap: 6px; }
  .status-chips .chip { height: 30px; padding: 0 10px; }
  .status-chips .chip .k { display: none; }
  .status-chips .chip .v { max-width: 92px; }
  .clock-utc { font-size: 17px; }
  input:not([type="range"]):not([type="checkbox"]), select, textarea { font-size: 16px; }   /* no zoom on focus (iOS) */
  dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .hub-dlg .dlg > :not(header) { margin-left: 12px; margin-right: 12px; }
  .hub-dlg .row .btn { flex: 1 1 auto; }
}
@media (max-width: 420px) {
  .brand-text h1 { font-size: 0; }                               /* just the logo and the version */
  .brand-text h1 .ver { font-size: 11px; }
}
@media (max-width: 860px) {
  /* long device names in a select must not widen the page */
  .col > .panel, .col-right > .panel { min-width: 0; max-width: 100%; }
  select { min-width: 0; max-width: 100%; }
  .field, .select-row { min-width: 0; }
  .tr-tools { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
}
@media (max-width: 640px) {
  .brand, .brand-text { flex: none; min-width: max-content; }   /* the version badge stays whole */
  .status-chips { min-width: 0; }
}
@media (max-width: 420px) {
  .topbar { gap: 6px; }
  .clock-utc { font-size: 15px; }
  .status-chips .chip .v { max-width: 76px; }
}

/* ---------------- phone: an app with tabs (the sections are tagged with data-m, data-mo) ------- */
.mtabs { display: none; }
@media (max-width: 860px) {
  .topbar {
    position: sticky; top: 0; z-index: 30;
    height: calc(var(--topbar-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top);
    background: rgba(8, 12, 19, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  /* the three columns become one list, in the phone's order, one tab at a time */
  .layout { display: flex; flex-direction: column; gap: 12px; height: auto; padding: 10px 10px calc(84px + env(safe-area-inset-bottom)); }
  .col, .top-row { display: contents; }
  .layout .panel[data-m] { order: 9; margin: 0; }
  .layout .panel[data-mo="1"] { order: 1; }
  .layout .panel[data-mo="2"] { order: 2; }
  .layout .panel[data-mo="3"] { order: 3; }
  .layout .panel[data-mo="4"] { order: 4; }
  body[data-m="radio"] .panel[data-m]:not([data-m="radio"]),
  body[data-m="scribe"] .panel[data-m]:not([data-m="scribe"]),
  body[data-m="talk"] .panel[data-m]:not([data-m="talk"]),
  body[data-m="stations"] .panel[data-m]:not([data-m="stations"]),
  body[data-m="more"] .panel[data-m]:not([data-m="more"]) { display: none !important; }
  /* a tab fills the screen: the transcript and the station list scroll inside it */
  body[data-m="scribe"] .transcript { height: calc(100dvh - var(--topbar-h) - 108px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 320px; flex: none; }
  body[data-m="stations"] .stations { min-height: calc(100dvh - var(--topbar-h) - 108px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  body[data-m="stations"] .st-list { max-height: none; }
  /* the PTT stays in reach above the tab bar while the transmit settings scroll */
  body[data-m="talk"] .ptt { min-height: 112px; position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 5; box-shadow: 0 -10px 24px -8px rgba(5, 8, 13, 0.9); }
  .mtabs {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: rgba(8, 12, 19, 0.96); border-top: 1px solid var(--line-2);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .mtabs button {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 0 5px; border: 0; border-radius: 12px; background: none; color: var(--text-3);
    font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  }
  .mtabs svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mtabs button.on { color: var(--cyan-2); background: var(--cyan-bg); }
  .mdot { position: absolute; top: 5px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
  .mdot.tx { background: var(--red); box-shadow: 0 0 8px var(--red); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
/* opened from the home screen: no browser bars, so keep clear of the notch */
@media (display-mode: standalone) and (max-width: 860px) {
  body { overscroll-behavior-y: none; }
}
