/* ============================================
   DCS MISSION COMMAND — Tactical Dark Theme
   ============================================ */

:root {
    --bg-primary: #0a0e13;
    --bg-secondary: #0f1419;
    --bg-panel: #111820;
    --bg-panel-alt: #151d27;
    --bg-elevated: #1a2430;
    --border: #1c2a3a;
    --border-active: #2a4a3a;
    --green-dim: #1e2a35;
    --green: #e0e8f0;
    --green-bright: #ffffff;
    --amber: #c89a20;
    --amber-dim: #7a5e10;
    --green-accent: #5dd98a;
    --red: #ff3344;
    --red-dim: #661122;
    --blue: #3388ff;
    --text-primary: #c8d6e5;
    --text-secondary: #7a8a9a;
    --text-bright: #e8f0f8;
    --shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.28);
    --shadow-panel: 0 20px 50px rgba(0, 0, 0, 0.34);
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
    --font-heading: 'Bahnschrift SemiCondensed', 'Bahnschrift', 'Arial Narrow', sans-serif;
    --font-ui: 'JetBrains Mono', 'Consolas', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(51, 136, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #0d1218 0%, var(--bg-primary) 38%, #070b10 100%);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 16px;
    cursor: auto;
}

a,
button,
select,
summary,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="file"],
label[for],
[role="button"],
.clickable,
.nav-link,
.nav-card,
.mode-tab,
.control-btn {
    cursor: pointer;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--red);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #ff5566;
}

/* ===== TOP DASHBOARD BAR ===== */
#top-bar {
    background: linear-gradient(180deg, rgba(20, 28, 38, 0.96), rgba(11, 17, 24, 0.96));
    border-bottom: 2px solid var(--border);
    font-family: var(--font-mono);
    user-select: none;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: var(--shadow-soft);
    scrollbar-width: none;
}

.dash-row {
    display: flex;
    align-items: stretch;
    min-width: max-content;
    height: 98px;
}

.dash-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px 10px;
    border-right: 1px solid var(--border);
    min-width: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0));
}

.dash-cell:last-child {
    border-right: none;
}

.dash-title {
    padding: 6px 14px;
    min-width: 180px;
}

.dash-title .callsign {
    color: var(--green);
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 3px;
    white-space: nowrap;
}

.dash-label {
    font-size: 10px;
    letter-spacing: 2.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.dash-value {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-bright);
    white-space: nowrap;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.dash-weather-cell {
    position: relative;
}
.dash-weather-icon {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    opacity: 0.75;
}

.dash-sub {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
    white-space: nowrap;
}

/* ===== FLAT UI OVERRIDE ===== */
body :is(
    #top-bar,
    .panel-section,
    .command-overview,
    .nav-link,
    .nav-card,
    .mode-tab,
    .mode-btn,
    .action-btn,
    .control-btn,
    .player-list li,
    .item-list li,
    .pilot-roster li,
    .leaderboard,
    .leaderboard li,
    .settings-card,
    .settings-intro,
    .settings-status-card,
    .settings-return-link,
    .settings-page-link,
    .settings-toggle,
    .settings-slider,
    .settings-status-pill,
    .terrain-chip,
    .debrief-stat-card,
    .logbook-stat-card,
    .file-drop,
    .map-help,
    .briefing-section,
    .report-card,
    .flight-row,
    .flight-table-header,
    .lb-btn,
    input,
    select,
    textarea,
    .leaflet-control-zoom a,
    .leaflet-bar a,
    .leaflet-control-layers-toggle,
    .leaflet-popup-content-wrapper,
    .leaflet-popup-tip,
    .leaflet-tooltip,
    .terrain-tooltip
) {
    border-radius: 0 !important;
}

/* Intel feed — military teletype terminal */
.dash-news {
    flex: 0 0 690px;
    width: 690px;
    overflow: hidden;
}

.dash-news .dash-label {
    display: none;
}

.dash-ticker {
    overflow: hidden;
    position: relative;
    height: 66px;
    max-width: 100%;
    box-sizing: border-box;
    background: #020604;
    border: 1px solid rgba(50, 255, 120, 0.14);
    border-radius: 0;
    padding: 4px 10px;
    margin-top: -2px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    /* CRT phosphor glow */
    box-shadow:
        inset 0 0 30px rgba(50, 255, 120, 0.03),
        inset 0 0 80px rgba(0, 0, 0, 0.5),
        0 0 8px rgba(0, 0, 0, 0.6);
}

/* Scanlines */
.dash-ticker::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.2) 2px,
        rgba(0, 0, 0, 0.2) 3px
    );
    mix-blend-mode: multiply;
}

/* Film grain */
.dash-ticker::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23g)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

/* CRT flicker */
@keyframes crt-flicker {
    0%, 100% { opacity: 1; }
    3% { opacity: 0.97; }
    6% { opacity: 1; }
    42% { opacity: 0.98; }
    44% { opacity: 1; }
    92% { opacity: 0.96; }
    94% { opacity: 1; }
}

