/* ShackLog – desktop-first, responsive. Light and dark themes follow the OS setting. */
:root {
  --bg: #eef1f5;
  --card: #ffffff;
  --card-head: #f7f9fb;
  --border: #dde2e9;
  --border-strong: #c5cdd8;
  --ink: #18212d;
  --ink-2: #3b4757;
  --muted: #6b7788;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, .14);
  --bar: #0f1c2e;
  --bar-ink: #e6edf6;
  --bar-muted: #93a4ba;
  --good: #15803d;
  --good-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --new: #be185d;
  --row-alt: #f8fafc;
  --row-hover: #eef4ff;
  --sel: #fff7d6;
  --input: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 8px;
  --radius-sm: 6px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color-scheme: light;
}
/* Theme: Auto follows the device; Settings → Profile can force Light or Dark (per device). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0b1119; --card: #121a25; --card-head: #16202d; --border: #243142; --border-strong: #33445a;
    --ink: #e3e9f1; --ink-2: #c3cdda; --muted: #8796a8; --accent: #3b7ddd; --accent-hover: #3270cc;
    --accent-soft: rgba(79, 141, 245, .22); --bar: #070c13; --row-alt: #141d29; --row-hover: #1a2638;
    --sel: #3a3214; --input: #0d141e; --good-soft: #0f2e1c; --warn-soft: #33260d; --bad-soft: #3a1414;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
    --bg: #0b1119; --card: #121a25; --card-head: #16202d; --border: #243142; --border-strong: #33445a;
    --ink: #e3e9f1; --ink-2: #c3cdda; --muted: #8796a8; --accent: #3b7ddd; --accent-hover: #3270cc;
    --accent-soft: rgba(79, 141, 245, .22); --bar: #070c13; --row-alt: #141d29; --row-hover: #1a2638;
    --sel: #3a3214; --input: #0d141e; --good-soft: #0f2e1c; --warn-soft: #33260d; --bad-soft: #3a1414;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1em; margin: 0; font-size: 13px; }
.upper { text-transform: uppercase; }
.upper::placeholder { text-transform: none; }

/* ---------- form controls ---------- */
input, select, textarea, button { font: inherit; color: var(--ink); }
input, select, textarea {
  background: var(--input); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 9px; height: 34px; width: 100%; min-width: 0;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 7px 9px; resize: vertical; line-height: 1.4; }
input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; padding: 0; line-height: inherit; }
/* iOS Safari draws the date at the top of the box: a line-height equal to the inner height centres it */
input[type=date] { line-height: 32px; padding-top: 0; padding-bottom: 0; }
select { padding-right: 4px; }
@media (hover: hover) { input:hover, select:hover, textarea:hover { border-color: var(--muted); } }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input:disabled, select:disabled { background: var(--card-head); color: var(--muted); }
input.invalid { border-color: var(--bad); background: var(--bad-soft); }
input.nudge { animation: nudge .4s; border-color: var(--bad); box-shadow: 0 0 0 3px rgba(185, 28, 28, .18); }
@keyframes nudge { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

button {
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  height: 34px; padding: 0 14px; cursor: pointer; white-space: nowrap; font-weight: 550;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
@media (hover: hover) { button:hover { background: var(--card-head); border-color: var(--muted); } }
button:active { filter: brightness(.92); }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (hover: hover) { button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); } }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border-strong)); }
button.danger:hover { background: var(--bad-soft); }
kbd {
  font-family: var(--mono); font-size: 10px; font-weight: 500; opacity: .8; margin-left: 6px;
  border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; vertical-align: 1px;
}

