/* ============================================================================
   RealRadio – Site CSS
   - Core variables + base
   - Header / top navigation
   - Layout helpers (grid/columns)
   - Utilities (muted, text-success, buttons, forms)
   - Cards / alerts
   - Sidebar + FIR badge
   - Maps (public/admin/adb-s)
   - User Admin page (scoped to #user-admin-root)
   ========================================================================== */

/* ----------------------------- Core variables ----------------------------- */
:root {
    --bg: #ffffff;
    --fg: #222222;
    --muted: #6b7280;
    --border: #e5e7eb;
    --accent-color: #2fa84f; /* brand green for borders/buttons/links */
    --accent-weak: #eaf7ea; /* light green surface */
    --accent-strong: #1f7a38;
    --accent-ring: rgba(47, 168, 79, 0.35);  /* matches accent-color, ~35% alpha */
    --header-bg: #0f172a; /* slate-900 */
    --header-fg: #e5e7eb; /* slate-200 */
    --header-fg-dim: #cbd5e1; /* slate-300 */
    --header-active-bg: rgba(47,168,79,0.28);
    --link: #2fa84f;
    --link-hover: #1f7a38;
    --radius: 8px;
    --pad: calc(12px * 0.8);
    --shadow: 0 1px 2px rgba(0,0,0,0.05);
    --space-1: calc(4px * 0.8);
    --space-2: calc(8px * 0.8);
    --space-3: calc(12px * 0.8);
    --space-4: calc(16px * 0.8);
    --sidebar-w: 260px;

    /* ------------------------------------------------------------------ */
    /* Semantic tokens (Stage B audit refactor, 2026-05-27).              */
    /*                                                                    */
    /* These are the *contract* between site.css and the theme files.     */
    /* Base components reference these tokens instead of hardcoded hex;   */
    /* themes redefine the token table without having to mirror every    */
    /* selector. Defaults below match the original light-mode palette so  */
    /* nothing visual changes when no theme is loaded.                    */
    /* ------------------------------------------------------------------ */

    /* Surfaces */
    --surface: #ffffff;            /* primary card/panel background */
    --surface-strong: #f8fafc;     /* hero/sidebar contrast surface */
    --surface-sunken: #f1f5f9;     /* striped rows, code blocks bg */
    --surface-hover: rgba(47, 168, 79, 0.08);
    --sidebar-bg: rgba(47, 168, 79, 0.06);

    /* Inputs */
    --input-bg: #ffffff;
    --input-border: var(--border);
    --input-fg: var(--fg);
    --input-placeholder: #94a3b8;
    --input-focus-ring: rgba(47, 168, 79, 0.25);

    /* Code blocks */
    --code-bg: #0f172a;
    --code-fg: #e2e8f0;
    --code-border: #1e293b;

    /* Semantic colors — bg / fg / border triples */
    --success-bg: var(--accent-weak);
    --success-fg: var(--accent-strong);
    --success-border: var(--accent-color);
    --warning-bg: #fff8d6;
    --warning-fg: #6b5a00;
    --warning-border: #e6c200;
    --danger-bg:  rgba(220, 38, 38, 0.08);
    --danger-fg:  #b91c1c;
    --danger-border: rgba(220, 38, 38, 0.35);
    --info-bg:  rgba(56, 189, 248, 0.08);
    --info-fg:  #0f4c81;
    --info-border: rgba(56, 189, 248, 0.35);

    /* Shard cards — `--offline` was the one that read brighter than live  */
    /* shards on dark themes; tokenizing lets each theme dim it.           */
    --shard-offline-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5f5 100%);
    --shard-offline-fg: #334155;
    --shard-offline-fg-dim: rgba(51, 65, 85, 0.8);
    --shard-offline-strong: #1e293b;
    --shard-offline-border: rgba(148, 163, 184, 0.35);
    --shard-offline-status-bg: rgba(15, 23, 42, 0.12);
    --shard-offline-status-fg: #0f172a;

    /* Map labels (FIR overlay text on tiles) */
    --map-label-fg: #155b2e;
    --map-label-halo: #fff;

    /* NOTAM ribbon — base is amber-on-cream */
    --notam-bg: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
    --notam-fg: #78350f;
    --notam-border: #f59e0b;

    /* Misc utility text overrides used inside billing/fids/etc. */
    --table-head-bg: rgba(15, 23, 42, 0.05);
    --table-head-fg: #1f2937;
    --table-head-border: rgba(15, 23, 42, 0.1);
    --table-row-hover: rgba(47, 168, 79, 0.08);
    --fir-option-name-fg: #6c757d;
    --fir-option-traffic-fg: #0f5132;

    /* Solid-color tokens (single-hue indicators, not surface/fg/border triples) */
    --warning: #f59e0b;        /* amber, used by .flight-row--imminent + .chip--warning */
    --surface-alt: #1e293b;    /* dark overlay-internal surface (modals, drop-in panels) */

    /* Typography */
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ------------------------------------------------------------------ */
/* prefers-color-scheme: dark fallback (audit item #10, 2026-05-27)   */
/*                                                                    */
/* When site.css is loaded without a theme overlay (e.g. auth pages)  */
/* OR before theme-selector.js sets [data-theme] on <html>, OS-dark   */
/* users get a neutral dark palette instead of the white light theme. */
/* The :not([data-theme]) guard means an explicit user theme choice   */
/* always wins once JS has set the attribute.                         */
/* Values mirror site.dark.css so the fallback matches the canonical  */
/* Dark Ops theme.                                                    */
/* ------------------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --bg: #0b1120;
        --fg: #f8fafc;
        --muted: #94a3b8;
        --border: rgba(148, 163, 184, 0.25);
        --accent-color: #38bdf8;
        --accent-weak: rgba(56, 189, 248, 0.12);
        --accent-strong: #0284c7;
        --accent-ring: rgba(56, 189, 248, 0.45);
        --header-bg: rgba(2, 6, 23, 0.92);
        --header-fg: #e2e8f0;
        --header-fg-dim: #cbd5f5;
        --header-active-bg: rgba(56, 189, 248, 0.32);
        --link: #38bdf8;
        --link-hover: #0ea5e9;
        --shadow: 0 6px 16px rgba(15, 23, 42, 0.45);

        --surface: rgba(15, 23, 42, 0.82);
        --surface-strong: rgba(8, 47, 73, 0.88);
        --surface-sunken: rgba(15, 23, 42, 0.6);
        --surface-hover: rgba(56, 189, 248, 0.14);
        --sidebar-bg: rgba(8, 47, 73, 0.55);

        --input-bg: rgba(2, 6, 23, 0.7);
        --input-border: rgba(56, 189, 248, 0.35);
        --input-fg: var(--fg);
        --input-placeholder: rgba(148, 163, 184, 0.65);
        --input-focus-ring: rgba(56, 189, 248, 0.4);

        --code-bg: rgba(2, 6, 23, 0.85);
        --code-fg: #bae6fd;
        --code-border: rgba(56, 189, 248, 0.3);

        --success-bg: rgba(16, 185, 129, 0.18);
        --success-fg: #a7f3d0;
        --success-border: rgba(45, 212, 191, 0.5);
        --warning-bg: rgba(234, 179, 8, 0.18);
        --warning-fg: #fef3c7;
        --warning-border: rgba(234, 179, 8, 0.45);
        --danger-bg: rgba(248, 113, 113, 0.18);
        --danger-fg: #fecdd3;
        --danger-border: rgba(248, 113, 113, 0.45);
        --info-bg: rgba(56, 189, 248, 0.16);
        --info-fg: #bae6fd;
        --info-border: rgba(56, 189, 248, 0.45);

        --shard-offline-bg: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
        --shard-offline-fg: #94a3b8;
        --shard-offline-fg-dim: rgba(148, 163, 184, 0.7);
        --shard-offline-strong: #94a3b8;
        --shard-offline-border: rgba(148, 163, 184, 0.25);
        --shard-offline-status-bg: rgba(148, 163, 184, 0.15);
        --shard-offline-status-fg: #94a3b8;

        --map-label-fg: #bae6fd;
        --map-label-halo: rgba(2, 6, 23, 0.85);

        --notam-bg: linear-gradient(90deg, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0.08));
        --notam-fg: #e0f2fe;
        --notam-border: rgba(56, 189, 248, 0.45);

        --table-head-bg: rgba(56, 189, 248, 0.18);
        --table-head-fg: #bae6fd;
        --table-head-border: rgba(56, 189, 248, 0.32);
        --table-row-hover: rgba(56, 189, 248, 0.12);
        --fir-option-name-fg: #94a3b8;
        --fir-option-traffic-fg: #7dd3fc;
    }
}

/* ============================================================================
   CLASSIC THEME — "ATC Green" (2026-06-03)
   ----------------------------------------------------------------------------
   The Classic theme loads site.css *standalone* (data-theme="site", no overlay
   file — the other themes @import site.css then override). Historically its
   palette was just the light defaults in :root above, but every page ships a
   hardcoded inline `style="background:#0f172a;color:#f8fafc"` on <body>. That
   combination produced near-white text on white (--surface) cards and dark/
   invisible section headers — see the screenshots in /screenshots.

   Original design intent for Classic was a green-phosphor ATC console:
   monospace type, bright readable green text on a dark green-black field.
   This block restores that intent.

   SCOPING: everything is scoped to [data-theme="site"]. That attribute is only
   present when Classic is the active theme (theme-selector.js sets it on <html>
   and <body>). When any OTHER theme is active its own data-theme value is set,
   so none of these rules match — no bleed into Dark/Neon/Horizon/Windows, and
   the bare-:root light defaults still drive the no-JS / auth-page fallback.
   ========================================================================== */