.dash-ticker .ticker-row-top {
    width: 100%;
    line-height: 16px;
    animation: crt-flicker 4s ease-in-out infinite;
}
.dash-ticker .ticker-row-body {
    width: 100%;
    line-height: 16px;
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    max-height: 32px;
    animation: crt-flicker 4s ease-in-out infinite;
    animation-delay: -1.5s;
}

/* Header line: DTG + classification + channel */
.dash-ticker .ticker-dtg {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: rgba(50, 255, 120, 0.35);
    letter-spacing: 1px;
    margin-right: 8px;
}
.dash-ticker .ticker-class {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    color: #cc2222;
    letter-spacing: 1.5px;
    margin-right: 8px;
    text-shadow: 0 0 4px rgba(204, 34, 34, 0.4);
}
.dash-ticker .ticker-precedence {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: rgba(255, 200, 60, 0.5);
    letter-spacing: 1px;
    margin-right: 8px;
}
.dash-ticker .ticker-channel {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: rgba(50, 255, 120, 0.25);
    letter-spacing: 0.5px;
}

/* Message body */
.dash-ticker .ticker-prefix {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: rgba(50, 255, 120, 0.6);
    letter-spacing: 1px;
    margin-right: 4px;
    text-shadow: 0 0 6px rgba(50, 255, 120, 0.2);
}
.dash-ticker .ticker-body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: rgba(50, 255, 120, 0.85);
    text-shadow: 0 0 8px rgba(50, 255, 120, 0.25);
    letter-spacing: 1px;
}

/* Blinking block cursor */
.dash-ticker .ticker-cursor {
    display: inline-block;
    width: 7px;
    height: 14px;
    background: rgba(50, 255, 120, 0.8);
    box-shadow: 0 0 6px rgba(50, 255, 120, 0.4);
    vertical-align: text-bottom;
    margin-left: 1px;
    animation: ticker-cursor-blink 0.5s steps(1) infinite;
}
@keyframes ticker-cursor-blink {
    0%, 45% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* RX indicator */
.dash-ticker .ticker-rx {
    position: absolute;
    top: 4px;
    right: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    color: rgba(50, 255, 120, 0.3);
    letter-spacing: 1px;
}
.dash-ticker .ticker-rx::before {
    content: '\25CF';
    font-size: 6px;
    margin-right: 3px;
    animation: rx-blink 0.3s steps(1) infinite;
    color: rgba(50, 255, 120, 0.6);
}
@keyframes rx-blink {
    0%, 60% { opacity: 1; }
    61%, 100% { opacity: 0; }
}

/* News / OSINT items */
.dash-ticker .ticker-news-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    color: rgba(100, 180, 255, 0.7);
    letter-spacing: 1.5px;
    margin-right: 8px;
}
.dash-ticker .ticker-news-src {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
    margin-right: 4px;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.15);
}
.dash-ticker .ticker-news-body {
    color: rgba(180, 210, 255, 0.85) !important;
    text-shadow: 0 0 6px rgba(100, 180, 255, 0.2) !important;
}

/* Conflict nations cell */
.dash-cell-nations {
    min-width: 180px;
    max-width: 280px;
}
.conflict-nations {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}
.nation-chip {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 2px 5px;
    border: 1px solid;
    cursor: pointer;
    border-radius: 1px;
    transition: filter 0.15s, transform 0.1s;
    user-select: none;
}
.nation-chip:hover {
    filter: brightness(1.4);
    transform: translateY(-1px);
}
.nation-for {
    color: #6ab0f5;
    border-color: rgba(100, 160, 240, 0.45);
    background: rgba(40, 80, 160, 0.18);
}
.nation-against {
    color: #f07070;
    border-color: rgba(220, 80, 80, 0.45);
    background: rgba(160, 30, 30, 0.18);
}
.nation-neutral {
    color: #80c080;
    border-color: rgba(100, 180, 100, 0.45);
    background: rgba(30, 100, 40, 0.18);
}