/* ---------- sign-in ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at top, color-mix(in srgb, var(--accent) 12%, var(--bg)), var(--bg) 60%);
}
.auth-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 28px;
  width: min(380px, 100%); box-shadow: 0 10px 30px rgba(16, 24, 40, .10);
}
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.auth-brand img { border-radius: 10px; }
.auth-box h1 { margin: 0; font-size: 22px; }
.auth-box .auth-brand p { margin: 2px 0 0; font-size: 13px; }
.auth-box label { display: block; margin: 12px 0; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.auth-box label input { margin-top: 5px; height: 38px; }
.auth-box label.check.remember { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; }
.auth-box label.check input { width: 16px; height: 16px; margin: 0; }
.auth-box button { width: 100%; margin-top: 6px; height: 40px; }
.auth-box p { font-size: 13px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bar); color: var(--bar-ink); padding: 8px 14px;
  padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: .2px; margin-right: 4px; }
.topbar .brand img { border-radius: 5px; }
.topbar select {
  width: auto; max-width: 240px; height: 30px; background: rgba(255, 255, 255, .08); color: var(--bar-ink);
  border-color: rgba(255, 255, 255, .16);
}
.topbar select option { color: var(--ink); background: var(--card); }
.topbar .muted { color: var(--bar-muted); font-size: 13px; }
.topbar button {
  height: 30px; padding: 0 12px; background: transparent; color: var(--bar-ink); border-color: rgba(255, 255, 255, .2);
}
.topbar button:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .35); }
.utc {
  font-family: var(--mono); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 3px 10px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .07); letter-spacing: .5px;
}
.spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; height: 22px; border-radius: 11px; padding: 0 9px;
  font-size: 11.5px; font-weight: 600; background: rgba(255, 255, 255, .1); color: var(--bar-ink); letter-spacing: .2px;
}
.pill.off::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bar-muted); margin-right: 6px; }
.pill.on { background: rgba(34, 197, 94, .2); color: #86efac; }
.pill.bad { background: rgba(239, 68, 68, .22); color: #fca5a5; }
.operators { display: inline-flex; gap: 4px; }
.operators b {
  font-family: var(--mono); font-size: 12px; font-weight: 600; background: rgba(79, 141, 245, .22);
  color: #bfd5ff; border-radius: 4px; padding: 2px 7px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); display: inline-block; box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }
.dot.live { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px;
  padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--card-head);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2);
}

/* ---------- workspace ---------- */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 12px; padding: 12px 12px 0; }
.entry { padding: 0 0 4px; }
.entry .row { padding: 0 14px; }
.entry .card-head { margin-bottom: 12px; }
.row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; align-items: end; }
.row label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
}
.row label input, .row label select, .row label textarea {
  font-size: 14px; color: var(--ink); text-transform: none; letter-spacing: normal; font-weight: 400;
}
.row label input.upper { text-transform: uppercase; }
/* numbers line up in monospace */
.row input[name=freq], .row input[name=time_on], .row input[name=time_off], .row input[name=rst_sent],
.row input[name=rst_rcvd], .row input[name=cqz], .row input[name=ituz], .row input[name=dxcc],
.row input[name=gridsquare], .row input[name=tx_pwr] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.row input[name=freq] { font-weight: 600; }

.f-call { flex: 0 0 170px; }
.f-call input.big {
  height: 42px; font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: .04em;
  border-width: 2px; border-color: var(--accent); padding: 0 10px;
}
.f-name { flex: 1 1 150px; } .f-qth { flex: 1 1 150px; } .f-st { flex: 0 0 72px; } .f-cnty { flex: 0 1 130px; }
.f-name input, .f-qth input, .f-st input, .f-cnty input { height: 42px; }
.f-country { flex: 1 1 170px; } .f-xs { flex: 0 0 62px; } .f-grid { flex: 0 0 96px; }
.f-date { flex: 0 0 146px; } .f-time { flex: 0 0 82px; } .f-band { flex: 0 0 86px; } .f-mode { flex: 0 0 96px; }
.f-freq { flex: 0 0 112px; } .f-rst { flex: 0 0 64px; } .f-op { flex: 0 0 104px; } .f-qsl { flex: 0 0 70px; }
.f-comment { flex: 1 1 100%; }

.entry .row.buttons {
  align-items: center; margin: 4px 0 0; padding: 12px 14px 10px; border-top: 1px solid var(--border); gap: 8px;
}
.buttons #btn-log { min-width: 120px; height: 38px; }
.buttons #btn-clear, .buttons #btn-start { height: 38px; }
.check {
  flex-direction: row !important; align-items: center; gap: 6px !important; font-size: 13px !important;
  color: var(--ink-2) !important; text-transform: none !important; letter-spacing: normal !important; font-weight: 500 !important;
}
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.edit-banner {
  background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  padding: 2px 10px; border-radius: 11px; font-size: 11px; letter-spacing: .03em;
}