:root[data-theme="site"] {
    color-scheme: dark;

    --bg: #04130b;
    --fg: #c6f3d2;                       /* pale phosphor green-white — high contrast on the field */
    --muted: #74ad88;                    /* desaturated green, still ≥ 4.5:1 on surfaces */
    --border: rgba(61, 240, 138, 0.26);

    --accent-color: #3df08a;             /* ATC phosphor green */
    --accent-weak: rgba(61, 240, 138, 0.13);
    --accent-strong: #62ffa3;            /* brighter — headings / labels */
    --accent-ring: rgba(61, 240, 138, 0.45);

    --header-bg: rgba(2, 11, 7, 0.96);
    --header-fg: #c6f3d2;
    --header-fg-dim: #8fc7a3;
    --header-active-bg: rgba(61, 240, 138, 0.22);

    --link: #4ef69f;
    --link-hover: #8effc0;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.55);

    --surface: rgba(10, 28, 18, 0.92);          /* card / panel field */
    --surface-strong: rgba(7, 22, 14, 0.95);    /* hero / sidebar contrast */
    --surface-sunken: rgba(3, 13, 8, 0.9);      /* striped rows, code */
    --surface-hover: rgba(61, 240, 138, 0.10);
    --sidebar-bg: rgba(7, 22, 14, 0.7);

    --input-bg: rgba(3, 13, 8, 0.85);
    --input-border: rgba(61, 240, 138, 0.35);
    --input-fg: var(--fg);
    --input-placeholder: rgba(143, 199, 163, 0.55);
    --input-focus-ring: rgba(61, 240, 138, 0.4);

    --code-bg: rgba(2, 10, 6, 0.9);
    --code-fg: #8effc0;
    --code-border: rgba(61, 240, 138, 0.3);

    --success-bg: rgba(61, 240, 138, 0.18);
    --success-fg: #8effc0;
    --success-border: rgba(61, 240, 138, 0.5);
    --warning-bg: rgba(245, 200, 66, 0.18);
    --warning-fg: #ffe08a;
    --warning-border: rgba(245, 200, 66, 0.5);
    --danger-bg: rgba(255, 107, 107, 0.16);
    --danger-fg: #ffb3b3;
    --danger-border: rgba(255, 107, 107, 0.5);
    --info-bg: rgba(94, 234, 212, 0.14);
    --info-fg: #9af2e0;
    --info-border: rgba(94, 234, 212, 0.45);

    --shard-offline-bg: linear-gradient(135deg, rgba(20, 40, 28, 0.85) 0%, rgba(6, 18, 11, 0.92) 100%);
    --shard-offline-fg: #74ad88;
    --shard-offline-fg-dim: rgba(116, 173, 136, 0.7);
    --shard-offline-strong: #8fc7a3;
    --shard-offline-border: rgba(116, 173, 136, 0.25);
    --shard-offline-status-bg: rgba(116, 173, 136, 0.15);
    --shard-offline-status-fg: #8fc7a3;

    --map-label-fg: #8effc0;
    --map-label-halo: rgba(2, 10, 6, 0.9);

    --notam-bg: linear-gradient(90deg, rgba(61, 240, 138, 0.14), rgba(61, 240, 138, 0.06));
    --notam-fg: #c6f3d2;
    --notam-border: rgba(61, 240, 138, 0.45);

    --table-head-bg: rgba(61, 240, 138, 0.16);
    --table-head-fg: #8effc0;
    --table-head-border: rgba(61, 240, 138, 0.32);
    --table-row-hover: rgba(61, 240, 138, 0.10);
    --fir-option-name-fg: #8fc7a3;
    --fir-option-traffic-fg: #62ffa3;

    --surface-alt: #0a1c12;             /* modal / drop-in internal surface */
}

/* Body: with the stale inline pre-paint style cleared by theme-selector.js
   once Classic is active, the theme's own body rule applies cleanly — no
   !important needed. (The inline style="background:#0f172a;color:#f8fafc" only
   survives when JS is disabled, in which case the default Dark theme is shown,
   not Classic, so this rule isn't in play.) Monospace completes the console
   look. */
body[data-theme="site"] {
    background-color: #04130b;
    background-image:
        radial-gradient(circle at 50% -10%, rgba(61, 240, 138, 0.07), transparent 55%),
        repeating-linear-gradient(0deg, rgba(61, 240, 138, 0.018) 0 2px, transparent 2px 4px); /* faint CRT scanlines */
    color: var(--fg);
    font-family: var(--font-mono);
}

/* Generic headings/labels glow phosphor-green. Selector is attribute-only
   (no `body` prefix) so it ties on specificity with the per-card accent rules
   in Home/Index.cshtml (TCAS orange, ELT red, SELCAL green, Space-Wx blue) —
   those load later and win the tie, keeping their brand colours. Only the
   un-coloured titles (Departing, Arriving, ACARS, SATCOM, Alerts, Busiest
   FIRs, sidebar section titles) pick up the green. */
[data-theme="site"] h1,
[data-theme="site"] h2,
[data-theme="site"] h3,
[data-theme="site"] h4,
[data-theme="site"] .section-title,
[data-theme="site"] .rr-card-toolbar strong,
[data-theme="site"] .card-header {
    color: var(--accent-strong);
}

/* ----------------------------- View Transitions --------------------------- */
/* Smooth transitions during soft navigation */
@supports (view-transition-name: test) {
    .sidebar {
        view-transition-name: sidebar;
    }

    .main-content {
        view-transition-name: main-content;
    }

    /* Sidebar: quick crossfade when content changes */
    ::view-transition-old(sidebar),
    ::view-transition-new(sidebar) {
        animation-duration: 150ms;
        animation-timing-function: ease-out;
    }

    /* Main content: slightly longer transition */
    ::view-transition-old(main-content),
    ::view-transition-new(main-content) {
        animation-duration: 120ms;
        animation-timing-function: ease-out;
    }
}

/* Soft navigation loading state */
body.is-soft-nav-loading .main-content {
    opacity: 0.7;
    transition: opacity 100ms ease-out;
}

/* --------------------------------- Base ---------------------------------- */
html, body {
    height: 100%;
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

a {
    color: var(--link);
    text-decoration: none;
}

    a:hover {
        color: var(--link-hover);
        text-decoration: underline;
    }

img {
    max-width: 100%;
    height: auto;
}

/* Code blocks — consume --code-* tokens so themes only need to override the palette */
code, kbd, samp {
    background: var(--code-bg);
    color: var(--code-fg);
    border-radius: 3px;
    padding: 0.05em 0.3em;
    font-family: var(--font-mono);
}

pre {
    background: var(--code-bg);
    color: var(--code-fg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius);
    padding: var(--space-2);
    overflow-x: auto;
}

pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* FIR labels */
.fir-label {
    font: 12px/1.1 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--map-label-fg);
    text-shadow: 0 0 2px var(--map-label-halo), 0 0 4px var(--map-label-halo); /* halo for readability */
    pointer-events: none;
}

.rr-two-col {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr
}

@media (min-width: 992px) {
    .rr-two-col {
        grid-template-columns: minmax(0,2fr) minmax(0,1fr)
    }
}

/* Stat cards on home page (matches admin .rr-card style) */
.stat-grid .rr-card .stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: var(--space-1);
}

.stat-grid .rr-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-grid .rr-card .stat-value--sm {
    font-size: 1.3rem;
}

.stat-grid .rr-card .stat-sub {
    font-size: 0.8rem;
    color: var(--muted);
}

.selcal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.selcal-grid .metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}



.rr-admin-grid {
    display: grid;
    gap: calc(var(--space-3) * 2);
}

.rr-admin-grid__main,
.rr-admin-grid__aside {
    display: grid;
    gap: var(--space-3);
    align-content: start;
}

@media (min-width: 992px) {
    .rr-admin-grid {
        grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    }
}

.rr-admin-grid__aside .cards {
    margin: 0;
}

.rr-admin-grid__aside .rr-card {
    margin: 0;
}

.rr-two-col-main, .rr-two-col-side {
    min-width: 0;
}


/* -------------------- Bulk action bar + provision modal ------------------- */
.bulk-action-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    margin-bottom: var(--space-2, 0.5rem);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    background: var(--surface-alt);
}

.bulk-provision-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}

.bulk-provision-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    padding: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.bulk-provision-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.bulk-provision-header .rr-title {
    margin: 0;
}

.bulk-provision-body label.fw-semibold {
    display: block;
    margin-bottom: 0.25rem;
}

.bulk-progress-bar-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border, #334155);
    overflow: hidden;
}

.bulk-progress-bar {
    height: 100%;
    border-radius: 3px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.bulk-result {
    padding: 0.5rem;
    border-radius: 6px;
    background: var(--surface-alt);
    font-size: 0.9rem;
}

.bulk-result details summary {
    cursor: pointer;
}

.bulk-result ul {
    list-style: disc;
    padding-left: 1.25rem;
    font-size: 0.85rem;
}

.user-select-cb {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.w-30 {
    width: 30px;
}


/* ------------------------ Admin Audio monitor cards ---------------------- */
.aa-status-card {
    margin-bottom: var(--space-3);
}

.aa-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: flex-end;
}

.aa-status-block {
    flex: 1 1 160px;
    min-width: 160px;
}

.aa-status-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.aa-status-value {
    font-size: 1.75rem;
    font-weight: 600;
}

.aa-status-message {
    flex: 1 1 100%;
    font-size: 0.9rem;
    color: var(--muted);
}



/* --------------------------- Admin Audio charts -------------------------- */
.aa-charts {
    display: grid;
    /* minmax(0, 1fr) — not bare 1fr — so the tracks can shrink below the
       canvas's stamped pixel width on a window resize. With bare 1fr the
       implicit min-width:auto pins each track to the chart's intrinsic
       width, so the grid overflows .main-content and slides under the
       sidebar when the viewport narrows. Matches .aa-grid below. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.aa-chart-card { min-height: 180px; padding-bottom: var(--space-2); }
.aa-chart-card .rr-card-toolbar { padding: var(--space-2) var(--space-3) 0; }
.aa-chart-card h3 { margin: 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
@media (max-width: 768px) {
    .aa-charts { grid-template-columns: 1fr; }
}

/* ----------------------- Admin Audio server grid ------------------------- */
/* Two columns of per-server-tag blocks so a busy live board uses the full
 * width. Each server's frequencies stay together in one block; blocks flow
 * down the columns. align-items:start keeps short blocks from stretching to
 * match a tall neighbour. */
.aa-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    align-items: start;
}
@media (max-width: 900px) {
    .aa-grid { grid-template-columns: 1fr; }
}

.aa-grid .aa-empty {
    grid-column: 1 / -1;
    color: var(--muted);
}

.aa-server-block {
    border: 1px solid #2a2a2a;
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

/* Server-tag header carries the "listen all" master for the whole block. */
.aa-server-head {
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid #2a2a2a;
}
.aa-server-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}
.aa-server-title input[type="checkbox"] {
    cursor: pointer;
}

/* --------------------------- Admin Audio table --------------------------- */
.aa-table {
    width: 100%;
    border-collapse: collapse;
}

.aa-table th,
.aa-table td {
    padding: .5rem;
    border-bottom: 1px solid #2a2a2a;
}

/* Compact, de-emphasised per-block column labels. */
.aa-table thead th {
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-align: left;
}

/* Last frequency row in a block has no divider — the block border closes it. */
.aa-table tbody tr:last-child > td {
    border-bottom: none;
}

.aa-bar {
    height: 8px;
    background: #4ade80;
    border-radius: 4px;
}

.aa-listen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    margin-right: 6px;
    font-size: 0.85rem;
    border: 1px solid var(--accent-color);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--accent-strong);
    cursor: pointer;
    transition: all 0.15s ease;
}