/* Conflict popup — newspaper style */
.conflict-popup {
    position: fixed;
    z-index: 9999;
    width: 420px;
    background: #f5f0e8;
    border: 1px solid #c8b89a;
    box-shadow: 0 8px 32px rgba(0,0,0,0.55);
    padding: 16px;
    font-family: Georgia, 'Times New Roman', serif;
    color: #1a1208;
    pointer-events: none;
}
.conflict-popup-flag {
    font-size: 11px;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    border-bottom: 2px solid #1a1208;
    padding-bottom: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.conflict-popup-stance {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 2px 6px;
    border-radius: 1px;
}
.stance-for     { background: #1a4a9a; color: #fff; }
.stance-against { background: #9a1a1a; color: #fff; }
.stance-neutral { background: #1a6a2a; color: #fff; }
.conflict-popup-headline {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    border-bottom: 1px solid #c8b89a;
    padding-bottom: 6px;
}
.conflict-popup-body {
    font-size: 12px;
    line-height: 1.65;
    color: #2a1e0a;
    font-family: 'JetBrains Mono', monospace;
}
.conflict-popup-dateline {
    font-size: 9px;
    font-family: var(--font-mono);
    color: #888;
    margin-top: 10px;
    border-top: 1px solid #c8b89a;
    padding-top: 6px;
    letter-spacing: 0.08em;
}

/* Nav cell — horizontal row of rectangular buttons */
.dash-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 8px;
    padding: 0 16px;
    align-items: center;
    justify-content: flex-end;
}

.dash-nav .nav-link {
    padding: 0 16px;
    height: 42px;
    font-size: 12px;
    letter-spacing: 2px;
    text-align: center;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 170, 0, 0.28);
    background: rgba(255, 170, 0, 0.04);
    position: relative;
    overflow: hidden;
}

/* Amber bottom-edge accent on hover — tab indicator feel */
.dash-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 2px;
    background: var(--amber);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.dash-nav .nav-link:hover {
    border-color: rgba(255, 170, 0, 0.6);
    background: rgba(255, 170, 0, 0.1);
    transform: none;
}

.dash-nav .nav-link:hover::after,
.dash-nav .nav-link.nav-active::after {
    opacity: 1;
}

.dash-nav .nav-link.nav-active {
    border-color: rgba(255, 170, 0, 0.55);
    color: var(--amber);
}

/* Home icon cell — narrow cell to the left of the title */
.dash-home {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    min-width: 60px;
}

.dash-home a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--amber);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.75;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.dash-home a:hover {
    opacity: 1;
    color: var(--text-bright);
}

.dash-home svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

/* ===== MAIN LAYOUT ===== */
#app {
    display: flex;
    height: calc(100vh - 104px);
    gap: 0;
}

/* ===== LEFT CONTROL PANEL ===== */
#control-panel {
    width: 320px;
    min-width: 320px;
    background:
        linear-gradient(180deg, rgba(20, 28, 38, 0.94), rgba(11, 17, 24, 0.98)),
        var(--bg-panel);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    font-size: 13px;
    padding: 1em;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 0.9em;
}

.panel-section {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
        var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9em 1em;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    flex-shrink: 0;
}

.panel-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 170, 0, 0.6), rgba(51, 136, 255, 0.25), transparent);
    opacity: 0.8;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.25em;
    letter-spacing: 2px;
    color: var(--green);
    margin-bottom: 0.5em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid var(--border);
}

.section-note {
    font-family: var(--font-mono);
    font-size: 1em;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0 0 0.9em;
}

/* BUTTON GRID */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7em;
}

.theater-btn, .type-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    min-height: 3.5em;
    padding: 0.6em 0.5em;
    font-family: var(--font-mono);
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.theater-btn:hover, .type-btn:hover {
    border-color: var(--green);
    color: var(--text-primary);
    background: var(--green-dim);
}

.theater-btn.active {
    border-color: var(--green);
    color: var(--green);
    background: var(--green-dim);
    box-shadow: 0 0 8px rgba(224, 232, 240, 0.1);
}

.type-btn.active {
    border-color: var(--amber);
    color: var(--amber);
    background: rgba(255, 170, 0, 0.1);
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.15);
}

/* PARAMS */
.param-row {
    display: flex;
    flex-direction: column;
    gap: 0.35em;
    margin-bottom: 0.7em;
}

.param-row label {
    font-family: var(--font-mono);
    font-size: 1em;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.param-row select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.6em 0.9em;
    font-family: var(--font-mono);
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
}

.param-row select:focus {
    border-color: var(--green);
}

.param-row select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* GENERATE BUTTON */
#generate-btn {
    width: 100%;
    padding: 1em 1.4em;
    background: linear-gradient(180deg, rgba(224, 232, 240, 0.16) 0%, rgba(30, 42, 53, 0.92) 100%);
    border: 1px solid var(--green);
    color: var(--green);
    font-family: var(--font-mono);
    font-size: 1.15em;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8em;
}

#generate-btn:hover {
    background: linear-gradient(180deg, rgba(224, 232, 240, 0.2) 0%, rgba(30, 42, 53, 1) 100%);
    box-shadow: 0 0 24px rgba(224, 232, 240, 0.12);
}

#generate-btn:active {
    transform: scale(0.98);
}

#generate-btn .btn-icon {
    font-size: 1.15em;
}

/* MISSION LOG */
#mission-log {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

#mission-log li {
    padding: 6px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

#mission-log li:hover {
    border-color: var(--amber);
    color: var(--text-primary);
}

#mission-log li .log-name {
    color: var(--amber);
    display: block;
    margin-bottom: 2px;
}

#mission-log li .log-meta {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===== MAP CONTAINER ===== */
#map-container {
    flex: 1;
    position: relative;
    background: var(--bg-primary);
    min-width: 0;
}

#map {
    width: 100%;
    height: 100%;
    cursor: none;
    background:
        radial-gradient(circle at 50% 45%, rgba(48, 127, 150, 0.18), transparent 34%),
        linear-gradient(180deg, #0a202b 0%, #0a1b24 48%, #07141c 100%);
}
#map,
#map *,
#lobby-map,
#lobby-map * {
    cursor: none !important;
}
#map.leaflet-container {
    background:
        radial-gradient(circle at 50% 45%, rgba(48, 127, 150, 0.18), transparent 34%),
        linear-gradient(180deg, #0a202b 0%, #0a1b24 48%, #07141c 100%) !important;
}
#map .leaflet-interactive,
#map .leaflet-marker-icon,
#map .leaflet-grab,
#map .leaflet-dragging,
#lobby-map .leaflet-interactive,
#lobby-map .leaflet-marker-icon,
#lobby-map .leaflet-grab,
#lobby-map .leaflet-dragging {
    cursor: none !important;
}

