/* ═══════════════════════════════════════════════════════════════════════════
   Border Vision — UI (LearnWithParam-inspired palette + modern cards)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Shell (aligned to learnwithparam.com dark slate / emerald accents) */
    --bg-page: #0f172b;
    --bg-surface: #101828;
    --bg-elevated: #161b22;
    --bg-elevated-2: #1d293d;

    --accent-primary: #10b981;
    --accent-primary-bright: #00bb7f;
    --accent-cyan: #06b6d4;
    --accent-blue: #155dfc;
    --accent-purple: #8b5cf6;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --shadow-tile: 0 4px 24px rgba(0, 0, 0, 0.35);

    /* Legacy tile vars — remapped for templates that use var(--bg-red) etc. */
    --bg-green: #059669;
    --bg-red: #ef4444;
    --bg-blue: #3b82f6;
    --bg-purple: var(--accent-purple);
    --bg-dark: var(--bg-elevated);
    --bg-teal: #14b8a6;

    --text: #f8fafc;
    --text-muted: #90a1b9;

    --tile-gap: 10px;
    --radius: 10px;
    --font: 'Geist Variable', 'Geist', system-ui, -apple-system, sans-serif;
    --font-mono: 'Geist Mono Variable', 'Geist Mono', ui-monospace, monospace;

    --unit: 130px;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg-page);
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(16, 185, 129, 0.12), transparent 50%),
        linear-gradient(180deg, #0c1222 0%, var(--bg-page) 45%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Start Screen Header ───────────────────────────────────────────────── */
/* ── Start Screen Header ───────────────────────────────────────────────── */
.hero-strip {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px 30px;
    width: 100%;
}

/* ── Top Bar & Footer ─────────────────────────────────────────────────── */
#top-bar {
    background: color-mix(in srgb, var(--bg-page) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-tag {
    font-size: 2.22rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    background: linear-gradient(135deg, #fecaca 0%, var(--accent-primary-bright) 55%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-flags {
    display: flex;
    gap: 6px;
    align-items: center;
}

.flag-icon {
    width: 32px;
    height: auto;
    border-radius: 6px;
    box-shadow: var(--shadow-tile);
    border: 1px solid var(--border-subtle);
}

.top-nav {
    display: flex;
    gap: 32px;
    margin-left: 60px;
    margin-right: auto;
    align-items: center;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--accent-cyan);
}

#bottom-bar {
    margin-top: auto;
    padding: 24px 40px 32px;
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.hero-strip h1 {
    font-size: 3rem;
    font-weight: 200;
    /* Thin Segoe UI look */
    letter-spacing: -1px;
    color: var(--text);
    margin-bottom: 0px;
}

.back-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-cyan);
    margin-bottom: 12px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--accent-primary-bright);
}

/* ═══════════════════════════════════════════════════════════════════════════
   WINDOWS TILE GRID
   ═══════════════════════════════════════════════════════════════════════════ */
.win-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px 60px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 40px;
    /* Gap between groups */
}

.win-group {
    display: flex;
    flex-direction: column;
}

.group-title {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

/* Base grids for wide tiles vs small tiles */
.group-tiles {
    display: grid;
    /* Wide tiles take 2 units wide, 1 unit high */
    grid-template-columns: repeat(2, calc(var(--unit) * 2 + var(--tile-gap)));
    grid-auto-rows: var(--unit);
    gap: var(--tile-gap);
}

.group-tiles-small {
    display: grid;
    /* Small tiles take 1 unit wide, 1 unit high */
    grid-template-columns: repeat(2, var(--unit));
    grid-auto-rows: var(--unit);
    gap: var(--tile-gap);
}

/* ── The Tile ──────────────────────────────────────────────────────────── */
.win-tile {
    position: relative;
    display: block;
    background-color: var(--bg-color, var(--bg-teal));
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-tile);
}

.win-tile:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* Windows 8 'press' effect */
.win-tile:active {
    transform: scale(0.98);
}

/* Tile Layout */
.tile-content {
    position: absolute;
    inset: 0;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
}

.tile-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tile-status {
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.4);
}

.tile-status.is-open {
    color: #fff;
}

.tile-status.is-closed {
    color: #ff6b6b;
}