.aa-listen:hover {
    background: var(--accent-weak);
    color: var(--accent-strong);
}

.aa-listen.listening {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    animation: aa-pulse 1.5s ease-in-out infinite;
}

@keyframes aa-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Highlight the .aa-main row that has a listener table directly below it so the
 * eye groups the main row with the metadata table (rather than reading the
 * metadata table's <thead> as a standalone section header). Listeners are now
 * always shown, so this fires for every frequency that has any. Transmitting
 * rows are excluded so their green TX tint isn't overpainted by this blue one. */
.aa-table tr.aa-main:not(.aa-tx-active):has(+ .aa-detail[data-detail-type="listeners"]) > td {
    background: rgba(96,165,250,0.08);
    border-bottom-color: rgba(96,165,250,0.25);
}

/* Live transmit (PTT held) on a frequency — sourced from the StateRegistry, so
 * it lights even when the operator isn't monitoring this bucket's audio. The
 * rising-edge green flash is the shared .dt-new-row animation (added in JS). */
.aa-table tr.aa-main.aa-tx-active > td {
    background: rgba(34,197,94,0.12);
    border-bottom-color: rgba(34,197,94,0.35);
}
.aa-tx-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    color: #22c55e;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}
.aa-tx-badge::before {
    content: '';
    width: 0.55em;
    height: 0.55em;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 5px #22c55e;
    animation: aa-tx-blink 1s steps(2, end) infinite;
}
@keyframes aa-tx-blink { 50% { opacity: 0.25; } }

/* Listener table inside detail rows */
.aa-listeners-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.aa-listeners-table th,
.aa-listeners-table td {
    padding: 0.3rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* De-emphasise the inner header so it reads as column labels for the
 * expanded main row, not as its own table heading. */
.aa-listeners-table th {
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    opacity: 0.7;
    border-bottom: 1px dashed rgba(255,255,255,0.08);
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}

.aa-listeners-table td code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.aa-listeners-table .aa-muted {
    color: var(--muted);
}

.aa-user-link {
    color: var(--accent-color);
    text-decoration: none;
}

.aa-user-link:hover {
    text-decoration: underline;
}


/* -------------------------------- Header --------------------------------- */
/* Header using rr-header — <details>/<summary> dropdown pattern. The old
   `.nav-main` block was removed 2026-05-27 — markup migrated to .rr-header
   in _TopNav.cshtml; no view or partial references it any longer. */
.rr-header {
    background: var(--header-bg);
    color: var(--header-fg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
}

    .rr-header .rr-left,
    .rr-header .rr-right {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .rr-header .rr-left { justify-content: flex-start; }
    .rr-header .rr-right { margin-left: auto; justify-content: flex-end; gap: 12px; }

    .rr-header ul, .rr-header .nav-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }

    .rr-header li {
        display: flex;
        align-items: center;
        position: relative;
    }

    /* ── Hamburger toggle (mobile only — revealed in the max-width:768px block) ── */
    .rr-header .nav-toggle {
        display: none;
        appearance: none;
        -webkit-appearance: none;
        background: rgba(15, 23, 42, 0.4);
        color: var(--header-fg);
        border: 1px solid rgba(255,255,255,0.18);
        border-radius: var(--radius);
        padding: 8px;
        cursor: pointer;
        line-height: 0;
    }

    .rr-header .nav-toggle:focus-visible {
        outline: 2px solid var(--accent-ring);
        outline-offset: 2px;
    }

    .rr-header .nav-toggle__box {
        position: relative;
        display: block;
        width: 22px;
        height: 16px;
    }

    .rr-header .nav-toggle__inner,
    .rr-header .nav-toggle__inner::before,
    .rr-header .nav-toggle__inner::after {
        position: absolute;
        left: 0;
        width: 100%;
        height: 2px;
        background: var(--header-fg);
        border-radius: 2px;
        transition: transform 150ms ease, opacity 150ms ease, top 150ms ease;
    }

    .rr-header .nav-toggle__inner { top: 50%; transform: translateY(-50%); }
    .rr-header .nav-toggle__inner::before { content: ""; top: -7px; }
    .rr-header .nav-toggle__inner::after  { content: ""; top: 7px; }

    /* Morph to an X while the menu is open */
    .rr-header.nav-open .nav-toggle__inner { background: transparent; }
    .rr-header.nav-open .nav-toggle__inner::before { top: 0; transform: rotate(45deg); }
    .rr-header.nav-open .nav-toggle__inner::after  { top: 0; transform: rotate(-45deg); }

    /* ── Dropdown (<details>/<summary>) ── */
    .nav-dropdown {
        position: relative;
    }

    .nav-dropdown > summary {
        list-style: none;
        cursor: pointer;
    }

    .nav-dropdown > summary::-webkit-details-marker { display: none; }
    .nav-dropdown > summary::marker { display: none; content: ""; }

    .nav-dropdown__arrow {
        transition: transform 150ms ease;
        flex-shrink: 0;
    }

    .nav-dropdown[open] > summary .nav-dropdown__arrow {
        transform: rotate(180deg);
    }

    /* Linkable dropdown parent (NavItem.LinkableParent): the label is a real
       <a> link carrying normal .nav-link styling; the summary is a bare flex
       wrapper, and the caret beside the label still toggles the submenu. */
    .nav-dropdown__summary {
        display: flex;
        align-items: center;
        cursor: pointer;
    }

    .nav-dropdown__caret {
        display: inline-flex;
        align-items: center;
        padding: 0 10px 0 2px;
    }

    .nav-dropdown__menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 200px;
        width: max-content;
        background: rgba(12, 20, 28, 0.96);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: var(--radius);
        padding: 4px 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.25);
        z-index: 100;
        list-style: none;
        margin: 4px 0 0;
    }

    .rr-header .rr-right .nav-dropdown__menu {
        left: 0; right: auto;         /* Left-align to parent item, not right edge */
        max-width: min(280px, 90vw);  /* Don't overflow viewport on narrow screens */
    }

    .nav-dropdown__menu li { display: block; width: 100%; }

    .nav-dropdown__menu .nav-link {
        padding: 6px 12px;
        display: flex;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        border-radius: 0;
    }

    .nav-dropdown__menu .nav-link:hover {
        background: rgba(255,255,255,0.08);
    }

    .nav-dropdown__menu .nav-link.active,
    .nav-dropdown__menu a[aria-current="page"] {
        background: var(--header-active-bg);
        box-shadow: inset 0 0 0 1px var(--accent-ring);
        color: var(--header-fg);
    }

    /* Nested group (e.g. Admin sub-section inside a dropdown) */
    .nav-dropdown__group { display: block; width: 100%; }

    .nav-dropdown__group-label {
        display: block;
        padding: 8px 12px 4px;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--header-fg-dim);
    }

    .nav-dropdown__group ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    .rr-header .header-inner {
        width: 100%;
    }

    .rr-header .nav-status {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .rr-header .theme-switcher {
        display: inline-flex;
        align-items: center;
    }

        .rr-header .theme-switcher label {
            display: none;
        }

        .rr-header .theme-switcher__select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background: rgba(15, 23, 42, 0.4);
            background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                              linear-gradient(135deg, currentColor 50%, transparent 50%),
                              linear-gradient(rgba(255,255,255,0.12), rgba(255,255,255,0.12));
            background-position: calc(100% - 12px) calc(50% - 3px),
                                 calc(100% - 8px) calc(50% - 3px),
                                 center;
            background-size: 6px 6px, 6px 6px, 100% 100%;
            background-repeat: no-repeat;
            color: var(--header-fg);
            border: 1px solid rgba(255,255,255,0.18);
            border-radius: var(--radius);
            padding: 4px 28px 4px 10px;
            font-size: 0.85rem;
            line-height: 1.2;
            cursor: pointer;
            position: relative;
        }

            .rr-header .theme-switcher__select:focus,
            .rr-header .theme-switcher__select:focus-visible {
                outline: 2px solid var(--accent-ring);
                outline-offset: 2px;
            }

    .rr-header .nav-bell {
        position: relative;
        display: inline-flex;
        align-items: center;
    }

    .rr-header .nav-bell__button {
        appearance: none;
        background: rgba(15, 23, 42, 0.4);
        color: var(--header-fg);
        border: 1px solid rgba(255,255,255,0.18);
        border-radius: var(--radius);
        padding: 4px 8px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        line-height: 1.2;
    }

    .rr-header .nav-bell__button:focus-visible {
        outline: 2px solid var(--accent-ring);
        outline-offset: 2px;
    }

    .rr-header .nav-bell__icon { display: block; }

    .rr-header .nav-bell__badge {
        background: #dc2626;
        color: #fff;
        font-size: 0.7rem;
        font-weight: 600;
        border-radius: 999px;
        padding: 1px 6px;
        min-width: 16px;
        text-align: center;
        line-height: 1.2;
    }

    .rr-header .nav-bell__panel {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: 320px;
        max-height: 60vh;
        overflow-y: auto;
        background: rgba(15, 23, 42, 0.96);
        color: var(--header-fg);
        border: 1px solid rgba(255,255,255,0.18);
        border-radius: var(--radius);
        box-shadow: 0 6px 20px rgba(0,0,0,0.35);
        z-index: 1000;
    }

    .rr-header .nav-bell__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 0.85rem;
        font-weight: 600;
    }

    .rr-header .nav-bell__action {
        background: transparent;
        border: 0;
        color: rgba(255,255,255,0.6);
        cursor: pointer;
        font-size: 0.75rem;
        padding: 2px 4px;
    }

    .rr-header .nav-bell__action:hover { color: var(--header-fg); }

    .rr-header .nav-bell__list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .rr-header .nav-bell__item {
        position: relative;
        padding: 10px 36px 10px 12px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        font-size: 0.85rem;
        line-height: 1.35;
    }

    .rr-header .nav-bell__item.is-unread { background: var(--accent-weak); }
    .rr-header .nav-bell__item.is-warn { border-left: 3px solid #f59e0b; }
    .rr-header .nav-bell__item.is-err  { border-left: 3px solid #dc2626; }

    .rr-header .nav-bell__title { font-weight: 600; margin-bottom: 2px; }
    .rr-header .nav-bell__body { color: rgba(255,255,255,0.75); }

    .rr-header .nav-bell__row-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 6px;
    }

    .rr-header .nav-bell__row-link {
        color: var(--link);
        text-decoration: none;
        font-size: 0.8rem;
    }
    .rr-header .nav-bell__row-link:hover { text-decoration: underline; }

    .rr-header .nav-bell__row-dismiss {
        position: absolute;
        top: 6px;
        right: 6px;
        background: transparent;
        border: 0;
        color: rgba(255,255,255,0.5);
        cursor: pointer;
        font-size: 1.1rem;
        line-height: 1;
        padding: 2px 6px;
    }
    .rr-header .nav-bell__row-dismiss:hover { color: var(--header-fg); }

    .rr-header .nav-bell__empty {
        padding: 16px 12px;
        text-align: center;
        color: rgba(255,255,255,0.55);
        font-size: 0.85rem;
    }

    .rr-header .server-switcher {
        display: inline-flex;
        align-items: center;
    }

        .rr-header .server-switcher label {
            display: none;
        }

        .rr-header .server-switcher__select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background: rgba(15, 23, 42, 0.4);
            background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                              linear-gradient(135deg, currentColor 50%, transparent 50%),
                              linear-gradient(rgba(255,255,255,0.12), rgba(255,255,255,0.12));
            background-position: calc(100% - 12px) calc(50% - 3px),
                                 calc(100% - 8px) calc(50% - 3px),
                                 center;
            background-size: 6px 6px, 6px 6px, 100% 100%;
            background-repeat: no-repeat;
            color: var(--header-fg);
            border: 1px solid rgba(255,255,255,0.18);
            border-radius: var(--radius);
            padding: 4px 28px 4px 10px;
            font-size: 0.85rem;
            line-height: 1.2;
            cursor: pointer;
            position: relative;
            min-width: 100px;
        }

            .rr-header .server-switcher__select:focus,
            .rr-header .server-switcher__select:focus-visible {
                outline: 2px solid var(--accent-ring);
                outline-offset: 2px;
            }

    .rr-header .nav-clock {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        border-radius: var(--radius);
        background: rgba(255,255,255,0.06);
        color: var(--header-fg-dim);
        font-size: 0.85rem;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

        .rr-header .nav-clock .clock-label {
            text-transform: uppercase;
            letter-spacing: .04em;
            font-size: 0.7rem;
        }

        .rr-header .nav-clock .clock-time {
            font-weight: 600;
            color: var(--header-fg);
        }

        .rr-header .nav-clock .clock-divider {
            color: var(--header-fg-dim);
        }

    @media (max-width: 768px) {
        .rr-header { flex-wrap: wrap; }
        .header-inner { flex-wrap: wrap; }

        /* Reveal the hamburger and park it at the far right of the brand row */
        .rr-header .nav-toggle {
            display: inline-flex;
            align-items: center;
            margin-left: auto;
        }

        /* Brand row spans the full width so the hamburger floats to the right.
           Everything else collapses behind the toggle until it's opened. */
        .rr-header .rr-left { width: 100%; }
        .rr-header .rr-left .nav-list,
        .rr-header .rr-right { display: none; }

        .rr-header.nav-open .rr-left .nav-list,
        .rr-header.nav-open .rr-right { display: flex; }

        .rr-header.nav-open .rr-right {
            width: 100%;
            flex-direction: column;
            align-items: stretch;
            justify-content: flex-start;
            gap: 8px;
            margin-left: 0;
            margin-top: 8px;
        }

        /* Every menu item stacks full-width and left-justified */
        .rr-header .nav-list {
            flex-direction: column;
            align-items: stretch;
            width: 100%;
            gap: 2px;
        }

        .rr-header .nav-list > li { width: 100%; }

        .rr-header .nav-link,
        .rr-header .nav-dropdown__summary {
            width: 100%;
            justify-content: flex-start;
        }

        /* Dropdowns expand inline rather than floating */
        .rr-header .nav-dropdown { width: 100%; }
        .nav-dropdown__menu {
            position: static;
            box-shadow: none;
            border: none;
            margin: 0;
            padding-left: 12px;
            width: 100%;
        }
        .rr-header .rr-right .nav-dropdown__menu { max-width: none; }

        /* Signup CTA: align to the left edge with the rest of the menu */
        .rr-header .rr-nav-signup {
            margin-left: 0;
            align-self: flex-start;
        }

        /* Status cluster (bell / server / theme / clock) stacks left-justified */
        .rr-header .nav-status {
            order: 1;
            width: 100%;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            gap: 8px;
            margin-top: 4px;
        }

        .rr-header .nav-clock {
            width: auto;
            justify-content: flex-start;
        }
    }

    .rr-header .rr-right ul {
        justify-content: flex-end;
    }

    /* Links */
    .rr-header a,
    .rr-header .nav-link {
        color: var(--header-fg);
        text-decoration: none;
        padding: 6px 10px;
        border-radius: var(--radius);
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

        .rr-header a:hover,
        .rr-header .nav-link:hover {
            background: rgba(255,255,255,0.06);
            color: var(--header-fg);
            text-decoration: none;
        }

        /* Active/current */
        .rr-header a.active,
        .rr-header .nav-link.active,
        .rr-header a[aria-current="page"] {
            background: var(--header-active-bg);
            box-shadow: inset 0 0 0 1px var(--accent-ring);
            color: var(--header-fg);
        }

    /* Brand + tagline */
    .rr-header .brand {
        font-weight: 700;
        letter-spacing: .2px;
        color: var(--header-fg);
    }

    .rr-header .brand-group {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-right: 8px;
    }

    .rr-header .brand-version {
        font-size: 0.75rem;
        color: var(--header-fg-dim);
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    .rr-header .brand-meta {
        display: inline-flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        line-height: 1.1;
    }

    .rr-header .brand-status-lights {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .rr-header .brand-status-lights .status-light {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: rgba(148, 163, 184, 0.45);
        box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
        transition: background-color 150ms ease, box-shadow 150ms ease;
    }

    .rr-header .brand-status-lights .status-light[data-status="ok"] {
        background: #22c55e;
        box-shadow: 0 0 4px rgba(34, 197, 94, 0.6);
    }

    .rr-header .brand-status-lights .status-light[data-status="warn"] {
        background: #f59e0b;
        box-shadow: 0 0 4px rgba(245, 158, 11, 0.55);
    }

    .rr-header .brand-status-lights .status-light[data-status="error"] {
        background: #ef4444;
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.6);
    }

    .rr-header .tagline {
        color: var(--header-fg-dim);
        font-size: .95rem;
        margin-left: 8px;
    }

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* ----------------------------- NOTAM ribbon ----------------------------- */
.notam-ribbon {
    background: var(--notam-bg);
    border-bottom: 1px solid var(--notam-border);
    color: var(--notam-fg);
}

.notam-ribbon.is-visible {
    display: block;
}

.notam-ribbon .container {
    padding-top: 0;
    padding-bottom: 0;
}

.notam-ribbon__inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.notam-ribbon__message {
    flex: 1 1 auto;
    font-weight: 600;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.notam-ribbon__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 120ms ease;
}

    .notam-ribbon__close:hover,
    .notam-ribbon__close:focus-visible {
        background: rgba(120, 53, 15, 0.16);
        outline: none;
    }

.notam-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.notam-card.is-busy {
    opacity: 0.7;
}

.notam-card__actions {
    justify-content: flex-end;
    gap: 8px;
}

.notam-card textarea {
    min-height: 72px;
    resize: vertical;
}

/* ---------------------------- Layout scaffolding ------------------------ */
.layout-shell {
    padding: 0;
}

.layout-main {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.layout-main--no-sidebar {
    display: block;
}

.layout-main--no-sidebar .main-content {
    max-width: 100%;
}

.main-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
}

.rr-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--accent-color);
    margin-top: var(--space-4);
    font-size: 0.875rem;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .rr-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ------------------------------ Layout helpers --------------------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.grid {
    display: grid;
    gap: 16px;
}

.cols-2 {
    grid-template-columns: 1fr 1fr;
}

.cols-3 {
    grid-template-columns: repeat(3,1fr);
}

@media (max-width: 991px) {
    .cols-2, .cols-3 {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------- Utilities ------------------------------ */
.muted, .rr-muted {
    color: var(--muted);
}

.text-success {
    color: var(--accent-strong) !important;
}

.text-info {
    color: var(--info-fg) !important;
}

.text-error {
    color: var(--danger-fg) !important;
}

.link-plain {
    text-decoration: none;
    color: inherit;
}

    .link-plain:hover {
        text-decoration: underline;
    }

.disabled-link {
    pointer-events: none;
}

.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }

.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }

.ms-auto { margin-left: auto !important; }
.ms-2 { margin-left: var(--space-2) !important; }
.ms-3 { margin-left: var(--space-3) !important; }

.text-center { text-align: center; }
.text-end { text-align: right; }
.text-nowrap { white-space: nowrap; }
.text-sm { font-size: 0.9rem; }
.text-xs { font-size: 0.85rem; }

.flex { display: flex; }
.flex-1 { flex: 1 1 auto; }
.inline-flex { display: inline-flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.gap-xs { gap: var(--space-1); }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-3); }
.gap-lg { gap: var(--space-4); }

.stack { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-xs { gap: var(--space-1); }
.stack-md { gap: var(--space-3); }

.list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
}

.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
.w-90 { width: 90px !important; }
.w-110 { width: 110px !important; }
.w-120 { width: 120px !important; }
.w-180 { width: 180px !important; }
.w-200 { width: 200px !important; }
.w-220 { width: 220px !important; }
.w-240 { width: 240px !important; }
.w-280 { width: 280px !important; }

.max-w-180 { max-width: 180px; }
.max-w-240 { max-width: 240px; }
.max-w-280 { max-width: 280px; }
.min-w-56 { min-width: 56px; }
.max-w-560 { max-width: 560px; }

.min-h-line { min-height: 18px; }
.min-h-120 { min-height: 120px; }

.overflow-auto { overflow: auto; }
.inline-form { display: inline; }
.text-uppercase { text-transform: uppercase; }

/* Buttons (lightweight – works even if you’re not using Bootstrap) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-color);
    color: var(--accent-strong);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 6px 12px;
    cursor: pointer;
}

.btn.is-loading,
.btn.is-loading:hover {
    pointer-events: none;
    opacity: 0.7;
    cursor: wait;
}

    .btn:hover {
        background: var(--accent-weak);
    }

.btn-sm {
    padding: 4px 8px;
    font-size: .9rem;
}

.btn-primary,
.btn-success {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

    .btn-primary:hover,
    .btn-success:hover {
        background: var(--accent-strong);
        border-color: var(--accent-strong);
        color: #fff;
    }

.btn-warn {
    background: #f59e0b;
    border-color: #d97706;
    color: #111;
}

    .btn-warn:hover {
        background: #d97706;
        color: #fff;
    }

.btn-danger {
    background: #5a0e0e;
    border-color: #7d1a1a;
    color: #fff;
}

    .btn-danger:hover {
        background: #7d1a1a;
    }

.btn-link {
    border: 0;
    background: transparent;
    color: var(--link);
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

    .btn-link:hover {
        text-decoration: underline;
        background: transparent;
    }

.btn-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--link);
}

    .btn-ghost:hover {
        background: rgba(0,0,0,0.04);
    }

/* Custom RealRadio button set (used in admin partials) */
.rr-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #222;
    color: #eee;
    border: 1px solid #333;
    cursor: pointer;
}

    .rr-btn:hover {
        background: #2d2d2d;
    }

