/* SatStation UI */

:root {
  --bg: #0a0d13;
  --surface: #10141c;
  --surface-2: #151a24;
  --surface-3: #1b2130;
  --border: #222a37;
  --border-strong: #2e3747;
  --text: #e7eaf0;
  --text-2: #a1aab8;
  --text-3: #6c7787;
  --accent: #5b9dff;
  --accent-strong: #7cb1ff;
  --accent-weak: rgba(91, 157, 255, .14);
  --ok: #3fcf8e;
  --ok-weak: rgba(63, 207, 142, .14);
  --warn: #f2a93b;
  --warn-weak: rgba(242, 169, 59, .14);
  --danger: #f2626b;
  --danger-weak: rgba(242, 98, 107, .14);
  --cyan: #3cc8d8;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, monospace;
  --header-h: 52px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }
svg.icon { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3b4658; }

/* ── Boot screen ─────────────────────────────────────────────────────────── */
#boot { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: var(--bg); transition: opacity .35s; }
#boot.done { opacity: 0; pointer-events: none; }
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.boot-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; letter-spacing: .02em; }
.boot-logo svg { width: 28px; height: 28px; color: var(--accent); }
.boot-msg { color: var(--text-3); font-size: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── App shell ───────────────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; }
header.topbar { height: var(--header-h); flex-shrink: 0; display: flex; align-items: center; gap: 18px;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 14px; letter-spacing: .01em; }
.brand svg { width: 22px; height: 22px; color: var(--accent); }
nav.tabs { display: flex; gap: 2px; height: 100%; }
nav.tabs button { display: flex; align-items: center; gap: 7px; padding: 0 13px; height: 100%;
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-2);
  cursor: pointer; font-weight: 500; transition: color .15s, border-color .15s; }
nav.tabs button:hover { color: var(--text); }
nav.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
nav.tabs button svg { width: 15px; height: 15px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; min-width: 76px; }
.clock .t { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.clock .l { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: 12px; white-space: nowrap; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--border-strong); color: var(--text); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.chip.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-weak); }
.chip.warn .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-weak); }
.chip.bad .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-weak); }
.chip.sim { background: rgba(60, 200, 216, .12); border-color: rgba(60, 200, 216, .35); color: var(--cyan); font-weight: 600; }

main { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: flex; }
.view.scroll { overflow-y: auto; }

/* ── Controls ────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px;
  padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, opacity .12s; }
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: #3b4658; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06101f; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { background: var(--danger-weak); border-color: rgba(242, 98, 107, .45); color: #ff9aa0; }
.btn.danger:hover:not(:disabled) { background: rgba(242, 98, 107, .24); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.icon-only { width: 32px; padding: 0; }
.btn.sm.icon-only { width: 26px; }
.btn.on { background: var(--accent-weak); border-color: rgba(91, 157, 255, .45); color: var(--accent-strong); }
.btn.notify.on { background: var(--warn-weak); border-color: rgba(242, 169, 59, .45); color: var(--warn); }
.btn.flag { border-color: rgba(91, 157, 255, .45); color: var(--accent-strong); }
.btn.busy { pointer-events: none; }
.btn.busy::before { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; }
.btn.busy svg { display: none; }

.input, select.input { height: 32px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); min-width: 0;
  transition: border-color .12s, box-shadow .12s; }
.input:focus, select.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.input.sm { height: 28px; padding: 0 8px; font-size: 12px; }
input.input[type=number] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input[type=number]::-webkit-inner-spin-button { opacity: .4; }
select.input { padding-right: 28px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23a1aab8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
.input-group { display: inline-flex; align-items: center; gap: 6px; }
.unit { color: var(--text-3); font-size: 12px; }
.input.w-xs { width: 72px; } .input.w-sm { width: 110px; } .input.w-md { width: 170px; } .input.w-lg { width: 260px; }

/* toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 32px; height: 18px; border-radius: 999px; background: var(--border-strong);
  position: relative; transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #c9d1dc; transition: transform .15s, background .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-weak); }
.switch .label { color: var(--text-2); }

/* segmented control */
.segmented { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border-strong); }
.segmented button { height: 26px; min-width: 34px; padding: 0 9px; border: 0; border-radius: 4px; background: none;
  color: var(--text-2); cursor: pointer; font-size: 12px; font-weight: 500; font-family: var(--mono); }