.tile-nexus {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

/* Big center numbers */
.tile-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.big-wait {
    font-size: 4.5rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.wait-unit {
    font-size: 1.2rem;
    font-weight: 400;
    margin-left: 2px;
    opacity: 0.6;
    letter-spacing: 0;
}

.wait-offline {
    font-size: 2rem;
    font-weight: 400;
    opacity: 0.5;
}

/* Bottom app label */
.tile-bottom {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
}

.tile-title {
    font-size: 1rem;
    font-weight: 400;
    /* Regular weight, not bold */
    letter-spacing: 0.2px;
}

/* ── Extras Group Sizes & Colors ────────────────────────────────────────── */
.bg-blue {
    --bg-color: var(--bg-blue);
}

.bg-purple {
    --bg-color: var(--bg-purple);
}

.bg-dark {
    --bg-color: var(--bg-dark);
}

.bg-teal {
    --bg-color: var(--bg-teal);
}

.bg-green {
    --bg-color: var(--bg-green);
}

.tile-icon {
    font-size: 2rem;
}

.small-hero-text {
    font-size: 2rem;
    font-weight: 300;
    margin-top: -4px;
}

.time-text {
    font-size: 1.2rem;
    margin-top: 4px;
}

.group-tiles-small .tile-center {
    align-items: center;
}

.group-tiles-small .tile-bottom {
    justify-content: flex-start;
}

/* ── Camera Background Integration ─────────────────────────────────────── */
.tile-bg-img {
    position: absolute;
    inset: -10px;
    /* Slight bleed to allow pan animation without edges showing */
    z-index: 0;
}

.cam-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: slow-pan 30s alternate infinite linear;
}

/* Very subtle shader so white text is readable against the camera feed */
.tile-shader {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

@keyframes slow-pan {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.08) translate(-2%, 2%);
    }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
    :root {
        --unit: 140px;
    }

    .hero-strip {
        padding: 40px 20px 20px;
    }

    .hero-strip h1 {
        font-size: 2.2rem;
    }

    .win-grid {
        padding: 0 20px 40px;
        flex-direction: column;
        gap: 30px;
    }

    .group-tiles {
        grid-template-columns: 1fr;
    }

    /* Let wide tiles span the screen */
    .win-tile.tile-wide {
        width: 100%;
    }
}

