﻿/* ================================================================
   DEEPCOMMANDER — style.css v2.0
   Military C2 Interface | Dark Glassmorphism + Tactical Theme
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Share+Tech+Mono&display=swap');

/* ─── Design Tokens ─── */
:root {
    /* Backgrounds */
    --bg-base: #070b10;
    --bg-primary: #0c1520;
    --bg-panel: rgba(10, 18, 30, 0.82);
    --bg-section: rgba(18, 30, 48, 0.55);
    /* Accents (French military palette) */
    --accent-red: #EF4135;
    --accent-blue: #0055A4;
    --accent-cyan: #00d4ff;
    --accent-white: #E8EDF2;
    /* Text */
    --text-primary: #dce8f0;
    --text-secondary: #6e8fa8;
    --text-muted: #2e4a62;
    /* Borders */
    --border-dim: rgba(239, 65, 53, 0.18);
    --border-active: rgba(239, 65, 53, 0.55);
    /* Glows */
    --glow-red: 0 0 8px rgba(239,65,53,0.45), 0 0 22px rgba(239,65,53,0.15);
    --glow-blue: 0 0 8px rgba(0,85,164,0.5), 0 0 22px rgba(0,85,164,0.18);
    --glow-cyan: 0 0 8px rgba(0,212,255,0.45), 0 0 22px rgba(0,212,255,0.12);
    /* Shadows */
    --shadow-panel: 0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(239,65,53,0.1);
    --shadow-button: 0 2px 8px rgba(0,0,0,0.4);
    /* Geometry */
    --radius-panel: 8px;
    --radius-btn: 4px;
    /* Typography */
    --font-ui: 'Exo 2', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t: 0.18s;
}

/* ─── Reset ─── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-base);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow: hidden;
}

    /* ─── Scanline Overlay ─── */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background: repeating-linear-gradient( 0deg, transparent, transparent 3px, rgba(0,0,0,0.025) 3px, rgba(0,0,0,0.025) 4px );
        pointer-events: none;
        z-index: 9999;
        animation: scanlines 8s linear infinite;
    }

@keyframes scanlines {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100px;
    }
}

/* ─── Tactical Grid Background ─── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(0,85,164,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(0,85,164,0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

/* ─── Scrollbars ─── */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(239,65,53,0.35);
    border-radius: 2px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--accent-red);
    }

/* ─── Menu Wrapper ─── */
#menu-wrapper {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
}

/* ================================================================
   TOPBAR
   ================================================================ */
#topbar {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 56px;
    min-height: 48px;
    max-height: 80px;
    background: var(--bg-panel);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 3px 10px 3px;
    border: 1px solid var(--border-active);
    border-top: 2px solid var(--accent-red);
    border-radius: var(--radius-panel);
    z-index: 2001;
    box-shadow: var(--shadow-panel);
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    pointer-events: auto;
    resize: both;
}

    /* Subtle header label above topbar */
    #topbar::before {
        content: 'DEEPCOMMANDER ◆ C2 SYSTEM ◆ ÉTAT-MAJOR';
        position: absolute;
        top: -16px;
        left: 12px;
        font-family: var(--font-mono);
        font-size: 10px;
        color: var(--accent-red);
        letter-spacing: 0.12em;
        opacity: 0.5;
        white-space: nowrap;
        pointer-events: none;
    }

    /* Resize corner indicator */
    #topbar::after {
        content: '';
        position: absolute;
        bottom: 2px;
        right: 2px;
        width: 8px;
        height: 8px;
        background: var(--accent-red);
        clip-path: polygon(100% 0, 100% 100%, 0 100%);
        opacity: 0.7;
        pointer-events: none;
    }

    /* Drag handle inside topbar — positionné en absolu pour ne pas casser le flex */
    #topbar .drag-handle {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--accent-red) 40%, transparent 100%);
        cursor: move;
        border-radius: var(--radius-panel) var(--radius-panel) 0 0;
        opacity: 0.7;
        pointer-events: auto;
    }

    /* Topbar section pill */
    #topbar .topbar-section {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: rgba(255,255,255,0.025);
        padding: 3px 6px;
        border-radius: var(--radius-btn);
        border: 1px solid var(--border-dim);
        flex-shrink: 0;
        transition: border-color var(--t) var(--ease);
    }

        #topbar .topbar-section:focus-within,
        #topbar .topbar-section:hover {
            border-color: rgba(239,65,53,0.45);
        }

        #topbar .topbar-section summary {
            font-size: 12px;
            font-weight: 600;
            font-family: var(--font-mono);
            color: var(--accent-red);
            cursor: pointer;
            padding: 2px 4px;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            white-space: nowrap;
            list-style: none;
            user-select: none;
        }

            #topbar .topbar-section summary::marker,
            #topbar .topbar-section summary::-webkit-details-marker {
                display: none;
            }

            #topbar .topbar-section summary::after {
                content: ' ▾';
                opacity: 0.55;
                font-size: 10px;
            }

details[open] > summary::after {
    content: ' ▴' !important;
}

/* Inputs & buttons inside topbar */
#topbar .topbar-section select,
#topbar .topbar-section button,
#topbar .topbar-section input[type="text"],
#topbar .topbar-section input[type="file"] {
    background: rgba(0,85,164,0.22);
    color: var(--text-primary);
    border: 1px solid rgba(0,85,164,0.35);
    padding: 5px 10px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-btn);
    cursor: pointer;
    box-shadow: var(--shadow-button);
    transition: all var(--t) var(--ease);
    white-space: nowrap;
}

#topbar .topbar-section select {
    max-width: 155px;
}

    #topbar .topbar-section button:hover,
    #topbar .topbar-section select:hover,
    #topbar .topbar-section input[type="text"]:hover {
        background: rgba(239,65,53,0.22);
        border-color: var(--accent-red);
        box-shadow: var(--glow-red);
        transform: translateY(-1px);
        color: #fff;
    }

/* ================================================================
   SIDEBAR
   ================================================================ */
