/* SPDX-License-Identifier: GPL-3.0-or-later */
:root {
  --bg: #0b0e16;
  --panel: #131926;
  --line: #222b3b;
  --text: #d6deeb;
  --dim: #7b879c;
  --accent: #5aa0ff;
  --accent-bg: #1d3a66;
  --warn: #ffb347;
  --bad: #ff5a5a;
  --ok: #5ad17a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.3 system-ui, sans-serif; }
#app { display: flex; flex-direction: column; height: 100dvh; }
header, footer { background: var(--panel); border-color: var(--line); border-style: solid; border-width: 0; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 6px 16px; border-bottom-width: 1px; }
footer { border-top-width: 1px; }
main { display: flex; flex: 1; min-height: 200px; }
main .view { position: relative; flex: 1; min-width: 0; }

.freq { font: 600 30px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.02em; cursor: text; user-select: none; min-width: 9ch; }
.freq .digit { padding: 0 0.02em; border-radius: 3px; }
.freq .digit:hover { background: var(--accent-bg); }
.freq .sep { color: var(--dim); }
.freq .unit { font-size: 13px; color: var(--dim); margin-left: 6px; font-weight: 400; }
.freq-input { background: var(--bg); color: var(--text); border: 1px solid var(--accent); border-radius: 4px; padding: 2px 6px; width: 12ch; font-size: 24px; }

.group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
button { background: #1a2232; color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px; font: inherit; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button.on { background: var(--accent-bg); border-color: var(--accent); }
button:disabled { opacity: 0.4; cursor: default; }
label { display: flex; align-items: center; gap: 4px; color: var(--dim); }
input[type="range"] { width: 90px; accent-color: var(--accent); }
.num { font-variant-numeric: tabular-nums; color: var(--dim); min-width: 4ch; }

.group button.am { min-width: 5ch; }
.users-ctl { position: relative; }
.users-ctl input.name { width: 10ch; }
.users-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 10; max-height: 60vh; overflow: auto; padding: 6px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); font-size: 13px; }
.users-pop thead th { padding-top: 6px; }
.users-pop tr.pick { cursor: pointer; }
.users-pop tr.pick:hover td { background: var(--accent-bg); }
.users-pop tr.me td { color: #ff8a8a; }
.labels-ctl { position: relative; }
header .labels-pop { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; }
.labels-pop { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 10; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); font-size: 13px; white-space: nowrap; }
.labels-opts { display: flex; flex-direction: column; gap: 6px; }
.labels-opts label { display: flex; align-items: center; gap: 6px; }
.labels-opts p { margin: 2px 0 0; font-size: 12px; white-space: normal; max-width: 240px; }
.smeter { display: flex; align-items: center; gap: 8px; }
header .tools { margin-left: auto; }
.smeter .bar { position: relative; width: 140px; height: 10px; background: #0a0d14; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.smeter .sql { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--warn); }
.seg { display: inline-flex; }
.seg button { padding: 4px 7px; border-radius: 0; }
.seg button:first-child { border-radius: 4px 0 0 4px; }
.seg button:last-child { border-radius: 0 4px 4px 0; }
.smeter .fill { height: 100%; background: linear-gradient(90deg, #2a7a4a, var(--ok) 60%, var(--warn) 85%, var(--bad)); transition: width 60ms linear; }
.lamp { font-size: 11px; padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line); color: var(--dim); }
.lamp.lit { background: var(--bad); color: #fff; border-color: var(--bad); }

.pane { position: absolute; inset: 0; display: flex; flex-direction: column; }
.pane canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }
.pane .spectrum { flex: 0 0 30%; }
.pane .waterfall { flex: 1; min-height: 0; }
.pane .ghost { position: absolute; top: 0; bottom: 0; pointer-events: none; background: rgba(255, 255, 255, 0.07); border: 1px dashed rgba(255, 255, 255, 0.35); border-width: 0 1px; }
.pane .ghost span { position: absolute; top: 2px; left: 100%; margin-left: 4px; padding: 0 4px; border-radius: 3px; background: rgba(11, 14, 22, 0.8); color: var(--text); font: 12px ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; }
.pane .ghost span.left { left: auto; right: 100%; margin: 0 4px 0 0; }
.pane-error { position: absolute; top: 40%; width: 100%; text-align: center; color: var(--warn); pointer-events: none; }

.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(5, 8, 14, 0.75); }
.overlay.small { inset: auto 0 16px 0; background: none; pointer-events: none; }
.overlay.small > * { pointer-events: auto; }
.overlay .start { font-size: 18px; padding: 10px 22px; background: var(--accent-bg); border-color: var(--accent); }
.overlay.login input { width: min(260px, 80vw); font-size: 16px; padding: 6px 10px; }
.warn { color: var(--warn); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 16px; background: var(--accent-bg); border-bottom: 1px solid var(--accent); font-size: 13px; }

.controls { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 6px 16px; }
.status { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 4px 16px 6px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); }
.status .right { margin-left: auto; }
/* fixed slots: values changing width don't move what follows */
.status { font-variant-numeric: tabular-nums; }
.status .sn { display: inline-block; text-align: right; }
.status .conn { display: inline-block; min-width: 10ch; }
.conn.open { color: var(--ok); }
.conn.closed, .conn.busy, .conn.ended { color: var(--bad); }
.conn.connecting { color: var(--warn); }