@media (max-width: 400px) {
    :root {
        --unit: 140px;
    }

    .group-tiles-small {
        grid-template-columns: repeat(2, calc(50vw - 24px));
        grid-auto-rows: calc(50vw - 24px);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NEW TAB & SPLIT-VIEW LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.dashboard-root {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 40px 60px;
}

/* Top Tabs */
.crossing-tabs-container {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.crossing-tab {
    flex: 1;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 24px 20px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 120px;
}

.crossing-tab:hover {
    background: var(--bg-elevated-2);
    border-color: color-mix(in srgb, var(--accent-cyan) 35%, transparent);
}

.crossing-tab.active-tab {
    background: linear-gradient(145deg, #047857 0%, var(--accent-primary) 50%, var(--accent-primary-bright) 100%);
    border-color: color-mix(in srgb, var(--accent-primary-bright) 50%, white);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.25);
    z-index: 10;
}

.tab-title {
    font-size: 1.25rem;
    font-weight: 300;
    margin-top: auto;
}

.tab-status {
    font-size: 0.8rem;
    margin-top: 8px;
    color: var(--text-muted);
}

.tab-status.is-open {
    color: color-mix(in srgb, var(--accent-primary-bright) 90%, white);
}

.crossing-tab.active-tab .tab-status.is-open {
    color: rgba(255, 255, 255, 0.95);
}

/* ── Driver-first: direction summaries + expandable detail ─────────────── */
.crossing-pane-root {
    position: relative;
    padding-bottom: 0;
}

.crossing-pane-root.has-expanded {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

.direction-panels {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.direction-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.direction-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 6px 12px;
    width: 100%;
    min-height: 88px;
    padding: 16px 44px 16px 18px;
    text-align: left;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: var(--shadow-tile);
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.direction-summary:hover {
    border-color: color-mix(in srgb, var(--accent-cyan) 40%, transparent);
}

.direction-summary:focus {
    outline: none;
}

.direction-summary:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

.direction-summary--nb {
    border-left: 4px solid var(--bg-red);
}

.direction-summary--sb {
    border-left: 4px solid var(--bg-blue);
}

.direction-summary[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
    box-shadow: none;
}

.direction-summary__main {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.direction-summary__titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.direction-summary__title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.direction-summary__sub {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.direction-summary__wait {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-shrink: 0;
}

.direction-summary__mins {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.direction-summary__unit {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.direction-summary__meta {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.direction-summary__hints {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
}

.direction-summary__chevron {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    pointer-events: none;
}

.direction-summary__cam-icon {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: color-mix(in srgb, var(--text) 78%, var(--text-muted));
    opacity: 1;
    filter: drop-shadow(0 0 0.5px color-mix(in srgb, var(--text) 40%, transparent));
}

.direction-summary__chevron::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    margin: 4px auto;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease, margin 0.2s ease;
}

.direction-summary[aria-expanded="true"] .direction-summary__chevron::after {
    transform: rotate(-135deg);
    margin-top: 8px;
}

.direction-detail {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0 16px 20px;
    box-shadow: var(--shadow-tile);
}

.direction-detail[hidden] {
    display: none !important;
}

.direction-column--detail {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 16px 0 0;
    border-radius: 0;
}

.dir-title--detail {
    font-size: 1.35rem;
    margin-bottom: 16px;
}

.direction-switch-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--bg-page) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

.direction-switch-bar[hidden] {
    display: none !important;
}

.direction-switch-other {
    width: 100%;
    max-width: 560px;
    min-height: 52px;
    padding: 14px 20px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    background: linear-gradient(145deg, #047857 0%, var(--accent-primary) 55%, var(--accent-primary-bright) 100%);
    border: 1px solid color-mix(in srgb, var(--accent-primary-bright) 45%, white);
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.3);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.direction-switch-other:hover {
    box-shadow: 0 10px 32px rgba(16, 185, 129, 0.4);
}

.direction-switch-other:active {
    transform: scale(0.98);
}

.direction-switch-other:focus {
    outline: none;
}

.direction-switch-other:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 3px;
}

@media (min-width: 900px) {
    .direction-panels {
        flex-direction: row;
        align-items: flex-start;
        gap: 16px;
    }

    .direction-panel {
        flex: 1;
    }

    .direction-summary[aria-expanded="true"] {
        border-radius: var(--radius) var(--radius) 0 0;
    }
}

/* Legacy split grid (e.g. crossing.html) */
.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* Direction Column */
.direction-column {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: var(--shadow-tile);
}

.dir-title {
    font-size: 2rem;
    font-weight: 200;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.dir-sub {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Waits row */
.dir-waits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.wait-box {
    background: var(--bg-elevated-2);
    border: 1px solid var(--border-subtle);
    border-radius: calc(var(--radius) - 2px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.wait-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.wait-columns {
    display: flex;
    gap: 40px;
    margin-bottom: 5px;
}

.wait-col {
    display: flex;
    flex-direction: column;
}

.wait-big-val {
    font-size: 3.5rem;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-variant-numeric: tabular-nums;
}

.wait-unit {
    font-size: 1.2rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
}

.wait-sub-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: -2px;
}

.wait-source {
    display: none;
}

/* Gallery */
.gallery-title {
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.main-cam-stage {
    width: 100%;
    aspect-ratio: 1.5 / 1;
    /* Taller (3:2) for better space reclamation */
    background: #0a0f18;
    margin-bottom: 0px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}

.large-cam {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-container .carousel-btn {
    opacity: 0.8;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: color-mix(in srgb, var(--bg-page) 70%, transparent);
    color: white;
    border: 1px solid var(--border-subtle);
    font-size: 1.75rem;
    line-height: 1;
    min-width: 48px;
    min-height: 48px;
    padding: 12px 16px;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
    user-select: none;
    backdrop-filter: blur(8px);
}

.carousel-btn:hover {
    background: color-mix(in srgb, var(--accent-primary) 35%, black);
}

.prev-btn {
    left: 0;
    border-radius: var(--radius) 0 0 var(--radius);
}

.next-btn {
    right: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.carousel-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    color: var(--text-muted);
}

.no-cams {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    padding: 20px 0;
}

.accuracy-warning {
    margin: 20px 0 30px;
    padding: 15px 20px;
    background: rgba(255, 153, 0, 0.1);
    border-left: 4px solid #ff9900;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #ffcc00;
    display: flex;
    gap: 15px;
    align-items: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.accuracy-warning:hover {
    background: rgba(255, 153, 0, 0.15);
}

.global-accuracy-warning {
    margin: 0 0 25px 0;
    padding: 16px 20px;
    background: rgba(229, 20, 0, 0.1);
    /* Muted Red */
    border: 1px solid rgba(229, 20, 0, 0.2);
    border-left: 5px solid #ce1100;
    color: #ffcccc;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    gap: 16px;
    align-items: center;
    border-radius: 4px;
    letter-spacing: 0.02em;
    width: 100%;
    box-sizing: border-box;
}

.global-accuracy-warning .warning-icon {
    font-size: 1.8rem;
    color: #db2828;
    flex-shrink: 0;
}

.warning-icon {
    font-size: 1.4rem;
}

.warning-text {
    font-weight: 500;
    letter-spacing: 0.02em;
}

@media (max-width: 900px) {
    .split-view {
        grid-template-columns: 1fr;
    }
}

/* ── Mobile & Tablet Responsiveness ───────────────────────────────────── */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #top-bar {
        padding: 10px 10px !important;
    }

    .top-bar-inner {
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .brand {
        gap: 10px !important;
    }

    .brand-tag {
        font-size: 1.6rem !important;
    }

    .top-nav {
        margin-left: 0 !important;
        gap: 8px !important;
        justify-content: center !important;
        width: 100% !important;
        flex-wrap: wrap !important;
    }

    .nav-link {
        font-size: 0.7rem !important;
        letter-spacing: 0.05em !important;
        padding: 4px 6px !important;
    }

    .dashboard-root {
        padding: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 2x2 Tabs for Mobile */
    .crossing-tabs-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        width: 100% !important;
        gap: 8px !important;
        padding: 0 !important;
        margin-bottom: 25px !important;
    }

    .crossing-tab {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 80px !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }

    .tab-title {
        font-size: 1rem !important;
        font-weight: 600 !important;
    }

    /* Stack Direction Columns */
    .split-view {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
    }

    .direction-panels {
        gap: 10px !important;
    }

    .direction-summary {
        min-height: 80px !important;
        padding: 14px 40px 14px 14px !important;
    }

    .direction-summary__mins {
        font-size: 1.85rem !important;
    }

    .direction-summary__title {
        font-size: 1.15rem !important;
    }

    .direction-detail {
        padding: 0 10px 16px !important;
    }

    .direction-column {
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px 10px !important;
        /* Further reduced from 20 15 */
        box-sizing: border-box !important;
    }

    .direction-column.direction-column--detail {
        padding: 12px 0 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* STACK WAIT BOXES */
    .dir-waits {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 15px !important;
    }

    .wait-box {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 15px !important;
        min-height: 120px !important;
        /* Forces symmetry between General/Nexus boxes */
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    .wait-columns {
        gap: 10px !important;
    }

    .wait-big-val {
        font-size: 1.8rem !important;
    }

    .global-accuracy-warning {
        padding: 12px 15px !important;
        font-size: 0.75rem !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .global-accuracy-warning .warning-icon {
        font-size: 1.2rem !important;
    }

    /* Fluid Cameras */
    .cam-gallery,
    .main-cam-stage,
    .large-cam {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
    }

    .dir-title {
        font-size: 1.3rem !important;
        margin-bottom: 15px !important;
    }

    .gallery-title {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .brand-tag {
        font-size: 1.4rem !important;
    }

    .flag-icon {
        width: 20px !important;
    }

    .top-nav {
        gap: 4px !important;
    }

    .nav-link {
        font-size: 0.65rem !important;
        padding: 3px 4px !important;
    }

    .wait-big-val {
        font-size: 2rem !important;
    }

    .wait-unit {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 420px) {
    .dashboard-root {
        padding: 10px 5px !important;
    }

    .direction-column {
        padding: 15px 10px !important;
    }

    .wait-big-val {
        font-size: 1.6rem !important;
    }

    .wait-unit {
        font-size: 0.8rem !important;
    }

    .tab-title {
        font-size: 1.1rem !important;
    }

    .brand-tag {
        font-size: 1.3rem !important;
    }
}

/* ── Guides pages — utility aliases (templates use Tailwind-like class names) ─ */
.text-primary {
    color: var(--accent-primary);
}

.text-muted {
    color: var(--text-muted);
}

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

.bg-card-bg {
    background: var(--bg-elevated);
}

.border-white\/10 {
    border-color: rgba(255, 255, 255, 0.1);
}

.border-primary\/20 {
    border-color: color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

.border-primary\/50,
.hover\:border-primary\/50:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 45%, transparent);
}

.bg-primary\/10 {
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.text-primary\/80 {
    color: color-mix(in srgb, var(--accent-primary) 80%, var(--text-muted));
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.space-y-12 > * + * {
    margin-top: 3rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.leading-tight {
    line-height: 1.25;
}

.leading-relaxed {
    line-height: 1.625;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-4xl {
    font-size: 2.25rem;
}

.text-5xl {
    font-size: 3rem;
}

.font-bold {
    font-weight: 700;
}

.font-extrabold {
    font-weight: 800;
}

.italic {
    font-style: italic;
}

.block {
    display: block;
}

.border {
    border-width: 1px;
    border-style: solid;
}

.border-b {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-top: none;
    border-left: none;
    border-right: none;
}

.pb-2 {
    padding-bottom: 0.5rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.list-disc {
    list-style-type: disc;
}

.list-inside {
    list-style-position: inside;
}

.transition-all {
    transition-property: color, background-color, border-color, box-shadow;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.grid {
    display: grid;
}

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

.gap-8 {
    gap: 2rem;
}

.group:hover .group-hover\:text-primary {
    color: var(--accent-primary);
}

.hover\:underline:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}