.rr-btn--primary {
    background: #0d3a76;
    border-color: #1454ad;
}

.rr-btn--ghost {
    background: transparent;
    border-color: #333;
}

.rr-btn--danger {
    background: #5a0e0e;
    border-color: #7d1a1a;
}

/* Inputs */
.form-control,
.form-select,
.input-group-text {
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    padding: 6px 8px;
    background: var(--input-bg);
    color: var(--input-fg);
}

    .form-control:focus {
        outline: 2px solid var(--input-focus-ring);
        outline-offset: 1px;
    }

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.auth-form {
    max-width: 320px;
}

    .auth-form .form-control {
        width: 100%;
    }


.rr-auth-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 560px;
    margin: var(--space-3) auto;
}

.rr-auth-shell--split {
    gap: var(--space-4);
}

.rr-auth-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    flex: 1 1 0;
}

.rr-auth-register {
    flex: 1 1 0;
}

.rr-auth-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

@media (min-width: 768px) {
    .rr-auth-shell--split {
        flex-direction: row;
        align-items: flex-start;
        max-width: 960px;
    }

    .rr-auth-register {
        max-width: 380px;
    }
}

.auth-provider-icon {
    height: 1.2rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.rr-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #2a2a2a;
    background: #0b0b0b;
    color: #eee;
    border-radius: 8px;
}

