/* ============================================================================
   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;
    --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: 320px;
}

/* ----------------------------- 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;
}

/* FIR labels */
.fir-label {
    font: 12px/1.1 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #155b2e;
    text-shadow: 0 0 2px #fff, 0 0 4px #fff; /* 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, #1e293b);
}

.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, #0f172a);
    border: 1px solid var(--border, #334155);
    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, #3b82f6);
    transition: width 0.3s ease;
}

.bulk-result {
    padding: 0.5rem;
    border-radius: 6px;
    background: var(--surface-alt, #1e293b);
    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-text, #94a3b8);
    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-text, #94a3b8);
}



/* --------------------------- Admin Audio charts -------------------------- */
.aa-charts {
    display: grid;
    grid-template-columns: 1fr 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-text, #94a3b8); }
@media (max-width: 768px) {
    .aa-charts { grid-template-columns: 1fr; }
}

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

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

.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, #3b82f6);
    border-radius: var(--radius, 4px);
    background: #fff;
    color: var(--accent-strong, #1d4ed8);
    cursor: pointer;
    transition: all 0.15s ease;
}

.aa-listen:hover {
    background: var(--accent-weak, #eff6ff);
    color: var(--accent-strong, #1d4ed8);
}

.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; }
}

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

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

.aa-listeners-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--muted-text, #94a3b8);
}

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

.aa-listeners-table .aa-muted {
    color: var(--muted-text, #64748b);
}

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

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


/* -------------------------------- Header --------------------------------- */
/* Expect markup like:
   <nav class="nav-main"><ul> <li><a href="/" class="active">Home</a></li> ... </ul></nav>
*/
.nav-main {
    background: var(--header-bg);
    color: var(--header-fg);
    box-shadow: var(--shadow);
}

    .nav-main .brand {
        font-weight: 700;
        letter-spacing: .2px;
        color: var(--header-fg);
        text-decoration: none;
    }

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

    .nav-main li {
        display: flex;
    }

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

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

        .nav-main a.active,
        .nav-main li.active > a,
        .nav-main a[aria-current="page"] {
            background: var(--header-active-bg);
            outline: 1px solid rgba(47,168,79,0.35);
            color: var(--header-fg);
        }

    .nav-main .spacer {
        flex: 1 1 auto;
    }

/* Header using rr-header (current layout) */
.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;
    }

    /* If a nav partial outputs <ul><li><a>…</a></li></ul>, make it inline & unbulleted */
    .rr-header ul {
        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;
    }

    .rr-header .nav-item__header {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .rr-header .nav-toggle {
        border: 0;
        background: transparent;
        color: var(--header-fg-dim);
        padding: 6px;
        border-radius: var(--radius);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

        .rr-header .nav-toggle:hover,
        .rr-header .nav-toggle:focus-visible {
            background: rgba(255,255,255,0.08);
            color: var(--header-fg);
            outline: none;
        }

    .rr-header .nav-caret {
        border: solid currentColor;
        border-width: 0 1px 1px 0;
        display: inline-block;
        padding: 3px;
        transform: rotate(45deg);
    }

    .rr-header .nav-item.has-children > .nav-item__header > .nav-link {
        padding-right: 4px;
    }

    .rr-header .nav-item.is-active > .nav-item__header > .nav-link {
        background: var(--header-active-bg);
        box-shadow: inset 0 0 0 1px rgba(47,168,79,0.35);
        color: var(--header-fg);
    }

    .rr-header .nav-item.has-children > .nav-submenu {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        min-width: 180px;
        width: max-content;
        background: rgba(12, 20, 28, 0.96);
        border-radius: var(--radius);
        padding: 4px 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.25);
        z-index: 40;
        box-sizing: border-box;
    }

    .rr-header .rr-left .nav-item.has-children > .nav-submenu { left: 0; }
    .rr-header .rr-right .nav-item.has-children > .nav-submenu { left: 0; }

    .rr-header .nav-item.has-children:hover > .nav-submenu,
    .rr-header .nav-item.has-children:focus-within > .nav-submenu,
    .rr-header .nav-item.has-children.is-open > .nav-submenu {
        display: flex;
    }

    .rr-header .nav-submenu .nav-item {
        display: block;
        width: 100%;
    }

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

    .rr-header .nav-submenu .nav-link.active,
    .rr-header .nav-submenu .nav-link.is-current,
    .rr-header .nav-submenu a[aria-current="page"] {
        background: var(--header-active-bg);
        box-shadow: inset 0 0 0 1px rgba(47,168,79,0.35);
        color: var(--header-fg);
    }

    .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;
        gap: 6px;
        padding: 4px 8px;
        border-radius: var(--radius);
        background: rgba(255,255,255,0.06);
        color: var(--header-fg-dim);
        font-size: 0.8rem;
        border: 1px solid rgba(255,255,255,0.08);
    }

        .rr-header .theme-switcher label {
            text-transform: uppercase;
            letter-spacing: .08em;
            font-size: 0.7rem;
            color: var(--header-fg-dim);
        }

        .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 rgba(47,168,79,0.6);
                outline-offset: 2px;
            }

    .rr-header .server-switcher {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 8px;
        border-radius: var(--radius);
        background: rgba(255,255,255,0.06);
        color: var(--header-fg-dim);
        font-size: 0.8rem;
        border: 1px solid rgba(255,255,255,0.08);
    }

        .rr-header .server-switcher label {
            text-transform: uppercase;
            letter-spacing: .08em;
            font-size: 0.7rem;
            color: var(--header-fg-dim);
        }

        .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 rgba(47,168,79,0.6);
                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: 720px) {
        .rr-header .nav-status {
            order: 1;
            width: 100%;
            justify-content: center;
            margin-top: 4px;
        }

        .rr-header .nav-clock {
            width: 100%;
            justify-content: center;
        }
    }

    .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 (JS in _Layout adds .is-current) */
        .rr-header a.active,
        .rr-header .nav-link.active,
        .rr-header .nav-link.is-current,
        .rr-header a[aria-current="page"] {
            background: var(--header-active-bg);
            box-shadow: inset 0 0 0 1px rgba(47,168,79,0.35);
            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: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 1px solid #f59e0b;
    color: #78350f;
}