/* ---------- station info panel ---------- */
.info { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.info > *:not(.card-head):not(h3) { margin-left: 14px; margin-right: 14px; }
.info h3 {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  margin: 14px 14px 6px; font-weight: 700;
}
.entity { font-size: 14px; color: var(--ink-2); margin-top: 12px; line-height: 1.45; }
.entity b { font-size: 18px; color: var(--ink); display: block; }
.entity.muted { color: var(--muted); }
.alerts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.alerts:empty { display: none; }
.alert { border-radius: 4px; padding: 3px 8px; font-weight: 700; font-size: 11px; letter-spacing: .04em; }
.alert.new { background: var(--new); color: #fff; }
.alert.dupe { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.alert.worked { background: var(--good-soft); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.qrz-info {
  margin-top: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card-head); font-size: 13px; line-height: 1.5;
}
.qrz-info b { font-size: 14px; }
.worked table { border-collapse: separate; border-spacing: 2px; font-size: 10.5px; width: 100%; table-layout: fixed; }
.worked th { font-weight: 600; color: var(--muted); padding: 2px 0; text-align: center; }
.worked td {
  text-align: center; padding: 4px 0; border-radius: 3px; background: var(--row-alt);
  border: 1px solid var(--border); font-family: var(--mono); font-size: 10px; overflow: hidden;
}
.worked tr th:first-child { text-align: left; width: 34px; }
.worked td.call { background: var(--good); border-color: var(--good); color: #fff; font-weight: 700; }
.worked td.ent { background: color-mix(in srgb, var(--accent) 70%, var(--card)); border-color: transparent; color: #fff; }
.worked td.cur { box-shadow: 0 0 0 2px var(--warn); }
.prev-wrap { overflow: auto; max-height: 230px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prev-wrap:has(tbody:empty) { display: none; }

/* ---------- tables ---------- */
table.grid { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.grid th, table.grid td { border-bottom: 1px solid var(--border); padding: 0 10px; height: 34px; text-align: left; white-space: nowrap; }
table.grid th {
  position: sticky; top: 0; z-index: 1; background: var(--card-head); height: 32px;
  font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
}
table.grid tbody tr:nth-child(even) { background: var(--row-alt); }
table.grid.small td { height: 28px; font-size: 12.5px; padding: 0 8px; }
#log-table td:nth-child(-n+3), #log-table td.c-freq { font-family: var(--mono); font-size: 13px; }
#log-table td:nth-child(3) strong { font-size: 13.5px; letter-spacing: .02em; }
#log-table tbody tr { cursor: pointer; transition: background .1s; }
#log-table tbody tr:hover { background: var(--row-hover); }
#log-table tbody tr.sel { background: var(--sel); box-shadow: inset 3px 0 0 var(--warn); }
#log-table tr.flash { animation: flash 2.2s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--good) 28%, var(--card)); } }
td.c-comment, td.c-qth { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
td.c-qrz { text-align: center; font-weight: 700; }
td.q-ok { color: var(--good); } td.q-pend { color: var(--warn); }
td.q-fail { color: var(--bad); background: var(--bad-soft); }

.log { margin: 12px; overflow: hidden; }
.log-bar {
  display: flex; gap: 10px; align-items: center; padding: 8px 14px; min-height: 46px;
  border-bottom: 1px solid var(--border); background: var(--card-head);
}
.log-bar strong { font-size: 14px; }
#log-count {
  font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent);
  padding: 2px 9px; border-radius: 11px;
}
.log-bar input { max-width: 220px; margin-left: auto; height: 32px; }
.log-wrap { overflow: auto; max-height: calc(100vh - 470px); min-height: 220px; }
#load-more { margin: 10px 14px; }

/* ---------- settings dialog ---------- */
dialog {
  border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink);
  width: min(760px, 96vw); max-height: 90vh; padding: 0 22px 22px; box-shadow: 0 20px 50px rgba(16, 24, 40, .25);
}
dialog::backdrop { background: rgba(10, 16, 26, .55); backdrop-filter: blur(2px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--card); z-index: 2; padding-top: 4px; }
.dlg-head h2 { font-size: 18px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; height: 38px;
  padding: 0 14px; color: var(--muted); font-weight: 600;
}
.tabs button:hover { color: var(--ink); background: none; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab h3 { font-size: 15px; margin: 18px 0 6px; }
.tab h3:first-child { margin-top: 4px; }
.tab h4 { font-size: 13px; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.tab p { line-height: 1.5; }
.tab label { display: block; margin: 10px 0; max-width: 380px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tab label input { margin-top: 5px; }
.tab label.check { display: flex; font-size: 13px; max-width: none; }
.tab label.check input { margin-top: 0; }
.tab form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tab form.inline input { width: auto; flex: 1 1 170px; }
.tab table.grid { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; }
.msg { color: var(--good); font-size: 13px; margin-left: 6px; }
.msg.err { color: var(--bad); }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 10px; border-radius: 8px; border: 1px solid var(--border); }
.qrz-status { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card-head); line-height: 1.6; }
.qrz-status:empty { display: none; }
.qrz-status .actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }
.small-note { font-size: 12px; margin: 0 0 8px; }
code { font-family: var(--mono); background: var(--card-head); padding: 2px 6px; border-radius: 4px; }

/* ---------- tablets ---------- */
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .log-wrap { max-height: none; }
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
  :root { font-size: 15px; }
  .topbar { gap: 8px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); }
  .topbar #whoami, .topbar .brand { display: none; }
  .topbar select { max-width: 130px; height: 32px; }
  .topbar #cat-status.off { display: none; }       /* shown again once a radio is connected (Phase 3) */
  .topbar .spacer { display: none; }
  .topbar button { height: 30px; padding: 0 10px; font-size: 13px; }
  .topbar #btn-stats { margin-left: auto; }
  .utc { font-size: 14px; }
  .workspace { padding: 8px 8px 0; gap: 8px; }
  .entry .row { padding: 0 10px; }
  .row { gap: 6px; margin-bottom: 8px; }
  .f-call { flex: 1 1 100%; }
  .f-call input.big { height: 48px; font-size: 24px !important; }
  .f-name, .f-qth, .f-country, .f-cnty { flex: 1 1 45%; }
  .f-date { flex: 1 1 45%; } .f-time { flex: 1 1 22%; }
  .f-band, .f-mode, .f-freq { flex: 1 1 30%; }
  .f-xs, .f-rst, .f-qsl, .f-st, .f-grid, .f-op { flex: 1 1 22%; }
  input, select, textarea { font-size: 16px !important; height: 40px; }  /* 16px stops iOS zoom-on-focus */
  input[type=date] { line-height: 38px; }
  .f-name input, .f-qth input, .f-st input, .f-cnty input { height: 40px; }
  .buttons button { flex: 1 1 40%; height: 44px !important; }
  .log { margin: 8px; }
  .log-bar { flex-wrap: wrap; }
  .log-bar input { max-width: none; flex: 1 1 100%; }
  .c-freq, .c-qth, .c-comment, #log-table th:nth-child(n+9), #log-table td:nth-child(n+9) { display: none; }
  dialog { padding: 0 14px 14px; }
}

/* phone quick-tab toolbar */
.quickbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--card);
  border-top: 1px solid var(--border); box-shadow: 0 -4px 14px rgba(16, 24, 40, .10);
}
.quickbar { align-items: center; }
.quickbar button { flex: 1 1 0; height: 46px; margin: 0; font-size: 16px; font-weight: 650; touch-action: manipulation; }
.quickbar button.log { background: var(--good); color: #fff; border-color: var(--good); }
body.phone #main { padding-bottom: 76px; }
#auth:not([hidden]) ~ .quickbar { display: none; }

/* CAT */
.pill.warn { background: rgba(245, 158, 11, .22); color: #fcd34d; }
#cat-status { font-family: var(--mono); }
.download-box { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-head); }
a.btn { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  font-weight: 650; text-decoration: none; border: 1px solid var(--border-strong); }
a.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
a.btn.big { height: 42px; font-size: 15px; }
.steps { margin: 12px 0 0; padding-left: 20px; line-height: 1.6; color: var(--ink-2); }
.token-box { margin-top: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--good) 45%, transparent);
  background: var(--good-soft); border-radius: var(--radius); }