/* -------------------------------- Cards/Alerts --------------------------- */
.card, .rr-card {
    background: var(--surface);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius);
    padding: var(--pad);
    box-shadow: var(--shadow);
}

.online-sidebar-card {
    display: flex;
    flex-direction: column;
}

    .online-sidebar-card .card-header {
        padding: 0;
        margin-bottom: var(--space-2);
        font-weight: 700;
    }

    .online-sidebar-card .card-body {
        padding: 0;
    }

    .online-sidebar-card .list {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        margin: 0;
    }

.rr-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.toolbar,
.rr-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-2) 0;
    flex-wrap: wrap;
}

.card-section {
    background: var(--surface);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
}

.alert-success {
    background: var(--accent-weak);
    color: var(--accent-strong);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius);
    padding: 8px 10px;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-fg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    padding: 8px 10px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
}

.stat-card {
    background: var(--accent-weak);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius);
    padding: var(--space-3);
}

    .stat-card .stat-label {
        color: var(--muted);
    }

    .stat-card .stat-value {
        font-size: 1.6rem;
        font-weight: 700;
    }

.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    cursor: pointer;
    background: var(--surface);
    color: var(--accent-strong);
}

    .badge-pill.active {
        background: var(--accent-color);
        border-color: var(--accent-strong);
        color: #fff;
    }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-top: var(--space-2);
}

.chip {
    border: 1px solid #e5e5e5;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1;
}

    .chip.dim {
        opacity: .5;
    }

.chip--server {
    background: var(--accent-weak, rgba(47, 168, 79, 0.12));
    border-color: var(--accent-color, #2fa84f);
    color: var(--accent-color, #2fa84f);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Toggleable filter chip (used in admin user search) */
.rr-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border, #ccc);
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: 4px 10px;
    margin-right: 6px;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}

.rr-chip:hover {
    background: rgba(0, 0, 0, 0.04);
}

.rr-chip--active {
    background: var(--accent-weak, rgba(47, 168, 79, 0.12));
    border-color: var(--accent-color, #2fa84f);
    color: var(--accent-strong, #1e8538);
    font-weight: 600;
}

.rr-chip--active:hover {
    background: var(--accent-weak, rgba(47, 168, 79, 0.20));
}

.rr-alert {
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.rr-alert--error {
    background: #451717;
    border: 1px solid #6b2323;
    color: #f2bbbb;
}

.rr-alert--success {
    background: #0f3b1b;
    border: 1px solid #1f7a38;
    color: #d1fae5;
}

.rr-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
    margin: var(--space-2) 0;
}

.rr-role-manager {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.rr-role-manager .role-search {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.rr-role-manager .role-search__controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.rr-role-manager .role-search__controls input {
    flex: 1 1 220px;
    min-width: 180px;
}

.role-results {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #f8faf8;
    padding: var(--space-2);
    font-size: 14px;
    min-height: 48px;
}

.role-results__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.role-result {
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 6px 10px;
    background: #f9fafb;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.role-result:hover {
    background: var(--surface-hover);
    border-color: var(--accent-ring);
}

.role-result.active {
    border-color: var(--accent-color);
    background: var(--accent-weak);
}

.role-assignment {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.role-assignment__user {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
}

.role-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.role-pill {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    background: #f8fafc;
    font-size: 14px;
}

.role-pill input {
    accent-color: var(--accent-color);
    margin-top: 4px;
}

.role-pill input:disabled {
    opacity: 0.6;
}

.role-pill__details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-pill__name {
    font-weight: 600;
}

.role-pill__description {
    font-size: 12px;
    color: var(--muted);
}

.role-pill__badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 11px;
    font-weight: 600;
}

.role-pill--locked {
    opacity: 0.75;
    cursor: not-allowed;
}

.role-pill--locked .role-pill__badge {
    border-color: var(--border);
    color: var(--muted);
}

.role-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.rr-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: var(--space-2);
}

.rr-kv {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    margin: 4px 0;
}

    .rr-kv > span {
        color: var(--muted);
    }

/* -------------------------------- Sidebar -------------------------------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 0 0 var(--sidebar-w);
    padding: var(--space-4);
    background: var(--sidebar-bg);
    border-left: 1px solid var(--accent-color);
    box-shadow: -4px 0 8px rgba(0,0,0,0.04);
    min-height: 100%;
    align-self: stretch;
}

    .sidebar .section-title {
        font-weight: 700;
    }

.sidebar-badge {
    background-color: var(--accent-weak);
    border: 2px solid var(--accent-color);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 10px;
    line-height: 1.35;
}

.rr-sidebar-affiliate {
    display: block;
    margin: 0 auto;
    line-height: 0;
}

.rr-sidebar-affiliate img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.sidebar-notice {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--warning-fg);
}

/* Mobile: stack sidebar below main content */
@media (max-width: 768px) {
    .layout-main {
        flex-direction: column;
    }

    .sidebar {
        flex: none;
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--accent-color);
        box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.04);
        min-height: auto;
        order: 2;
    }

    .main-content {
        order: 1;
        width: 100%;
    }
}

/* Busiest FIRs sidebar rows */
.fir-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: var(--bg);
    margin-bottom: 8px;
}

.fir-row__header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fir-row__info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fir-row__name {
    font-weight: 600;
    font-size: 1rem;
}

.fir-row__aircraft {
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
}

.fir-row .muted {
    font-size: 12px;
}

.fir-row .btn {
    align-self: flex-start;
    margin-top: 4px;
}

/* Upcoming flights sidebar */
.flight-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: var(--bg);
    margin-bottom: 8px;
}

.flight-row--imminent {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
}

.flight-row__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.flight-row__callsign {
    font-weight: 600;
    font-size: 1rem;
}

.flight-row__details {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.flight-row__pilot {
    font-size: 0.75rem;
}

.chip--warning {
    background: var(--warning);
    color: #000;
}

/* --------------------------------- Maps ---------------------------------- */
.map-card, .public-map-card {
    padding: var(--pad);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius);
    margin: 12px 0;
}

#publicOnlineMap,
#adminOnlineMap,
#adbSMap {
    height: 60vh;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.public-map-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

    .public-map-toolbar .muted {
        color: var(--muted);
    }

.public-map-banner {
    margin: 6px 0;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--warning-border);
    background: var(--warning-bg);
    color: var(--warning-fg);
    display: none;
}

#home-map {
    height: 400px;
}

/* --------------------------- User Admin (scoped) ------------------------- */
/* Ensures RadioOps & public pages are unaffected */
#user-admin-root .rr-cols {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    align-items: start;
}

#user-admin-root .rr-col-left,
#user-admin-root .rr-col-right {
    min-width: 0;
}