.spots { display: flex; flex-direction: column; width: min(420px, 40vw); border-left: 1px solid var(--line); background: var(--panel); font-size: 12px; }
.spots-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.spots-bar input[type="text"] { flex: 1; min-width: 80px; }
.spots-bar .close { margin-left: auto; padding: 2px 8px; }
.spots-list { flex: 1; overflow: auto; padding: 0 8px 8px; }
.spots-list p { margin: 12px 0; }
.spots-list table { width: 100%; }
.spots-list thead th { position: sticky; top: 0; background: var(--panel); padding-top: 4px; }
.spots-bar label { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.digi-status { margin: 6px 0 !important; }
.spots-list td.msg { font-family: ui-monospace, Menlo, Consolas, monospace; white-space: normal; overflow-wrap: anywhere; }
.spots-list tbody tr { cursor: pointer; }
.spots-list tr.dx td.msg { color: #ffa94d; }
.spots-list .dx-tag { font-size: 10px; color: #ffa94d; }
.spots-list tbody tr:hover td { background: var(--accent-bg); }
.map { display: flex; flex-direction: column; flex: 1 1 55%; min-width: 320px; border-left: 1px solid var(--line); background: var(--panel); font-size: 12px; }
.map-box { position: relative; flex: 1; min-height: 240px; }
.map-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.map-box canvas:active { cursor: grabbing; }
.map-box canvas.pick { cursor: pointer; }
.map-tip { position: absolute; z-index: 2; max-width: min(280px, 85%); padding: 6px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; pointer-events: none; line-height: 1.4; }
.map-note { position: absolute; left: 8px; bottom: 4px; margin: 0; }
@media (max-width: 900px) {
  main { flex-direction: column; }
  .spots { width: auto; height: 40%; border-left: 0; border-top: 1px solid var(--line); }
  .map { min-width: 0; height: 55%; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  header { padding: 6px 16px; }
  .freq { font-size: 24px; }
  .smeter { margin-left: 0; }
  .smeter .bar { width: 100px; }
  .pane .spectrum { flex-basis: 25%; }
}

a { color: var(--accent); }
.dim { color: var(--dim); }
.ok { color: var(--ok); }

/* admin pages */
.admin { display: flex; flex-direction: column; height: 100dvh; }
.admin header .spacer { flex: 1; }
.admin .page { flex: 1; overflow: auto; padding: 12px 16px 32px; }
.admin-login { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 12vh auto; max-width: 420px; padding: 0 16px; text-align: center; }
.admin-login input { width: 100%; }
input[type="text"], input[type="password"], select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; font: inherit; }
input[type="text"]:focus, input[type="password"]:focus, select:focus { border-color: var(--accent); outline: none; }
input.bad { border-color: var(--bad); }
pre, code { font-family: ui-monospace, Menlo, Consolas, monospace; }
pre { background: var(--panel); padding: 6px 12px; border-radius: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; min-width: 0; overflow-x: auto; }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.card pre.notes { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; font-size: 12px; }
.card progress { width: 100%; }
.card h4 { margin: 12px 0 4px; font-size: 13px; color: var(--dim); }
.card form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card form p { flex-basis: 100%; margin: 0; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 10px; }
.card dt { color: var(--dim); }
.card dd { margin: 0; font-variant-numeric: tabular-nums; }
table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--dim); font-weight: 400; }
th, td { padding: 2px 10px 2px 0; white-space: nowrap; }
td.r, th.r { text-align: right; }
tr.dim td { color: var(--dim); }
table.wide { width: 100%; }
.page > div:has(> table.wide) { overflow-x: auto; }
.config { max-width: 900px; }
.config fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 12px; padding: 6px 14px 10px; background: var(--panel); }
.config fieldset.sub { background: none; margin: 8px 0; }
.config legend { padding: 0 6px; font-weight: 600; }
.config .field { display: grid; grid-template-columns: 170px 1fr; gap: 4px 12px; padding: 5px 0; border-top: 1px solid var(--line); }
.config .field:first-of-type { border-top: 0; }
.config .name { color: var(--text); align-self: start; padding-top: 4px; }
.config .line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.config .line input[type="text"] { width: min(340px, 100%); }
.config .help { color: var(--dim); font-size: 12px; margin-top: 2px; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--warn); color: var(--warn); }
.tag.edit { border-color: var(--accent); color: var(--accent); }
.savebar { position: sticky; top: -12px; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; margin-bottom: 8px; background: var(--bg); }
@media (max-width: 640px) {
  .config .field { grid-template-columns: 1fr; }
}