/* Tactical crosshair cursor */
.map-crosshair {
    position: absolute;
    pointer-events: none;
    z-index: 1001;
}
.map-crosshair-ring {
    width: 28px;
    height: 28px;
    border: 1.5px solid rgba(255, 170, 0, 0.7);
    border-radius: 0;
    position: absolute;
    top: -14px;
    left: -14px;
    transition: border-color 0.15s;
    box-shadow: 0 0 12px rgba(255, 170, 0, 0.2), 0 0 24px rgba(0, 0, 0, 0.4);
}
.map-crosshair.snapped .map-crosshair-ring {
    border-color: rgba(255, 170, 0, 0.45);
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.1), 0 0 16px rgba(0, 0, 0, 0.3);
}
.map-crosshair.active .map-crosshair-ring {
    border-color: rgba(255, 170, 0, 0.7);
}
.map-crosshair.active .map-crosshair-h,
.map-crosshair.active .map-crosshair-v {
    background: rgba(255, 170, 0, 0.7);
}
.map-crosshair.active .map-crosshair-coords {
    opacity: 0;
}
.map-crosshair-h,
.map-crosshair-v {
    position: absolute;
    background: rgba(255, 170, 0, 0.5);
}
.map-crosshair-h {
    width: 12px;
    height: 1px;
    top: -0.5px;
}
.map-crosshair-h.left { right: 15px; }
.map-crosshair-h.right { left: 15px; }
.map-crosshair-v {
    width: 1px;
    height: 12px;
    left: -0.5px;
}
.map-crosshair-v.top { bottom: 15px; }
.map-crosshair-v.bottom { top: 15px; }
.map-crosshair-coords {
    position: absolute;
    top: -28px;
    left: 18px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: rgba(255, 170, 0, 0.9);
    text-shadow:
        0 0 8px  rgba(255, 170, 0, 0.65),
        0 0 20px rgba(255, 170, 0, 0.35),
        0 1px 3px rgba(0, 0, 0, 1),
        0 2px 10px rgba(0, 0, 0, 1),
        0 4px 18px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
}
/* Snapped: coords stay amber but subdued */
.map-crosshair.snapped .map-crosshair-coords {
    color: rgba(255, 170, 0, 0.6);
    text-shadow:
        0 0 6px  rgba(255, 170, 0, 0.3),
        0 0 14px rgba(255, 170, 0, 0.12),
        0 1px 3px rgba(0, 0, 0, 1),
        0 2px 10px rgba(0, 0, 0, 0.9),
        0 4px 18px rgba(0, 0, 0, 0.7);
}
/* Amber centre dot */
.map-crosshair-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    box-shadow: 0 0 0 0.5px rgba(255, 170, 0, 0.7);
}

/* Film grain overlay on dark map layers (Dark Matter / Dark Smooth).
 * A pseudo-element filled with SVG feTurbulence noise is animated with
 * steps(1) to jump between random offsets each frame, simulating grain.
 * Opacity is kept very low — just enough texture to feel analogue. */
#map.map-dark-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 250; /* above tile pane (200), below markers/overlays (400+) */
    opacity: 0.09;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23g)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    animation: mapFilmGrain 0.38s steps(1) infinite;
}

@keyframes mapFilmGrain {
    0%   { background-position:   0px   0px; }
    12%  { background-position: -43px  57px; }
    25%  { background-position:  64px -32px; }
    37%  { background-position: -19px -68px; }
    50%  { background-position:  49px  42px; }
    62%  { background-position: -70px  13px; }
    75%  { background-position:  28px -54px; }
    87%  { background-position: -55px  37px; }
    100% { background-position:   0px   0px; }
}

/* Static film grain — always visible on map, subtle texture */
#map::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 249;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23g)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* Remove tile borders/outlines */
.leaflet-tile {
    outline: none !important;
    border: none !important;
}

/* Main satellite tiles — slightly darkened to keep overlays readable */
.satellite-tiles {
    filter: brightness(0.75) contrast(1.20) saturate(0.65);
}
/* Pastel satellite tiles — softer, muted colors */
.pastel-tiles {
    filter: saturate(0.65) brightness(1.0) contrast(1.1);
}
/* Relief — NATO Blue tactical look */
.terrain-inverted-tiles {
    filter: hue-rotate(200deg) saturate(1.8) brightness(0.8);
}
/* Dark red country borders overlay */
.border-tiles {
    filter: brightness(0.3) sepia(1) saturate(5) hue-rotate(-30deg);
}

/* Coordinate grid labels */
.grid-label {
    color: rgba(255, 255, 255, 0.4);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    background: none !important;
    border: none !important;
}

/* Dark map tiles — using CartoDB Dark Matter, no filter needed */