.segmented button:hover { color: var(--text); background: var(--surface-3); }
.segmented button.active { background: var(--accent-weak); color: var(--accent-strong); }

/* ── Cards / forms ───────────────────────────────────────────────────────── */
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 24px 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.page-head p { color: var(--text-2); margin-top: 3px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; align-items: stretch; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 13px; font-weight: 600; }
.card-head svg { color: var(--text-2); }
.card-head .spacer { flex: 1; }
.card-body { padding: 6px 16px 12px; }
.field { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid rgba(34, 42, 55, .6); }
.field:last-child { border-bottom: 0; }
.field > label, .field > .label { color: var(--text-2); }
.field .control { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.hint { color: var(--text-3); font-size: 12px; }
.field .hint { grid-column: 2; margin-top: -6px; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.status-line.ok { color: var(--ok); } .status-line.warn { color: var(--warn); } .status-line.bad { color: var(--danger); }

.callout { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--warn-weak); border: 1px solid rgba(242, 169, 59, .3); color: #f6c67a; font-size: 12px; margin: 10px 0 4px; }
.callout.info { background: var(--accent-weak); border-color: rgba(91, 157, 255, .3); color: #a9caff; }

.savebar { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); z-index: 50;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.savebar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.savebar .msg { color: var(--text-2); margin-right: 8px; }

/* ── Tracking view ───────────────────────────────────────────────────────── */
#view-track { flex-direction: row; }
.sidebar { width: 340px; min-width: 260px; max-width: 560px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); position: relative; }
.resize-handle { position: absolute; top: 0; bottom: 0; right: -3px; width: 6px; cursor: col-resize; z-index: 5; }
.resize-handle:hover, .resize-handle.active { background: var(--accent); opacity: .4; }
.sidebar-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.sidebar-head h2 { font-size: 13px; font-weight: 600; }
.count-badge { font-size: 11px; color: var(--text-2); background: var(--surface-3); border-radius: 999px; padding: 1px 8px; font-family: var(--mono); }
.sidebar-head .spacer { flex: 1; }
.pass-list { flex: 1; overflow-y: auto; padding: 6px; }
.pass-group { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3);
  padding: 10px 8px 5px; }
.empty { padding: 30px 18px; text-align: center; color: var(--text-3); }
.empty svg { width: 28px; height: 28px; margin-bottom: 8px; opacity: .6; }

.pass { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 9px 10px 9px 13px;
  border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; transition: background .1s, border-color .1s; }
.pass:hover { background: var(--surface-2); }
.pass.selected { background: var(--accent-weak); border-color: rgba(91, 157, 255, .35); }
.pass::before { content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: transparent; }
.pass.live::before { background: var(--ok); box-shadow: 0 0 8px rgba(63, 207, 142, .6); }
.pass.armed:not(.live)::before { background: var(--accent); opacity: .7; }
.pass-name { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.pass-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass-name svg { width: 13px; height: 13px; color: var(--text-3); }
.pass-name svg.sunlit { color: #f5c451; }
.pass-time { color: var(--text-2); font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.pass-time .dur { color: var(--text-3); }
.el-badge { justify-self: end; display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.el-bar { width: 34px; height: 4px; border-radius: 4px; background: var(--border-strong); overflow: hidden; }
.el-bar i { display: block; height: 100%; border-radius: 4px; background: var(--warn); }
.el-badge.hi { color: var(--ok); } .el-badge.hi .el-bar i { background: var(--ok); }
.el-badge.mid { color: var(--warn); }
.el-badge.lo { color: var(--text-2); } .el-badge.lo .el-bar i { background: var(--text-3); }
.pass-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.eta { font-family: var(--mono); font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.live-pill { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--ok); background: var(--ok-weak);
  border-radius: 4px; padding: 1px 6px; }
.dop { font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.pass-actions { margin-left: auto; display: flex; gap: 2px; }
.ibtn { width: 26px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 5px; background: none;
  color: var(--text-3); cursor: pointer; transition: background .1s, color .1s; }
.ibtn svg { width: 15px; height: 15px; }
.ibtn:hover { background: var(--surface-3); color: var(--text); }
.ibtn.on { color: var(--accent-strong); background: var(--accent-weak); }
.ibtn.on.notify { color: var(--warn); background: var(--warn-weak); }
.ibtn.flag { color: var(--accent-strong); }
.ibtn:disabled { opacity: .3; cursor: default; background: none; }

.track-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.map-wrap { flex: 1; min-height: 160px; position: relative; }
#map { position: absolute; inset: 0; background: #0d1118; }
.timebar { position: absolute; z-index: 500; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; pointer-events: none; }
.timebar > * { pointer-events: auto; }
.glass { background: rgba(16, 20, 28, .86); backdrop-filter: blur(10px); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.timebar .glass { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; }
.sim-time { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; min-width: 168px; }
.sim-time.sim { color: var(--cyan); }
.timebar input[type=datetime-local] { height: 28px; font-size: 12px; font-family: var(--mono); }
.map-legend { position: absolute; z-index: 500; bottom: 10px; left: 10px; display: flex; gap: 12px; padding: 6px 10px;
  font-size: 11px; color: var(--text-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.bottom { height: 270px; flex-shrink: 0; display: flex; border-top: 1px solid var(--border); background: var(--surface); }
.polar-panel { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.panel-title { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; font-size: 11px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.panel-title .sub { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.polar-box { flex: 1; min-height: 0; position: relative; }
.polar-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.details { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.details-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.details-empty { height: 100%; display: grid; place-items: center; color: var(--text-3); text-align: center; }
.det-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.det-head h3 { font-size: 16px; font-weight: 650; }
.det-head .norad { color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.det-head .actions { margin-left: auto; display: flex; gap: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.stat .v { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.stat .v small { font-size: 11px; color: var(--text-2); }
.stat.live { border-color: rgba(63, 207, 142, .35); }
.stat.live .v { color: var(--ok); }

/* Leaflet */
.leaflet-container { background: #0d1118; font-family: var(--font); }
.leaflet-control-zoom { border: 1px solid var(--border-strong) !important; border-radius: var(--radius-sm) !important; overflow: hidden; }
.leaflet-control-zoom a { background: rgba(16, 20, 28, .9) !important; color: var(--text) !important; border-bottom-color: var(--border) !important; }
.leaflet-control-zoom a:hover { background: var(--surface-3) !important; }
.leaflet-top.leaflet-right { top: 54px; }
.leaflet-control-layers { background: rgba(16, 20, 28, .92) !important; color: var(--text) !important;
  border: 1px solid var(--border-strong) !important; border-radius: var(--radius-sm) !important; }
.leaflet-control-layers-toggle { width: 30px !important; height: 30px !important; filter: invert(1) brightness(.8); background-size: 18px !important; }
.leaflet-control-layers-expanded { padding: 8px 12px 8px 8px !important; }
.leaflet-control-layers label { font-size: 12px; margin: 3px 0; }
.leaflet-control-attribution { background: rgba(10, 13, 19, .7) !important; color: var(--text-3) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.sat-label { background: rgba(10, 13, 19, .72) !important; border: 0 !important; border-radius: 4px !important; box-shadow: none !important;
  color: var(--text) !important; font: 500 11px var(--font) !important; padding: 1px 6px !important; }
.sat-label::before { display: none; }
.sat-label.dim { color: var(--text-3) !important; background: rgba(10, 13, 19, .5) !important; }
.sat-label.sel { color: #fff !important; background: rgba(91, 157, 255, .55) !important; }

/* ── Popover ─────────────────────────────────────────────────────────────── */
.popover { position: fixed; z-index: 900; width: 420px; max-height: calc(100vh - 24px); overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); }
.popover-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.popover-head h3 { font-size: 13px; font-weight: 600; }
.popover-head .sub { color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.popover-head .btn { margin-left: auto; }
.popover-body { padding: 8px 14px 4px; }
.popover-body .field { grid-template-columns: 96px 1fr; padding: 7px 0; }
.popover-body .control { flex-wrap: nowrap; }
.popover-body .control select { min-width: 0; }
.popover-section { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 12px 0 2px; }
.popover-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface-2); }
.popover-foot .spacer { flex: 1; }
.src { font-size: 10px; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.src.pass { background: var(--accent-weak); color: var(--accent-strong); }
.src.sat { background: var(--ok-weak); color: #7fe0b3; }
.src.global { background: var(--surface-3); color: var(--text-3); }

/* ── Frequency spinner ───────────────────────────────────────────────────── */
.freq { display: inline-flex; align-items: stretch; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: #070a0f; user-select: none; font-family: var(--mono); font-variant-numeric: tabular-nums; outline: none; }
.freq:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.freq .digit { position: relative; width: .72em; display: grid; place-items: center; cursor: ns-resize; color: var(--text); outline: none; }
.freq .digit.lead { color: #39424f; }
.freq .digit:hover, .freq .digit:focus { background: var(--accent-weak); color: var(--accent-strong); }
.freq .digit::before, .freq .digit::after { position: absolute; left: 0; right: 0; text-align: center; font-size: .38em; color: var(--text-3); opacity: 0; transition: opacity .1s; }
.freq .digit::before { content: "▲"; top: 1px; } .freq .digit::after { content: "▼"; bottom: 1px; }
.freq .digit:hover::before, .freq .digit:hover::after, .freq .digit:focus::before, .freq .digit:focus::after { opacity: 1; }
.freq .sep { width: .3em; display: grid; place-items: end center; padding-bottom: .22em; color: var(--text-3); font-size: .7em; }
.freq .funit { display: grid; place-items: center; padding: 0 .5em; font-size: .45em; color: var(--text-3); border-left: 1px solid var(--border); font-family: var(--font); }
.freq.lg { font-size: 34px; height: 60px; padding: 0 4px; }
.freq.md { font-size: 18px; height: 34px; padding: 0 2px; }

/* ── Satellites view ─────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search { position: relative; }
.search svg { position: absolute; left: 9px; top: 8px; color: var(--text-3); }
.search .input { padding-left: 31px; width: 220px; }
.sat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; margin-top: 16px; }
.sat-card .card-head { padding: 12px 14px; }
.sat-card .card-head h2 { font-size: 14px; }
.sat-card .norad { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.sat-card .card-body { padding: 4px 14px 10px; }
.sat-card .field { grid-template-columns: 120px 1fr; }
.sat-card.disabled { opacity: .62; }
.tag { font-size: 11px; border-radius: 4px; padding: 1px 7px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag.ok { background: var(--ok-weak); color: #7fe0b3; } .tag.warn { background: var(--warn-weak); color: #f6c67a; }
.tag.bad { background: var(--danger-weak); color: #ff9aa0; }
.conflict { display: inline-flex; color: var(--warn); }
.conflict svg { width: 14px; height: 14px; }
.timing { display: grid; grid-template-columns: 56px 1fr; gap: 6px 10px; align-items: center; padding: 8px 0 4px; }
.timing .k { color: var(--text-3); font-size: 12px; }
.timing .row { display: flex; gap: 6px; align-items: center; }
.subhead { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding-top: 10px; }

/* sat enable chips (settings) */
.sat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 4px; }
.sat-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); color: var(--text-2); background: var(--bg); user-select: none; font-size: 12px; transition: all .1s; }
.sat-chip input { display: none; }
.sat-chip:hover { border-color: #3b4658; color: var(--text); }
.sat-chip.on { background: var(--accent-weak); border-color: rgba(91, 157, 255, .45); color: var(--accent-strong); }

/* az mask editor */
.mask-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 10px 0; }
#mask-canvas { width: 260px; height: 260px; cursor: crosshair; flex-shrink: 0; }
.mask-help { color: var(--text-2); font-size: 12px; line-height: 1.9; }
.mask-help b { color: var(--text); font-weight: 600; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); border: 1px solid var(--border-strong); }

/* ── Radio view ──────────────────────────────────────────────────────────── */
.radio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .radio-grid { grid-template-columns: 1fr; } }
.readout { padding: 18px 16px; }
.readout .big { font-family: var(--mono); font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.readout .big small { font-size: 14px; color: var(--text-2); margin-left: 4px; }
.readout .row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(34, 42, 55, .6); }
.readout .row:last-child { border-bottom: 0; }
.readout .row .v { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tune-freq { display: flex; flex-direction: column; gap: 10px; padding: 16px 0 10px; }
.doppler-line { display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 12px; color: var(--text-2); min-height: 18px; }
.engage-row { display: flex; align-items: center; gap: 10px; padding: 14px 0 6px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); margin-top: 10px;
  background: var(--ok-weak); border: 1px solid rgba(63, 207, 142, .3); color: #8ae6bd; font-size: 12px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(63, 207, 142, .5); } 50% { box-shadow: 0 0 0 6px rgba(63, 207, 142, 0); } }

/* ── Toasts ──────────────────────────────────────────────────────────────── */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: flex-start; gap: 10px; max-width: 420px; padding: 10px 12px 10px 12px; border-radius: var(--radius);
  background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 12.5px;
  animation: toast-in .2s ease-out; }
.toast svg { margin-top: 1px; }
.toast.ok svg { color: var(--ok); } .toast.error svg { color: var(--danger); } .toast.info svg { color: var(--accent); }
.toast.error { border-color: rgba(242, 98, 107, .45); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ── Login ───────────────────────────────────────────────────────────────── */
#login { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; background: var(--bg); }
.login-card { width: 300px; display: flex; flex-direction: column; gap: 12px; align-items: stretch;
  padding: 28px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.login-card .boot-logo { justify-content: center; margin-bottom: 6px; }
.login-card .input { height: 36px; }
.login-card .btn { height: 36px; }
.login-error { color: var(--danger); font-size: 12px; min-height: 16px; }

/* ── Connection overlay ──────────────────────────────────────────────────── */
#offline { position: fixed; top: calc(var(--header-h) + 10px); left: 50%; transform: translateX(-50%); z-index: 1500;
  display: none; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; background: var(--warn-weak);
  border: 1px solid rgba(242, 169, 59, .4); color: #f6c67a; font-size: 12px; backdrop-filter: blur(8px); }
#offline.show { display: flex; }
#offline .spinner { width: 12px; height: 12px; border-width: 2px; border-top-color: var(--warn); }

/* ── Modal (add satellites) ──────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 950; display: grid; place-items: start center; padding-top: 7vh;
  background: rgba(4, 6, 10, .62); backdrop-filter: blur(3px); }
.modal { width: min(820px, calc(100vw - 32px)); max-height: 84vh; display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 10px; }
.modal-head h2 { font-size: 15px; font-weight: 650; }
.modal-head .spacer { flex: 1; }
.modal-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 0 16px 12px; border-bottom: 1px solid var(--border); }
.modal-tools .search .input { width: 280px; }
.modal-status { padding: 8px 16px 0; color: var(--text-2); font-size: 12px; min-height: 26px; display: flex; align-items: center; gap: 8px; }
.modal-status .spinner { width: 12px; height: 12px; }
.modal-body { overflow-y: auto; padding: 4px 8px 8px; flex: 1; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--border); }
.result { display: grid; grid-template-columns: 1fr 150px 92px; gap: 12px; align-items: center; padding: 10px 8px;
  border-radius: var(--radius-sm); border-bottom: 1px solid rgba(34, 42, 55, .6); }
.result:hover { background: var(--surface-3); }
.result > div:first-child { min-width: 0; }
.result .r-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.result .r-title b { font-weight: 600; white-space: nowrap; }
.result .r-title .norad { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.result .r-title .aka { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .r-tx { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); margin-top: 3px; line-height: 1.6; }
.result .r-tx span { margin-right: 12px; white-space: nowrap; }
.result .r-tx .unconf { color: var(--warn); }
.result .r-act { font-size: 12px; color: var(--text-3); }
.result .r-act.fresh { color: var(--ok); } .result .r-act.stale { color: var(--warn); }
.result .r-btn { justify-self: end; }