@media (max-width: 991px) {
    #user-admin-root .rr-cols {
        grid-template-columns: 1fr;
    }
}

#user-admin-root .rr-card {
    padding: var(--pad);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: var(--surface);
}

    #user-admin-root .rr-card h3 {
        margin: 0 0 8px 0;
    }

#user-admin-root .rr-muted {
    color: var(--muted);
}

#user-admin-root .btn {
    cursor: pointer;
}

#user-admin-root .btn-sm {
    padding: 4px 8px;
    font-size: .9rem;
}

#user-recordings-card .rec-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

#user-recordings-card .rec-row,
#user-recordings-card .rec-actions,
#user-recordings-history .history-btns {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
}

#user-recordings-card .rec-connection {
    flex: 1 1 220px;
    min-width: 200px;
}

#user-recordings-card .rec-mins {
    width: 180px;
}

#user-recordings-card .rr-table,
#user-recordings-history .rr-table {
    font-size: 0.9rem;
}

#user-recordings-card .rr-table td,
#user-recordings-history .rr-table td {
    padding: 6px 0;
    border-top: 1px solid rgba(0,0,0,0.08);
    border-bottom: 0;
}

#user-recordings-card .rr-table th,
#user-recordings-history .rr-table th {
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: transparent;
}

#user-recordings-card .rr-table td.actions {
    text-align: right;
}

#user-recordings-history .history-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

#user-recordings-history .history-actions audio {
    max-width: 100%;
}

#radio-card .rr-radio-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

#radio-card .rr-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

#radio-card .rr-radio-input {
    width: 110px;
    min-width: 110px;
}

#radio-card .rr-radio-select {
    width: auto;
    min-width: 110px;
}

#radio-card .rr-radio-band {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    padding: 10px;
    background: rgba(25, 39, 52, 0.04);
}

#radio-card .rr-radio-band-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
}

#radio-card .rr-radio-band-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
}

#radio-card .rr-radio-display {
    font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 1.6rem;
    background: #111;
    color: #4cffb0;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 120px;
    text-align: right;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6);
}

#radio-card .rr-radio-band.active .rr-radio-display {
    border: 2px solid var(--accent-color, #198754);
}

#radio-card .rr-radio-band.is-off {
    opacity: 0.6;
}

#radio-card .rr-radio-band.is-off .rr-radio-display {
    background: #2a2a2a;
    color: #bbb;
}

#radio-card .rr-radio-band.is-scanning .rr-radio-display {
    background: #6c757d;
    color: #fff;
}

#radio-card .rr-radio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    justify-content: space-between;
}

#radio-card [data-role="status"] {
    flex: 1;
    min-width: 220px;
}

.rr-fir-search {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.rr-fir-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.rr-fir-actions [data-role="fir-selected"] {
    margin: 0;
}

.rr-fir-results {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: stretch;
    padding-bottom: var(--space-1);
    overflow-x: auto;
}

.rr-fir-results::-webkit-scrollbar {
    height: 6px;
}

.rr-fir-placeholder {
    flex: 1 1 100%;
    padding: var(--space-2);
}

.rr-fir-option {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 160px;
    padding: var(--space-2);
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.65rem;
    background: var(--surface);
    color: inherit;
    text-align: left;
    cursor: pointer;
    flex: 0 0 auto;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.rr-fir-option:hover,
.rr-fir-option:focus-visible,
.rr-fir-option.is-selected {
    outline: none;
    border-color: rgba(25, 135, 84, 0.6);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15);
    background-color: rgba(25, 135, 84, 0.08);
}

.rr-fir-option__code {
    font-weight: 600;
    letter-spacing: 0.03em;
}

.rr-fir-option__name {
    font-size: 0.85rem;
    color: var(--fir-option-name-fg);
}

.rr-fir-option__traffic {
    margin-top: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fir-option-traffic-fg);
}

/* --------------------------- RadioOps safe area -------------------------- */
/* If you wrap RadioOps with #radio-ops-root, you can add page-specific tweaks here.
   These rules are empty by default (no changes).
*/
#radio-ops-root { /* RadioOps-specific overrides go here if needed */
}

/* ----------------------------- Misc helpers ------------------------------ */
.hidden {
    display: none !important;
}

.mono {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
}

.rr-empty {
    text-align: center;
    color: #888;
}

.rr-form--row {
    display: grid;
    grid-template-columns: 1fr 220px auto;
    gap: 12px;
    margin-bottom: 12px;
}

.rr-field--actions {
    display: flex;
    align-items: flex-end;
}

.rr-table-wrap {
    overflow: auto;
    max-height: 360px;
}

/* Bootstrap .table base styling so themes only need :root token overrides.
   Cell text follows --fg; the wrapper is transparent so it inherits page bg. */
.table {
    color: var(--fg);
}

.table td,
.table th {
    background-color: transparent;
    color: inherit;
}

.table-responsive {
    background: transparent;
}

.table-hover > tbody > tr:hover,
.table-hover > tbody > tr:hover > * {
    background-color: var(--table-row-hover);
    color: var(--fg);
}

.table small,
.table .text-muted,
.text-muted,
.muted {
    color: var(--muted) !important; /* fights Bootstrap's own .text-muted !important rule */
}

/* Bootstrap component defaults driven by tokens.
   Themes only need to override the token table. */
.modal-content {
    background: var(--surface);
    color: var(--fg);
    border-color: var(--border);
}

.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }
.modal-title { color: var(--fg); }

.dropdown-menu {
    background: var(--surface);
    color: var(--fg);
    border-color: var(--border);
}

.dropdown-item { color: var(--fg); }

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item:focus-visible {
    background: var(--surface-hover);
    color: var(--fg);
}

.list-group-item {
    background: var(--surface);
    color: var(--fg);
    border-color: var(--border);
}

.list-group-item:hover { background: var(--surface-hover); }

.page-link {
    background: var(--surface);
    color: var(--fg);
    border-color: var(--border);
}

.page-link:hover {
    background: var(--surface-hover);
    color: var(--fg);
    border-color: var(--accent-ring);
}

.page-item.active .page-link {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--header-fg);
}

.page-item.disabled .page-link {
    background: var(--surface-sunken);
    color: var(--muted);
    border-color: var(--border);
}

.nav-tabs { border-bottom-color: var(--border); }
.nav-tabs .nav-link { color: var(--muted); border-color: transparent; }
.nav-tabs .nav-link:hover { color: var(--fg); border-color: var(--border); }
.nav-tabs .nav-link.active {
    background: var(--surface);
    color: var(--fg);
    border-color: var(--border);
    border-bottom-color: transparent;
}

/* Bootstrap utility surfaces that assume the page is white. */
.bg-white,
.bg-light { background: var(--surface) !important; color: var(--fg); }
.border-light { border-color: var(--border) !important; }
.text-dark { color: var(--fg) !important; }

hr { border-color: var(--border); }

/* Paired UTC/Local datetime-local inputs */
.rr-time-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2, 8px);
}
.rr-time-pair > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rr-time-pair__tag {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
/* Dual-time cells (schedules table, FIDS) */
.rr-time-dual {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.15;
    font-family: var(--font-mono);
    white-space: nowrap;
}
.rr-time-dual__utc {
    font-weight: 600;
}
.rr-time-dual__local {
    font-size: 0.75rem;
    color: var(--muted);
}

.rr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rr-table thead th {
    text-align: left;
    padding: 8px 10px;
    background: var(--accent-weak);
    border-bottom: 1px solid var(--accent-color);
}

.rr-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.rr-table__actions {
    text-align: right;
}

.rr-table--compact {
    font-size: 0.9rem;
}

    .rr-table--compact thead th,
    .rr-table--compact td {
        padding-top: 4px;
        padding-bottom: 4px;
    }

.rr-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 18px;
}

.rr-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 2px;
    opacity: 0.3;
    font-size: 0.75em;
}

.rr-table th.sort-asc::after {
    content: '▲';
    opacity: 0.7;
}

.rr-table th.sort-desc::after {
    content: '▼';
    opacity: 0.7;
}

.rr-table .placeholder-row td {
    padding-top: 12px;
    padding-bottom: 12px;
    opacity: .7;
}

@media (max-width: 720px) {
    .rr-form--row {
        grid-template-columns: 1fr;
    }

    .rr-field--actions {
        align-items: flex-start;
    }
}

/* --- Admin billing management card --- */
#billingCatalog {
    display: flex;
    flex-direction: column;
    gap: calc(var(--space-3) * 1.5);
}

#billingCatalog .billing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

#billingCatalog .billing-toolbar .rr-muted {
    margin-top: 4px;
    max-width: 38rem;
}

#billingCatalog .billing-sections {
    display: grid;
    gap: calc(var(--space-3) * 1.5);
    grid-template-columns: repeat(2, 1fr);
}

#billingCatalog .billing-panel--service-list {
    grid-column: 1 / -1;
}

#billingCatalog .billing-panel--service-form {
    align-self: start;
}

#billingCatalog .billing-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.02) 0%, rgba(15, 23, 42, 0.05) 100%);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

#billingCatalog .billing-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

#billingCatalog .billing-panel__header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-strong);
}

#billingCatalog .billing-panel__surface {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    padding: var(--space-3);
}

#billingCatalog .billing-panel__surface--table {
    padding: 0;
    overflow: hidden;
}

#billingCatalog .billing-panel__surface--table .rr-table-wrap {
    max-height: 360px;
}

#billingCatalog .billing-panel__surface--table .rr-table {
    min-width: 100%;
}

#billingCatalog .billing-panel__hint {
    background: var(--accent-weak);
    color: var(--accent-strong);
    border-radius: var(--radius);
    padding: var(--space-2) var(--space-3);
    font-size: 0.9rem;
    font-weight: 600;
}

#billingCatalog .billing-form .form-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#billingCatalog .billing-form .form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

#billingCatalog .billing-form .form-field.full {
    grid-column: 1 / -1;
}

#billingCatalog .billing-form .form-field.checkbox-field {
    flex-direction: row;
    align-items: center;
    gap: var(--space-1);
}

#billingCatalog .billing-form label {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--muted);
}

#billingCatalog .billing-form textarea {
    resize: vertical;
    min-height: 72px;
}

#billingCatalog .billing-form .form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

#billingCatalog .input-with-suffix {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