#sidebar {
    position: fixed;
    top: 80px;
    left: 10px;
    width: 250px;
    min-width: 200px;
    max-width: 320px;
    height: calc(100vh - 90px);
    background: var(--bg-panel);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 8px;
    border: 1px solid var(--border-active);
    border-left: 2px solid var(--accent-red);
    border-radius: var(--radius-panel);
    z-index: 2001;
    box-shadow: var(--shadow-panel);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 7px;
    resize: horizontal;
    pointer-events: auto;
}

    #sidebar .drag-handle {
        height: 2px;
        background: linear-gradient(90deg, var(--accent-red) 20%, transparent 100%);
        cursor: move;
        border-radius: 1px;
        opacity: 0.55;
        margin-bottom: 2px;
    }

    /* ================================================================
       DOMAIN TABS (sidebar) — filters .metier-group[data-domain] below,
       cf. js/28-domain-tabs.js. Colors deliberately avoid pure red/blue/
       green/yellow: those are reserved for MIL-STD-2525 affiliation on the
       map, reusing them here for chrome would risk visual confusion with
       unit symbols.
       ================================================================ */
    #domain-tabs {
        display: flex;
        border-bottom: 1px solid var(--border-dim);
        background: var(--bg-base);
    }

    .domain-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 9px 4px 8px;
        background: transparent;
        border: none;
        border-bottom: 2px solid transparent;
        cursor: pointer;
        color: var(--text-muted);
        font-family: var(--font-ui);
        box-shadow: none;
        transform: none;
    }

        .domain-tab svg {
            width: 17px;
            height: 17px;
        }

        .domain-tab span {
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }

        .domain-tab:hover {
            color: var(--text-primary);
            background: transparent;
            box-shadow: none;
            transform: none;
        }

        .domain-tab.active[data-domain="outils"] { color: #8b95a5; border-bottom-color: #8b95a5; }
        .domain-tab.active[data-domain="terrestre"] { color: #c68a3d; border-bottom-color: #c68a3d; }
        .domain-tab.active[data-domain="marine"] { color: #ffb300; border-bottom-color: #ffb300; }

    /* ================================================================
       MÉTIER GROUPS (sidebar) — collapsible sections, one per domain
       ================================================================ */
    .metier-group {
        border-bottom: 1px solid var(--border-dim);
    }

    .metier-group summary {
        padding: 10px 14px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-secondary);
        cursor: pointer;
        user-select: none;
        list-style: none;
    }

        .metier-group summary::-webkit-details-marker {
            display: none;
        }

        .metier-group summary:hover {
            color: var(--text-primary);
        }

        .metier-group[open] > summary {
            color: var(--accent-red);
        }

    /* Section card */
    #sidebar .sidebar-section {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: var(--bg-section);
        padding: 9px 10px;
        border-radius: 6px;
        border: 1px solid var(--border-dim);
        transition: border-color var(--t) var(--ease);
    }

        #sidebar .sidebar-section:hover {
            border-color: rgba(239,65,53,0.3);
        }

        /* Section header */
        #sidebar .sidebar-section h3 {
            color: var(--accent-red);
            font-size: 11px;
            font-family: var(--font-mono);
            font-weight: 400;
            margin: 0 0 5px;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            border-bottom: 1px solid var(--border-dim);
            padding-bottom: 5px;
        }

        #sidebar .sidebar-section label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        /* Buttons */
        #sidebar .sidebar-section button,
        #sidebar .sidebar-section input[type="text"],
        #sidebar .sidebar-section input[type="file"] {
            background: rgba(0,85,164,0.18);
            color: var(--text-primary);
            border: 1px solid rgba(0,85,164,0.3);
            padding: 8px 11px;
            font-size: 13px;
            font-weight: 600;
            font-family: var(--font-ui);
            border-radius: var(--radius-btn);
            cursor: pointer;
            box-shadow: var(--shadow-button);
            transition: all var(--t) var(--ease);
            width: 100%;
            text-align: left;
        }

            /* Arrow indicator on buttons */
            #sidebar .sidebar-section button:not(#generate-description)::before {
                content: '›';
                margin-right: 6px;
                font-size: 14px;
                opacity: 0.4;
                line-height: 0;
                vertical-align: -1px;
            }

            #sidebar .sidebar-section button:hover {
                background: rgba(239,65,53,0.18);
                border-color: var(--accent-red);
                box-shadow: var(--glow-red);
                transform: translateX(2px);
                color: #fff;
            }

            #sidebar .sidebar-section button:active {
                transform: translateX(2px) scale(0.98);
            }

            /* Generate button (primary CTA) */
            #sidebar .sidebar-section button#generate-description {
                background: rgba(0,85,164,0.32);
                border-color: rgba(0,85,164,0.6);
                color: #fff;
                font-weight: 700;
                text-align: center;
                margin-top: 3px;
                letter-spacing: 0.04em;
            }

                #sidebar .sidebar-section button#generate-description::before {
                    content: '⚡ ';
                    font-size: 12px;
                    opacity: 1;
                }

                #sidebar .sidebar-section button#generate-description:hover {
                    background: rgba(239,65,53,0.25);
                    border-color: var(--accent-red);
                    box-shadow: var(--glow-red);
                }

        /* File input appearance */
        #sidebar .sidebar-section input[type="file"] {
            font-size: 12px;
            padding: 6px 9px;
            cursor: pointer;
        }

/* Textarea for mission description */
#mission-description-text {
    width: 100%;
    min-width: 220px;
    height: 220px;
    min-height: 120px;
    max-height: 400px;
    resize: vertical !important;
    font-size: 13px;
    font-family: var(--font-mono);
    line-height: 1.6;
    padding: 10px;
    box-sizing: border-box;
    background: rgba(5,10,17,0.75);
    color: var(--text-primary);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-btn);
    z-index: 2002;
    transition: border-color var(--t), box-shadow var(--t);
}

    #mission-description-text::placeholder {
        color: var(--text-muted);
    }

    #mission-description-text:focus {
        outline: none;
        border-color: rgba(0,85,164,0.7);
        box-shadow: var(--glow-blue);
    }

    #mission-description-text::-webkit-resizer {
        border: 2px solid var(--accent-red);
        background: var(--accent-red);
    }

/* Other textareas */
#sidebar .sidebar-section textarea:not(#mission-description-text) {
    width: 100%;
    height: 80px;
    min-height: 50px;
    resize: vertical;
    background: rgba(5,10,17,0.75);
    color: var(--text-primary);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-btn);
    padding: 7px;
    font-size: 12px;
    font-family: var(--font-mono);
    transition: border-color var(--t);
}

    #sidebar .sidebar-section textarea:not(#mission-description-text):focus {
        outline: none;
        border-color: rgba(0,85,164,0.6);
        box-shadow: var(--glow-blue);
    }

/* Select in sidebar */
#sidebar .custom-select {
    background: rgba(0,85,164,0.18);
    color: var(--text-primary);
    border: 1px solid rgba(0,85,164,0.3);
    padding: 7px 9px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    transition: all var(--t) var(--ease);
    font-family: var(--font-ui);
}

    #sidebar .custom-select:hover {
        border-color: var(--accent-red);
        box-shadow: var(--glow-red);
    }

/* ================================================================
   MAP CONTAINER
   ================================================================ */
#map-container {
    position: fixed;
    top: 78px;
    left: 272px;
    right: 10px;
    bottom: 28px; /* leave room for status bar */
    z-index: 1;
    border-radius: var(--radius-panel);
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-panel);
    z-index: 1;
    transition: opacity var(--t);
}

    #map.hidden {
        opacity: 0;
        pointer-events: none;
    }