.token-box p { margin: 0 0 8px; }
.token-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.token-row code { font-size: 13px; word-break: break-all; padding: 6px 8px; background: var(--card); flex: 1 1 300px; user-select: all; }

/* ---------- ADIF open / save ---------- */
a.button {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--card); color: var(--ink); font-weight: 550;
  text-decoration: none; white-space: nowrap;
}
@media (hover: hover) { a.button:hover { background: var(--card-head); border-color: var(--muted); } }
.log-file { display: flex; gap: 6px; }
.log-file button, .log-file a.button { height: 32px; padding: 0 11px; font-size: 13px; }
dialog.small-dlg { width: min(520px, 96vw); padding: 4px 22px 18px; }
.small-dlg h3 { font-size: 17px; margin: 14px 0 8px; }
.small-dlg label { display: block; margin: 10px 0; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.small-dlg label input:not([type=checkbox]):not([type=radio]) { margin-top: 5px; }
.small-dlg label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 500; color: var(--ink); }
.small-dlg label.check input { width: 16px; height: 16px; margin: 1px 0 0; flex: none; }
.small-dlg .radios { margin: 6px 0 4px; }
.small-dlg .actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.small-dlg .actions .msg { order: -1; margin-right: auto; }
.imp-summary { margin: 10px 0 6px; }
.imp-errors { max-height: 200px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
@media (max-width: 1100px) {
  .log-file { flex: 1 1 100%; }
  .log-file button, .log-file a.button { flex: 1; justify-content: center; height: 40px; }
}
.small-list { font-size: 13px; line-height: 1.5; margin: 4px 0 10px; padding-left: 20px; }
.small-list li { margin: 3px 0; }

/* ---------- Phase 4: radio panel ---------- */
.info > #rig-panel { margin: 0; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.rig-panel > *:not(.card-head) { margin-left: 14px; margin-right: 14px; }
.rig-panel .card-head #rig-name { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 12px; }
.rig-display { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.rig-freq { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.rig-mode { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--accent); }
.rig-tune { display: flex; gap: 6px; margin-top: 8px; }
.rig-tune input { font-family: var(--mono); }
.rig-buttons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.rig-buttons button { height: 30px; padding: 0 8px; font-size: 12px; font-family: var(--mono); min-width: 40px; }
.rig-buttons button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.rig-panel.busy .rig-buttons button, .rig-panel.busy .rig-tune button { opacity: .6; pointer-events: none; }
.rig-msg { font-size: 12px; color: var(--muted); min-height: 0; margin-top: 6px; }
.rig-msg:empty { display: none; }
.rig-msg.err { color: var(--bad); }
@media (max-width: 1100px) {
  .rig-buttons button { height: 38px; flex: 1 1 13%; font-size: 13px; }
  .rig-freq { font-size: 26px; }
}

/* ---------- statistics & awards ---------- */
dialog.stats-dlg { width: min(1000px, 97vw); height: min(860px, 94vh); }
.dlg-head #st-close { border: none; background: none; font-size: 18px; }
.st-confirm { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; color: var(--ink-2); margin: -6px 0 12px; }
.st-confirm label.check { display: flex; gap: 6px; align-items: center; font-weight: 500; color: var(--ink); }
.st-confirm input { width: 16px; height: 16px; margin: 0; }
.st-note { background: var(--warn-soft, var(--card-head)); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.st-tiles.small { grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 6px; margin: 10px 0 6px; }
.st-tile { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--card-head); }
.st-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.st-value { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.st-tiles.small .st-value { font-size: 18px; }
.st-sub { font-size: 12px; color: var(--ink-2); }
.st-progress-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px 24px; margin-bottom: 18px; }
.st-progress { margin: 4px 0 10px; }
.st-progress-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.st-progress-head strong { color: var(--ink); }
.st-meter { position: relative; height: 10px; border-radius: 5px; background: var(--border); overflow: hidden; }
.st-meter span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.st-meter-w { background: color-mix(in srgb, var(--accent) 35%, var(--card)); }
.st-meter-c { background: var(--accent); }
.st-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.st-chart h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 10px 0 8px; }
.st-bars { display: flex; flex-direction: column; gap: 4px; }
.st-bar-row { display: grid; grid-template-columns: 64px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; padding: 1px 0; }
@media (hover: hover) { .st-bar-row:hover { background: var(--card-head); } }
.st-bar-label { font-family: var(--mono); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-bar-track { height: 14px; }
.st-bar { display: block; position: relative; height: 100%; min-width: 3px; background: color-mix(in srgb, var(--accent) 35%, var(--card)); border-radius: 0 4px 4px 0; overflow: hidden; }
.st-bar-conf { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.st-bar-value { font-family: var(--mono); text-align: right; color: var(--ink); }
.st-cols { display: flex; gap: 4px; height: 180px; overflow-x: auto; }
.st-col { flex: 1 0 34px; display: flex; flex-direction: column; height: 100%; }
.st-col-plot { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border-bottom: 1px solid var(--border); min-height: 0; }
.st-col-bar { width: 70%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.st-col-value { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.st-col-label { text-align: center; font-family: var(--mono); font-size: 10px; color: var(--muted); white-space: nowrap; padding-top: 4px; }
.st-legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); margin: 0 0 8px; }
.st-legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid var(--border-strong); }
.sw.c, .st-cell.c { background: var(--accent); border-color: var(--accent); color: #fff; }
.sw.w, .st-cell.w { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--card)); color: var(--accent); }
.sw.n { background: var(--card); }
.st-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 5px; }
.st-cell { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 4px; text-align: center;
  font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--muted); position: relative; }