#billingCatalog .input-with-suffix span {
    font-weight: 700;
    min-width: 1.75rem;
    text-align: center;
    font-size: 1rem;
}

#billingCatalog .rr-table thead th {
    background: var(--table-head-bg);
    border-bottom: 1px solid var(--table-head-border);
    font-size: 0.75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--table-head-fg);
}

#billingCatalog .rr-table tbody tr:hover {
    background: var(--table-row-hover);
    transition: background 120ms ease;
}

#billingCatalog table tbody tr.selected {
    background: var(--accent-weak);
}

#billingCatalog #billingStatus {
    min-height: 1.75rem;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    transition: background 160ms ease, color 160ms ease;
    padding: 0;
    border-radius: 999px;
}

#billingCatalog #billingStatus.ok,
#billingCatalog #billingStatus.err {
    padding: 0 var(--space-3);
}

#billingCatalog #billingStatus.ok {
    background: var(--accent-weak);
    color: var(--accent-strong);
}

#billingCatalog #billingStatus.err {
    background: rgba(185, 28, 28, 0.12);
    color: #7d1a1a;
}

/* --- Profile page helpers --- */
.rr-profile-card {
    margin-bottom: 12px;
}

.section-title {
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--accent-strong);
}

.kv {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 6px 14px;
}

    .kv .k {
        color: var(--muted);
    }

@media (max-width: 720px) {
    .kv {
        grid-template-columns: 1fr;
    }
}

/* --- Profile photo upload --- */
.profile-photo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.profile-photo-container {
    flex-shrink: 0;
}

.profile-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-photo-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}

.profile-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* --- Shard admin card tweaks --- */
.shard-card .card-title {
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.shard-card .kv {
    grid-template-columns: minmax(0, 120px) minmax(0, 1fr);
    gap: 4px 8px;
    align-items: start;
}

@media (max-width: 720px) {
    .shard-card .kv {
        grid-template-columns: 1fr;
    }
}

.shard-card .kv span,
.shard-card .kv strong {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.shard-card .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.rr-card-shards {
    margin-top: var(--space-3);
}

.rr-shard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: var(--space-3);
}

.shard-card--summary {
    border: none;
    padding: 18px;
    color: #0f172a;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
}

.shard-card__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shard-card__title {
    font-weight: 700;
    font-size: 1.05rem;
}

.shard-card__subtitle {
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.shard-card--summary .shard-card__body {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.shard-card--summary .kv {
    grid-template-columns: minmax(0, 120px) minmax(0, 1fr);
}

@media (max-width: 720px) {
    .shard-card--summary .kv {
        grid-template-columns: 1fr;
    }
}

.shard-card--summary .kv span,
.shard-card--summary .kv strong {
    font-size: 0.95rem;
}

.shard-card--summary .kv span {
    opacity: 0.85;
}

.shard-card--summary .kv strong {
    font-weight: 700;
}

.shard-card--api {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    color: #f8fafc;
}

.shard-card--api .shard-card__subtitle,
.shard-card--api .kv span {
    color: rgba(248, 250, 252, 0.75);
}

.shard-card--api .kv strong {
    color: #f8fafc;
}

.shard-card--web {
    background: linear-gradient(135deg, #064e3b 0%, #10b981 100%);
    color: #ecfdf5;
}

.shard-card--web .shard-card__subtitle,
.shard-card--web .kv span {
    color: rgba(236, 253, 245, 0.8);
}

.shard-card--web .kv strong {
    color: #ffffff;
}

.shard-card--ingestor {
    background: linear-gradient(135deg, #4c1d95 0%, #c084fc 100%);
    color: #f5f3ff;
}

.shard-card--ingestor .shard-card__subtitle,
.shard-card--ingestor .kv span {
    color: rgba(245, 243, 255, 0.82);
}

.shard-card--ingestor .kv strong {
    color: #fff;
}

.shard-card__status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.shard-card--offline {
    background: var(--shard-offline-bg);
    color: var(--shard-offline-fg);
    box-shadow: none;
    border: 1px solid var(--shard-offline-border);
}

.shard-card--offline .shard-card__subtitle {
    color: var(--shard-offline-fg-dim);
}

.shard-card--offline .kv span,
.shard-card--offline .kv strong {
    color: var(--shard-offline-strong);
}

.shard-card--offline .shard-card__status {
    background: var(--shard-offline-status-bg);
    color: var(--shard-offline-status-fg);
}

.badge-soft {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--accent-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
    gap: 12px;
    margin-top: 10px;
}

.product {
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .product h4 {
        margin: 0;
        color: var(--accent-strong);
    }

    .product small {
        color: var(--muted);
    }

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.price-btn.active-plan {
    background-color: var(--accent-strong);
    color: #fff;
    border-color: var(--accent-strong);
}

/* Single launch "Pilot" bundle card */
.product--bundle {
    max-width: 420px;
}

/* PayPal mark next to the checkout button */
.paypal-badge {
    height: 22px;
    width: auto;
    vertical-align: middle;
    opacity: 0.95;
}

.bundle-features {
    list-style: none;
    margin: 4px 0 4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9em;
}

    .bundle-features li {
        position: relative;
        padding-left: 20px;
    }

    .bundle-features li::before {
        content: "✓";
        position: absolute;
        left: 0;
        color: var(--accent-strong);
        font-weight: 700;
    }

/* ---- Remove page chrome margins/padding globally ---- */
.main-content {
    padding: 0;
}

    /* Override Bootstrap's .container default padding/margin/max-width for full-bleed pages. */
    .main-content .container {
        margin: 0;
        padding: 0;
        max-width: none;
    }

/* RadioOps: 2-column grid */
#radio-ops-root .ops-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    align-items: stretch; /* equal height per row */
}

    /* first card spans both columns */
    #radio-ops-root .ops-grid .ops-span-2 {
        grid-column: 1 / -1;
    }

/* stack on small screens */
@media (max-width: 991px) {
    #radio-ops-root .ops-grid {
        grid-template-columns: 1fr;
    }

        #radio-ops-root .ops-grid .ops-span-2 {
            grid-column: auto;
        }
}

/* remove extra outer spacing for cards inside the grid */
#radio-ops-root .ops-grid > .rr-card {
    margin: 0;
}

/* Downloads section */
.downloads-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.download-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.download-icon {
    flex-shrink: 0;
    color: var(--accent-color);
    opacity: 0.8;
}

.download-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.download-info strong {
    font-size: 1rem;
    color: var(--fg);
}

.download-btn {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .download-item {
        flex-direction: column;
        text-align: center;
    }

    .download-btn {
        width: 100%;
    }
}

/* list that shows ~10 items then scrolls */
.user-scroll {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* height is only constrained when .is-scroll is present */
}

    .user-scroll.is-scroll {
        max-height: 220px; /* ~10 rows visually */
        overflow: auto;
    }

    .user-scroll li a {
        text-decoration: none;
    }



/* -------------------------------- ACARS Sandbox -------------------------------- */
#acars-sandbox-root {
    padding: var(--space-3);
}

@media (max-width: 640px) {
    #acars-sandbox-root {
        padding: var(--space-2);
    }
}

.acars-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.acars-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--accent-weak);
}

.acars-hero__copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.acars-hero__title {
    margin: 0;
    font-size: 1.9rem;
    color: var(--accent-strong);
}

.acars-hero__steps {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.acars-step {
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
    border: 1px solid var(--accent-ring);
    border-radius: var(--radius);
    background: var(--surface);
    padding: var(--space-2);
    font-size: .95rem;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(15,23,42,0.08);
}

.acars-step__num {
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--accent-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .85rem;
}

.acars-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
}

@media (max-width: 1024px) {
    .acars-grid {
        grid-template-columns: 1fr;
    }
}

.acars-main,
.acars-side {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
}

.acars-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.acars-card-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-start;
}

@media (min-width: 900px) {
    .acars-card-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .acars-card-header > div {
        flex: 1;
    }
}

.acars-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.acars-toggle {
    border: 1px solid var(--input-border);
    background: var(--surface);
    color: var(--fg);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, border .2s, color .2s, box-shadow .2s;
}

.acars-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-strong);
}

.acars-toggle:focus-visible {
    outline: 2px solid var(--accent-ring);
    outline-offset: 2px;
}

.acars-toggle.is-active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 0 2px var(--accent-weak);
}

.acars-flight-grid {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.acars-flight-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.acars-flight-field--wide {
    grid-column: span 2;
}

@media (max-width: 720px) {
    .acars-flight-field--wide {
        grid-column: span 1;
    }
}

.acars-flight-label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.acars-flight-field input,
.acars-field input {
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    padding: 8px 10px;
    font-size: .95rem;
    background: var(--input-bg);
    box-shadow: inset 0 1px 0 rgba(15,23,42,0.04);
    transition: border .2s, box-shadow .2s;
}

.acars-flight-field input:focus,
.acars-field input:focus {
    outline: 2px solid var(--input-focus-ring);
    outline-offset: 1px;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-weak);
}

.acars-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.acars-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.acars-status {
    font-size: .85rem;
    color: var(--muted);
}

.acars-status.is-success {
    color: var(--accent-strong);
}

.acars-status.is-warn {
    color: var(--warning-fg);
}

.acars-status.is-error {
    color: var(--danger-fg);
}

.acars-status.is-info {
    color: var(--muted);
}

.acars-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 4px 12px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #f8fafc;
    color: var(--muted);
    transition: background .2s, border .2s, color .2s;
}

.acars-badge.is-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-fg);
}

.acars-badge.is-warn {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-fg);
}

.acars-badge.is-error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-fg);
}

.acars-badge.is-info {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: var(--muted);
}

.acars-menu {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: stretch;
}

.acars-menu-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
}

.acars-menu-column h4 {
    margin: 0;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}

.acars-select {
    width: 100%;
    padding: var(--space-2);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    background: var(--input-bg);
    font-family: inherit;
    font-size: .95rem;
    line-height: 1.4;
    color: inherit;
    box-shadow: inset 0 1px 0 rgba(15,23,42,0.04);
    transition: border .2s, box-shadow .2s;
}

.acars-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-weak);
}

.acars-select:disabled {
    background: var(--surface-sunken);
    color: var(--muted);
    cursor: not-allowed;
}