.leaflet-control-zoom a {
    background: var(--bg-panel) !important;
    color: var(--green) !important;
    border-color: var(--border) !important;
}

/* Custom map layer control */
.map-layer-ctrl {
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: all;
}
.mlc-overlay-row,
.mlc-base-row {
    display: flex;
    flex-direction: row;
    gap: 2px;
}
.mlc-toggle,
.mlc-base {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    padding: 7px 13px;
    background: transparent;
    border: 1px solid rgba(160, 150, 120, 0.2);
    border-top: 2px solid transparent;
    color: rgba(200, 190, 165, 0.45);
    cursor: pointer;
    white-space: nowrap;
    border-radius: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
    text-transform: uppercase;
}
.mlc-toggle:hover,
.mlc-base:hover {
    color: rgba(220, 200, 155, 0.85);
    border-color: rgba(255, 170, 0, 0.35);
    background: rgba(5, 9, 14, 0.5);
}
.mlc-toggle.mlc-on {
    color: #ffe08a;
    border-color: rgba(255, 170, 0, 0.4);
    border-top: 2px solid rgba(255, 170, 0, 0.6);
    background: rgba(5, 9, 14, 0.88);
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.mlc-base.mlc-active {
    color: #ffe08a;
    border-color: rgba(255, 170, 0, 0.4);
    border-top: 2px solid rgba(255, 170, 0, 0.6);
    background: rgba(5, 9, 14, 0.88);
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.map-reset-control {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--bg-panel) !important;
    color: var(--amber) !important;
    border-color: var(--border) !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    line-height: 1 !important;
}

.map-reset-control:hover {
    background: var(--bg-panel-alt) !important;
    color: #ffd27a !important;
}

.map-night-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--bg-panel) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border) !important;
    font-size: 16px;
    text-decoration: none !important;
    line-height: 1 !important;
    transition: color 0.2s, background 0.2s;
}

.map-night-toggle:hover {
    background: var(--bg-panel-alt) !important;
    color: var(--amber) !important;
}

.map-night-toggle.night-active {
    background: #0a1428 !important;
    color: #ffd27a !important;
    border-color: rgba(255, 210, 122, 0.4) !important;
}

.leaflet-control-attribution {
    background: rgba(10, 14, 19, 0.8) !important;
    color: var(--text-secondary) !important;
    font-size: 13px !important;
}

.leaflet-control-attribution a {
    color: var(--text-secondary) !important;
}

#map-overlay-top {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(10, 14, 19, 0.75);
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--amber);
    letter-spacing: 2px;
    pointer-events: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#map-coords {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    background: rgba(10, 14, 19, 0.85);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Map markers */
.mission-marker {
    background: none;
    border: none;
}

.marker-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    font-family: var(--font-mono);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.marker-icon.marker-svg {
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.7));
}

.marker-icon.marker-svg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.marker-label {
    position: absolute;
    top: 34px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #e0e8f0;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 5px;
    border-radius: 2px;
    pointer-events: none;
}
/* City labels on map */
.city-label {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 2px;
    background: rgba(8, 13, 18, 0.72);
    border: 1px solid rgba(26, 58, 106, 0.6);
    color: rgba(140, 180, 220, 0.95);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    letter-spacing: 0.9px;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.city-label-sm {
    color: rgba(210, 195, 165, 0.85);
    border-color: rgba(120, 100, 70, 0.45);
}

/* FLOT line label */
.flot-label-wrapper { background: none; border: none; }
.flot-label {
    font-family: var(--font-heading, 'Bahnschrift SemiCondensed', sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #ff4455;
    background: rgba(0, 0, 0, 0.6);
    padding: 1px 6px;
    border-radius: 2px;
}

.marker-label.marker-friendly { color: #3BB9FF; border-bottom: 1px solid rgba(59, 185, 255, 0.5); }
.marker-label.marker-waypoint { color: #ffaa00; border-bottom: 1px solid rgba(255, 170, 0, 0.5); }
.marker-label.marker-target { color: #ff5566; border-bottom: 1px solid rgba(255, 85, 102, 0.5); }
.marker-label.marker-sam { color: #ff5566; border-bottom: 1px solid rgba(255, 85, 102, 0.5); }

.marker-icon.marker-svg.marker-sam img,
.marker-icon.marker-svg.marker-target img {
    filter: drop-shadow(0 0 3px rgba(255, 51, 68, 0.5));
}

.marker-icon.marker-svg.marker-friendly img {
    filter: drop-shadow(0 0 3px rgba(59, 185, 255, 0.5));
}

.marker-icon.marker-svg.marker-waypoint img {
    filter: drop-shadow(0 0 3px rgba(255, 170, 0, 0.5));
}

.marker-target {
    border-color: var(--red);
    background: var(--red-dim);
    color: var(--red);
}

.marker-friendly {
    border-color: var(--blue);
    background: rgba(20, 40, 80, 0.8);
    color: var(--blue);
}

.marker-waypoint {
    border-color: var(--amber);
    background: rgba(80, 60, 10, 0.8);
    color: var(--amber);
}

.marker-sam {
    border-color: var(--red);
    background: rgba(100, 10, 20, 0.9);
    color: var(--red);
    animation: threat-pulse 1.5s ease-in-out infinite;
}

.marker-icon.marker-svg.marker-sam {
    background: none;
    animation: threat-pulse-svg 1.5s ease-in-out infinite;
}

@keyframes threat-pulse-svg {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 51, 68, 0.4)); }
    50% { filter: drop-shadow(0 0 14px rgba(255, 51, 68, 0.8)); }
}

@keyframes threat-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(255, 51, 68, 0.4); }
    50% { box-shadow: 0 0 18px rgba(255, 51, 68, 0.7); }
}

/* Threat rings */
.threat-ring {
    border: 1px dashed var(--red);
    border-radius: 50%;
    background: rgba(255, 51, 68, 0.05);
    opacity: 0.6;
}

/* Route lines */
.route-line {
    stroke: var(--amber);
    stroke-dasharray: 8 4;
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
    background: var(--bg-panel) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 4px !important;
    font-family: var(--font-mono) !important;
    font-size: 13px !important;
}

.leaflet-popup-tip {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border) !important;
}