.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: 980px) {
    .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: #0f4c81 !important;
}

.text-error {
    color: #b91c1c !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: #fff;
    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 {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 8px;
    background: #fff;
    color: var(--fg);
}

    .form-control:focus {
        outline: 2px solid rgba(47,168,79,0.25);
        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: #fff;
    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: #fff;
    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: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.35);
    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: #fff;
    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;
}

.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: #eef6ef;
    border-color: rgba(47, 168, 79, 0.35);
}

.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: linear-gradient(0deg, rgba(47,168,79,0.06), rgba(47,168,79,0.06));
    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;
}

.sidebar-notice {
    background: #fff4cc;
    border: 1px solid #f0c36d;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.35;
    color: #6b5a00;
}

/* 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, #f59e0b);
    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, #f59e0b);
    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 #e6c200;
    background: #fff8d6;
    color: #6b5a00;
    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: 980px) {
    #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: #fff;
}

    #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(--rr-surface, var(--bs-body-bg, #fff));
    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: #6c757d;
}

.rr-fir-option__traffic {
    margin-top: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0f5132;
}

/* --------------------------- 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;
}

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

.rr-table thead th {
    text-align: left;
    padding: 8px 10px;
    background: linear-gradient(0deg, rgba(47,168,79,0.12), rgba(47,168,79,0.12));
    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: 700px) {
    .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: #ffffff;
    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: linear-gradient(0deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.05));
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    font-size: 0.75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #1f2937;
}

#billingCatalog .rr-table tbody tr:hover {
    background: rgba(47, 168, 79, 0.08);
    transition: background 120ms ease;
}

#billingCatalog table tbody tr.selected {
    background: rgba(47, 168, 79, 0.16);
}

#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:700px) {
    .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: 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:700px) {
    .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:700px) {
    .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: linear-gradient(135deg, #e2e8f0 0%, #cbd5f5 100%);
    color: #334155;
    box-shadow: none;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.shard-card--offline .shard-card__subtitle {
    color: rgba(51, 65, 85, 0.8);
}

.shard-card--offline .kv span,
.shard-card--offline .kv strong {
    color: #1e293b;
}

.shard-card--offline .shard-card__status {
    background: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.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);
}

/* ---- Remove page chrome margins/padding globally ---- */
.main-content {
    padding: 0 !important; /* kill the 16px inline padding from _Layout */
}

    /* Many pages wrap in a `.container` (some with inline margin-top) — flatten those too */
    .main-content .container {
        margin: 0 !important; /* overrides inline margin-top:16px */
        padding: 0 !important;
        max-width: none; /* full-width content */
    }