/* ─── 3D Cesium Container ─── */
#cesium-container {
    position: absolute;
    inset: 0;
    display: none;
    border-radius: var(--radius-panel);
    overflow: hidden;
    border: 1px solid rgba(0,212,255,0.4);
    z-index: 2;
}

    #cesium-container.active {
        display: block;
    }

/* ─── 2D/3D Toggle Button ─── */
#toggle-3d {
    position: fixed;
    bottom: 36px;
    right: 20px;
    z-index: 2100;
    background: rgba(7,11,16,0.88);
    backdrop-filter: blur(12px);
    color: var(--accent-cyan);
    border: 1px solid rgba(0,212,255,0.45);
    padding: 7px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    border-radius: var(--radius-btn);
    cursor: pointer;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    box-shadow: 0 0 14px rgba(0,212,255,0.15);
    transition: all var(--t) var(--ease);
    pointer-events: auto;
}

    #toggle-3d:hover {
        background: rgba(0,212,255,0.1);
        box-shadow: var(--glow-cyan);
        transform: translateY(-1px);
    }

    #toggle-3d.mode-3d {
        background: rgba(0,212,255,0.12);
        border-color: var(--accent-cyan);
        box-shadow: var(--glow-cyan);
        color: #fff;
    }

/* ─── Status Bar ─── */
#status-bar {
    position: fixed;
    bottom: 6px;
    left: 272px;
    right: 10px;
    height: 20px;
    background: rgba(7,11,16,0.72);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0,85,164,0.2);
    border-radius: 4px;
    z-index: 2100;
    pointer-events: none;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-red);
    animation: blink 2.5s ease-in-out infinite;
    flex-shrink: 0;
}

    .status-dot.online {
        background: #69f0ae;
    }

    .status-dot.warn {
        background: #ffcc02;
    }

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.25;
    }
}

/* ================================================================
   LEAFLET OVERRIDES
   ================================================================ */
.leaflet-container {
    z-index: 1;
    pointer-events: auto;
    background: var(--bg-primary);
}

    .leaflet-container * {
        pointer-events: auto;
    }

.leaflet-popup-content-wrapper {
    background: var(--bg-panel);
    backdrop-filter: blur(14px);
    color: var(--text-primary);
    border: 1px solid var(--border-active);
    border-radius: 6px;
    z-index: 2002;
    box-shadow: var(--shadow-panel);
    padding: 0;
}

.leaflet-popup-content {
    margin: 12px 14px;
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 1.55;
}

.leaflet-popup-tip {
    background: rgba(10,18,30,0.9);
}

.leaflet-popup-close-button {
    color: var(--accent-red) !important;
    font-size: 16px !important;
    top: 4px !important;
    right: 8px !important;
}

.leaflet-popup-content select,
.leaflet-popup-content input {
    background: rgba(0,85,164,0.25);
    color: var(--text-primary);
    border: 1px solid rgba(0,85,164,0.4);
    padding: 5px 7px;
    font-family: var(--font-ui);
    font-size: 13px;
    border-radius: var(--radius-btn);
    transition: border-color var(--t);
}

    .leaflet-popup-content select:hover {
        border-color: var(--accent-red);
    }

/* Leaflet controls theming */
.leaflet-bar a {
    background: var(--bg-panel) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-dim) !important;
}

    .leaflet-bar a:hover {
        background: rgba(239,65,53,0.2) !important;
        border-color: var(--accent-red) !important;
    }

/* ================================================================
   TACTICAL ELEMENTS
   ================================================================ */
.military-symbol {
    overflow: visible;
}

.measure-point {
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: var(--glow-red);
}

.measure-line {
    stroke: var(--accent-blue);
    stroke-width: 1.5;
    stroke-dasharray: 5,4;
}

.measure-label {
    color: var(--bg-base);
    font-size: 12px;
    font-family: var(--font-mono);
    background: rgba(232,237,242,0.92);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--accent-red);
}

/* Relief grid */
#relief-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.relief-cell {
    position: absolute;
    border: 1px solid rgba(255,255,255,0.05);
    box-sizing: border-box;
    background: transparent;
    transition: transform 0.3s ease;
}

    .relief-cell.low {
        background: rgba(0,85,164,0.07);
    }

    .relief-cell.medium {
        background: rgba(239,65,53,0.16);
    }

    .relief-cell.high {
        background: rgba(255,255,255,0.32);
    }

/* ================================================================
   SPECIFIC PANELS
   ================================================================ */

/* GE Optimization */
#ew-optimization-panel {
    background: rgba(10,22,10,0.82) !important;
    border: 1px solid rgba(105,240,174,0.25) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 5px;
}

/* Heatmap controls */
#heatmap-opacity {
    width: 90px;
    vertical-align: middle;
    accent-color: var(--accent-red);
}

#heatmap-opacity-value {
    margin-left: 4px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

#heatmap-type {
    background: rgba(0,85,164,0.18);
    color: var(--text-primary);
    border: 1px solid rgba(0,85,164,0.3);
    padding: 6px 8px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-btn);
    cursor: pointer;
    width: 200px;
    transition: all var(--t) var(--ease);
}

    #heatmap-type:hover {
        border-color: var(--accent-red);
        box-shadow: var(--glow-red);
    }

/* Artillery caliber controls */
#artillery-caliber-controls {
    background: var(--bg-panel) !important;
    backdrop-filter: blur(14px) !important;
    border: 1px solid var(--border-active) !important;
    border-radius: var(--radius-panel) !important;
    box-shadow: var(--shadow-panel) !important;
}

/* Restricted area form */
#restricted-area-form {
    position: fixed;
    top: 90px;
    right: 10px;
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-active);
    border-top: 2px solid var(--accent-red);
    padding: 12px 14px;
    border-radius: var(--radius-panel);
    z-index: 2000;
    box-shadow: var(--shadow-panel);
    min-width: 200px;
}

    #restricted-area-form h3 {
        color: var(--accent-red);
        font-size: 11px;
        font-family: var(--font-mono);
        font-weight: 400;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        margin: 0 0 10px;
    }

    #restricted-area-form label {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-secondary);
        margin-bottom: 3px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    #restricted-area-form select,
    #restricted-area-form input,
    #restricted-area-form button {
        width: 100%;
        background: rgba(0,85,164,0.18);
        color: var(--text-primary);
        border: 1px solid rgba(0,85,164,0.3);
        padding: 7px 9px;
        margin-bottom: 5px;
        font-size: 13px;
        font-weight: 600;
        font-family: var(--font-ui);
        border-radius: var(--radius-btn);
        cursor: pointer;
        transition: all var(--t) var(--ease);
    }

        #restricted-area-form button:hover,
        #restricted-area-form select:hover {
            border-color: var(--accent-red);
            background: rgba(239,65,53,0.18);
            box-shadow: var(--glow-red);
        }