.st-cell small { position: absolute; top: 1px; right: 4px; font-size: 10px; }
.st-filter { max-width: 260px; margin: 8px 0; }
.st-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 52vh; }
.st-dxcc th { position: sticky; top: 0; background: var(--card-head); }
.st-dxcc td.num { font-family: var(--mono); text-align: right; }
.st-dxcc td.st-c { color: var(--accent); font-weight: 700; }
.st-dxcc td.st-w { color: var(--muted); }
.st-bandcell { text-align: center; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.st-bandcell.c { background: var(--accent); color: #fff; }
.st-bandcell.w { background: var(--accent-soft); color: var(--accent); }
.st-prefixes { display: flex; flex-wrap: wrap; gap: 5px; }
.st-prefixes span { font-family: var(--mono); font-size: 12px; border: 1px solid var(--border); border-radius: 4px; padding: 3px 7px; }
@media (max-width: 1100px) {
  .st-grid2 { grid-template-columns: 1fr; gap: 0; }
  dialog.stats-dlg { height: 94vh; }
  #btn-stats { padding: 0 10px; }
}

/* ---------- LoTW settings ---------- */
.lotw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0 12px; }
.lotw-grid label { margin: 6px 0; }
.qrz-status .actions a.button { height: 34px; }

/* ---------- log tabs, DX spots ---------- */
.log-tabs { display: flex; gap: 2px; }
.log-tabs button { border: none; background: none; height: 32px; padding: 0 10px; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); font-weight: 600; }
.log-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.log-tabs button.active strong { color: var(--ink); }
#spot-count { font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 10px; }
#spot-count:empty { display: none; }
.spots-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.spots-bar select { width: auto; height: 30px; }
.spots-bar label.check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.spots-bar label.check input { width: 16px; height: 16px; margin: 0; }
.spots-bar .spacer { flex: 1; }
#spots-table tr.spot { cursor: pointer; }
#spots-table td.mono { font-family: var(--mono); }
#spots-table tr.worked td, #spots-table tr.worked_band td { color: var(--muted); }
.spot-flag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.spot-flag.new_dxcc { background: var(--accent); color: #fff; }
.spot-flag.new_band { background: var(--accent-soft); color: var(--accent); }
.spot-flag.worked_band, .spot-flag.worked { color: var(--muted); border: 1px solid var(--border); }
.spots-empty { padding: 14px; margin: 0; }
.spots-empty:empty { display: none; }

/* ---------- beam heading ---------- */
.beam { margin-top: 6px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.beam-main { font-family: var(--mono); font-weight: 700; color: var(--ink); }
.beam-turn { display: inline-flex; gap: 4px; margin-left: 8px; }
button.small { height: 26px; padding: 0 9px; font-size: 12px; }
.rig-rot { font-family: var(--mono); font-size: 13px; color: var(--ink-2); margin-top: 6px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: var(--card); padding: 10px 14px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
@media (max-width: 1100px) {
  .toasts { left: 12px; right: 12px; bottom: 90px; }
  .spots-bar .small-note { display: none; }
  #spots-table th:nth-child(n+7), #spots-table td:nth-child(n+7),
  #spots-table th:nth-child(1), #spots-table td:nth-child(1),
  #spots-table th:nth-child(4), #spots-table td:nth-child(4) { display: none; }   /* phones: freq, call, mode, flag */
}

/* ---------- send a spot ---------- */
.spot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ---------- pop-out windows (/?view=radio|info|log|spots) ---------- */
.head-right { display: inline-flex; align-items: center; gap: 8px; }
.pop-btn { height: 24px; min-width: 26px; padding: 0 6px; font-size: 13px; line-height: 1; border-color: var(--border); color: var(--muted); }
.pop-btn.wide { height: 30px; padding: 0 10px; }
.card-head .pop-btn { margin-left: auto; }
html.popout .pop-btn { display: none !important; }
html.popout .topbar > :not(.brand):not(#logbook-select):not(#cat-status):not(#ws-status):not(.spacer):not(.utc) { display: none; }
html.popout #quickbar { display: none !important; }
html.popout .workspace { grid-template-columns: minmax(0, 1fr); padding: 8px; }
html.popout #qso-form { display: none; }
html.popout .log { margin: 8px; }
html[data-popout=radio] section.log, html[data-popout=info] section.log { display: none; }
html[data-popout=radio] .info > :not(#rig-panel) { display: none !important; }
html[data-popout=info] #rig-panel { display: none !important; }
html[data-popout=log] .workspace, html[data-popout=spots] .workspace { display: none; }
html[data-popout=log] #log-tabs [data-view=spots], html[data-popout=spots] #log-tabs [data-view=log] { display: none; }
html[data-popout=log] .log-wrap { max-height: calc(100vh - 130px); }
html[data-popout=spots] .log-file, html[data-popout=spots] #log-search { display: none !important; }
html[data-popout=spots] #spots-view { display: block !important; }
html[data-popout=spots] section.log > .log-wrap { display: none; }
html[data-popout=spots] #spots-view .log-wrap { max-height: calc(100vh - 150px); }
html[data-popout=info] .prev-wrap { max-height: none; }

/* ---------- rotator ---------- */
.rot-box { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.rot-head { display: flex; align-items: center; gap: 14px; }
.rot-dial { width: 76px; height: 76px; flex: none; }
.dial-ring { fill: var(--card-head); stroke: var(--border-strong); stroke-width: 2; }
.dial-ticks line { stroke: var(--muted); stroke-width: 2; }
.dial-n { fill: var(--muted); font-size: 13px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; }
.dial-needle { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.dial-target { stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 4 3; }
.dial-hub { fill: var(--accent); }
.rot-az { font-family: var(--mono); font-size: 28px; font-weight: 700; }
#rot-beam button { flex: 1 1 auto; min-width: 38px; white-space: nowrap; }

/* ---------- rotator map ---------- */
.rot-map-wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.rot-map { display: block; max-width: 100%; }
.rot-readout { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.rot-state { font-size: 12px; color: var(--muted); }
.rot-state.moving { color: var(--accent); font-weight: 600; }
.rot-name { text-align: center; margin-bottom: 4px; }
html[data-popout=radio] .rot-az { font-size: 36px; }

/* ---------- grey line ---------- */
.greyline-view { margin: 8px; display: none; }
html[data-popout=greyline] .greyline-view:not([hidden]) { display: block; }
html[data-popout=greyline] .workspace, html[data-popout=greyline] section.log { display: none !important; }
.gl-wrap { padding: 8px; }
.gl-wrap canvas { display: block; width: 100%; border-radius: 6px; }
.gl-info { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 0 14px 12px; align-items: flex-start; }
.gl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.gl-legend span { display: flex; align-items: center; gap: 6px; }
.sw.gl-day { background: #8fbf73; } .sw.gl-twi { background: #4d6a86; } .sw.gl-night { background: #0e1a33; } .sw.gl-line { background: #ffc446; }
.gl-sun { color: #e0a800; font-style: normal; font-size: 15px; }
.gl-times { min-width: 360px; }
.gl-times th { text-align: left; }
td.gl-on { color: #b7791f; font-weight: 700; }
#gl-time { font-family: var(--mono); font-weight: 600; text-transform: none; letter-spacing: 0; }
/* Pop-out windows need a desktop browser: hide them on phones and tablets. */
@media (max-width: 600px), (hover: none) and (pointer: coarse) { #btn-greyline, .pop-btn { display: none !important; } }

/* ---------- worked stations on the maps ---------- */
.plot-ctrl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.plot-ctrl label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.plot-ctrl select { width: auto; height: 26px; font-size: 12px; padding: 0 4px; }
.rot-plot { display: flex; justify-content: center; margin: 2px 0 6px; }
.sw.gl-worked { background: #22c55e; border-radius: 50%; }

/* ---------- DX ticker ---------- */
.ticker {
  position: relative; display: flex; align-items: center; gap: 0; height: 34px;
  background: color-mix(in srgb, var(--bar) 88%, #000); color: var(--bar-ink);
  border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: 13px;
}
.ticker-label {
  flex: none; align-self: stretch; display: flex; align-items: center; padding: 0 12px;
  font-weight: 800; letter-spacing: 1px; font-size: 12px; background: var(--accent, #2563eb); color: #fff;
}
.ticker-viewport {
  flex: 1; min-width: 0; overflow: hidden; height: 100%; display: flex; align-items: center;
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.ticker-track { display: flex; white-space: nowrap; will-change: transform; padding-left: 12px; }
.ticker-track.scrolling { animation: ticker-scroll linear infinite; }
.ticker:hover .ticker-track.scrolling, .ticker:focus-within .ticker-track.scrolling { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-viewport { overflow-x: auto; mask-image: none; } }
.tk-run { display: inline-flex; gap: 0; padding-right: 0; }
.tk-item {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 14px; margin: 0;
  background: transparent; border: 0; border-right: 1px solid rgba(255, 255, 255, .14); border-radius: 0;
  color: var(--bar-ink); font-size: 13px; cursor: pointer;
}
.tk-item:hover { background: rgba(255, 255, 255, .1); }
.tk-call { font-size: 14px; letter-spacing: .3px; color: #fff; }
.tk-freq { color: #fde68a; }
.tk-country { color: var(--bar-ink); }
.tk-mode, .tk-age { color: var(--bar-muted); font-size: 12px; }
.tk-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; padding: 1px 6px; border-radius: 4px; }
.tk-tag.new { background: #dc2626; color: #fff; }
.tk-tag.band { background: #d97706; color: #fff; }
.tk-tag.rare { background: #7c3aed; color: #fff; }
.tk-item.is-new .tk-call { color: #fecaca; }
.tk-empty { color: var(--bar-muted); padding: 0 4px; }
.ticker-opts-btn {
  flex: none; height: 26px; margin: 0 8px; padding: 0 10px; font-size: 12px;
  background: transparent; color: var(--bar-ink); border-color: rgba(255, 255, 255, .2);
}
.ticker-opts {
  position: absolute; right: 8px; top: 36px; z-index: 50; width: min(340px, calc(100vw - 16px));
  display: grid; gap: 8px; padding: 12px 14px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: var(--radius-sm, 6px); box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.ticker-opts label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.ticker-opts input[type=checkbox] { width: auto; height: auto; }
.ticker-opts select { width: auto; height: 26px; font-size: 12px; padding: 0 4px; }
.topbar button.active { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .4); }
html.popout .ticker { display: none !important; }
@media (max-width: 700px) { .tk-age, .tk-mode { display: none; } .ticker-label { padding: 0 8px; } }

/* ---------- band buttons (phones) ---------- */
.band-chips { display: none; }
@media (max-width: 600px) {
  #spot-band { display: none; }
  .band-chips {
    display: flex; gap: 6px; flex: 1 1 100%; order: 5; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px 0 4px;
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .band-chips::-webkit-scrollbar { display: none; }
  .band-chip {
    flex: none; scroll-snap-align: start; height: 34px; padding: 0 12px; margin: 0; border-radius: 17px;
    font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; color: var(--muted);
  }
  .band-chip.has { color: var(--ink); }
  .band-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .chip-n { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
  .band-chip.active .chip-n { background: rgba(255, 255, 255, .25); color: #fff; }
}

/* ---------- live spots on the grey line map ---------- */
.gl-spots-ctrl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-2); }
.gl-spots-ctrl input { width: 15px; height: 15px; margin: 0; }
.sw.gl-spot { background: #ff3fd1; transform: rotate(45deg) scale(.8); border-radius: 1px; }

/* ---------- ticker band choice ---------- */
.tk-bands { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.tk-bands legend { font-size: 13px; padding: 0; margin-bottom: 4px; }
.tk-band-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-band-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 8px; }
.ticker-opts label.tk-band { font-size: 12.5px; gap: 4px; flex-wrap: nowrap; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-band-grid { grid-template-columns: repeat(5, auto); justify-content: space-between; }
.tk-off { justify-self: start; }

/* ---------- satellite fields ---------- */
.entry label.check.f-sat { flex: 0 0 auto; display: flex; flex-direction: row; align-items: center; gap: 6px; align-self: end; height: 38px; font-size: 13px; }
.f-sat input { width: 16px; height: 16px; margin: 0; }
.sat-row { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: var(--radius-sm, 6px); padding-top: 8px !important; padding-bottom: 8px !important; margin-left: 14px; margin-right: 14px; }
.f-satpick { flex: 1 1 260px; } .f-satname { flex: 0 0 110px; } .f-satmode { flex: 0 0 76px; }
.sat-note { flex: 1 1 100%; font-size: 12px; }
@media (max-width: 600px) { .sat-row { margin-left: 10px; margin-right: 10px; } .f-satpick { flex: 1 1 100%; } .f-satname, .f-satmode { flex: 1 1 30%; } }

/* ---------- two-factor required ---------- */
.must-2fa-note { background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius-sm, 6px); padding: 10px 12px; font-size: 13.5px; line-height: 1.45; }
body.must-2fa #settings [data-close], body.must-2fa #settings .tabs > button:not([data-tab=tab-security]) { display: none; }
body.must-2fa #password-form, body.must-2fa #tab-security > h3:first-of-type { display: none; }

/* ---------- forgotten password / admin reset ---------- */
.auth-links { margin: 6px 0 0; font-size: 13px; }
.forgot-note { font-size: 13px; line-height: 1.45; background: color-mix(in srgb, var(--accent) 8%, transparent); padding: 8px 10px; border-radius: var(--radius-sm, 6px); }
.temp-pw { font-size: 22px; font-weight: 700; letter-spacing: 1.5px; text-align: center; padding: 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm, 6px); user-select: all; }
.pill-admin { margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
body.must-pw #settings [data-close], body.must-pw #settings .tabs > button:not([data-tab=tab-security]) { display: none; }
body.must-pw #tab-security > :not(#must-pw-note):not(#password-form):not(h3:first-of-type) { display: none; }

.tk-empty.tk-warn { color: #fde68a; }
.ticker-opts label.tk-all { padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.tk-filters { display: grid; gap: 8px; }
.tk-filters.off { opacity: .45; pointer-events: none; }
.tk-bands.myband .tk-band-quick, .tk-bands.myband .tk-band-grid { opacity: .45; pointer-events: none; }
.tk-run.tk-msg { padding: 0 60px 0 4px; white-space: nowrap; }

/* ---------- grey line map: its own spot filter ---------- */
.greyline-view { position: relative; }
.gl-filter { top: 46px; right: 12px; }
.gl-filter-title { margin: 0 0 4px; font-size: 13px; }
#gl-filter-btn { height: 26px; margin-left: -4px; }
html.popout { scrollbar-gutter: stable; }   /* keep the width steady: no resize loops */

/* ---------- flags and mode filter ---------- */
img.flag { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); vertical-align: -2px; flex: none; }
td img.flag { margin-right: 6px; }
.tk-modes { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tk-modes legend { font-size: 13px; padding: 0; margin-bottom: 4px; width: 100%; }
.ticker-opts .tk-modes label { font-size: 12.5px; }
.spots-bar #spot-mode { width: auto; height: 30px; }

/* Solar & band conditions (Station Info panel) */
.solar { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin: 0 !important; }
.solar > *:not(.card-head) { margin-left: 14px; margin-right: 14px; }
.solar-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 10px; }
.solar-num { background: var(--row-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 6px; text-align: center; }
.solar-num span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.solar-num b { font-family: var(--mono); font-size: 15px; color: var(--ink); }
.solar-num.good b { color: var(--good); } .solar-num.warn b { color: var(--warn); } .solar-num.bad b { color: var(--bad); }
.solar-bands { width: calc(100% - 28px); border-collapse: separate; border-spacing: 2px; font-size: 12px; margin-top: 8px; table-layout: fixed; }
.solar-bands th { color: var(--muted); font-weight: 600; font-size: 10.5px; text-align: center; }
.solar-bands th:first-child, .solar-bands td:first-child { text-align: left; color: var(--ink-2); font-weight: 600; }
.solar-bands td { text-align: center; padding: 2px 0; border-radius: 4px; }
.solar-bands td.Good { background: var(--good-soft); color: var(--good); font-weight: 600; }
.solar-bands td.Fair { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.solar-bands td.Poor { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.solar-extra { font-size: 11.5px; margin-top: 6px; line-height: 1.5; }
.solar-extra a { color: inherit; }
