/* AirChain theme: the Nielsen Encoder page's design carried to every app page.
   Loaded after each app's own stylesheet (the stack pages link it; the shared
   header script adds it for MixBus Control and SignalWatch), so these rules
   win on the vocabulary the pages share: tokens, header nav, cards, lists, chips,
   buttons, fields, tiles, tables, logs. Montserrat for everything, numbers too.
   App-specific pieces are at the end, each under its own heading. */

/* ── Tokens ─────────────────────────────────────────────────────────── */

:root {
  --page: #EBEAE8;
  --surface: #FAFAF9;
  --surface-2: #F1F0EE;
  --surface-3: #E1E0DD;
  --header: #222221;
  --fg: #222221;
  --fg-2: #585755;
  --fg-3: #7F7E7A;
  --fg-quiet: #A3A29F;
  --hairline: rgba(34, 33, 31, 0.08);
  --line: rgba(34, 33, 31, 0.15);
  --strong: rgba(34, 33, 31, 0.3);
  --accent: #F36F1F;
  --accent-hover: #D85A12;
  --accent-ink: #B5480C;
  --accent-soft: #FCEBDF;
  --accent-glow: rgba(243, 111, 31, 0.32);
  --ok: #3B9460; --ok-soft: #E3F0E7; --ok-ink: #226B43;
  --warn: #D69A1C; --warn-soft: #F9EFD6; --warn-ink: #86590A;
  --bad: #C94A37; --bad-soft: #FAE7E3; --bad-ink: #9A3222;
  --off-soft: #E1E0DD; --off-ink: #585755;
  --track: #E1E0DD; --meter: #3A3936; --meter-2: #8F8E8A; --meter-hold: #222221;
  --grid: rgba(34, 33, 31, 0.08); --plot-line: #2E2D2B; --plot-band: rgba(46, 45, 43, 0.16); --plot-fill: rgba(46, 45, 43, 0.1);
  --shadow-1: 0 1px 2px rgba(34, 33, 31, 0.04), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  --shadow-2: 0 1px 2px rgba(34, 33, 31, 0.05), 0 18px 40px -28px rgba(34, 33, 31, 0.35);
  --shadow-4: 0 24px 64px -24px rgba(34, 33, 31, 0.35);
  --shadow-thumb: 0 1px 2px rgba(34, 33, 31, 0.12), 0 4px 10px -4px rgba(34, 33, 31, 0.25);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r: 20px;
}
:root[data-theme="dark"] {
  --page: #1A1A19;
  --surface: #252524;
  --surface-2: #2E2E2C;
  --surface-3: #393937;
  --header: #222221;
  --fg: #EFEFED;
  --fg-2: #B9B9B5;
  --fg-3: #8B8B87;
  --fg-quiet: #686865;
  --hairline: rgba(255, 254, 250, 0.07);
  --line: rgba(255, 254, 250, 0.14);
  --strong: rgba(255, 254, 250, 0.28);
  --accent-ink: #FFA060;
  --accent-soft: rgba(243, 111, 31, 0.16);
  --accent-glow: rgba(243, 111, 31, 0.4);
  --ok: #4FB57F; --ok-soft: rgba(79, 181, 127, 0.16); --ok-ink: #8ADBB0;
  --warn: #E6B04A; --warn-soft: rgba(230, 176, 74, 0.16); --warn-ink: #F2CB7A;
  --bad: #E2604D; --bad-soft: rgba(226, 96, 77, 0.16); --bad-ink: #FF8E7E;
  --off-soft: rgba(255, 254, 250, 0.07); --off-ink: #B9B9B5;
  --track: #393937; --meter: #D6D5D1; --meter-2: #77766F; --meter-hold: #FFFFFF;
  --grid: rgba(255, 254, 250, 0.07); --plot-line: #E0DFDB; --plot-band: rgba(224, 223, 219, 0.18); --plot-fill: rgba(224, 223, 219, 0.1);
  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  --shadow-2: 0 1px 0 rgba(0, 0, 0, 0.3), 0 24px 50px -30px rgba(0, 0, 0, 0.8);
  --shadow-4: 0 24px 64px -16px rgba(0, 0, 0, 0.6);
  --shadow-thumb: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 10px -4px rgba(0, 0, 0, 0.5);
}