/* Unit popup */
.unit-popup button {
    margin-top: 8px;
    padding: 5px 10px;
    background: rgba(211,47,47,0.28);
    color: #fff;
    border: 1px solid rgba(211,47,47,0.5);
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--t) var(--ease);
}

    .unit-popup button:hover {
        background: rgba(211,47,47,0.55);
        box-shadow: var(--glow-red);
    }

/* RF params */
.rf-params label {
    display: block;
    margin: 4px 0;
    font-size: 11px;
    color: var(--text-secondary);
}

.rf-params input {
    width: 76px;
    font-size: 11px;
    background: rgba(5,10,17,0.75);
    color: var(--text-primary);
    border: 1px solid var(--border-dim);
    border-radius: 3px;
    padding: 3px 5px;
}

/* Range inputs */
input[type="range"] {
    accent-color: var(--accent-red);
}

/* Text inputs focus */
input[type="text"] {
    outline: none;
}

    input[type="text"]:focus {
        border-color: rgba(0,85,164,0.7) !important;
        box-shadow: var(--glow-blue) !important;
    }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    #topbar {
        height: auto;
        min-height: 46px;
        padding: 4px 8px;
    }

    #sidebar {
        width: 200px;
        min-width: 150px;
        top: 98px;
    }

    #map-container {
        left: 218px;
        top: 98px;
        bottom: 28px;
    }

    #status-bar {
        left: 218px;
    }

    #toggle-3d {
        bottom: 34px;
        right: 14px;
    }
}

@media (max-width: 480px) {
    #sidebar {
        width: 160px;
        min-width: 120px;
    }

    #map-container {
        left: 176px;
    }

    #status-bar {
        left: 176px;
    }

    #topbar {
        left: 5px;
        right: 5px;
        padding: 3px 6px;
    }
}

/* ================================================================
   WIDGET ROTATION 3D CSS — #rotation-widget
   ================================================================ */
#rotation-widget {
    position: fixed;
    bottom: 55px;
    right: 20px;
    z-index: 2200;
    width: 180px;
    background: rgba(7, 11, 16, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-top: 2px solid rgba(0, 212, 255, 0.6);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.12), 0 4px 24px rgba(0,0,0,0.55);
    user-select: none;
    pointer-events: auto;
    cursor: default;
}

/* Header */
.rw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 9px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    padding-bottom: 6px;
}

.rw-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: rgba(0, 212, 255, 0.8);
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

#rw-reset {
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: rgba(0, 212, 255, 0.7);
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    transition: all 0.15s;
}

    #rw-reset:hover {
        background: rgba(0, 212, 255, 0.15);
        border-color: rgba(0, 212, 255, 0.7);
        color: #fff;
    }

/* Slider row */
.rw-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.rw-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    flex-shrink: 0;
    width: 22px;
}

#tilt-slider {
    flex: 1;
    accent-color: rgba(0, 212, 255, 0.8);
    height: 3px;
    cursor: pointer;
}

.rw-val {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: rgba(0, 212, 255, 0.8);
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

/* Directional pad */
.rw-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-bottom: 9px;
}

.rw-mid {
    display: flex;
    gap: 3px;
    align-items: center;
}

.rw-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: rgba(0, 212, 255, 0.7);
    width: 34px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .rw-btn:hover {
        background: rgba(0, 212, 255, 0.15);
        border-color: rgba(0, 212, 255, 0.6);
        color: #fff;
        box-shadow: 0 0 8px rgba(0, 212, 255, 0.25);
    }

    .rw-btn:active {
        background: rgba(0, 212, 255, 0.25);
        transform: scale(0.94);
    }

/* Centre "vue plate" — accentué */
.rw-flat {
    background: rgba(239, 65, 53, 0.1);
    border-color: rgba(239, 65, 53, 0.3);
    color: rgba(239, 65, 53, 0.7);
    width: 34px;
    height: 30px;
}

    .rw-flat:hover {
        background: rgba(239, 65, 53, 0.2);
        border-color: rgba(239, 65, 53, 0.7);
        color: #fff;
        box-shadow: 0 0 8px rgba(239,65,53,0.25);
    }

/* Preset buttons */
.rw-presets {
    display: flex;
    gap: 3px;
    justify-content: space-between;
}

.rw-preset {
    flex: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    padding: 5px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s;
}

    .rw-preset:hover {
        background: rgba(0, 212, 255, 0.1);
        border-color: rgba(0, 212, 255, 0.4);
        color: rgba(0, 212, 255, 0.9);
    }

/* Masquer quand Cesium est actif */
#cesium-container.active ~ #rotation-widget,
body.cesium-active #rotation-widget {
    display: none !important;
}

/* ── Widget toujours visible + bouton toggle ON/OFF ── */
#rotation-widget {
    display: block !important; /* toujours visible */
}