.leaflet-popup-content {
    margin: 10px !important;
}

.cursor-missile-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5000;
    overflow: hidden;
}

.cursor-missile-salvo {
    position: fixed;
    width: 0;
    height: 0;
}

.cursor-missile {
    position: absolute;
    width: 40px;
    height: 10px;
    background:
        linear-gradient(90deg, rgba(168, 178, 190, 0.98) 0%, rgba(229, 234, 239, 0.98) 40%, rgba(245, 201, 96, 0.92) 78%, rgba(255, 126, 28, 0.92) 100%);
    border: 1px solid rgba(255, 228, 163, 0.45);
    clip-path: polygon(0 45%, 16% 26%, 67% 26%, 82% 0, 100% 50%, 82% 100%, 67% 74%, 16% 74%);
    box-shadow:
        0 0 14px rgba(255, 170, 0, 0.56),
        0 0 34px rgba(255, 110, 0, 0.24);
    transform-origin: left center;
    animation: missile-salvo var(--flight-duration, 0.68s) cubic-bezier(0.2, 0.75, 0.22, 1) forwards;
    left: 0;
    top: 0;
}

.cursor-missile::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 50%;
    width: 30px;
    height: 9px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 246, 215, 0.95) 0%, rgba(255, 196, 89, 0.92) 34%, rgba(255, 124, 32, 0.7) 62%, rgba(255, 124, 32, 0) 100%);
    filter: blur(0.6px);
    box-shadow:
        0 0 16px rgba(255, 186, 69, 0.86),
        0 0 24px rgba(255, 106, 0, 0.32);
}

.cursor-missile::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    width: 10px;
    height: 14px;
    transform: translateY(-50%);
    background:
        linear-gradient(180deg, transparent 0 18%, rgba(225, 231, 240, 0.9) 18% 28%, transparent 28% 72%, rgba(225, 231, 240, 0.9) 72% 82%, transparent 82% 100%);
    opacity: 0.85;
}

.cursor-missile-left {}

.cursor-missile-right {}

.cursor-missile-flash {
    position: absolute;
    left: -4px;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 247, 214, 0.95) 0%, rgba(255, 170, 0, 0.5) 50%, rgba(255, 170, 0, 0) 100%);
    animation: missile-flash 0.35s ease-out forwards;
}

.cursor-impact {
    position: fixed;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.cursor-impact::before,
.cursor-impact::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.cursor-impact::before {
    background: radial-gradient(circle, rgba(255, 247, 221, 1) 0%, rgba(255, 184, 66, 0.95) 32%, rgba(255, 104, 24, 0.72) 56%, rgba(255, 70, 38, 0.2) 74%, rgba(255, 70, 38, 0) 100%);
    box-shadow:
        0 0 18px rgba(255, 184, 66, 0.9),
        0 0 46px rgba(255, 104, 24, 0.45);
    animation: impact-core 0.82s ease-out forwards;
}

.cursor-impact::after {
    inset: -22px;
    border: 2px solid rgba(255, 196, 84, 0.72);
    box-shadow: 0 0 18px rgba(255, 170, 0, 0.28);
    animation: impact-ring 0.82s ease-out forwards;
}

@keyframes missile-salvo {
    0% {
        opacity: 0;
        filter: brightness(1.35);
        transform: translate(0, 0) rotate(var(--flight-angle, -15deg)) scale(0.72);
    }
    8% {
        opacity: 1;
    }
    86% {
        opacity: 1;
        filter: brightness(1.02);
        transform: translate(calc(var(--travel-x, 96px) * 0.9), calc(var(--travel-y, -24px) * 0.9)) rotate(var(--flight-angle, -15deg)) scale(1);
    }
    100% {
        opacity: 0;
        filter: brightness(0.9);
        transform: translate(var(--travel-x, 96px), var(--travel-y, -24px)) rotate(var(--flight-angle, -15deg)) scaleX(1);
    }
}

@keyframes missile-flash {
    0% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(0.45);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.8);
    }
}