/* ── Base ───────────────────────────────────────────────────────────── */

html, body { background: var(--page); }
body { font: 400 14px/1.5 var(--font); font-variant-numeric: tabular-nums; color: var(--fg); }
::selection { background: var(--orange-200, #FFC79C); color: #222221; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* Containers that only take focus as a skip-link or dialog-return target (the
   page's main area) never show a ring around the whole page. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
.mono, .num, .kv dd, .log, .raw, pre, code, .readout, .scale, .bi-scale, .pcount, .ab-key, .meta-text, .up-at, .af span,
.tune input, .minput.mono, .field input, .side-freq, .hero-freq, .ps, .big-num, .stat .value, .mod-readout .big,
.tile strong, .pl-card .when, .pl-card .prog, .log-list time, .kv.mono-v dd, .chain-sub, table.data .id, .log-box {
  font-family: var(--font);
}
/* The wave watermark at the foot of every page: quieter on the gray. */
body::after { opacity: 0.22; }
:root[data-theme="dark"] body::after { opacity: 0.14; }

/* ── Header ─────────────────────────────────────────────────────────── */

.topbar-inner { gap: 16px; }
.brand-name { border-left-color: rgba(255, 254, 250, 0.18); font-size: 12px; letter-spacing: 0; text-transform: none; color: rgba(255, 254, 250, 0.8); }
.nav { position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(255, 254, 250, 0.08); border: 0; box-shadow: none; }
.nav-btn {
  position: relative; z-index: 1;
  height: 34px; padding: 0 18px;
  border-radius: 999px;
  color: rgba(255, 254, 250, 0.66);
  font: 700 13px/1 var(--font);
  letter-spacing: 0; text-transform: none;
  transition: color 260ms var(--ease);
}
.nav-btn:hover { color: #fff; background: transparent; }
:root[data-theme="dark"] .nav-btn:hover { background: transparent; }
.nav-btn[aria-current="page"] { color: #222221; background: #F2F2F0; text-shadow: none; box-shadow: none; }
.nav-btn[aria-current="page"]:hover { background: #F2F2F0; }
.nav.thumbed .nav-btn[aria-current="page"] { background: transparent; }
.nav-thumb {
  position: absolute; top: 4px; height: 34px;
  left: var(--x, 4px); width: var(--w, 0px);
  border-radius: 999px; background: #F2F2F0; box-shadow: var(--shadow-thumb);
  opacity: 0; transition: left 420ms var(--ease), width 420ms var(--ease), opacity 200ms;
}
.nav.thumbed .nav-thumb { opacity: 1; }
.nav-btn .nav-badge { background: var(--bad); color: #fff; font-size: 10px; letter-spacing: 0; }
.conn { font: 600 12.5px/1 var(--font); letter-spacing: 0; text-transform: none; color: rgba(255, 254, 250, 0.7); gap: 8px; min-width: 11em; justify-content: flex-end; }
.conn::before { width: 8px; height: 8px; background: rgba(255, 254, 250, 0.35); transition: background 400ms, box-shadow 400ms; }
.conn[data-state="live"] { color: rgba(255, 254, 250, 0.9); }
.conn[data-state="live"]::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(79, 181, 127, 0.22); animation: fs-breathe-ok 2.6s var(--ease) infinite; }
.conn[data-state="stale"], .conn[data-state="reconnecting"] { color: rgba(255, 254, 250, 0.8); }
.conn[data-state="stale"]::before, .conn[data-state="reconnecting"]::before { background: var(--warn); box-shadow: 0 0 0 3px rgba(230, 176, 74, 0.22); }
@keyframes fs-breathe-ok { 0% { box-shadow: 0 0 0 0 rgba(79, 181, 127, 0.4); } 70%, 100% { box-shadow: 0 0 0 7px rgba(79, 181, 127, 0); } }
.readout { font: 600 12px/1 var(--font); letter-spacing: 0; color: rgba(255, 254, 250, 0.6); background: rgba(255, 254, 250, 0.07); border: 0; border-radius: 999px; padding: 8px 12px; }
.icon-btn { border: 1px solid rgba(255, 254, 250, 0.2); border-radius: 50%; color: #EFEFED; transition: border-color 200ms, background 200ms; }
.icon-btn:hover { border-color: rgba(255, 254, 250, 0.55); background: rgba(255, 254, 250, 0.06); color: #fff; }
.icon-btn svg { width: 16px; height: 16px; }
.banner { font-weight: 700; }

/* ── Layout ─────────────────────────────────────────────────────────── */

.shell { max-width: 1480px; padding: 0 32px 48px; gap: 24px; }
.page-head { margin: 30px 0 18px; padding-bottom: 0; border-bottom: 0; align-items: baseline; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
/* The header already says which app this is and the menu which section: no eyebrow over the title. */
.page-head .eyebrow { display: none; }
.page-meta { font-size: 12.5px; color: var(--fg-3); }
.eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--fg-3); margin: 0 0 6px; }
:root:not([data-theme="dark"]) .eyebrow { color: var(--fg-3); }
.grid { gap: 16px; margin-bottom: 16px; }

.card { border-radius: 20px; border: 1px solid var(--hairline); box-shadow: var(--shadow-1); padding: 22px 24px; }
.card-head { margin-bottom: 12px; }
.card h2, .card-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.card h3 { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--fg-3); margin: 18px 0 8px; }
.card-note { font-size: 12.5px; line-height: 1.55; }
.card-head .subtle { font-size: 12.5px; }
.notice { border-radius: 14px; padding: 12px 16px; font-size: 13px; font-weight: 600; line-height: 1.45; border: 0; }
.notice.info { background: var(--surface); color: var(--fg-2); box-shadow: 0 0 0 1px var(--hairline) inset; }
.notice.warn { background: var(--warn-soft); color: var(--warn-ink); }
.notice.bad { background: var(--bad-soft); color: var(--bad-ink); }
.empty { color: var(--fg-3); font-size: 13px; }

/* Side panel (SignalWatch): a card of its own instead of a rule down the side, level with the first row of cards. */
.side { padding-top: 74px; }
.side-inner { gap: 16px; top: 88px; }
.side-block { border-left: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; box-shadow: var(--shadow-1); }
.side .eyebrow { color: var(--fg-3); margin-bottom: 8px; }
.side-station { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.side-freq { font-weight: 600; font-size: 13px; }
.side p { font-size: 13px; line-height: 1.6; }

/* ── Lists, chips, readings ─────────────────────────────────────────── */

.kv { font-size: 13.5px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.kv dt, .kv dd { padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.kv dt { color: var(--fg-2); }
.kv dd { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.kv.compact dt, .kv.compact dd { padding: 6px 0; }
.kv dd.null, .null { color: var(--fg-quiet); font-weight: 500; }

.chip {
  height: 26px; padding: 0 11px 0 9px; gap: 7px;
  font: 600 12px/1 var(--font); letter-spacing: 0; text-transform: none;
  background: var(--off-soft); color: var(--off-ink);
}
.chip::before { width: 7px; height: 7px; opacity: 0.85; }
.chip.ok { background: var(--ok-soft); color: var(--ok-ink); }
.chip.warn { background: var(--warn-soft); color: var(--warn-ink); }
.chip.bad { background: var(--bad-soft); color: var(--bad-ink); }
.chips { gap: 8px; }

.hero-call { font-size: 40px; font-weight: 800; letter-spacing: -0.035em; }
.hero-sub { font-size: 13.5px; color: var(--fg-2); }
.hero-sub .mono { font-weight: 600; }
.hero-freq { font-weight: 800; font-size: 32px; letter-spacing: -0.03em; }
.hero-freq small { font: 600 12px var(--font); letter-spacing: 0; text-transform: none; color: var(--fg-3); margin-top: 4px; }
.big-num { font-weight: 800; font-size: 32px; letter-spacing: -0.03em; }
.big-num small { font: 600 13px var(--font); color: var(--fg-3); letter-spacing: 0; }
.mod-readout .big { font-weight: 800; letter-spacing: -0.035em; }

/* Stat tiles: dividers instead of boxes. */
.stats { gap: 18px 14px; background: none; border: 0; border-radius: 0; margin-left: -14px; overflow: hidden; margin-top: 14px; }
.stats .stat, .stat { background: none; padding: 2px 0 2px 14px; box-shadow: -1px 0 0 var(--hairline); }
.stat .label { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--fg-3); margin-bottom: 6px; }
.stat .value { font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.stat .value small { font: 600 12px var(--font); letter-spacing: 0; }
.stat .sub { font-size: 12px; }

.meter { border-radius: 4px; }
.meter.tall { border-radius: 6px; }
.scale { font: 500 10px/16px var(--font); color: var(--fg-quiet); }
.meter-label { font-size: 12.5px; }
.meter-label .num { font-weight: 600; }
.plot { border-radius: 14px; }
.legend { font-size: 12px; }

/* Tables */
table.data th { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--fg-3); padding: 8px 12px; }
table.data td { padding: 10px 12px; }
table.data td.mono { font-size: 13px; }
table.data .id { font-size: 11.5px; }

/* Logs */
.log, .log-box, .raw { font: 500 12.5px/1.7 var(--font); color: var(--fg-2); background: var(--surface-2); border-radius: 14px; padding: 16px 18px; }

/* ── Controls ───────────────────────────────────────────────────────── */

.btn {
  height: 40px; min-height: 0; padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  font: 700 13.5px/1 var(--font);
  white-space: nowrap;
  transition: background 200ms, border-color 200ms, color 200ms, transform 160ms var(--ease), box-shadow 200ms;
}
.btn:hover { background: var(--surface-2); border-color: var(--strong); }
.btn:active { transform: scale(0.97); }
.btn:disabled { color: var(--fg-quiet); background: var(--surface-2); border-color: var(--hairline); transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 18px -10px var(--accent-glow); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:disabled { opacity: 0.5; color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: none; }
.btn.danger { color: var(--bad-ink); border-color: rgba(201, 74, 55, 0.4); background: var(--surface); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn[aria-pressed="true"] { background: var(--fg); color: var(--page); border-color: var(--fg); }
.btn svg { width: 15px; height: 15px; }
.big-btn { height: auto; min-height: 56px; font-size: 15px; white-space: normal; }

.seg { position: relative; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--hairline); }
.seg button {
  position: relative; z-index: 1;
  height: 36px; padding: 0 18px; border-radius: 999px;
  font: 700 13.5px/1 var(--font); letter-spacing: 0; text-transform: none;
  color: var(--fg-2);
  transition: color 300ms;
}
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { color: var(--fg); background: var(--surface); box-shadow: var(--shadow-thumb); }
.seg.thumbed button[aria-pressed="true"] { background: transparent; box-shadow: none; }
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px;
  left: var(--x, 4px); width: var(--w, 0px);
  border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-thumb);
  opacity: 0; transition: left 420ms var(--ease), width 420ms var(--ease), opacity 200ms;
}
.seg.thumbed .seg-thumb { opacity: 1; }

.field { gap: 7px; margin-bottom: 16px; }
.field label, .field > span, .label { font-size: 13px; font-weight: 600; color: var(--fg); letter-spacing: 0; text-transform: none; }
.field .hint { font-size: 12px; color: var(--fg-3); line-height: 1.45; }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=datetime-local], select, textarea, .minput, .field input {
  font: 500 14px var(--font);
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--fg);
  padding: 0 14px; min-height: 42px;
  transition: border-color 200ms, box-shadow 200ms;
}
textarea { padding: 12px 14px; line-height: 1.5; }
/* Selects drawn like the text fields in every browser (Safari ignores height
   and padding on its native control), with their own arrow. */
select:not([multiple]) {
  -webkit-appearance: none; appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238A8F98' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
input[type=text]:focus, input[type=password]:focus, input[type=number]:focus, input[type=time]:focus, input[type=datetime-local]:focus, select:focus, textarea:focus, .minput:focus, .field input:focus {
  outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type=checkbox] { accent-color: var(--accent); }
.form-msg { font-size: 13px; font-weight: 600; }
.ctl-row { gap: 12px; }

/* ── Motion ─────────────────────────────────────────────────────────── */
/* A tab change is a short rise, staggered down the page; nothing else moves on its own. */

@keyframes fs-rise { from { opacity: 0; transform: translateY(14px); } }
.page { animation: none; }
.page.enter > *, .sec.enter > * { animation: fs-rise 480ms var(--ease) backwards; }
.page.enter > :nth-child(2), .sec.enter > :nth-child(2) { animation-delay: 50ms; }
.page.enter > :nth-child(3), .sec.enter > :nth-child(3) { animation-delay: 100ms; }
.page.enter > :nth-child(4), .sec.enter > :nth-child(4) { animation-delay: 150ms; }
.page.enter > :nth-child(5), .sec.enter > :nth-child(5) { animation-delay: 200ms; }
.page.enter > :nth-child(n+6), .sec.enter > :nth-child(n+6) { animation-delay: 240ms; }
.sec { animation: none; }

/* ── StreamPlayer 2 ─────────────────────────────────────────────────── */

.sp-head h1.sp-station { font-size: 30px; letter-spacing: -0.03em; }
.tiles { gap: 14px; }
.tile { border-radius: 16px; padding: 16px 18px; border: 1px solid var(--hairline); box-shadow: var(--shadow-1); }
.tile span { font-size: 12px; color: var(--fg-3); }
.tile strong { font-weight: 700; font-size: 24px; letter-spacing: -0.02em; }
.tile strong small { font: 600 12px var(--font); }
.tile em { font-size: 11.5px; }
.pl-rail { padding: 26px 6px 16px; }
.pl-card { border-radius: 16px; padding: 10px; }
.pl-card .art { border-radius: 12px; }
.pl-card.current { border: 1.5px solid var(--accent); box-shadow: 0 14px 30px -18px var(--accent-glow); }
.pl-card .when { font-weight: 600; font-size: 11px; }
.pl-card .kind { font-size: 10.5px; letter-spacing: 0.04em; }
.log-list { border-radius: 14px; }
.log-list li { font-size: 13px; }
.log-list time { font-weight: 600; font-size: 12px; }

/* ── System ─────────────────────────────────────────────────────────── */

.core-row { font-size: 12.5px; }
.core-row .num { font-weight: 600; }
.head-notice { border-radius: 999px; }

/* ── Emergency Alert ────────────────────────────────────────────────── */

.air { border-radius: 20px; border-left-width: 1px; }
.air[data-state="idle"] { box-shadow: 0 0 0 1px var(--ok-soft) inset, var(--shadow-1); }
.air[data-state="on"] { box-shadow: 0 0 0 1px rgba(201, 74, 55, 0.35) inset, var(--shadow-2); }
.air-eyebrow { margin-bottom: 2px; }
.air-label { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.air-msg { font-size: 14px; }
.subnav { display: flex; gap: 2px; padding: 4px; margin: 0 0 20px; width: max-content; max-width: 100%; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 999px; overflow-x: auto; }
.subnav-btn { position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; font: 700 13px/1 var(--font); letter-spacing: 0; text-transform: none; color: var(--fg-2); text-decoration: none; transition: color 260ms var(--ease), background 260ms var(--ease); }
.subnav-btn:hover { color: var(--fg); background: transparent; }
.subnav-btn[aria-current="true"] { color: var(--fg); background: var(--surface); box-shadow: var(--shadow-thumb); }
.subnav-btn::after { display: none; }
.subnav-btn .badge { top: 2px; right: 4px; background: var(--bad); color: #fff; border-radius: 999px; font: 700 9.5px/1 var(--font); padding: 3px 5px; }
.rows { gap: 10px; }
.row { border-radius: 14px; background: var(--surface-2); border: 1px solid var(--hairline); padding: 12px 14px; }
.row-title { font-weight: 700; }
.ent, .rl-row, .meta-now, .aes-stream { border-radius: 14px; }
.drop { border-radius: 16px; border: 2px dashed var(--line); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.set-bar { border-radius: 20px; padding: 12px 14px 12px 22px; box-shadow: var(--shadow-4); }
.dlg { border-radius: 20px; border: 1px solid var(--hairline); padding: 24px 26px; box-shadow: var(--shadow-4); }
.dlg h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.025em; }
.dlg::backdrop { background: rgba(34, 33, 31, 0.5); backdrop-filter: blur(2px); }
.alarm { border-radius: 20px; }
.alarm-item { border-radius: 12px; }
.alarm-ev { letter-spacing: 0.04em; font-size: 11.5px; }
.up-list li { font-size: 13px; }
.up-at { font-weight: 600; }
.check { font-weight: 600; }

/* ── MixBus Control ─────────────────────────────────────────────────── */

.preset-select { font-weight: 600; }
.paste summary, .fold summary, .aes-sdp summary { font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.pgroup, .params .card { border-radius: 20px; }
.prow { border-radius: 12px; }
.prow:hover { background: var(--surface-2); }
.prow-name { font-weight: 600; font-size: 13px; }
.prow-unit { font-size: 12px; color: var(--fg-3); }
.pcount { font-size: 11px; font-weight: 600; color: var(--fg-quiet); }
.link-btn { font-weight: 600; }
.ab { gap: 12px; }
.ab-btn { border-radius: 16px; padding: 14px 16px; }
.ab-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 10px 24px -16px var(--accent-glow); }
.ab-key { font-weight: 800; font-size: 22px; }
.ab-name { font-weight: 700; }
.chain-node { border-radius: 12px; }
.chain-node.custom { border-color: var(--accent); background: var(--accent-soft); }
.chain-lane-label { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.chain-name { font-weight: 600; }
.chain-sub { font-weight: 500; }
.meta-label { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--fg-3); }
.meta-text { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.out-actions { border-radius: 20px; padding: 12px 14px 12px 22px; box-shadow: var(--shadow-4); }
/* Parameter rows keep their compact controls; only the shapes change. */
.prow { padding: 8px 6px; margin: 0 -6px; font-size: 13px; }
.prow:hover { background: var(--surface-2); }
.prow-name small { font-weight: 500; }
.prow-ctl input[type=number], .prow-ctl input[type=text], .prow-ctl select { min-height: 34px; height: 34px; border-radius: 10px; padding: 0 10px; font-size: 12.5px; }
.prow-ctl input[type=number] { text-align: right; }
.prow-reset { border-radius: 8px; }
.params-retry { height: 32px; }
.ins-big { font-weight: 700; }
.bimeter { border-radius: 4px; }
.switch-row { font-size: 13px; }

/* ── SignalWatch ───────────────────────────────────────────────── */
/* "About this view" lives behind the "?" by the title now; the station block keeps the side. */
.side .side-block:has(#sd-help) { display: none; }

.now-title { font-weight: 700; }
.ps { font-weight: 700; letter-spacing: 0.04em; }
.ps.large { letter-spacing: 0.06em; }
.song-then { border-radius: 12px; }
.tune input { font-weight: 600; border-radius: 10px; }
.af span { font-weight: 600; border-radius: 6px; }
.lufs div { border-radius: 12px; }
.lufs .num { font-weight: 700; }
.timeline { border-radius: 12px; }
.wave-tip { border-radius: 8px; font-weight: 600; }
.prog-name { font-weight: 800; letter-spacing: -0.02em; }
.al-warn li { border-radius: 10px; }
.alarm-list li { font-size: 13px; }

/* ── "?" beside a page title, and its popover (the header script wires it) ── */
.page-head > div:first-child { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-head > h1 + .help-btn { margin-right: auto; }
.help-btn {
  appearance: none; width: 26px; height: 26px; padding: 0; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg-3); font: 700 13px/1 var(--font); cursor: pointer;
  transition: color 200ms, border-color 200ms, background 200ms, transform 160ms var(--ease);
}
.help-btn:hover, .help-btn[aria-expanded="true"] { color: var(--fg); border-color: var(--strong); background: var(--surface-2); }
.help-btn:active { transform: scale(0.94); }
.help-pop {
  position: fixed; left: var(--x, 16px); top: var(--y, 80px); z-index: 60;
  width: 360px; max-width: calc(100vw - 32px);
  padding: 16px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow-4);
  animation: fs-rise 260ms var(--ease) both;
}
.help-pop p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--fg-2); }
.help-pop p + p { margin-top: 10px; }

/* ── The bridge: live readings docked at the foot of the window while you work
   elsewhere in an app. Frosted, with a gradual fade behind it; hidden on phones. ── */
.bridge { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; pointer-events: none; padding: 0 32px; }
.bridge[hidden] { display: none; }
.bridge::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 170px; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--page) 35%, transparent) 35%, color-mix(in srgb, var(--page) 80%, transparent) 65%, var(--page) 100%); }
.bridge-inner {
  position: relative; z-index: 1; pointer-events: auto;
  max-width: 1480px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 9px 22px 11px; border-radius: 18px 18px 0 0;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--line); border-bottom: 0;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.5) inset, 0 -18px 40px -24px rgba(34, 33, 31, 0.45), var(--shadow-4);
}
:root[data-theme="dark"] .bridge-inner { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 -18px 40px -20px rgba(0, 0, 0, 0.9), var(--shadow-4); }
.bridge-title { flex: none; font-size: 12px; font-weight: 700; color: var(--fg-3); }
.bridge-rows { display: flex; gap: 16px; flex: 1 1 auto; min-width: 0; }
.bridge-row { flex: 1 1 0; min-width: 0; display: grid; gap: 1px; align-content: start; }
.bridge-row.wide { flex: 1.9 1 0; }
.bridge-label { font-size: 11px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bridge-value { font-size: 11.5px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.4em; transition: color 400ms; }
.bridge-row.ok .bridge-value { color: var(--ok-ink); }
.bridge-row.warn .bridge-value { color: var(--warn-ink); }
.bridge-row.bad .bridge-value { color: var(--bad-ink); }
.bridge-bar { display: block; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 3px; }
.bridge-bar[hidden] { display: block; visibility: hidden; }
.bridge-bar u { display: block; height: 100%; background: var(--meter); transform-origin: left; transform: scaleX(0); transition: transform 220ms linear, background-color 300ms; }
.bridge-bar.hot u { background: var(--accent); }
body:has(.bridge:not([hidden])) main { padding-bottom: 110px; }
@media (max-width: 720px) { .bridge { display: none; } }


/* SignalWatch: signal quality rides in the bridge, not as a notice that moves the page. */
#mod-conf { display: none; }

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1240px) {
  .nav { justify-self: center; margin: 6px 0 12px; }
}
@media (max-width: 720px) {
  .shell { padding: 0 16px 120px; }
  .topbar-inner { padding: 0 16px; }
  .nav { justify-self: stretch; }
  .nav-btn { flex: 1; padding: 0 10px; }
  .page-head { margin-top: 22px; }
  .page-head h1 { font-size: 22px; }
  .card { padding: 18px; border-radius: 18px; }
  .hero-call { font-size: 32px; }
  /* Phones: the AirChain button and the app's name carry the header; the lockup and the connection word step aside. */
  body .topbar .stack-brand > img { display: none; }
  .conn { min-width: 0; font-size: 0; gap: 0; }
  .conn::before { width: 8px; height: 8px; }
  .readout { display: none; }
  .side-block { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