.acars-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 180px;
    box-shadow: inset 0 1px 0 rgba(15,23,42,0.04);
}

.acars-choice {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: var(--space-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    text-align: left;
    padding: var(--space-2);
    cursor: pointer;
    font-family: inherit;
    transition: border .2s, box-shadow .2s, background .2s, color .2s;
    line-height: 1.35;
}

.acars-choice:hover {
    border-color: var(--accent-color);
}

.acars-choice:focus-visible {
    outline: 2px solid var(--accent-ring);
    outline-offset: 2px;
}

.acars-choice.is-active {
    border-color: var(--accent-color);
    background: var(--accent-weak);
    color: var(--accent-strong);
    box-shadow: 0 0 0 2px var(--accent-weak);
}

.acars-choice__title {
    font-weight: 600;
}

.acars-choice__meta {
    font-size: .8rem;
    color: var(--muted);
}

.acars-empty {
    padding: var(--space-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: #f8fafc;
    color: var(--muted);
    font-size: .9rem;
    font-style: italic;
    text-align: center;
}

.acars-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: #f8fafc;
}

.acars-field-grid {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.acars-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.acars-field span {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.acars-field-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    font-size: .85rem;
    color: var(--muted);
}

.acars-field-meta code {
    background: #0f172a;
    color: #e2e8f0;
    padding: 4px 8px;
    border-radius: var(--radius);
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: .8rem;
}

.acars-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 2px 8px;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #f1f5f9;
    color: var(--muted);
}

.acars-preview {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.acars-preview__pane {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.acars-preview__label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.acars-preview textarea {
    min-height: 120px;
    resize: vertical;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: .95rem;
    line-height: 1.45;
    background: #0f172a;
    color: #e2e8f0;
    border: 0;
    border-radius: var(--radius);
    padding: var(--space-3);
}

.acars-preview__json {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: var(--space-3);
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: .85rem;
    line-height: 1.45;
    overflow: auto;
    max-height: 260px;
}

.acars-preview__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.acars-log {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.acars-log-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.acars-log-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    box-shadow: var(--shadow);
}

.acars-log-item__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
}

.acars-log-item__header time {
    font-size: .85rem;
    color: var(--muted);
}

.acars-log-item p {
    margin: 0;
    line-height: 1.45;
}

.acars-log-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: .85rem;
    color: var(--muted);
}

.acars-log-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.acars-code-block {
    margin-top: var(--space-2);
    display: block;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: var(--space-3);
    overflow: auto;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: .85rem;
    line-height: 1.5;
}

.acars-code-block code {
    color: inherit;
}

.acars-side .rr-card {
    gap: var(--space-2);
}

.acars-list--bullets,
.acars-list--numbered {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    line-height: 1.4;
}

.acars-list--bullets {
    padding-left: 1.2rem;
}

.acars-list--numbered {
    padding-left: 1.4rem;
}

.acars-list--bullets code,
.acars-list--numbered code {
    background: #0f172a;
    color: #e2e8f0;
    padding: 0 4px;
    border-radius: 4px;
    font-family: "JetBrains Mono", "Fira Code", monospace;
}

/* -------------------------- Operations firehose -------------------------- */
#firehose-root {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.firehose__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    flex-wrap: wrap;
}

.firehose__search {
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--fg);
    font-size: 0.8rem;
    width: 180px;
}

.firehose__live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
    transition: background 0.2s;
}

.firehose__live-dot--active {
    background: #22c55e;
    animation: firehose-pulse 1s ease-in-out;
}

@keyframes firehose-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

.firehose__chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--chip-color, #888);
    background: transparent;
    color: var(--chip-color, #888);
    opacity: 0.5;
    transition: all 0.15s ease;
}

.firehose__chip:hover {
    opacity: 0.8;
}

.firehose__chip--active {
    background: var(--chip-color, #888);
    color: #fff;
    opacity: 1;
}

.firehose__control-row input[type="datetime-local"] {
    min-width: 160px;
}

.firehose__status-inline {
    white-space: nowrap;
}

.firehose__search {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.firehose__search input {
    min-width: 240px;
}

.firehose__toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--fg);
}

.firehose__toggle input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.firehose__status {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
}

.firehose__table td {
    vertical-align: top;
}

/* Show all 25 rows without scrolling - users can search for older data */
#firehose-root .rr-table-wrap {
    max-height: none;
    overflow: visible;
}

.firehose__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0 4px;
    border-top: 1px solid var(--border, #e5e5e5);
    margin-top: 8px;
}

.firehose__pagination button:disabled {
    opacity: 0.35;
    cursor: default;
}

.firehose__time-range {
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.firehose__time-range label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.firehose__time-range input[type="datetime-local"] {
    width: 180px;
}

.firehose__message {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
}

.rr-sort {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rr-sort::after {
    content: '';
    font-size: 0.8em;
    opacity: 0.3;
}

.rr-sort[data-sort-direction="asc"]::after {
    content: '▲';
    opacity: 0.7;
}

.rr-sort[data-sort-direction="desc"]::after {
    content: '▼';
    opacity: 0.7;
}

.rr-sort.is-active {
    color: var(--accent-color);
}

/* DataTable component */
.dt-search { margin-bottom: 8px; }
.dt-search input { max-width: 300px; }
.dt-pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 0 4px; border-top: 1px solid var(--border); margin-top: 8px; }
.dt-pagination button:disabled { opacity: 0.35; cursor: default; }
.dt-selected { background: var(--accent-weak) !important; border-left: 3px solid var(--accent-color); }
.dt-new-row { animation: dt-flash-green 1.5s ease-out; }
@keyframes dt-flash-green { 0% { background: rgba(34, 197, 94, 0.2); } 100% { background: transparent; } }
.dt-actions { display: flex; gap: 4px; justify-content: flex-end; }
.dt-actions .btn--danger { color: #ef4444; border-color: rgba(239,68,68,0.3); }
.dt-actions .btn--danger:hover { background: rgba(239,68,68,0.1); }
.rr-sort.sort-asc::after { content: ' \u25B2'; font-size: 0.7em; }
.rr-sort.sort-desc::after { content: ' \u25BC'; font-size: 0.7em; }

@media (max-width: 720px) {
    .firehose__controls {
        align-items: stretch;
        width: 100%;
    }

    .firehose__search input {
        min-width: 0;
        width: 100%;
    }

    .firehose__status {
        text-align: left;
    }
}

/* ------------------------ Traffic map controls ------------------------ */
.traffic-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
}

.traffic-overlay-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.traffic-overlay-toggle input[type="checkbox"] {
    margin: 0;
}

/* ------------------------------- Toasts -------------------------------- */
.toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    padding: 0.6rem 0.8rem;
    background: #222;
    color: #fff;
    border-radius: 0.5rem;
    opacity: 0.95;
    z-index: 1200;
}

.toast.show {
    animation: rr-toast-fadein 0.2s ease;
}

@keyframes rr-toast-fadein {
    from {
        transform: translateY(8px);
        opacity: 0.5;
    }

    to {
        transform: translateY(0);
        opacity: 0.95;
    }
}

/* Ops Feed Cards */
.flight-status-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 12px 0;
    max-width: 100%;
}

.flight-status-cards > * {
    min-width: 0;
}

.ops-feed-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 12px 0;
}

.ops-feed-card {
    min-height: 250px;
}

.ops-feed-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.9rem;
}

.ops-feed-empty {
    color: var(--muted);
    font-style: italic;
    padding: 8px 0;
}

/* Ops-feed cards on the home page render a real <table class="rr-table">
 * so columns line up and row borders match the firehose look.
 * Per-card accent colour is applied by Home/Index.cshtml. Shares
 * dt-flash-green with the DataTable component for "new row arrived" feedback. */
.ops-feed-messages .rr-table td {
    padding-top: 4px;
    padding-bottom: 4px;
    white-space: nowrap;
}
.ops-feed-messages .rr-table td.ops-feed-msg {
    /* Classic single-stretching-cell truncation in an auto-layout table. */
    max-width: 1px;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ops-feed-messages .rr-table td.ops-feed-time {
    text-align: right;
    color: var(--muted);
    font-size: 0.75rem;
}
.ops-feed-messages .rr-table td.ops-feed-tag {
    color: var(--muted);
    font-size: 0.75rem;
}
.ops-feed-messages .rr-table td.ops-feed-dir {
    width: 16px;
    text-align: center;
    font-weight: 700;
    color: var(--muted);
}
.ops-feed-messages .rr-table td.ops-feed-dir--up   { color: #3b82f6; }
.ops-feed-messages .rr-table td.ops-feed-dir--down { color: #22c55e; }
.ops-feed-messages .rr-table td.ops-feed-cs { font-weight: 600; }
.ops-feed-messages .rr-table td.ops-feed-sev { width: 60px; }
.ops-feed-messages .rr-table td.ops-feed-sev > span {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ops-feed-sev--error { background: rgba(239, 68, 68, 0.2);  color: #ef4444; }
.ops-feed-sev--warn  { background: rgba(234, 179, 8, 0.2);  color: #eab308; }
.ops-feed-sev--info  { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }

@media (max-width: 768px) {
    .flight-status-cards,
    .ops-feed-cards {
        grid-template-columns: 1fr;
    }
}

/* Toggle switch for profile visibility */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--muted, #6b7280);
    transition: .2s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Passenger lightbox: click thumb → medium → click medium → full, click outside → close. */
.rr-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: zoom-out;
    animation: rr-lightbox-fade 120ms ease-out;
}
.rr-lightbox-img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.rr-lightbox-zoomable {
    cursor: zoom-in;
}
@keyframes rr-lightbox-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.rr-media-tile {
    cursor: zoom-in;
    text-decoration: none;
    color: inherit;
}
.rr-media-tile:hover {
    transform: translateY(-1px);
    transition: transform 120ms ease-out;
}

.rr-sidebar-photo__tile {
    display: block;
    overflow: hidden;
    border-radius: calc(var(--radius) - 2px);
}

.rr-sidebar-photo__tile img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 200ms ease-out;
}

.rr-sidebar-photo__tile:hover img {
    transform: scale(1.03);
}

.rr-sidebar-photo__caption {
    margin-top: var(--space-2);
    line-height: 1.3;
}