.rw-toggle-btn {
    background: rgba(239, 65, 53, 0.12);
    border: 1px solid rgba(239, 65, 53, 0.4);
    color: rgba(239, 65, 53, 0.8);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

    .rw-toggle-btn:hover {
        background: rgba(239, 65, 53, 0.25);
        border-color: rgba(239, 65, 53, 0.7);
        color: #fff;
    }

    .rw-toggle-btn.rw-toggle-on {
        background: rgba(105, 240, 174, 0.12);
        border-color: rgba(105, 240, 174, 0.5);
        color: #69f0ae;
        box-shadow: 0 0 8px rgba(105, 240, 174, 0.2);
    }

        .rw-toggle-btn.rw-toggle-on:hover {
            background: rgba(105, 240, 174, 0.22);
        }

/* Désactiver les contrôles quand tilt inactif */
#rotation-widget:not(.tilt-on) .rw-row,
#rotation-widget:not(.tilt-on) .rw-pad,
#rotation-widget:not(.tilt-on) .rw-presets {
    opacity: 0.35;
    pointer-events: none;
}
.floating-panel {
    display: none;
    position: fixed;
    z-index: 2002;
    pointer-events: auto;
    padding: 10px;
    min-width: 250px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-panel);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-panel);
}
.tg-preview-thumb {
    height: 90px;
    max-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tg-preview-thumb:has(svg) { background: #fff; border-radius: 4px; padding: 2px 6px; }
.tg-preview-thumb svg { max-height: 100%; max-width: 100%; width: auto; height: auto; display: block; }

#sidebar button.mini-btn {
    display: inline-block;
    width: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-active);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 400;
    padding: 1px 6px;
    border-radius: 3px;
    cursor: pointer;
    box-shadow: none;
    transform: none;
}
#sidebar button.mini-btn::before { content: none; }
#sidebar button.mini-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-red);
    background: var(--bg-primary);
    box-shadow: none;
    transform: none;
}
.row-wrap { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mt-6 { margin-top: 6px; }
.metier-group-desc { display: block; font-size: 10px; color: #6e8fa8; margin: 4px 0 0; line-height: 1.35; }

/* ============================================================================
   FUSION MULTI-DOMAINES · TURENNE (js/31-fusion.js)
   La pyramide de la situation awareness : couleurs du deck Turenne
   (sommet bleu, niveau 3 orange, niveau 2 vert, niveau 1 rose, base violet).
   ========================================================================== */
.tp-svg { display: block; overflow: visible; }
.tp-band polygon {
    fill: var(--tp-color);
    fill-opacity: 0.16;
    stroke: var(--tp-color);
    stroke-opacity: 0.55;
    stroke-width: 1;
    transition: fill-opacity 0.6s ease;
}
.tp-band .tp-text {
    fill: var(--text-primary);
    font: 600 8.5px var(--font-mono);
    letter-spacing: 0.04em;
    opacity: 0.85;
    pointer-events: none;
}
.tp-band.is-lit polygon { animation: tp-light 0.9s ease-out; fill-opacity: 0.5; }
@keyframes tp-light {
    0% { fill-opacity: 0.95; filter: drop-shadow(0 0 5px var(--tp-color)); }
    100% { fill-opacity: 0.5; filter: none; }
}

/* Bouton de barre d'outils : la pyramide, allumée quand Turenne travaille */
.tb-turenne {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 10px 0 8px;
    background: transparent;
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font: 600 10.5px var(--font-mono);
    letter-spacing: 0.14em;
}
.tb-turenne:hover { border-color: rgba(236,64,122,0.7); color: var(--text-primary); }
.tb-turenne-icon { display: flex; }
.tb-turenne.is-idle .tp-band polygon { fill-opacity: 0.08; stroke-opacity: 0.35; }
.tb-turenne.is-ready .tp-band polygon { fill-opacity: 0.4; }
.tb-turenne.is-running { border-color: rgba(236,64,122,0.85); color: var(--text-primary); box-shadow: 0 0 10px rgba(236,64,122,0.35); }
.tb-turenne.is-running .tp-band polygon { fill-opacity: 0.55; }

.turenne-panel {
    position: fixed;
    width: 520px;
    max-width: 94vw;
    z-index: 1850;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    border-left: 3px solid #ec407a;
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-panel);
    color: var(--text-primary);
    font-family: var(--font-ui);
    max-height: calc(100vh - 130px);
}
.turenne-panel.is-hidden { display: none; }
.turenne-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-section);
    border-bottom: 1px solid var(--border-dim);
    cursor: move;
    user-select: none;
}
.turenne-title { flex: 1; font: 700 12px var(--font-mono); letter-spacing: 0.16em; }
.turenne-title small { font: 400 10.5px var(--font-ui); letter-spacing: 0; color: var(--text-secondary); margin-left: 6px; }
.turenne-time { font: 600 11px var(--font-mono); color: #ec407a; }
.turenne-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 13px; }
.turenne-close:hover { color: var(--text-primary); }
.turenne-body { padding: 8px 10px 10px; overflow-y: auto; }
.turenne-pyr { display: flex; gap: 10px; align-items: flex-start; }
.turenne-levels { flex: 1; min-width: 0; }
.tp-m {
    height: 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 8px;
    border-left: 2px solid var(--border-dim);
    font-size: 10.5px;
    line-height: 1.25;
    overflow: hidden;
}
.tp-m b { font-weight: 600; font-size: 11px; }
.tp-m span { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-m em { color: #7d8794; font-style: normal; }
#tp-m-top { border-left-color: #42a5f5; }
#tp-m-l3 { border-left-color: #ffa726; }
#tp-m-l2 { border-left-color: #66bb6a; }
#tp-m-l1 { border-left-color: #ec407a; }
#tp-m-base { border-left-color: #ab47bc; }
.turenne-sec {
    margin: 10px 0 4px;
    font: 600 10px var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.turenne-methods { display: flex; gap: 6px; flex-wrap: wrap; }
.tm-chip { padding: 3px 8px; border-radius: 10px; font-size: 10.5px; border: 1px solid var(--border-dim); background: var(--bg-section); }
.tm-chip small { margin-left: 6px; color: var(--text-secondary); }
.tm-chip.tm-modele { border-color: #ec407a; }
.turenne-spark { border: 1px solid var(--border-dim); border-radius: 4px; background: var(--bg-section); padding: 2px 4px 0; }
.turenne-spark polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.turenne-spark .ts-cop { stroke: #ec407a; }
.turenne-spark .ts-naive { stroke: #7d8794; stroke-dasharray: 3 3; }
.turenne-spark .ts-cursor { stroke: #e7ebef; stroke-width: 1; opacity: 0.6; vector-effect: non-scaling-stroke; }
.ts-legend { display: flex; gap: 12px; font-size: 9.5px; color: var(--text-secondary); padding: 0 2px 3px; }
.ts-cop-key::before, .ts-naive-key::before { content: ''; display: inline-block; width: 12px; height: 2px; margin-right: 4px; vertical-align: middle; background: #ec407a; }
.ts-naive-key::before { background: #7d8794; }
.turenne-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.turenne-table th { text-align: left; font-weight: 600; color: var(--text-secondary); padding: 2px 4px; border-bottom: 1px solid var(--border-dim); }
.turenne-table td { padding: 2px 4px; border-bottom: 1px solid rgba(50,58,68,0.4); white-space: nowrap; }
.turenne-table td i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.turenne-table tr[data-track] { cursor: pointer; }
.turenne-table tr[data-track]:hover { background: rgba(236,64,122,0.1); }
.turenne-table tr.tc-tentative td, .turenne-table tr.tc-coasting td { opacity: 0.55; }
.turenne-events { list-style: none; margin: 0; padding: 0; font-size: 10.5px; }
.turenne-events li { padding: 2px 0; border-bottom: 1px solid rgba(50,58,68,0.4); }
.turenne-events time { font: 500 10px var(--font-mono); color: var(--text-secondary); margin-right: 8px; }
.turenne-events .te-alert { color: #ff8a65; }
.turenne-events .te-warn { color: #ffd54f; }

/* Barre latérale */
.tool-btn--fusion { border-color: rgba(236,64,122,0.6); }
.tool-btn--fusion:hover { background: rgba(236,64,122,0.16); }
.fusion-clock { font: 500 11px var(--font-mono); color: var(--text-secondary); margin-left: auto; }
.fusion-slider { width: 100%; margin: 6px 0; accent-color: #ec407a; }
.fusion-options { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; font-size: 11px; margin-top: 4px; }
.fusion-options label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.fusion-verdict { margin-top: 8px; padding: 7px 8px; border: 1px solid var(--border-dim); border-left: 3px solid #ec407a; border-radius: 4px; background: var(--bg-section); font-size: 11px; }
.fusion-verdict.is-hidden { display: none; }
.fv-title { font-weight: 600; margin-bottom: 5px; }
.fv-row { position: relative; display: grid; grid-template-columns: 118px 1fr 58px; align-items: center; gap: 6px; margin: 2px 0; font-size: 10.5px; }
.fv-row i { display: block; height: 7px; background: #5c6673; border-radius: 2px; }
.fv-row.fv-best i { background: #ec407a; }
.fv-row b { text-align: right; font-family: var(--font-mono); font-weight: 500; }
.fv-note { margin-top: 5px; color: var(--text-secondary); font-size: 10.5px; line-height: 1.35; }

/* Couches de la carte */
.fusion-track-icon, .fusion-sensor-icon { background: transparent !important; border: none !important; }
.leaflet-tooltip.fusion-lbl {
    background: rgba(11,15,20,0.72);
    border: none;
    color: #e7ebef;
    font: 500 9.5px var(--font-mono);
    padding: 1px 4px;
    box-shadow: none;
}
.leaflet-tooltip.fusion-lbl::before { display: none; }
#sidebar .fusion-options label { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11px; color: var(--text-primary); }
.fusion-status { margin: 6px 0 4px; font-size: 11px; color: var(--text-secondary); line-height: 1.35; }

/* ── Synchromatrix ── */
.fusion-options label.fusion-opt-wide { grid-column: 1 / -1; }
.tsm-title { font: 500 10.5px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--text-primary); margin-left: 6px; }
.tsm-grid table { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 10.5px; }
.tsm-grid th { font-weight: 600; color: var(--text-secondary); text-align: center; padding: 1px 2px 3px; line-height: 1.15; }
.tsm-grid th small { display: block; font-weight: 400; color: #7d8794; }
.tsm-grid th.tsm-now, .tsm-grid td.tsm-now { background: rgba(236,64,122,0.10); }
.tsm-grid td.tsm-asset { text-align: left; white-space: nowrap; padding-right: 8px; color: var(--text-primary); }
.tsm-grid td.tsm-asset.tsm-off { color: #ff8a65; }
.tsm-grid td.tsm-asset.tsm-off::after { content: ' ⏻'; }
.tsm-cell { text-align: center; padding: 1px 0; }
.tsm-cell i {
    display: inline-block;
    width: 17px; height: 17px;
    border-radius: 3px;
    border: 2px solid var(--plan, #4fc3f7);
    background: var(--obs, transparent);
    position: relative;
    vertical-align: middle;
    box-sizing: border-box;
}
.tsm-cell i.tsm-future { background: transparent; border-style: dashed; opacity: 0.7; }
.tsm-cell i.tsm-gap { box-shadow: 0 0 0 1.5px #ff5252; }
.tsm-cell i b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 9px var(--font-mono); color: #0b0f14; }
.tsm-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 9.5px; color: var(--text-secondary); margin: 4px 0 2px; }
.tsm-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: middle; background: var(--c); }
.tsm-objectives, .tsm-dps, .tsm-tasks { font-size: 10.5px; margin-top: 5px; }
.tsm-obj { display: grid; grid-template-columns: 30px 1fr 70px; gap: 6px; padding: 2px 0; border-bottom: 1px solid rgba(50,58,68,0.4); align-items: center; }
.tsm-obj em { font-style: normal; text-align: right; font-family: var(--font-mono); }
.tsm-obj.met em { color: #66bb6a; }
.tsm-obj.unmet em { color: #ff8a65; }
.tsm-obj.pending em, .tsm-obj.na em { color: #7d8794; }
.tsm-obj.future { opacity: 0.5; }
.tsm-dps { display: flex; gap: 6px; flex-wrap: wrap; }
.tsm-dp { padding: 3px 8px; border-radius: 10px; border: 1px solid var(--border-dim); background: var(--bg-section); cursor: default; }
.tsm-dp.armed { border-color: #ffb74d; }
.tsm-dp.fired { border-color: #ff5252; background: rgba(255,82,82,0.14); }
.tsm-dp.expired, .tsm-dp.waiting { opacity: 0.55; }
.tsm-tasks div { padding: 1px 0; color: var(--text-secondary); }
.tsm-tasks b { color: var(--text-primary); }
.fusion-area-label { background: transparent !important; border: none !important; box-shadow: none !important; color: #e7ebef; font: 500 9.5px var(--font-mono); text-shadow: 0 0 3px #000; }
.leaflet-tooltip.fusion-area-label::before { display: none; }

/* ================================================================
   OPORD → SITAC (js/32-opord.js) — groupe de la barre latérale et panneau flottant
   ================================================================ */
.tool-btn--opord { border-left: 3px solid #26a69a; }
.opord-options { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; font-size: 12px; color: var(--text-secondary); }
.opord-options label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opord-options input[type="text"], .opord-options select { width: 96px; }
#opord-status { min-height: 18px; margin: 6px 0 0; font-size: 12px; }
#opord-status[data-kind="ok"] { color: #5fd38d; }
#opord-status[data-kind="error"] { color: #ff6b6b; }
#opord-status[data-kind="warn"] { color: #f2c94c; }
#opord-status[data-kind="busy"] { color: var(--text-secondary); }

.opord-panel {
    position: fixed;
    width: 600px;
    max-width: 94vw;
    z-index: 1850;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    border-left: 3px solid #26a69a;
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-panel);
    color: var(--text-primary);
    font-family: var(--font-ui);
    max-height: calc(100vh - 130px);
}
.opord-panel.is-hidden { display: none; }
.opord-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg-section); border-bottom: 1px solid var(--border-dim); cursor: move; user-select: none; }
.opord-title { flex: 1; font: 700 12px var(--font-mono); letter-spacing: 0.14em; }
.opord-title small { font: 400 10.5px var(--font-ui); letter-spacing: 0; color: var(--text-secondary); margin-left: 6px; }
.opord-time { font: 600 11px var(--font-mono); color: #26a69a; }
.opord-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 13px; }
.opord-close:hover { color: var(--text-primary); }
.opord-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 4px; }
.opord-chip { display: flex; flex-direction: column; padding: 3px 9px; border: 1px solid var(--border-dim); border-radius: 6px; background: rgba(255,255,255,0.03); line-height: 1.25; }
.opord-chip small { font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.opord-chip b { font: 600 12px var(--font-mono); }
.opord-tabs { display: flex; gap: 2px; padding: 4px 10px 0; border-bottom: 1px solid var(--border-dim); }
.opord-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-secondary); padding: 6px 10px; font: 600 11.5px var(--font-ui); cursor: pointer; }
.opord-tab:hover { color: var(--text-primary); }
.opord-tab.active { color: var(--text-primary); border-bottom-color: #26a69a; }
.opord-body { padding: 6px 10px 8px; overflow-y: auto; min-height: 120px; flex: 1; }
.opord-h { margin: 12px 0 4px; font: 700 10.5px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); }
.opord-h span { color: #26a69a; margin-left: 4px; }
.opord-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; margin: 1px 0; text-align: left; color: inherit; background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font: inherit; }
.opord-row:hover { background: rgba(255,255,255,0.05); border-color: var(--border-dim); }
.opord-ico { flex: 0 0 34px; display: flex; align-items: center; justify-content: center; min-height: 26px; }
.opord-ico svg { max-height: 28px; max-width: 34px; }
.opord-lineicon { width: 30px; height: 22px; }
.opord-rt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.opord-rt b { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opord-rt em { font-style: normal; font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opord-aff { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 10.5px; font-weight: 600; color: var(--c); border: 1px solid var(--c); white-space: nowrap; }
.opord-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: #7d8794; }
.opord-dot.ok { background: #5fd38d; }
.opord-dot.ko { background: #f2994a; }
.opord-empty, .opord-note { color: var(--text-secondary); font-size: 12px; margin: 8px 0; }
.opord-json { margin: 4px 0 0; padding: 8px; background: rgba(0,0,0,0.25); border: 1px solid var(--border-dim); border-radius: 6px; font: 11px/1.45 var(--font-mono); white-space: pre-wrap; word-break: break-word; max-height: 46vh; overflow: auto; }
.opord-kv { width: 100%; border-collapse: collapse; font-size: 12px; }
.opord-kv th { width: 34%; text-align: left; vertical-align: top; padding: 3px 8px 3px 0; color: var(--text-secondary); font-weight: 600; }
.opord-kv td { padding: 3px 0; word-break: break-word; }
.opord-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.opord-table th { text-align: left; padding: 3px 6px; color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border-dim); }
.opord-table td { padding: 3px 6px; border-bottom: 1px solid rgba(50,58,68,0.4); vertical-align: top; }
.opord-table td.nowrap { white-space: nowrap; font-family: var(--font-mono); }
.opord-table td.ctx { color: var(--text-secondary); font-size: 11px; }
.opord-list { margin: 0; padding-left: 18px; font-size: 12px; color: var(--text-secondary); }
.opord-quote { margin: 4px 0; padding: 6px 8px; border-left: 3px solid var(--border-active); background: rgba(255,255,255,0.03); font-size: 12px; color: var(--text-secondary); border-radius: 0 6px 6px 0; }
.opord-detail { position: relative; padding: 8px 32px 8px 12px; border-top: 1px solid var(--border-dim); background: var(--bg-section); font-size: 12px; max-height: 32vh; overflow-y: auto; }
.opord-detail.is-hidden { display: none; }
.opord-detail-x { position: absolute; right: 8px; top: 6px; background: none; border: none; color: var(--text-secondary); cursor: pointer; }
.opord-detail-t { font-size: 13px; margin-bottom: 2px; }
.opord-detail-m { color: var(--text-secondary); margin: 2px 0; font-size: 11.5px; }
.opord-detail code, .opord-table code, .opord-body code { font: 11px var(--font-mono); color: var(--text-primary); }
.opord-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border-dim); }
.opord-popup { min-width: 300px; max-width: 420px; font-size: 12px; color: var(--text-primary); }
.opord-popup .opord-detail-t { margin-bottom: 4px; }

/* Bouton TREF de la barre d'outils (js/32-opord.js) : ouvre le lanceur OPORD → SITAC */
.tb-tref {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 11px 0 9px;
    background: transparent;
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font: 600 10.5px var(--font-mono);
    letter-spacing: 0.14em;
}
.tb-tref svg { color: #26a69a; }
.tb-tref:hover { border-color: rgba(38,166,154,0.8); color: var(--text-primary); }
.tb-tref.on { border-color: rgba(38,166,154,0.85); color: var(--text-primary); background: rgba(38,166,154,0.10); }
.tb-tref.is-running { border-color: rgba(38,166,154,0.95); color: var(--text-primary); box-shadow: 0 0 10px rgba(38,166,154,0.4); animation: tref-pulse 1.4s ease-in-out infinite; }
@keyframes tref-pulse { 0%, 100% { box-shadow: 0 0 4px rgba(38,166,154,0.25); } 50% { box-shadow: 0 0 12px rgba(38,166,154,0.6); } }

/* Lanceur dans le panneau OPORD */
.opord-new { background: none; border: 1px solid var(--border-dim); border-radius: 4px; color: var(--text-secondary); cursor: pointer; font: 600 10.5px var(--font-ui); padding: 2px 8px; }
.opord-new:hover { color: var(--text-primary); border-color: var(--border-active); }
.opord-new.is-hidden, .opord-launch.is-hidden, .opord-results.is-hidden { display: none; }
.opord-launch { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.opord-results { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.opord-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 22px 12px; text-align: center; cursor: pointer;
    border: 2px dashed var(--border-active); border-radius: 10px;
    background: rgba(38,166,154,0.05); color: var(--text-secondary);
    transition: background 0.15s, border-color 0.15s;
}
.opord-drop svg { color: #26a69a; }
.opord-drop:hover, .opord-drop:focus-visible, .opord-drop.over { background: rgba(38,166,154,0.13); border-color: #26a69a; outline: none; }
.opord-drop-t { font: 700 14px var(--font-ui); color: var(--text-primary); }
.opord-drop-s { font-size: 11.5px; }
.opord-drop-f { font: 600 12px var(--font-mono); color: #26a69a; margin-top: 4px; word-break: break-all; }
.opord-drop.has-file { border-style: solid; }
.opord-launch-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }
.opord-launch-row label { display: flex; align-items: center; gap: 8px; }
.opord-launch-row input[type="text"], .opord-launch-row select { width: 96px; }
.opord-run {
    padding: 10px 14px; cursor: pointer; border-radius: 6px; font: 700 13px var(--font-ui); letter-spacing: 0.04em;
    color: #fff; background: #1e8e83; border: 1px solid #26a69a;
}
.opord-run:hover:not(:disabled) { background: #26a69a; }
.opord-run:disabled { opacity: 0.45; cursor: not-allowed; }
.opord-status2 { min-height: 18px; margin: 0; font-size: 12px; color: var(--text-secondary); }
.opord-status2[data-kind="ok"] { color: #5fd38d; }
.opord-status2[data-kind="error"] { color: #ff6b6b; }
.opord-status2[data-kind="warn"] { color: #f2c94c; }
.opord-launch-hint { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); }

/* ════════ Gouraud (js/33-gouraud.js) : planification de manœuvre déterministe ════════ */
.tb-gouraud {
    display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 9px;
    background: transparent; border: 1px solid var(--border-dim); border-radius: 4px;
    color: var(--text-secondary); cursor: pointer; font: 600 10.5px var(--font-mono); letter-spacing: 0.14em;
}
.tb-gouraud svg { color: #d4a72c; }
.tb-gouraud:hover { border-color: rgba(212,167,44,0.8); color: var(--text-primary); }
.tb-gouraud.on { border-color: rgba(212,167,44,0.85); color: var(--text-primary); background: rgba(212,167,44,0.10); }
.tb-gouraud.is-running { border-color: rgba(212,167,44,0.95); color: var(--text-primary); box-shadow: 0 0 10px rgba(212,167,44,0.4); animation: gouraud-pulse 1.4s ease-in-out infinite; }
@keyframes gouraud-pulse { 0%, 100% { box-shadow: 0 0 4px rgba(212,167,44,0.25); } 50% { box-shadow: 0 0 12px rgba(212,167,44,0.6); } }

.gouraud-panel {
    position: fixed; width: 640px; max-width: 94vw; z-index: 1850; display: flex; flex-direction: column;
    background: var(--bg-panel); border: 1px solid var(--border-dim); border-left: 3px solid #d4a72c;
    border-radius: var(--radius-panel); box-shadow: var(--shadow-panel); color: var(--text-primary);
    font-family: var(--font-ui); max-height: calc(100vh - 130px);
}
.gouraud-panel.is-hidden { display: none; }
#kinematics-doctrine-panel.is-hidden,
#kinematics-time-container.is-hidden { display: none; }
#kinematics-doctrine-panel.alert-banner-error {
    background: rgba(239,154,154,0.12); border-color: #ef9a9a; color: #ef9a9a;
}
.gouraud-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg-section); border-bottom: 1px solid var(--border-dim); cursor: move; user-select: none; }
.gouraud-title { flex: 1; font: 700 12px var(--font-mono); letter-spacing: 0.14em; }
.gouraud-title small { font: 400 10.5px var(--font-ui); letter-spacing: 0; color: var(--text-secondary); margin-left: 6px; }
.gouraud-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 13px; }
.gouraud-close:hover { color: var(--text-primary); }
.gouraud-new { background: none; border: 1px solid var(--border-dim); border-radius: 4px; color: var(--text-secondary); cursor: pointer; font: 600 10.5px var(--font-ui); padding: 2px 8px; }
.gouraud-new:hover { color: var(--text-primary); border-color: var(--border-active); }
.gouraud-new.is-hidden, .gouraud-launch.is-hidden, .gouraud-results.is-hidden { display: none; }

.gouraud-launch { display: flex; flex-direction: column; gap: 10px; padding: 12px; overflow-y: auto; }
.gouraud-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; font-size: 12px; color: var(--text-secondary); }
.gouraud-grid label { display: flex; flex-direction: column; gap: 4px; }
.gouraud-grid select, .gouraud-grid input[type="number"] { width: 100%; }
.gouraud-sub { display: flex; flex-direction: column; gap: 6px; }
.gouraud-h { font: 700 10.5px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); }
.gouraud-chips-input { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; }
.gouraud-chips-input label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.gouraud-run {
    padding: 10px 14px; cursor: pointer; border-radius: 6px; font: 700 13px var(--font-ui); letter-spacing: 0.04em;
    color: #1a1500; background: #d4a72c; border: 1px solid #e6bc47;
}
.gouraud-run:hover:not(:disabled) { background: #e6bc47; }
.gouraud-run:disabled { opacity: 0.45; cursor: not-allowed; }
.gouraud-status { min-height: 18px; margin: 0; font-size: 12px; color: var(--text-secondary); }
.gouraud-status[data-kind="ok"] { color: #5fd38d; }
.gouraud-status[data-kind="error"] { color: #ff6b6b; }
.gouraud-status[data-kind="warn"] { color: #f2c94c; }
.gouraud-launch-hint { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); }

.gouraud-results { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow-y: auto; padding: 10px; }
.gouraud-cards { display: flex; flex-direction: column; gap: 10px; }
.gouraud-card { border: 1px solid var(--border-dim); border-radius: 8px; background: rgba(255,255,255,0.02); overflow: hidden; }
.gouraud-card.rank-0 { border-color: rgba(212,167,44,0.55); }
.gouraud-card-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.gouraud-rank { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 12px var(--font-mono); background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.gouraud-card.rank-0 .gouraud-rank { background: #d4a72c; color: #1a1500; }
.gouraud-card-name { flex: 1; min-width: 0; }
.gouraud-card-name b { font-size: 13.5px; display: block; }
.gouraud-card-name em { font-style: normal; font-size: 11.5px; color: var(--text-secondary); }
.gouraud-score { font: 700 14px var(--font-mono); color: #d4a72c; }
.gouraud-verified { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.gouraud-verified.ok { color: #5fd38d; border: 1px solid #5fd38d; }
.gouraud-verified.ko { color: #f2994a; border: 1px solid #f2994a; }
.gouraud-card-body { padding: 0 12px 12px; border-top: 1px solid var(--border-dim); display: none; }
.gouraud-card.open .gouraud-card-body { display: block; }
.gouraud-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin: 10px 0; }
.gouraud-bar-row { font-size: 11px; color: var(--text-secondary); }
.gouraud-bar-row b { color: var(--text-primary); float: right; font-family: var(--font-mono); }
.gouraud-bar-track { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.08); margin-top: 3px; overflow: hidden; }
.gouraud-bar-fill { height: 100%; background: #d4a72c; }
.gouraud-fail { margin: 8px 0; padding: 6px 8px; border-left: 3px solid #f2994a; background: rgba(242,153,74,0.08); font-size: 11.5px; color: var(--text-secondary); border-radius: 0 6px 6px 0; }
.gouraud-fail div { margin: 2px 0; }
.gouraud-intent { margin: 8px 0; font-size: 12.5px; font-style: italic; color: var(--text-secondary); }
.gouraud-roe-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.gouraud-roe-chip { font: 600 10px var(--font-mono); padding: 2px 7px; border-radius: 10px; border: 1px solid var(--border-dim); color: var(--text-secondary); }
.gouraud-casualties { font-size: 11.5px; color: var(--text-secondary); margin: 6px 0; }
.gouraud-dag-toggle { background: none; border: 1px solid var(--border-dim); border-radius: 4px; color: var(--text-secondary); cursor: pointer; font: 600 10.5px var(--font-ui); padding: 3px 9px; margin-top: 4px; }
.gouraud-dag-toggle:hover { color: var(--text-primary); border-color: var(--border-active); }
.gouraud-dag { display: none; margin-top: 8px; }
.gouraud-dag.open { display: block; }
.gouraud-dag-meta { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
.gouraud-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.gouraud-table th { text-align: left; padding: 3px 6px; color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border-dim); }
.gouraud-table td { padding: 3px 6px; border-bottom: 1px solid rgba(50,58,68,0.4); vertical-align: top; }
.gouraud-table td.nowrap { white-space: nowrap; font-family: var(--font-mono); }