/* phone layout (ctl/mobile.tsx; doc/m7-mobile-ui.md) */
.m-app { display: flex; flex-direction: column; height: 100dvh; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.m-app button, .m-app select, .m-app input[type="range"] { touch-action: manipulation; }
.m-app button { min-height: 44px; font-size: 16px; border-radius: 8px; padding: 6px 12px; }
.m-app button:active { background: var(--accent-bg); }
/* a tap leaves :hover on in iOS: no hover styles here */
.m-app button:hover:not(:disabled) { border-color: var(--line); }
.m-app button.on:hover:not(:disabled), .m-app button.go:hover:not(:disabled), .m-cap:hover:not(:disabled) { border-color: var(--accent); }
.m-app input[type="text"] { font-size: 16px; min-height: 40px; }
.m-app select { font-size: 16px; min-height: 40px; }
.m-app input[type="range"] { width: 130px; height: 32px; }

.m-top { flex: none; padding: max(6px, env(safe-area-inset-top)) 14px 0; background: var(--panel); border-bottom: 1px solid var(--line); }
.m-top .m-freq { display: block; width: 100%; min-height: 0; padding: 0; border: 0; background: none; text-align: left; font: 600 40px/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.02em; color: var(--text); }
.m-top .m-freq .unit { font-size: 16px; color: var(--dim); margin-left: 8px; font-weight: 400; }
.m-info { display: flex; gap: 14px; align-items: center; height: 22px; color: var(--dim); font-size: 14px; }
.m-info span:first-child { color: var(--accent); font-weight: 600; }
.m-info .lamp[hidden] { display: none; }
.m-meter { height: 4px; margin: 2px -14px 0; background: #0a0d14; }
.m-meter .fill { height: 100%; background: linear-gradient(90deg, #2a7a4a, var(--ok) 60%, var(--warn) 85%, var(--bad)); transition: width 60ms linear; }

.m-view { position: relative; flex: 1; min-height: 120px; }
.m-view .pane .spectrum { flex-basis: 22%; }
.m-app .banner { flex: none; padding: 6px 14px; }
.m-view .overlay.small { inset: auto 0 12px 0; }
.m-view .overlay .start { font-size: 20px; min-height: 52px; }

.m-dock { flex: none; display: flex; gap: 10px; align-items: center; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); }
.m-keys { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.m-row { display: flex; gap: 6px; flex-wrap: wrap; }
.m-keys .m-row { flex-wrap: nowrap; }
.m-row > * { flex: 1; min-width: 0; }
.m-row button { padding: 6px 2px; }
.m-app button.go { background: var(--accent-bg); border-color: var(--accent); }

.m-wheel { position: relative; flex: none; width: 150px; height: 150px; touch-action: none; cursor: grab; }
.m-wheel svg { width: 100%; height: 100%; display: block; }
.m-wheel .rim { fill: #0f1522; stroke: var(--line); stroke-width: 2; }
.m-wheel line { stroke: #3b4a66; stroke-width: 2; stroke-linecap: round; }
.m-wheel line.major { stroke: var(--accent); stroke-width: 3; }
.m-cap { position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px; padding: 0 !important; border-radius: 50% !important; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; font-size: 14px !important; background: var(--accent-bg); border-color: var(--accent); }
.m-cap small { font-size: 10px; color: var(--dim); }

.m-sheet-back { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; background: rgba(5, 8, 14, 0.6); }
.m-sheet { width: 100%; max-height: 85dvh; display: flex; flex-direction: column; background: var(--panel); border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.m-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; font-size: 17px; }
.m-sheet-head button { min-width: 44px; }
.m-sheet-body { overflow: auto; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.m-sheet-body h4 { margin: 8px 0 0; font-size: 13px; font-weight: 400; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.m-sheet .group { gap: 8px; }
.m-sheet input[type="range"] { flex: 1 1 140px; width: auto; min-width: 120px; }
.m-sheet label { flex: 1 1 220px; }
/* but not the checkbox lists and the panels' bars (a column: 220 px tall) */
.m-sheet .labels-opts label, .m-sheet .spots-bar label { flex: none; }
.m-sheet .spots-bar input[type="text"] { flex: 1 1 120px; }
.m-panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.m-panels button { flex: 1; padding: 6px 2px; }
.m-sheet .users-pop { position: static; margin-top: 6px; max-height: 40vh; box-shadow: none; }
.m-sheet .spots { width: auto; height: 50vh; border: 0; }
.m-sheet .map { flex: none; height: 70dvh; border: 0; }
.m-sheet .status { padding: 8px 0 0; }

.m-entry { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; min-height: 52px; padding: 6px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font: 600 36px/1.2 ui-monospace, "SF Mono", Menlo, monospace; }
.m-entry .unit { font-size: 14px; color: var(--dim); font-weight: 400; }
.m-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-pad .k { min-height: 58px; font-size: 26px; }
.m-bands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-bands button { min-height: 56px; font-size: 18px; }

@media (max-width: 380px) {
  .m-wheel { width: 128px; height: 128px; }
  .m-cap { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
}

.ico { width: 22px; height: 22px; fill: currentColor; display: block; margin: 0 auto; }
.overlay .start { display: inline-flex; align-items: center; gap: 8px; }
.overlay .start .ico { margin: 0; }



/* --- CUSTOM DECORDER & UI EXTENSIONS (v0.12.0) --- */

/* Spectrum Height Slide & Chrome Flexbox Aspect-Ratio Fix */
.pane .spectrum {
  flex: 0 0 var(--spec-h, 30%) !important;
  height: var(--spec-h, 30%) !important;
  min-height: 22px !important;
  max-height: var(--spec-h, 30%) !important;
}

.spec-divider {
  display: block !important;
  position: relative !important;
  height: 0 !important;
  width: 100% !important;
  z-index: 6 !important;
}

.spec-handle {
  position: absolute !important;
  right: 8px !important;
  top: -21px !important;
  height: 20px !important;
  padding: 0 8px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  color: #e2e8f0 !important;
  background: rgba(25, 35, 54, 0.92) !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: ns-resize !important;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.spec-handle.collapsed {
  background: rgba(29, 58, 102, 0.95) !important;
  border: none !important;
  color: #fff !important;
}

/* Pulsing glowing red REC button */
@keyframes recPulseGlow {
  0%, 100% {
    background: #dc2626 !important;
    border-color: #f87171 !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.85), 0 0 18px rgba(220, 38, 38, 0.55) !important;
    color: #ffffff !important;
  }
  50% {
    background: #991b1b !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 3px rgba(239, 68, 68, 0.4) !important;
    color: #ffe4e6 !important;
  }
}

button.rec-btn {
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums !important;
}

button.rec-btn.on {
  animation: recPulseGlow 1.15s infinite ease-in-out !important;
  color: #fff !important;
  font-weight: 700 !important;
}

/* Custom Decoders Panel */
.spots.custom-decoders {
  width: min(560px, 46vw);
}

/* CW (Morse) Live Terminal */
.cw-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}
.cw-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: #93c5fd;
  background: #141d2e;
  border: 1px solid #283753;
  border-radius: 5px;
  padding: 4px 8px;
}
.cw-terminal {
  background: #070a10;
  border: 1px solid #26334d;
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 180px;
  max-height: 56vh;
  overflow-y: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cw-line {
  word-break: break-word;
  white-space: pre-wrap;
}
.cw-prefix {
  color: #64748b;
  font-size: 11px;
  user-select: none;
}
.cw-text {
  color: #f8fafc;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* RTTY Baudot Live Terminal & Controls */
.rtty-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}
.rtty-ctl-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  background: #141d2e;
  border: 1px solid #283753;
  border-radius: 5px;
  padding: 4px 8px;
}
.rtty-baud-group {
  display: flex;
  align-items: center;
  gap: 3px;
}
.rtty-terminal {
  background: #070a10;
  border: 1px solid #26334d;
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 180px;
  max-height: 56vh;
  overflow-y: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rtty-line {
  word-break: break-word;
  white-space: pre-wrap;
}
.rtty-prefix {
  color: #64748b;
  font-size: 11px;
  user-select: none;
}
.rtty-text {
  color: #38bdf8;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* SSTV Live Canvas, History Grid & Full-Size Modal */
.sstv-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}
.sstv-live-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  color: #94a3b8;
}
.sstv-force-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}
.sstv-force-bar button {
  padding: 2px 6px !important;
  font-size: 11px !important;
}
.sstv-canvas-wrap {
  position: relative;
  width: 100%;
  background: #070a10;
  border: 1px solid #28354c;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sstv-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}
.sstv-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.sstv-card {
  background: #0e1420;
  border: 1px solid #263349;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.sstv-card:hover {
  border-color: var(--accent, #3b82f6);
}
.sstv-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #05070b;
}
.sstv-card-meta {
  padding: 4px 6px;
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sstv-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 15, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sstv-modal {
  background: #131926;
  border: 1px solid #334666;
  border-radius: 8px;
  padding: 12px;
  max-width: min(92vw, 760px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
}
.sstv-modal img {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  background: #05070b;
  border: 1px solid #222b3b;
}
.sstv-modal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sstv-modal-actions {
  display: flex;
  gap: 8px;
}
.sstv-modal-actions button.danger {
  background: #451218;
  border-color: #dc2626;
  color: #fecaca;
}

/* HF WEFAX (Weather Fax 120 LPM) Live Canvas, Gallery & Modal */
.wefax-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}
.wefax-live-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  color: #94a3b8;
}
.wefax-nudge-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  background: #141d2e;
  border: 1px solid #283753;
  border-radius: 5px;
  padding: 4px 8px;
}
.wefax-nudge-bar button {
  padding: 2px 7px !important;
  font-size: 11px !important;
}
.wefax-canvas-wrap {
  position: relative;
  width: 100%;
  background: #ffffff;
  border: 1px solid #28354c;
  border-radius: 6px;
  overflow-y: auto;
  max-height: 480px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.wefax-canvas-wrap canvas {
  width: 100%;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  background: #ffffff;
}
.wefax-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.wefax-card {
  background: #0e1420;
  border: 1px solid #263349;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.wefax-card:hover {
  border-color: var(--accent, #3b82f6);
}
.wefax-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #ffffff;
}
.wefax-card-meta {
  padding: 4px 6px;
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wefax-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 15, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.wefax-modal {
  background: #131926;
  border: 1px solid #334666;
  border-radius: 8px;
  padding: 12px;
  max-width: min(94vw, 860px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
}
.wefax-modal img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #222b3b;
}
.wefax-modal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wefax-modal-actions {
  display: flex;
  gap: 8px;
}
.wefax-modal-actions button.danger {
  background: #451218;
  border-color: #dc2626;
  color: #fecaca;
}
/* Flywheel VFO Mode in Mobile UI */
.m-dock.m-dock-flywheel {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  padding: 6px 10px max(8px, env(safe-area-inset-bottom)) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.m-dock.m-dock-flywheel .flywheel-wrapper {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 54px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 1px solid #33425b !important;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.7), 0 1px 3px rgba(0,0,0,0.4) !important;
  background: #080b13 !important;
  touch-action: none !important;
  flex: none !important;
}

.flywheel-canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  cursor: grab !important;
  touch-action: none !important;
}

.flywheel-canvas:active {
  cursor: grabbing !important;
}

.flywheel-label {
  position: absolute !important;
  bottom: 3px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 0.18em !important;
  color: rgba(148, 163, 184, 0.4) !important;
  pointer-events: none !important;
  text-transform: uppercase !important;
}

.m-dock.m-dock-flywheel .m-keys {
  width: 100% !important;
  flex: none !important;
}

/* VFO Mode Toggle Button */
button.vfo-toggle-btn {
  font-weight: 600 !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}
button.vfo-toggle-btn.on {
  background: #1e3a8a !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}

/* Mobile Panels 4-column layout for Shared / Spots / Map / Decoders */
.m-panels {
  grid-template-columns: repeat(4, 1fr) !important;
}
.m-panels .group {
  display: flex !important;
  width: 100% !important;
}
.m-panels .group button {
  width: 100% !important;
}