@keyframes impact-core {
    0% {
        opacity: 0;
        transform: scale(0.35);
        filter: brightness(1.5);
    }
    20% {
        opacity: 1;
        transform: scale(1.45);
    }
    100% {
        opacity: 0;
        transform: scale(2.8);
        filter: brightness(0.9);
    }
}

@keyframes impact-ring {
    0% {
        opacity: 0.85;
        transform: scale(0.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.45);
    }
}

.popup-title {
    color: var(--amber);
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 13px;
}

.popup-detail {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* Marker hover tooltips — match popup style exactly */
.marker-tooltip {
    background: var(--bg-panel) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 4px !important;
    font-family: var(--font-mono) !important;
    font-size: 13px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.7) !important;
    padding: 10px !important;
    white-space: normal !important;
    min-width: 280px;
    max-width: 320px;
    line-height: 1.5;
}
.marker-tooltip::before {
    border-top-color: var(--border) !important;
}
.marker-tooltip-threat {
    border-color: rgba(255, 51, 68, 0.6) !important;
}
.marker-tooltip-threat::before {
    border-top-color: rgba(255, 51, 68, 0.6) !important;
}

.terrain-tooltip {
    background: transparent;
    color: #ffaa00;
    border: none;
    box-shadow: none;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.6), 0 0 20px rgba(255, 170, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 1), 0 2px 10px rgba(0, 0, 0, 0.85), 0 4px 16px rgba(0, 0, 0, 0.6);
}

.terrain-tooltip:before {
    display: none;
}

.terrain-chip-wrapper {
    background: transparent;
    border: none;
}

.terrain-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(8, 13, 18, 0.78);
    border: 1px solid rgba(26, 58, 106, 0.5);
    color: rgba(140, 180, 220, 0.85);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.terrain-chip.is-supported {
    border-color: rgba(42, 90, 154, 0.55);
    color: rgba(160, 195, 235, 0.92);
}

.terrain-chip.is-regional {
    border-color: rgba(26, 58, 106, 0.45);
    color: rgba(140, 180, 220, 0.9);
}

.terrain-chip.is-historic {
    border-color: rgba(26, 58, 106, 0.45);
    color: rgba(140, 180, 220, 0.9);
}

.terrain-chip-wrapper.is-active .terrain-chip,
.terrain-chip-wrapper:hover .terrain-chip {
    transform: translateY(-1px);
}

.terrain-chip-wrapper.is-active .terrain-chip.is-supported {
    background: rgba(26, 58, 106, 0.2);
    border-color: rgba(42, 90, 154, 0.7);
    color: var(--green);
}

.terrain-chip-wrapper.is-active .terrain-chip.is-regional {
    background: rgba(26, 58, 106, 0.18);
    border-color: rgba(42, 90, 154, 0.65);
    color: var(--green);
}

.terrain-chip-wrapper.is-active .terrain-chip.is-historic {
    background: rgba(26, 58, 106, 0.18);
    border-color: rgba(42, 90, 154, 0.65);
    color: var(--green);
}

.terrain-chip-wrapper.is-active .terrain-chip.is-official {
    background: rgba(26, 58, 106, 0.18);
    border-color: rgba(42, 90, 154, 0.65);
    color: var(--green);
}

/* ===== RIGHT BRIEFING PANEL ===== */
#briefing-panel {
    width: 520px;
    min-width: 520px;
    background:
        linear-gradient(180deg, rgba(20, 28, 38, 0.94), rgba(11, 17, 24, 0.98)),
        var(--bg-panel);
    border-left: 1px solid var(--border);
    overflow-y: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#briefing-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
    padding: 48px 36px;
}

.placeholder-kicker {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 14px;
}

.placeholder-icon {
    font-size: 48px;
    color: var(--border);
    margin-bottom: 16px;
}

#briefing-placeholder p {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.8;
    letter-spacing: 1px;
}

/* BRIEFING CONTENT — lined paper aesthetic */
#briefing-content {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 26px,
            rgba(100, 140, 200, 0.25) 26px,
            rgba(100, 140, 200, 0.25) 27px
        );
    background-position: 0 12px;
    background-color: #e8e4dc;
    background-attachment: local;
    border-left: none;
    color: #1a1a1a;
}

.briefing-header {
    background:
        radial-gradient(circle at top, rgba(255, 170, 0, 0.08), transparent 48%),
        var(--bg-panel-alt);
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.classification {
    font-family: var(--font-mono);
    font-size: 14px;
    color: #b91c1c;
    letter-spacing: 3px;
    font-weight: bold;
    padding: 4px 12px;
    border: 1px solid #b91c1c;
    display: inline-block;
    margin-bottom: 10px;
}

.briefing-header h2 {
    font-family: var(--font-heading);
    font-size: 34px;
    color: var(--text-bright);
    letter-spacing: 3px;
    margin: 10px 0;
}

.brief-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: #6b5a00;
}

.briefing-section {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
}

.briefing-section h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    letter-spacing: 2px;
    color: #1a3a1a;
    margin-bottom: 14px;
    text-decoration: underline dotted;
    text-decoration-color: rgba(0, 0, 0, 0.3);
    text-underline-offset: 4px;
}