/* 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: 980px) {
    #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);
    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: 600px) {
    .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-sandbox-root .acars-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

#acars-sandbox-root .acars-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: linear-gradient(135deg, rgba(47,168,79,0.12), rgba(47,168,79,0.03));
}

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

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

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

#acars-sandbox-root .acars-step {
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
    border: 1px solid rgba(47,168,79,0.35);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.92);
    padding: var(--space-2);
    font-size: .95rem;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(15,23,42,0.08);
}

#acars-sandbox-root .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-sandbox-root .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-sandbox-root .acars-grid {
        grid-template-columns: 1fr;
    }
}

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

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

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

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

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

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

#acars-sandbox-root .acars-toggle {
    border: 1px solid var(--border);
    background: #fff;
    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-sandbox-root .acars-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-strong);
}

#acars-sandbox-root .acars-toggle:focus-visible {
    outline: 2px solid rgba(47,168,79,0.35);
    outline-offset: 2px;
}

#acars-sandbox-root .acars-toggle.is-active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(47,168,79,0.18);
}

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

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

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

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

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

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

#acars-sandbox-root .acars-flight-field input:focus,
#acars-sandbox-root .acars-field input:focus {
    outline: 2px solid rgba(47,168,79,0.35);
    outline-offset: 1px;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(47,168,79,0.12);
}

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

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

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

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

#acars-sandbox-root .acars-status.is-warn {
    color: #b45309;
}

#acars-sandbox-root .acars-status.is-error {
    color: #b91c1c;
}

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

#acars-sandbox-root .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-sandbox-root .acars-badge.is-success {
    background: rgba(47,168,79,0.12);
    border-color: var(--accent-color);
    color: var(--accent-strong);
}

#acars-sandbox-root .acars-badge.is-warn {
    background: #fef3c7;
    border-color: #fde68a;
    color: #b45309;
}

#acars-sandbox-root .acars-badge.is-error {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

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

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

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

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

#acars-sandbox-root .acars-select {
    width: 100%;
    padding: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    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-sandbox-root .acars-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(47,168,79,0.18);
}

#acars-sandbox-root .acars-select:disabled {
    background: #f8fafc;
    color: var(--muted);
    cursor: not-allowed;
}

#acars-sandbox-root .acars-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2);
    background: #fff;
    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-sandbox-root .acars-choice {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: var(--space-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    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-sandbox-root .acars-choice:hover {
    border-color: var(--accent-color);
}

#acars-sandbox-root .acars-choice:focus-visible {
    outline: 2px solid rgba(47,168,79,0.35);
    outline-offset: 2px;
}

#acars-sandbox-root .acars-choice.is-active {
    border-color: var(--accent-color);
    background: var(--accent-weak);
    color: var(--accent-strong);
    box-shadow: 0 0 0 2px rgba(47,168,79,0.18);
}

#acars-sandbox-root .acars-choice__title {
    font-weight: 600;
}

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

#acars-sandbox-root .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-sandbox-root .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-sandbox-root .acars-field-grid {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

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

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

#acars-sandbox-root .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-sandbox-root .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-sandbox-root .acars-preview {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

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

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

#acars-sandbox-root .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-sandbox-root .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-sandbox-root .acars-preview__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

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

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

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

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

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

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

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

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

#acars-sandbox-root .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-sandbox-root .acars-code-block code {
    color: inherit;
}

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

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

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

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

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

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

.acars-firehose__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.acars-firehose__controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-2);
}

.acars-firehose__control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.acars-firehose__control-row .form-control--sm {
    width: auto;
    min-width: 120px;
}

.acars-firehose__control-row input[type="search"] {
    min-width: 180px;
}

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

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

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

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

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

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

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

.acars-firehose__table td {
    vertical-align: top;
}

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

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

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

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

.acars-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);
}

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

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

    .acars-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;
}

.traffic-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.traffic-legend-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: #1f2937;
}

.traffic-legend-chip--adsb {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
    color: #1e3a8a;
}

.traffic-legend-chip--presence {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.14);
    color: #9a3412;
}

/* ------------------------------- 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;
}

.ops-feed-cards {
    display: grid;
    grid-template-columns: repeat(3, 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-item {
    padding: 8px;
    border-left: 2px solid var(--accent-color);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

.ops-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 4px;
}

.ops-feed-time {
    color: var(--muted);
    font-size: 0.8rem;
}

.ops-feed-body {
    font-size: 0.85rem;
    color: var(--text);
    word-break: break-word;
}

.ops-feed-alert-error {
    border-left-color: #b91c1c;
}

.ops-feed-alert-warn {
    border-left-color: #b45309;
}

.ops-feed-alert-info {
    border-left-color: var(--accent-color);
}

@media (max-width: 1024px) {
    .ops-feed-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@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, #2563eb);
}

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

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