.briefing-section div {
    font-size: 15px;
    line-height: 1.85;
    color: #1a1a1a;
}

.briefing-section ul {
    list-style: none;
    padding: 0;
}

.briefing-section li {
    padding: 0;
    padding-left: 16px;
    position: relative;
    font-size: 15px;
    line-height: 1.85;
    margin-bottom: 6px;
}

.briefing-section li::before {
    content: '\25B8';
    position: absolute;
    left: 0;
    color: #2a5a2a;
}

.briefing-section p {
    line-height: 1.85;
    margin-bottom: 10px;
}

.briefing-section p:last-child {
    margin-bottom: 0;
}

.briefing-footer {
    padding: 16px 16px 16px 44px;
    text-align: center;
    border-top: 1px solid rgba(100, 140, 200, 0.3);
}

.brief-callsign {
    color: #6b5a00;
    font-weight: bold;
}

.brief-freq {
    color: #1a5a1a;
    font-family: var(--font-mono);
}

.brief-threat {
    color: #b91c1c;
    font-weight: bold;
}

.brief-coord {
    color: #6b5a00;
    font-family: var(--font-mono);
    font-size: 14px;
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    #control-panel {
        width: 280px;
        min-width: 280px;
    }
    #briefing-panel {
        width: 360px;
        min-width: 360px;
    }
}

@media (max-width: 900px) {
    html, body {
        overflow: auto;
    }

    #app {
        flex-direction: column;
        height: auto;
    }
    #control-panel, #briefing-panel {
        width: 100%;
        min-width: 100%;
        max-height: none;
    }
    #map-container {
        min-height: 360px;
        order: -1;
    }
}

/* ===== MOBILE (768px) ===== */
@media (max-width: 768px) {

    /* Top bar: compact two-row layout */
    #top-bar {
        overflow-x: hidden;
        overflow-y: visible;
    }

    .dash-row {
        display: flex;
        flex-wrap: wrap;
        min-width: 0;
        height: auto;
        padding: 8px 10px;
        gap: 0;
    }

    /* Hide low-priority cells */
    .dash-cell:not(.dash-title):not(.dash-nav):not(.dash-home) {
        display: none;
    }

    .dash-cell.dash-home {
        padding: 4px 8px;
        border-right: none;
    }

    .dash-cell.dash-home svg {
        width: 22px;
        height: 22px;
    }

    /* Title takes full width on first row */
    .dash-cell.dash-title {
        flex: 1 1 100%;
        padding: 4px 0 6px;
        border-right: none;
        min-width: 0;
    }

    .dash-cell.dash-title .callsign {
        font-size: 13px;
    }

    /* Nav takes full width on second row */
    .dash-cell.dash-nav {
        flex: 1 1 100%;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 0;
        border-right: none;
    }

    .dash-cell.dash-nav .nav-link {
        min-height: 40px;
        padding: 6px 4px;
        font-size: 10px;
        letter-spacing: 0.5px;
        text-align: center;
    }

    /* Drawer system — panels become off-canvas */
    #app {
        display: block;
        position: relative;
        height: calc(100vh - 80px);
        overflow: hidden;
    }

    #map-container {
        position: absolute;
        inset: 0;
        min-height: unset;
        order: unset;
    }

    #control-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 300;
        width: min(320px, 88vw);
        min-width: 0;
        max-width: 88vw;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #control-panel.drawer-open {
        transform: translateX(0);
    }

    #briefing-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        z-index: 300;
        width: min(340px, 92vw);
        min-width: 0;
        max-width: 92vw;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid var(--border);
    }

    #briefing-panel.drawer-open {
        transform: translateX(0);
    }

    /* Scrim */
    #drawer-scrim {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 299;
        background: rgba(0, 0, 0, 0.6);
    }

    #drawer-scrim.visible {
        display: block;
    }

    /* FAB buttons */
    #drawer-toggle-left,
    #drawer-toggle-right {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 24px;
        z-index: 200;
        width: 52px;
        height: 52px;
        background: rgba(10, 14, 19, 0.92);
        border: 1px solid var(--amber);
        color: var(--amber);
        font-size: 20px;
        cursor: pointer;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

    #drawer-toggle-left  { left: 16px; }
    #drawer-toggle-right { right: 16px; }

    /* Touch targets */
    .theater-btn, .type-btn, .mode-btn {
        min-height: 44px;
    }

    .param-row select {
        min-height: 44px;
    }

    #generate-btn {
        min-height: 52px;
    }

    .import-btn, .export-btn {
        min-height: 44px;
    }

    #add-flight-btn {
        min-height: 44px;
    }

    .action-btn {
        min-height: 44px;
    }

    /* Briefing panel font sizes */
    .briefing-header h2 {
        font-size: 24px;
    }

    .briefing-section li,
    .briefing-section p {
        font-size: 14px;
    }
}

/* Hide FABs and scrim on desktop */
@media (min-width: 769px) {
    #drawer-toggle-left,
    #drawer-toggle-right,
    #drawer-scrim {
        display: none !important;
    }
}

/* Film grain overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
    opacity: 0.09;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}
