/* ── Reset & Base ──────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: 'Segoe UI', Tahoma, sans-serif; background: #1a1a2e; color: #e0e0e0; }

/* ── Elegant Custom Scrollbars ─────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.18);
    border-radius: 3px;
    transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 195, 247, 0.35);
}
::-webkit-scrollbar-corner {
    background: transparent;
}
/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(79, 195, 247, 0.18) transparent;
}

/* ── Top Bar ──────────────────────────────────── */
#topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px;
    background: linear-gradient(135deg, #0d1628 0%, #162240 50%, #0f1d38 100%);
    border-bottom: 1px solid rgba(79, 195, 247, 0.15);
    font-size: 13px;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
/* Tactical pattern overlay (banner) */
#topbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/static/banner.svg') no-repeat left center;
    background-size: auto 40px;
    pointer-events: none;
    z-index: 0;
}
/* Subtle accent line along the bottom edge */
#topbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(79, 195, 247, 0.35) 30%, rgba(79, 195, 247, 0.35) 70%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}
/* Keep all topbar children above the pattern overlay */
#topbar > * { position: relative; z-index: 1; }
#app-title {
    font-weight: 700;
    color: #4fc3f7;
    white-space: nowrap;
    font-size: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.2);
}

/* ── WarOnline Brand Title ─────────────────────── */
#topbar-brand {
    position: absolute;
    left: 41%;
    top: 50%;
    transform: translate(calc(-50% - 40px), -50%);
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffd700 0%, #f5c518 25%, #d4a017 50%, #c49b0c 75%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6))
            drop-shadow(0 0 8px rgba(255, 215, 0, 0.25));
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 1;
}

/* ── Coordinate Info Bar (bottom-left, on map as Leaflet control) ── */
.coord-info-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 24, 48, 0.92);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 5px;
    padding: 4px 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    min-width: 180px;
}
.coord-info-control .coord-sep {
    color: rgba(79, 195, 247, 0.2);
    font-size: 10px;
    user-select: none;
}
#snail-display { color: #81c784; font-family: 'Consolas', 'Courier New', monospace; font-size: 11px; white-space: nowrap; }
#coord-display { color: #9e9e9e; font-family: 'Consolas', 'Courier New', monospace; font-size: 11px; white-space: nowrap; }
#zoom-display { color: #64b5f6; font-family: 'Consolas', 'Courier New', monospace; font-size: 11px; white-space: nowrap; }
#terrain-display { color: #a5d6a7; font-family: 'Consolas', 'Courier New', monospace; font-size: 11px; white-space: nowrap; }
#elevation-display { color: #ce93d8; font-family: 'Consolas', 'Courier New', monospace; font-size: 11px; white-space: nowrap; }
#user-info { color: #aaa; white-space: nowrap; }
#user-info:hover { color: #4fc3f7; }

/* ── Topbar text button (Rules, etc.) ────────── */
.topbar-text-btn {
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    background: rgba(15, 52, 96, 0.4);
    border: 1px solid rgba(79, 195, 247, 0.2);
    color: #90caf9;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.topbar-text-btn:hover {
    background: rgba(26, 82, 118, 0.6);
    border-color: rgba(79, 195, 247, 0.5);
    color: #e0f0ff;
}

/* ── Execute Orders Button (topbar) ────────── */
.topbar-orders-complete-btn {
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    background: rgba(46, 125, 50, 0.35);
    border: 1px solid rgba(102, 187, 106, 0.5);
    color: #a5d6a7;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
}
.topbar-orders-complete-btn:hover {
    background: rgba(46, 125, 50, 0.6);
    border-color: rgba(129, 199, 132, 0.8);
    color: #c8e6c9;
    box-shadow: 0 0 8px rgba(102, 187, 106, 0.3);
}
.topbar-orders-complete-btn:active {
    background: rgba(46, 125, 50, 0.8);
    transform: scale(0.97);
}

/* ── Rules Modal ─────────────────────────────── */
.rules-modal-dialog {
    max-width: 620px !important;
    min-width: 400px;
}
.rules-modal-body {
    max-height: 72vh;
    overflow-y: auto;
    padding: 20px 24px !important;
}
.rules-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(15, 52, 96, 0.25);
}
.rules-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.rules-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4fc3f7;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(79, 195, 247, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}
.rules-section-title::before {
    content: '▸';
    color: #90caf9;
    font-size: 11px;
}
.rules-section p {
    font-size: 12.5px;
    line-height: 1.7;
    color: #c0c0c0;
    margin-bottom: 8px;
    text-align: justify;
}
.rules-section ol,
.rules-section ul {
    font-size: 12.5px;
    line-height: 1.7;
    color: #c0c0c0;
    padding-left: 22px;
    margin: 6px 0;
}
.rules-section li {
    margin-bottom: 5px;
    padding-left: 4px;
}
.rules-section li::marker {
    color: #4fc3f7;
}
.rules-section b {
    color: #e8e8e8;
    font-weight: 600;
}
.rules-section code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    background: rgba(15, 52, 96, 0.5);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 3px;
    padding: 2px 6px;
    color: #81c784;
    white-space: nowrap;
}
.rules-section i {
    color: #90caf9;
    font-style: italic;
}
.rules-snail-diagram {
    display: flex;
    justify-content: center;
    margin: 12px 0;
}
.snail-grid {
    display: grid;
    grid-template-columns: repeat(3, 36px);
    grid-template-rows: repeat(3, 32px);
    gap: 2px;
    background: rgba(15, 52, 96, 0.4);
    border: 2px solid rgba(79, 195, 247, 0.35);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.snail-grid span {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 22, 40, 0.95);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #90caf9;
    transition: all 0.15s ease;
}
.snail-grid span:hover {
    background: rgba(79, 195, 247, 0.15);
    color: #fff;
}
.snail-grid .snail-center {
    color: #ff9800;
    background: rgba(255, 152, 0, 0.12);
}
.snail-grid .snail-center:hover {
    background: rgba(255, 152, 0, 0.25);
}
.rules-keys-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 8px;
    background: rgba(15, 52, 96, 0.1);
    border-radius: 6px;
    overflow: hidden;
}
.rules-keys-table tr:nth-child(even) {
    background: rgba(15, 52, 96, 0.15);
}
.rules-keys-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(15, 52, 96, 0.2);
    color: #c0c0c0;
}
.rules-keys-table tr:last-child td {
    border-bottom: none;
}
.rules-keys-table td:first-child {
    width: 130px;
    white-space: nowrap;
}
.rules-keys-table kbd {
    display: inline-block;
    padding: 2px 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    background: linear-gradient(180deg, rgba(30, 60, 100, 0.6) 0%, rgba(20, 40, 70, 0.8) 100%);
    border: 1px solid rgba(79, 195, 247, 0.35);
    border-radius: 4px;
    color: #e0e0e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ── Session info (clickable for scenario description) ── */
.session-info-btn {
    color: #4fc3f7;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.15s;
}
.session-info-btn:hover {
    background: rgba(79, 195, 247, 0.15);
    color: #81d4fa;
    text-decoration: underline;
}
.session-info-btn:empty {
    display: none;
}

/* ── Map control buttons in topbar ──────────── */
#map-ctrl-topbar {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid #0f3460;
    border-radius: 5px;
    margin: 0 2px;
}

/* ── User Dropdown Menu ──────────────────────── */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 200px;
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.7);
    z-index: 9999;
    padding: 0;
    font-size: 12px;
    overflow: hidden;
}
.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(15, 27, 56, 0.8);
    border-bottom: 1px solid rgba(15, 52, 96, 0.5);
}
.user-dropdown-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d3460, #1a5276);
    border: 2px solid #4fc3f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.user-dropdown-identity {
    flex: 1;
    min-width: 0;
}
.user-dropdown-name {
    font-size: 13px;
    font-weight: 700;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-dropdown-session {
    font-size: 10px;
    color: #81c784;
    margin-top: 2px;
}
.user-dropdown-item {
    padding: 8px 14px;
    color: #e0e0e0;
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
    font-size: 12px;
}
.user-dropdown-item:hover { background: #1a5276; color: #fff; }
.user-dropdown-danger:hover { background: #5a2020; color: #ef9a9a; }
.user-dropdown-sep {
    height: 1px;
    background: rgba(15, 52, 96, 0.5);
    margin: 0;
}

/* ── Settings Modal ───────────────────────────── */
.settings-modal-dialog {
    max-width: 400px !important;
    min-width: 340px;
}
.settings-modal-body {
    padding: 16px 20px !important;
}
.settings-section {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 52, 96, 0.25);
}
.settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.settings-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4fc3f7;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.settings-section-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 12px;
    background: linear-gradient(180deg, #4fc3f7, #0d47a1);
    border-radius: 2px;
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 2px 0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    background: rgba(15, 52, 96, 0.08);
}
.settings-row:hover {
    background: rgba(15, 52, 96, 0.2);
}
.settings-label {
    font-size: 12px;
    color: #ccc;
    flex: 1;
    padding-right: 12px;
}
.settings-row:hover .settings-label {
    color: #fff;
}
.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 2px 0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    background: rgba(15, 52, 96, 0.08);
    gap: 12px;
}
.settings-toggle:hover {
    background: rgba(15, 52, 96, 0.2);
}
.settings-toggle > span:first-child {
    font-size: 12px;
    color: #ccc;
    flex: 1;
}
.settings-toggle:hover > span:first-child {
    color: #fff;
}
.settings-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 38px;
    height: 20px;
    background: rgba(30, 50, 80, 0.6);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.settings-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    top: 2px;
    left: 3px;
    background: #666;
    transition: all 0.2s ease;
}
.settings-toggle input[type="checkbox"]:checked {
    background: rgba(46, 125, 50, 0.5);
    border-color: #4caf50;
}
.settings-toggle input[type="checkbox"]:checked::before {
    left: 19px;
    background: #81c784;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.5);
}
.settings-toggle input[type="checkbox"]:hover {
    border-color: #4fc3f7;
}
.settings-toggle-slider {
    display: none; /* Using custom checkbox styling instead */
}
/* ── Language selector row in settings ──────── */
.settings-lang-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: 4px;
    background: rgba(15, 52, 96, 0.08);
    gap: 12px;
}
.settings-lang-row > span {
    font-size: 12px;
    color: #ccc;
    flex: 1;
}
.settings-lang-row:hover {
    background: rgba(15, 52, 96, 0.2);
}
.settings-lang-row:hover > span {
    color: #fff;
}
.settings-lang-select {
    padding: 6px 10px;
    font-size: 12px;
    background: rgba(20, 35, 60, 0.8);
    color: #e0e0e0;
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 4px;
    cursor: pointer;
    min-width: 110px;
    transition: all 0.15s ease;
}
.settings-lang-select:hover {
    border-color: #4fc3f7;
    background: rgba(25, 45, 75, 0.9);
}
.settings-lang-select:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.3);
}
.settings-lang-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}
/* ── Settings modal buttons ──────────────────── */
.settings-btn-save {
    flex: 1;
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%) !important;
    color: #a5d6a7 !important;
    border: 1px solid rgba(76, 175, 80, 0.4) !important;
}
.settings-btn-save:hover {
    background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%) !important;
    border-color: #4caf50 !important;
    color: #fff !important;
}
.settings-btn-close {
    flex: 1;
}

/* ── Topbar standalone icon buttons ──────────── */
.topbar-icon-btn {
    width: 30px;
    height: 28px;
    padding: 0;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background: transparent;
    border: 1px solid transparent;
    color: #bbb;
    cursor: pointer;
    transition: all 0.12s;
}
.topbar-icon-btn:hover { background: #1a5276; border-color: #4fc3f7; color: #fff; }

/* ── Map control buttons (top-right overlay) ──── */
.map-ctrl-group {
    display: flex;
    gap: 2px;
    background: rgba(16, 24, 48, 0.85);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 4px;
    padding: 2px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.map-ctrl-group .topbar-icon-btn {
    width: 28px;
    height: 26px;
    font-size: 14px;
    color: #bbb;
}
.map-ctrl-group .topbar-icon-btn:hover {
    background: rgba(26, 82, 118, 0.8);
    border-color: #4fc3f7;
    color: #fff;
}
.map-ctrl-group .topbar-icon-btn.toggled-off {
    opacity: 0.35;
}
.map-ctrl-group .topbar-icon-btn.toggled-off:hover {
    opacity: 0.6;
}

/* ── Game Clock Control (bottom-right, on map, covers attribution) ── */
.game-clock-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: rgba(16, 24, 48, 0.95);
    border: 1px solid rgba(79, 195, 247, 0.4);
    border-radius: 5px;
    padding: 5px 14px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    margin-bottom: -16px !important;
    min-width: 240px;
    position: relative;
    z-index: 9999;
    transition: padding 0.25s;
}
.game-clock-control:hover {
    padding-bottom: 8px;
}
.game-clock-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: 100%;
}
/* Push the Leaflet attribution behind the game clock */
.leaflet-bottom.leaflet-right .leaflet-control-attribution {
    position: relative;
    z-index: 0;
    margin-bottom: 0;
    margin-right: 10px;
    font-size: 9px;
    opacity: 0.4;
    padding: 0 4px;
    line-height: 1.3;
}
.game-clock-icon {
    font-size: 16px;
}
.game-clock-time {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #4fc3f7;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.game-clock-tick {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #ff9800;
    background: rgba(255, 152, 0, 0.12);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 3px;
    padding: 1px 6px;
    white-space: nowrap;
}

/* ── Replay Panel (inside game clock, expands on hover) ── */
.replay-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s, opacity 0.25s;
    opacity: 0;
    width: 100%;
    padding: 0;
}
.game-clock-control:hover .replay-panel,
.replay-panel.replay-active {
    max-height: 360px;
    opacity: 1;
    padding: 6px 0 0 0;
}
.replay-panel.replay-active {
    max-height: 400px;
}
.replay-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}
.replay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 4px;
    color: #4fc3f7;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.replay-btn:hover { background: rgba(79, 195, 247, 0.18); }
.replay-btn:disabled { opacity: 0.5; cursor: default; }
.replay-playback {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.replay-transport {
    display: flex;
    justify-content: center;
    gap: 2px;
}
.replay-ctrl-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: #ccc;
    font-size: 10px;
    padding: 2px 6px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    line-height: 1.3;
}
.replay-ctrl-btn:hover { background: rgba(79, 195, 247, 0.15); color: #fff; }
.replay-play-btn { color: #4fc3f7; font-size: 12px; padding: 2px 10px; }
.replay-progress {
    display: flex;
    align-items: center;
    gap: 6px;
}
.replay-slider {
    flex: 1;
    height: 4px;
    accent-color: #4fc3f7;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(79, 195, 247, 0.15);
    border-radius: 2px;
    outline: none;
}
.replay-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #4fc3f7;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}
.replay-tick-display {
    font-family: 'Consolas', monospace;
    font-size: 9px;
    color: #888;
    white-space: nowrap;
    min-width: 44px;
    text-align: right;
}
.replay-speed-row {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}
.replay-speed-label {
    font-size: 9px;
    color: #667;
}
.replay-speed-select {
    background: rgba(16, 24, 48, 0.9);
    color: #ccc;
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 3px;
    font-size: 9px;
    padding: 1px 4px;
    cursor: pointer;
}
.replay-aar-btn { color: #ffb74d; }
.replay-exit-btn { color: #ef5350; }
.replay-events {
    max-height: 120px;
    overflow-y: auto;
    margin-top: 4px;
    border-top: 1px solid rgba(79, 195, 247, 0.1);
    padding-top: 3px;
}
.replay-event {
    font-size: 9px;
    color: #aab;
    padding: 1px 4px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.replay-event.replay-order { color: #ffb74d; }
.replay-event.replay-empty { color: #556; font-style: italic; text-align: center; }
.replay-event.replay-report { color: #81c784; }
.replay-event.replay-evt-combat { color: #ef5350; }
.replay-event.replay-evt-unit_destroyed { color: #ff5252; font-weight: 600; }
.replay-event.replay-evt-contact_new { color: #4fc3f7; }

/* ── AAR Modal ── */
.replay-aar-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(4px);
}
.replay-aar-content {
    background: linear-gradient(135deg, #0d1628, #162240);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}
.replay-aar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.15);
    font-size: 14px;
    font-weight: 700;
    color: #4fc3f7;
}
.replay-aar-close {
    background: none;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
}
.replay-aar-close:hover { color: #ef5350; }
.replay-aar-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    font-size: 12px;
    line-height: 1.6;
    color: #ccc;
}
.replay-aar-body h2 { color: #4fc3f7; font-size: 16px; margin: 12px 0 6px; }
.replay-aar-body h3 { color: #81c784; font-size: 14px; margin: 10px 0 4px; }
.replay-aar-body h4 { color: #ffb74d; font-size: 12px; margin: 8px 0 4px; }
.replay-aar-body li { margin-left: 16px; margin-bottom: 2px; }
.replay-aar-body strong { color: #fff; }
.replay-aar-body .aar-h2 { color: #4fc3f7; font-size: 16px; font-weight: 700; margin: 16px 0 8px; border-bottom: 1px solid rgba(79,195,247,0.2); padding-bottom: 4px; }
.replay-aar-body .aar-h3 { color: #81c784; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
.replay-aar-body .aar-h4 { color: #ffb74d; font-size: 12px; font-weight: 600; margin: 8px 0 4px; }
.replay-aar-body .aar-numbered { margin: 4px 0; padding-left: 4px; }
.replay-aar-text p { margin: 4px 0; }
.replay-aar-loading, .replay-aar-error {
    text-align: center;
    padding: 48px 32px;
    color: #8ab4d6;
    font-size: 14px;
}
.replay-aar-loading::before {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 3px solid rgba(79, 195, 247, 0.15);
    border-top-color: #4fc3f7;
    border-radius: 50%;
    animation: aar-spin 1s linear infinite;
}
@keyframes aar-spin {
    to { transform: rotate(360deg); }
}
.replay-aar-error {
    color: #ef5350;
}
.replay-aar-error::before {
    content: '⚠';
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
}

/* ── AAR Floating Window ── */
.aar-floating-window {
    position: fixed;
    top: 5vh;
    right: 3vw;
    width: clamp(520px, 45vw, 780px);
    height: clamp(400px, 75vh, 85vh);
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #0a1020 0%, #0d1830 40%, #111d38 100%);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), 0 0 40px rgba(79, 195, 247, 0.08), inset 0 1px 0 rgba(79, 195, 247, 0.1);
    z-index: 10002;
    overflow: hidden;
    resize: both;
}
.aar-win-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(180deg, rgba(79, 195, 247, 0.12), rgba(79, 195, 247, 0.04));
    border-bottom: 1px solid rgba(79, 195, 247, 0.2);
    user-select: none;
    flex-shrink: 0;
}
.aar-win-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #4fc3f7;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: 'Consolas', 'Courier New', monospace;
}
.aar-win-icon { font-size: 16px; }
.aar-win-classification {
    font-size: 8px;
    font-weight: 600;
    color: #ffb74d;
    background: rgba(255, 183, 77, 0.1);
    border: 1px solid rgba(255, 183, 77, 0.3);
    padding: 1px 6px;
    border-radius: 2px;
    letter-spacing: 1px;
    margin-left: 8px;
}
.aar-win-controls {
    display: flex;
    gap: 4px;
}
.aar-win-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 12px;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.aar-win-btn:hover { background: rgba(79, 195, 247, 0.15); color: #fff; border-color: rgba(79, 195, 247, 0.3); }
.aar-win-close:hover { background: rgba(239, 83, 80, 0.2); color: #ef5350; border-color: rgba(239, 83, 80, 0.3); }
.aar-win-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #c8d0e0;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
.aar-win-body h2, .aar-win-body .aar-h2 {
    color: #4fc3f7;
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Consolas', monospace;
}
.aar-win-body h3, .aar-win-body .aar-h3 {
    color: #81c784;
    font-size: 14px;
    font-weight: 600;
    margin: 14px 0 6px;
}
.aar-win-body h4, .aar-win-body .aar-h4 {
    color: #ffb74d;
    font-size: 12.5px;
    font-weight: 600;
    margin: 10px 0 4px;
}
.aar-win-body li { margin-left: 20px; margin-bottom: 3px; }
.aar-win-body ul { margin: 4px 0 8px 8px; padding: 0; list-style: disc; }
.aar-win-body strong { color: #fff; }
.aar-win-body .aar-numbered {
    margin: 6px 0;
    padding: 8px 12px 8px 36px;
    background: rgba(79, 195, 247, 0.05);
    border-left: 2px solid rgba(79, 195, 247, 0.3);
    border-radius: 0 4px 4px 0;
    counter-increment: aar-num;
    position: relative;
}
.aar-win-body .aar-numbered .aar-num::before {
    content: counter(aar-num) ".";
    position: absolute;
    left: 10px;
    color: #4fc3f7;
    font-weight: 700;
}
.aar-win-body .aar-text { counter-reset: aar-num; }
.aar-win-body .aar-text p { margin: 4px 0 8px; line-height: 1.65; }

/* ── AAR Table Styling ── */
.aar-win-body .aar-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 11px;
}
.aar-win-body .aar-table th {
    background: linear-gradient(180deg, rgba(79, 195, 247, 0.15), rgba(79, 195, 247, 0.08));
    color: #4fc3f7;
    font-weight: 600;
    text-transform: uppercase;
    padding: 8px 10px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    font-size: 10px;
    letter-spacing: 0.5px;
}
.aar-win-body .aar-table td {
    padding: 6px 10px;
    border: 1px solid rgba(79, 195, 247, 0.1);
    background: rgba(0, 0, 0, 0.2);
}
.aar-win-body .aar-table tr:nth-child(odd) td {
    background: rgba(79, 195, 247, 0.03);
}

/* ── AAR Event Timeline Styling ── */
.aar-win-body .aar-event {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 10px;
    margin: 4px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border-left: 3px solid rgba(79, 195, 247, 0.3);
    font-size: 11px;
}
.aar-win-body .aar-turn {
    background: rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    font-family: 'Consolas', monospace;
    flex-shrink: 0;
}
.aar-win-body .aar-evt-type {
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.aar-win-body .aar-evt-combat { border-left-color: #ef5350; }
.aar-win-body .aar-evt-combat .aar-evt-type { background: rgba(239, 83, 80, 0.2); color: #ef5350; }
.aar-win-body .aar-evt-unit_destroyed { border-left-color: #ff5722; }
.aar-win-body .aar-evt-unit_destroyed .aar-evt-type { background: rgba(255, 87, 34, 0.2); color: #ff5722; }
.aar-win-body .aar-evt-contact_new { border-left-color: #ffb74d; }
.aar-win-body .aar-evt-contact_new .aar-evt-type { background: rgba(255, 183, 77, 0.2); color: #ffb74d; }
.aar-win-body .aar-evt-order_completed { border-left-color: #81c784; }
.aar-win-body .aar-evt-order_completed .aar-evt-type { background: rgba(129, 199, 132, 0.2); color: #81c784; }

/* ── AAR Assessment Badge ── */
.aar-win-body .aar-assessment {
    display: inline-block;
    padding: 8px 16px;
    margin: 8px 0;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15), rgba(79, 195, 247, 0.05));
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 6px;
    color: #4fc3f7;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── AAR Divider ── */
.aar-win-body .aar-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 195, 247, 0.3), transparent);
    margin: 16px 0;
}

/* ── AAR Section Icons ── */
.aar-win-body .aar-icon {
    margin-right: 8px;
    font-size: 14px;
}

/* ── AAR H1 (Main Title) ── */
.aar-win-body .aar-h1 {
    color: #4fc3f7;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(79, 195, 247, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Consolas', monospace;
    display: flex;
    align-items: center;
}
.aar-win-footer {
    padding: 6px 16px;
    border-top: 1px solid rgba(79, 195, 247, 0.1);
    flex-shrink: 0;
}
.aar-win-footer-text {
    font-size: 9px;
    color: #445;
    font-style: italic;
}

/* ── Compass Rose (bottom-right, above game clock) ── */
.compass-control {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    transition: opacity 0.3s ease;
    margin-bottom: -4px !important;
    margin-right: 4px !important;
}
.compass-control:hover {
    opacity: 0.85;
}
.compass-rose {
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
}
.compass-label {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 9px;
    font-weight: 700;
    fill: rgba(180, 210, 240, 0.7);
    letter-spacing: 0.5px;
}
.compass-n {
    fill: rgba(239, 83, 80, 0.9);
    font-size: 11px;
}
.compass-s {
    fill: rgba(150, 170, 200, 0.5);
}
.compass-needle-n {
    fill: rgba(239, 83, 80, 0.75);
    stroke: rgba(239, 83, 80, 0.3);
    stroke-width: 0.5;
    transform-origin: 50px 50px;
    animation: compass-tremble 12s ease-in-out infinite;
}
.compass-needle-s {
    fill: rgba(30, 50, 80, 0.7);
    stroke: rgba(79, 195, 247, 0.15);
    stroke-width: 0.5;
    transform-origin: 50px 50px;
    animation: compass-tremble 12s ease-in-out infinite;
}
/* Needle trembles: mostly still, with brief magnetic jitter bursts */
@keyframes compass-tremble {
    0%   { transform: rotate(0deg); }
    /* still */
    18%  { transform: rotate(0deg); }
    /* first jitter burst */
    19%  { transform: rotate(1.2deg); }
    20%  { transform: rotate(-0.8deg); }
    21%  { transform: rotate(0.5deg); }
    22%  { transform: rotate(-0.3deg); }
    23%  { transform: rotate(0deg); }
    /* still */
    54%  { transform: rotate(0deg); }
    /* second jitter burst (subtler) */
    55%  { transform: rotate(-0.7deg); }
    56%  { transform: rotate(0.4deg); }
    57%  { transform: rotate(-0.2deg); }
    58%  { transform: rotate(0deg); }
    /* still */
    79%  { transform: rotate(0deg); }
    /* third tiny tick */
    80%  { transform: rotate(0.6deg); }
    81%  { transform: rotate(-0.3deg); }
    82%  { transform: rotate(0deg); }
    /* settle */
    100% { transform: rotate(0deg); }
}

/* ── Drawing Toolbar (inside topbar) ─────────── */
#draw-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid #0f3460;
    border-radius: 5px;
    margin: 0 4px;
}
.draw-btn {
    width: 30px;
    height: 28px;
    padding: 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    color: #8eafc0;
    cursor: pointer;
    transition: all 0.15s;
}
.draw-btn svg { display: block; }
.draw-btn:hover { background: rgba(26, 82, 118, 0.6); border-color: rgba(79, 195, 247, 0.5); color: #e0f0ff; }
.draw-btn.active { background: rgba(15, 52, 96, 0.8); border-color: #4fc3f7; color: #4fc3f7; }
.draw-btn.btn-cancel { color: #e53935; }
.draw-btn.btn-cancel:hover { background: #3e1a1a; border-color: #e53935; }
.draw-btn.sep { margin-left: 4px; }

/* ── Topbar toggle buttons state ─────────────── */
.topbar-icon-btn.toggled-off { opacity: 0.35; }
.topbar-icon-btn.toggled-off:hover { opacity: 0.6; }
#admin-topbar-btn {
    font-size: 14px;
    color: #ff9800;
    margin-left: 4px;
}
#admin-topbar-btn:hover {
    color: #ffcc80;
    background: rgba(255, 152, 0, 0.15);
    border-color: #ff9800;
}

/* ── Main Layout ──────────────────────────────── */
#main-container {
    display: flex;
    height: calc(100% - 40px);
}

#map {
    flex: 1;
    background: #0d1117;
}

/* ── Sidebar ──────────────────────────────────── */
#sidebar {
    width: 340px;
    background: #16213e;
    border-left: 1px solid #0f3460;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.25s ease, min-width 0.25s ease, opacity 0.2s ease;
    min-width: 340px;
}
#sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-left: none;
    overflow: hidden;
}

/* ── Sidebar Toggle Handle ───────────────────── */
#sidebar-toggle {
    position: absolute;
    right: 340px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 800;
    width: 22px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #16213e 0%, #1a2744 100%);
    border: 1px solid #0f3460;
    border-right: none;
    border-radius: 6px 0 0 6px;
    cursor: pointer;
    color: #4fc3f7;
    opacity: 0.6;
    transition: right 0.25s ease, opacity 0.2s, background 0.2s, width 0.15s;
}
#sidebar-toggle:hover {
    opacity: 1;
    background: linear-gradient(135deg, #1a2744 0%, #1f3050 100%);
    width: 26px;
}
#sidebar-toggle svg {
    transition: transform 0.25s ease;
}
#sidebar-toggle.collapsed {
    right: 0;
}
#sidebar-toggle.collapsed svg {
    transform: rotate(180deg);
}

#sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #0f3460;
}
.tab-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    position: relative;
}
.tab-btn.active { color: #4fc3f7; border-bottom: 2px solid #4fc3f7; }
.tab-btn:hover { color: #fff; }

/* Reports unread badge */
.reports-badge {
    position: absolute;
    top: 1px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: linear-gradient(135deg, #4fc3f7, #0288d1);
    color: #0d1628;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.2px;
    box-shadow: 0 0 6px rgba(79, 195, 247, 0.5);
    animation: reports-badge-pulse 2.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}
@keyframes reports-badge-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(79, 195, 247, 0.5), 0 0 2px rgba(79, 195, 247, 0.3); }
    50% { opacity: 0.7; box-shadow: 0 0 14px rgba(79, 195, 247, 0.7), 0 0 4px rgba(79, 195, 247, 0.5); }
}

.tab-panel { display: none; padding: 12px; overflow-y: auto; flex: 1; }
.tab-panel.active { display: flex; flex-direction: column; gap: 10px; }
.tab-panel h3 { font-size: 14px; color: #4fc3f7; margin-bottom: 4px; }

/* ── Inputs & Buttons ─────────────────────────── */
input[type="text"], textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #0f3460;
    border-radius: 4px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 13px;
}
textarea { min-height: 80px; resize: vertical; }
button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: #0f3460;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
button:hover { background: #1a5276; }

/* ── Grid axis labels (column/row headers on edges) ── */
.grid-axis-label {
    pointer-events: none;
    text-align: center;
}
.grid-axis-label span {
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow:
        0 0 3px rgba(0,0,0,1),
        0 0 6px rgba(0,0,0,0.8),
        1px 1px 2px rgba(0,0,0,0.9);
}
.grid-axis-lg span {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 2px;
}
.grid-axis-md span {
    font-size: 14px;
    color: rgba(230, 230, 230, 0.9);
    letter-spacing: 1.5px;
}
.grid-axis-sm span {
    font-size: 12px;
    color: rgba(200, 200, 200, 0.8);
    letter-spacing: 1px;
}

/* ── Grid corner coordinate labels ────────────── */
.grid-corner-coord {
    pointer-events: none;
}
.grid-corner-coord span {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 9px;
    color: rgba(255, 210, 80, 0.65);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
    white-space: nowrap;
}

/* ── Grid selection highlight ─────────────────── */
.grid-highlight {
    stroke: #ffd740;
    stroke-width: 3;
    fill: #ffd740;
    fill-opacity: 0.15;
}

/* ── Order & Log items ────────────────────────── */
.order-item, .log-item {
    padding: 6px 8px;
    background: #1a1a2e;
    border-radius: 4px;
    font-size: 12px;
    border-left: 3px solid #0f3460;
    margin-bottom: 2px;
}
.order-item .status { font-weight: 600; }
.log-item.event { border-left-color: #f39c12; }
.log-item.report { border-left-color: #27ae60; }
.log-item.order { border-left-color: #2196f3; }
.log-item.info { border-left-color: #607d8b; }

/* ── Reports Panel ───────────────────────────── */
.reports-filter-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.1);
}
.reports-filter-btn {
    background: rgba(15, 52, 96, 0.3);
    border: 1px solid rgba(79, 195, 247, 0.15);
    border-bottom: 2px solid transparent;
    border-radius: 4px;
    color: #aaa;
    font-size: 10px;
    padding: 3px 7px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.reports-filter-btn:hover {
    background: rgba(15, 52, 96, 0.5);
    color: #e0e0e0;
}
.reports-filter-btn.active {
    background: rgba(79, 195, 247, 0.15);
    color: #4fc3f7;
    border-color: rgba(79, 195, 247, 0.3);
}
.report-item {
    padding: 6px 8px;
    background: rgba(15, 20, 35, 0.6);
    border-radius: 4px;
    font-size: 12px;
    border-left: 3px solid #555;
    margin-bottom: 3px;
    transition: background 0.15s;
}
.report-item:hover {
    background: rgba(25, 35, 55, 0.8);
}
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}
.report-channel {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.report-tick {
    font-size: 10px;
    color: #777;
}
.report-text {
    font-size: 11px;
    color: #ccc;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Orders Panel (enhanced) ─────────────────── */
#orders-tab.active {
    flex-direction: column;
    gap: 0;
}
.orders-section {
    background: rgba(15, 52, 96, 0.15);
    border: 1px solid rgba(79, 195, 247, 0.08);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}
.orders-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.orders-section-label {
    font-size: 10px;
    font-weight: 600;
    color: #4fc3f7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.orders-clear-btn {
    font-size: 9px;
    padding: 2px 8px;
    background: rgba(239, 83, 80, 0.15);
    border: 1px solid rgba(239, 83, 80, 0.3);
    color: #ef5350;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}
.orders-clear-btn:hover {
    background: rgba(239, 83, 80, 0.3);
}
.orders-unit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 22px;
    align-items: center;
}
.orders-empty-hint {
    color: #607d8b;
    font-size: 11px;
    font-style: italic;
}
.orders-unit-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: rgba(33, 150, 243, 0.12);
    border: 1px solid rgba(33, 150, 243, 0.25);
    border-radius: 12px;
    font-size: 10px;
    color: #90caf9;
    white-space: nowrap;
}
.orders-unit-chip .chip-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
}
.orders-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 160px;
    padding: 8px 10px;
    background: #0d1b2e;
    border: 1px solid rgba(79, 195, 247, 0.15);
    border-radius: 5px;
    color: #e0e0e0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.orders-textarea:focus {
    outline: none;
    border-color: rgba(79, 195, 247, 0.4);
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.08);
}
.orders-textarea::placeholder {
    color: #4a6a80;
    font-style: italic;
}
.orders-submit-btn {
    width: 100%;
    padding: 8px 12px;
    margin-top: 6px;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 5px;
    color: #c8e6c9;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.orders-submit-btn:hover {
    background: linear-gradient(135deg, #2e7d32, #388e3c);
    border-color: rgba(76, 175, 80, 0.5);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
    color: #fff;
}
.orders-submit-btn:active {
    transform: scale(0.98);
}
.orders-count-badge {
    font-size: 9px;
    padding: 1px 6px;
    background: rgba(79, 195, 247, 0.12);
    border-radius: 8px;
    color: #4fc3f7;
}
.orders-history-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 500px;
}

/* ── Radio-style Order Log ───────────────────── */
.order-radio-log {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 600px;
    padding: 4px 0;
}
.order-radio-entry {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.5;
    border-left: 3px solid #1565c0;
    background: rgba(15, 30, 60, 0.4);
    transition: background 0.15s;
}
.order-radio-entry:hover {
    background: rgba(20, 40, 80, 0.5);
}
.order-radio-entry.side-red {
    border-left-color: #c62828;
}
.order-radio-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}
.order-radio-time {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 10px;
    font-weight: 700;
    color: #4fc3f7;
    white-space: nowrap;
}
.order-radio-callsign {
    font-size: 10px;
    font-weight: 700;
    color: #90caf9;
    white-space: nowrap;
}
.order-radio-callsign.side-red {
    color: #ef9a9a;
}
.order-radio-arrow {
    color: #556;
    font-size: 10px;
}
.order-radio-target {
    font-size: 10px;
    font-weight: 600;
    color: #b0bec5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.order-radio-text {
    color: #ddd;
    font-size: 11px;
    word-break: break-word;
    font-style: italic;
}
.order-radio-text::before {
    content: '"';
    color: #556;
}
.order-radio-text::after {
    content: '"';
    color: #556;
}
.order-radio-status {
    display: inline-block;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.order-radio-status.pending    { background: rgba(255, 152, 0, 0.12); color: #ffb74d; }
.order-radio-status.validated  { background: rgba(33, 150, 243, 0.12); color: #64b5f6; }
.order-radio-status.executing  { background: rgba(76, 175, 80, 0.12); color: #81c784; }
.order-radio-status.completed  { background: rgba(76, 175, 80, 0.2); color: #a5d6a7; }
.order-radio-status.failed     { background: rgba(239, 83, 80, 0.12); color: #ef9a9a; }
.order-radio-status.cancelled  { background: rgba(158, 158, 158, 0.12); color: #bdbdbd; }

/* Order classification & LLM parse badges */
.order-radio-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    margin-top: 3px;
}
.order-class-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(79, 195, 247, 0.12);
    color: #4fc3f7;
    text-transform: lowercase;
}
.order-conf-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(156, 204, 101, 0.12);
    color: #9ccc65;
}
.order-lang-badge {
    display: inline-block;
    font-size: 7px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
    background: rgba(171, 71, 188, 0.15);
    color: #ce93d8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.order-processing {
    font-size: 8px;
    color: #ffb74d;
    animation: orderPulse 1.2s ease-in-out infinite;
}
@keyframes orderPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1.0; }
}

/* Unit radio response styling in chat */
.radio-msg.msg-unit {
    border-left: 3px solid #66bb6a;
    background: linear-gradient(135deg, rgba(102, 187, 106, 0.08), rgba(76, 175, 80, 0.04));
    align-self: flex-start;
    border-radius: 12px 12px 12px 4px;
}
.radio-msg.msg-unit .radio-msg-sender {
    color: #66bb6a;
    font-style: italic;
}

/* Outgoing order styling in radio */
.radio-msg.msg-order {
    border-left: 3px solid #ffa726;
    background: linear-gradient(135deg, rgba(255, 167, 38, 0.10), rgba(255, 152, 0, 0.05));
    align-self: flex-start;
    border-radius: 12px 12px 12px 4px;
}
.radio-msg.msg-order .radio-msg-sender {
    color: #ffa726;
    font-weight: 600;
}
.radio-msg.msg-order .radio-msg-text {
    color: #ffe0b2;
}

/* Location highlight tooltip */
.location-tooltip {
    background: rgba(255, 102, 0, 0.9) !important;
    border: 1px solid #FF6600 !important;
    color: white !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
}

.order-radio-empty {
    color: #445;
    font-size: 11px;
    font-style: italic;
    text-align: center;
    padding: 16px 0;
}

/* Order history cards (legacy / admin) */
.order-card {
    padding: 7px 10px;
    background: #111a2e;
    border-radius: 5px;
    border-left: 3px solid #1565c0;
    font-size: 11px;
    transition: background 0.15s;
}
.order-card:hover {
    background: #152240;
}
.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}
.order-card-units {
    font-size: 10px;
    color: #90caf9;
    font-weight: 600;
}
.order-card-time {
    font-size: 9px;
    color: #607d8b;
}
.order-card-text {
    color: #cfd8dc;
    line-height: 1.4;
    word-break: break-word;
}
.order-card-status {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 4px;
}
.order-card-status.pending    { background: rgba(255, 152, 0, 0.15); color: #ffb74d; }
.order-card-status.validated  { background: rgba(33, 150, 243, 0.15); color: #64b5f6; }
.order-card-status.executing  { background: rgba(76, 175, 80, 0.15); color: #81c784; }
.order-card-status.completed  { background: rgba(76, 175, 80, 0.25); color: #a5d6a7; }
.order-card-status.failed     { background: rgba(239, 83, 80, 0.15); color: #ef9a9a; }
.order-card-status.cancelled  { background: rgba(158, 158, 158, 0.15); color: #bdbdbd; }

/* ── Game log container ──────────────────────── */
#game-log {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ── Order list ──────────────────────────────── */
#order-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

/* ── Session list ─────────────────────────────── */

/* ── Auth Panel (Login Card) ─────────────────── */
#auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 24px 12px;
}
.auth-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 280px;
    padding: 28px 20px 22px;
    background: linear-gradient(165deg, rgba(15, 30, 60, 0.9) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 1px solid rgba(79, 195, 247, 0.18);
    border-radius: 12px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(79, 195, 247, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.auth-icon {
    color: #4fc3f7;
    opacity: 0.7;
    margin-bottom: 4px;
}
.auth-title {
    font-size: 16px;
    font-weight: 700;
    color: #e0e6ed;
    letter-spacing: 0.5px;
}
.auth-subtitle {
    font-size: 11px;
    color: #6b7f99;
    margin-bottom: 10px;
}
.auth-input-group {
    display: flex;
    width: 100%;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(79, 195, 247, 0.2);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #0d1628;
}
.auth-input-group:focus-within {
    border-color: rgba(79, 195, 247, 0.5);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.08), 0 0 12px rgba(79, 195, 247, 0.06);
}
.auth-input {
    flex: 1;
    padding: 10px 12px !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #e0e0e0 !important;
    font-size: 13px !important;
    outline: none;
    min-width: 0;
}
.auth-input::placeholder {
    color: #4a5d78;
    font-style: italic;
}
.auth-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px !important;
    border: none !important;
    border-radius: 0 !important;
    background: linear-gradient(135deg, #0d3460, #1565c0) !important;
    color: #90caf9 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.auth-btn:hover {
    background: linear-gradient(135deg, #1565c0, #1e88e5) !important;
    color: #fff !important;
}
.auth-btn:active {
    background: linear-gradient(135deg, #0a2540, #0d3460) !important;
}
.auth-btn svg {
    flex-shrink: 0;
}
.auth-hint {
    font-size: 10px;
    color: #4a5d78;
    margin-top: 6px;
    letter-spacing: 0.2px;
}
.auth-field {
    width: 100%;
    margin-bottom: 4px;
}
.auth-field .auth-input-group {
    border-radius: 6px;
}
.auth-field .auth-input {
    border-radius: 6px !important;
}
.auth-actions {
    display: flex;
    width: 100%;
    gap: 6px;
    margin-top: 6px;
}
.auth-actions .auth-btn {
    flex: 1;
    justify-content: center;
    border-radius: 6px !important;
    padding: 10px 12px !important;
}
.auth-btn-secondary {
    background: linear-gradient(135deg, #1a2340, #2a3555) !important;
    color: #7b9cc0 !important;
    border: 1px solid rgba(79, 195, 247, 0.15) !important;
}
.auth-btn-secondary:hover {
    background: linear-gradient(135deg, #2a3555, #3a4570) !important;
    color: #a0c4e8 !important;
}
.auth-error {
    font-size: 11px;
    color: #ef5350;
    min-height: 16px;
    margin-top: 4px;
    text-align: center;
}

/* ── Session list ─────────────────────────────── */
.session-card {
    padding: 10px 12px;
    background: rgba(26, 26, 46, 0.7);
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(15, 52, 96, 0.6);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.session-card:hover {
    border-color: rgba(79, 195, 247, 0.4);
    background: rgba(15, 52, 96, 0.3);
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.06);
}
.session-card .title { font-weight: 600; font-size: 13px; }
.session-card .meta { font-size: 11px; color: #6b7f99; margin-top: 3px; }

/* ── Leaflet overrides ────────────────────────── */
.leaflet-container { background: #0d1117 !important; }

/* ── Unit icon (milsymbol) ────────────────────── */
.unit-icon {
    /* DivIcon already fixed-pixel; suppress any background/border Leaflet adds */
    background: none !important;
    border: none !important;
    /* Prevent browser image scaling artefacts */
    image-rendering: auto;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
    transition: filter 0.15s;
    overflow: visible !important;
}
.unit-icon:hover {
    filter: drop-shadow(0 0 6px rgba(79,195,247,0.6)) drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.unit-marker-fallback {
    background: none !important;
    border: none !important;
    overflow: visible !important;
}

/* ── Unit callsign label (below marker) ──────── */
.unit-callsign {
    text-align: center;
    white-space: nowrap;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #e0e0e0;
    text-shadow:
        0 0 3px rgba(0,0,0,1),
        0 0 6px rgba(0,0,0,0.9),
        1px 1px 2px rgba(0,0,0,0.95);
    pointer-events: none;
    line-height: 1;
    margin-top: 1px;
    letter-spacing: 0.3px;
}

/* ── Unit tooltip (name on hover) ─────────────── */
.unit-tooltip {
    background: rgba(16, 24, 48, 0.9) !important;
    border: 1px solid rgba(79, 195, 247, 0.4) !important;
    border-radius: 3px !important;
    padding: 2px 8px !important;
    color: #e0e0e0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4) !important;
    white-space: nowrap !important;
}
.unit-tooltip::before { display: none !important; }

/* ── Leaflet popup dark theme ─────────────────── */
.leaflet-popup-content-wrapper {
    background: rgba(22, 33, 62, 0.95) !important;
    color: #e0e0e0 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
    border: 1px solid rgba(15, 52, 96, 0.6) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.leaflet-popup-content {
    font-size: 12px !important;
    line-height: 1.5 !important;
    margin: 10px 12px !important;
}
.leaflet-popup-content b { color: #4fc3f7; }
.leaflet-popup-tip {
    background: rgba(22, 33, 62, 0.95) !important;
    border: 1px solid rgba(15, 52, 96, 0.6) !important;
    border-top: none !important;
    border-left: none !important;
}
.leaflet-popup-content button {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 3px;
    background: #0f3460;
    color: #b0c4de;
    border: 1px solid #1a5276;
    cursor: pointer;
}
.leaflet-popup-content button:hover {
    background: #1a5276;
    color: #fff;
    border-color: #4fc3f7;
}
.leaflet-popup-close-button {
    color: #888 !important;
    font-size: 18px !important;
}
.leaflet-popup-close-button:hover { color: #ef5350 !important; }

/* ── Distance Measurement Labels ──────────────── */
.measure-label {
    background: rgba(30, 30, 40, 0.85) !important;
    border: 1px solid #ffd740 !important;
    border-radius: 3px !important;
    padding: 2px 6px !important;
    color: #ffd740 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    font-family: monospace !important;
    box-shadow: none !important;
}
.measure-label::before { display: none !important; }

.measure-total-label {
    background: rgba(30, 30, 40, 0.9) !important;
    border: 1px solid #ff9800 !important;
    border-radius: 3px !important;
    padding: 2px 6px !important;
    color: #ff9800 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    font-family: monospace !important;
    box-shadow: none !important;
}
.measure-total-label::before { display: none !important; }

.measure-final-label {
    background: rgba(30, 60, 30, 0.9) !important;
    border: 1px solid #4caf50 !important;
    border-radius: 4px !important;
    padding: 3px 8px !important;
    color: #4caf50 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    font-family: monospace !important;
    box-shadow: none !important;
}
.measure-final-label::before { display: none !important; }

/* ── LOS Check Labels ───────────────────────── */
.los-label-pending {
    background: rgba(20, 26, 40, 0.92) !important;
    border: 1px solid rgba(79, 195, 247, 0.3) !important;
    border-radius: 8px !important;
    padding: 6px 14px !important;
    color: #90a4ae !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    font-family: 'Segoe UI', system-ui, sans-serif !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}
.los-label-pending::before { display: none !important; }

.los-label-clear,
.los-label-blocked {
    background: rgba(14, 20, 30, 0.94) !important;
    border-radius: 10px !important;
    padding: 8px 16px !important;
    font-family: 'Segoe UI', system-ui, sans-serif !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.55), 0 0 1px rgba(255,255,255,0.08) !important;
    white-space: nowrap !important;
    line-height: 1.5 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2px !important;
}
.los-label-clear { border: 1px solid rgba(102, 187, 106, 0.5) !important; }
.los-label-blocked { border: 1px solid rgba(239, 83, 80, 0.5) !important; }
.los-label-clear::before,
.los-label-blocked::before { display: none !important; }

.los-heading {
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
}
.los-label-clear .los-heading { color: #81c784 !important; }
.los-label-blocked .los-heading { color: #ef5350 !important; }

.los-details {
    font-size: 11.5px !important;
    font-weight: 400 !important;
    color: #b0bec5 !important;
    letter-spacing: 0.3px !important;
    font-variant-numeric: tabular-nums !important;
}

.los-block-info {
    font-size: 10.5px !important;
    font-weight: 500 !important;
    color: #ef9a9a !important;
    opacity: 0.85 !important;
    margin-top: 1px !important;
}

/* ── Start Session Button ─────────────────────── */
.exit-session-btn {
    background: #37474f;
    color: #b0bec5;
    font-weight: 600;
    border: 1px solid #546e7a;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-bottom: 8px;
    width: 100%;
    transition: background 0.15s;
}
.exit-session-btn:hover { background: #455a64; color: #eceff1; }

/* ── Turn Button ──────────────────────────────── */
#turn-btn {
    background: #e65100;
    color: #ffcc80;
    font-weight: 700;
    transition: all 0.2s ease;
}
#turn-btn:hover { background: #ef6c00; }
#turn-btn:disabled {
    background: #555;
    color: #aaa;
    cursor: wait;
}
#turn-btn.has-pending {
    background: #2e7d32;
    color: #a5d6a7;
    animation: pulse-pending 1.5s ease-in-out infinite;
}
#turn-btn.has-pending:hover {
    background: #388e3c;
}
@keyframes pulse-pending {
    0%, 100% { box-shadow: 0 0 3px rgba(76, 175, 80, 0.4); }
    50% { box-shadow: 0 0 10px rgba(76, 175, 80, 0.7); }
}

/* ── Leaflet scale control styling ───────────── */
.leaflet-control-scale {
    margin-bottom: 2px !important;
    margin-left: 8px !important;
}
.leaflet-control-scale-line {
    background: rgba(16, 24, 48, 0.75) !important;
    border: 1px solid rgba(150, 170, 200, 0.5) !important;
    border-top: none !important;
    border-radius: 0 0 3px 3px !important;
    padding: 1px 8px !important;
    color: rgba(180, 200, 230, 0.9) !important;
    font-size: 10px !important;
    font-family: 'Consolas', 'Courier New', monospace !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
    line-height: 14px !important;
    text-align: center !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
}

/* ── Selected unit tags ──────────────────────── */
.selected-unit-tag {
    display: inline-block;
    background: #0d3460;
    color: #4fc3f7;
    border: 1px solid #4fc3f7;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 11px;
    margin: 1px;
    white-space: nowrap;
}

/* ── Clickable event items ───────────────────── */
.log-item.event[style*="cursor"] {
    transition: background 0.15s;
}
.log-item.event:hover {
    background: #222844;
}



/* ── Selected Units Display ──────────────────── */
#selected-units-display {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
}

/* ── Admin Panel ─────────────────────────────── */
.admin-section {
    background: rgba(15, 20, 40, 0.5);
    border: 1px solid #0f3460;
    border-radius: 6px;
    padding: 10px;
}
.admin-section h4 {
    font-size: 12px;
    color: #90caf9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(15, 52, 96, 0.5);
}
.admin-btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    background: #1a3a5c;
    color: #b0c4de;
    border: 1px solid #0f3460;
    cursor: pointer;
    margin: 2px 4px 2px 0;
    transition: all 0.15s;
}
.admin-btn:hover {
    background: #1a5276;
    color: #fff;
    border-color: #4fc3f7;
}
.admin-btn-danger {
    background: #3e1a1a;
    color: #ef9a9a;
    border-color: #5a2020;
}
.admin-btn-danger:hover {
    background: #5a2020;
    color: #ffcdd2;
    border-color: #e53935;
}
.admin-info {
    font-size: 11px;
    color: #aaa;
    padding: 4px 0;
    min-height: 18px;
}
.admin-success { color: #81c784 !important; }
.admin-error { color: #ef9a9a !important; }
.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    background: #1a1a2e;
    border-radius: 3px;
    margin-bottom: 3px;
    font-size: 12px;
}
.admin-item b { color: #e0e0e0; font-weight: 600; }
.admin-item-meta { color: #666; font-size: 10px; font-family: monospace; }
.admin-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.admin-stats-table td {
    padding: 3px 6px;
    border-bottom: 1px solid rgba(15, 52, 96, 0.3);
}
.admin-stats-table td:first-child {
    color: #90caf9;
    font-family: monospace;
}
.admin-stats-table td:last-child {
    text-align: right;
    color: #e0e0e0;
    font-weight: 600;
}

/* ── Admin Sub-Tabs ──────────────────────────────── */
.admin-subtabs {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(15, 52, 96, 0.5);
    padding-bottom: 4px;
}
.admin-subtab-btn {
    flex: 1;
    padding: 5px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px 3px 0 0;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
}
.admin-subtab-btn:hover { color: #ccc; background: rgba(15, 52, 96, 0.3); }
.admin-subtab-btn.active { color: #4fc3f7; border-color: #0f3460; border-bottom-color: transparent; background: rgba(15, 52, 96, 0.4); }
.admin-subtab-panel { /* shown/hidden via JS */ }

/* ── Admin Active Button State ───────────────────── */
.admin-btn-active {
    background: #1b5e20 !important;
    color: #a5d6a7 !important;
    border-color: #2e7d32 !important;
}

/* ── Scenario Builder Form ───────────────────────── */
.sb-unit-form {
    border: 1px solid rgba(79, 195, 247, 0.3) !important;
    background: rgba(15, 30, 60, 0.7) !important;
}
.sb-form-row {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 4px;
}
.sb-form-row label {
    font-size: 10px;
    color: #aaa;
    white-space: nowrap;
}
.sb-form-row input, .sb-form-row select {
    padding: 3px 5px;
    font-size: 11px;
}
.sb-grid-row {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 4px;
}
.sb-grid-row label {
    font-size: 10px;
    color: #90caf9;
    width: 40px;
    white-space: nowrap;
}
.sb-grid-row input {
    padding: 3px 5px;
    font-size: 11px;
}

/* ── Staged Unit Items ───────────────────────────── */
.sb-unit-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: rgba(33, 150, 243, 0.08);
    border-left: 3px solid #4fc3f7;
    border-radius: 3px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: background 0.15s;
}
.sb-unit-item:hover { background: rgba(33, 150, 243, 0.18); }
.sb-unit-item.sb-unit-red {
    background: rgba(244, 67, 54, 0.08);
    border-left-color: #ef5350;
}
.sb-unit-item.sb-unit-red:hover { background: rgba(244, 67, 54, 0.18); }
.sb-unit-name {
    font-size: 11px;
    font-weight: 600;
    color: #e0e0e0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sb-unit-type-badge {
    font-size: 9px;
    color: #888;
    white-space: nowrap;
}
.sb-unit-del {
    width: 16px;
    height: 16px;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    border-radius: 2px;
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    cursor: pointer;
}
.sb-unit-del:hover { background: #5a2020; color: #ef9a9a; border-color: #e53935; }

/* ── Admin Dashboard Table ───────────────────────── */
.admin-dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.admin-dashboard-table th {
    padding: 3px 4px;
    text-align: left;
    color: #90caf9;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(15, 52, 96, 0.5);
}
.admin-dashboard-table td {
    padding: 3px 4px;
    border-bottom: 1px solid rgba(15, 52, 96, 0.2);
    color: #e0e0e0;
}

/* ── Overlay Context Menu ────────────────────── */
.ctx-menu {
    position: fixed;
    z-index: 10000;
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 6px;
    padding: 6px 0;
    min-width: 160px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
    font-size: 12px;
}
.ctx-menu-section {
    padding: 4px 10px;
    border-bottom: 1px solid rgba(15,52,96,0.4);
}
.ctx-menu-section:last-child { border-bottom: none; }
.ctx-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.ctx-item {
    display: block;
    width: 100%;
    padding: 6px 8px;
    background: transparent;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    border-radius: 3px;
}
.ctx-item:hover { background: #1a5276; color: #fff; }
.ctx-item-danger { color: #ef9a9a; }
.ctx-item-danger:hover { background: #5a2020; color: #ef9a9a; }
.ctx-colors {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.ctx-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.1s;
}
.ctx-color-swatch:hover { border-color: #4fc3f7; transform: scale(1.15); }
.ctx-color-swatch.active { border-color: #fff; }
.ctx-widths {
    display: flex;
    gap: 4px;
}
.ctx-width-btn {
    flex: 1;
    padding: 4px 6px;
    background: #0f3460;
    border: 1px solid #1a5276;
    color: #b0c4de;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}
.ctx-width-btn:hover { background: #1a5276; color: #fff; border-color: #4fc3f7; }
.ctx-width-btn.active { background: #1a5276; border-color: #4fc3f7; color: #4fc3f7; }

/* ── Context menu header & label ─────────────── */
.ctx-menu-header {
    padding: 5px 10px 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #4fc3f7;
    border-bottom: 1px solid rgba(15, 52, 96, 0.5);
}
.ctx-input {
    flex: 1;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #0f3460;
    border-radius: 3px;
    background: #1a1a2e;
    color: #e0e0e0;
    outline: none;
}
.ctx-input:focus { border-color: #4fc3f7; }
.ctx-apply-btn {
    padding: 4px 8px;
    font-size: 12px;
    background: #1b5e20;
    color: #a5d6a7;
    border: 1px solid #2e7d32;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 700;
}
.ctx-apply-btn:hover { background: #2e7d32; color: #fff; }

/* ── Overlay marker label tooltip ────────────── */
.overlay-marker-label {
    background: rgba(16, 24, 48, 0.85) !important;
    border: 1px solid rgba(79, 195, 247, 0.4) !important;
    border-radius: 3px !important;
    padding: 1px 6px !important;
    color: #e0e0e0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4) !important;
}
.overlay-marker-label::before { display: none !important; }
/* Shape label (polygon/rect/ellipse centroid, line midpoint) */
.overlay-shape-label {
    background: rgba(16, 24, 48, 0.80) !important;
    border: 1px solid rgba(79, 195, 247, 0.35) !important;
    border-radius: 3px !important;
    padding: 1px 6px !important;
    color: #e0e0e0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4) !important;
    white-space: nowrap;
}
.overlay-shape-label::before { display: none !important; }

/* ── Overlay Edit Handles ─────────────────────── */
.overlay-edit-handle {
    background: #fff;
    border: 2px solid #4fc3f7;
    border-radius: 2px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.overlay-edit-handle-rotate {
    background: #4fc3f7;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.overlay-edit-handle-rotate:active { cursor: grabbing; }
.overlay-editing { cursor: move !important; }

/* ── Rubber band selection rectangle ─────────── */
.selection-rectangle {
    border: 2px dashed #4fc3f7;
    background: rgba(79, 195, 247, 0.1);
    position: absolute;
    pointer-events: none;
    z-index: 1000;
}

/* ── Admin Lock Gate ─────────────────────────── */
#admin-lock-gate {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 12px;
    flex: 1;
}
.admin-lock-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 260px;
    padding: 28px 20px 22px;
    background: linear-gradient(165deg, rgba(30, 20, 10, 0.9) 0%, rgba(40, 30, 15, 0.95) 100%);
    border: 1px solid rgba(255, 183, 77, 0.18);
    border-radius: 12px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(255, 183, 77, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.admin-lock-icon {
    color: #ffb74d;
    opacity: 0.7;
    margin-bottom: 4px;
}
.admin-lock-title {
    font-size: 16px;
    font-weight: 700;
    color: #e0d6c8;
    letter-spacing: 0.5px;
}
.admin-lock-subtitle {
    font-size: 11px;
    color: #8b7b68;
    margin-bottom: 10px;
}
.admin-lock-input-group {
    display: flex;
    width: 100%;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 183, 77, 0.2);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #1a1208;
}
.admin-lock-input-group:focus-within {
    border-color: rgba(255, 183, 77, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 183, 77, 0.08), 0 0 12px rgba(255, 183, 77, 0.06);
}
.admin-lock-input {
    flex: 1;
    padding: 10px 12px !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #e0d6c8 !important;
    font-size: 13px !important;
    outline: none;
    min-width: 0;
}
.admin-lock-input::placeholder {
    color: #6b5d4a;
    font-style: italic;
}
.admin-lock-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px !important;
    border: none !important;
    border-radius: 0 !important;
    background: linear-gradient(135deg, #5d3a00, #8b5a00) !important;
    color: #ffcc80 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.admin-lock-btn:hover {
    background: linear-gradient(135deg, #8b5a00, #b77200) !important;
    color: #fff !important;
}
.admin-lock-btn:active {
    background: linear-gradient(135deg, #3e2700, #5d3a00) !important;
}
.admin-lock-btn svg {
    flex-shrink: 0;
}
.admin-lock-hint {
    font-size: 10px;
    color: #6b5d4a;
    margin-top: 6px;
    letter-spacing: 0.2px;
}

/* ── Chain of Command Tree ───────────────────── */
.coc-tree {
    font-size: 12px;
}
.coc-side-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 0 2px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.2);
    margin-bottom: 4px;
}
.coc-node {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px;
    border-radius: 3px;
    transition: background 0.12s;
    margin-bottom: 1px;
}
.coc-node:hover {
    background: rgba(79, 195, 247, 0.08);
}
.coc-expand {
    width: 12px;
    text-align: center;
    color: #666;
    font-size: 8px;
    flex-shrink: 0;
}
.coc-connector {
    width: 3px;
    height: 14px;
    border-radius: 1px;
    flex-shrink: 0;
}
.coc-name {
    font-weight: 600;
    font-size: 11px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    cursor: pointer;
    transition: color 0.12s;
}
.coc-name:hover {
    color: #4fc3f7 !important;
    text-decoration: underline;
}
.coc-type {
    font-size: 9px;
    color: #777;
    white-space: nowrap;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.coc-cmd {
    font-size: 9px;
    color: #90caf9;
    white-space: nowrap;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}
.coc-str {
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    min-width: 28px;
    text-align: right;
}
.coc-assign-btn,
.coc-unassign-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    border-radius: 2px;
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.coc-assign-btn:hover {
    background: #1a5276;
    color: #4fc3f7;
    border-color: #4fc3f7;
}
.coc-unassign-btn:hover {
    background: #5a2020;
    color: #ef9a9a;
    border-color: #e53935;
}

/* ── CoC Hierarchy Buttons ─────────────────────── */
.coc-hier-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    font-size: 9px;
    line-height: 1;
    border-radius: 2px;
    background: transparent;
    border: 1px solid transparent;
    color: #777;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background 0.12s, color 0.12s;
}
.coc-node:hover .coc-hier-btn {
    opacity: 1;
}
.coc-move-up-btn:hover {
    background: #1a3a5c;
    color: #64b5f6;
    border-color: #42a5f5;
}
.coc-move-down-btn:hover {
    background: #1a3a5c;
    color: #64b5f6;
    border-color: #42a5f5;
}

/* ── CoC Drag-and-Drop Styling ─────────────────── */
.coc-drag-hint {
    font-size: 9px;
    color: #666;
    padding: 2px 4px;
    margin-bottom: 4px;
    font-style: italic;
}
.coc-draggable {
    cursor: grab;
}
.coc-draggable:active {
    cursor: grabbing;
}
.coc-dragging {
    opacity: 0.4;
    background: rgba(79, 195, 247, 0.1) !important;
}
.coc-drop-target {
    background: rgba(76, 175, 80, 0.2) !important;
    border: 1px dashed #4caf50 !important;
    border-radius: 4px;
}
.coc-drop-target-above {
    border-top: 2px solid #4fc3f7 !important;
    background: rgba(79, 195, 247, 0.08) !important;
}
.coc-drop-target-invalid {
    background: rgba(244, 67, 54, 0.15) !important;
    border: 1px dashed #f44336 !important;
    border-radius: 4px;
}

/* ── Scenario Builder Context Menu (reuses .ctx-menu) ── */
.sb-ctx-menu {
    min-width: 180px;
    max-width: 240px;
}
.sb-ctx-menu .ctx-menu-header {
    padding: 6px 10px 4px;
}

/* ── Admin Floating Window ───────────────────── */
#admin-window {
    position: fixed;
    top: 50px;
    right: 10px;
    width: 700px;
    max-height: calc(100vh - 60px);
    z-index: 9000;
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    min-width: 420px;
    min-height: 500px;
}
/* When locked (showing lock gate), shrink to fit the card */
#admin-window.admin-locked {
    width: auto;
    min-width: 0;
    min-height: 0;
    max-height: none;
    resize: none;
}
#admin-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #0f1b38;
    border-bottom: 1px solid #0f3460;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: #ff9800;
}
#admin-window-header:active { cursor: grabbing; }
#admin-window-close {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 14px;
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#admin-window-close:hover { background: #5a2020; color: #ef9a9a; border-color: #e53935; }
#admin-window-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
/* Pick-on-map indicator */
.pick-mode-active {
    cursor: crosshair !important;
}
.pick-mode-banner {
    position: fixed;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 152, 0, 0.9);
    color: #000;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    z-index: 9500;
    pointer-events: none;
}
/* CoC user assignment tooltip */
.coc-user-badge {
    display: inline-block;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: 3px;
    padding: 0 4px;
    font-size: 9px;
    color: #81c784;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    cursor: default;
}

/* ── Admin Modal Overlay & Dialog ────────────── */
.admin-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.admin-modal {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    min-width: 320px;
    max-width: 440px;
    width: 90%;
    overflow: hidden;
    animation: adminModalIn 0.15s ease-out;
}
@keyframes adminModalIn {
    from { transform: translateY(-20px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #0f1b38;
    border-bottom: 1px solid #0f3460;
    font-size: 13px;
    font-weight: 700;
    color: #ff9800;
}
.admin-modal-close {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 14px;
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-modal-close:hover { color: #ef5350 !important; }
.admin-modal-body {
    padding: 14px;
}
.admin-modal-row {
    margin-bottom: 10px;
}
.admin-modal-row label {
    display: block;
    font-size: 11px;
    color: #90caf9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}
.admin-modal-select {
    width: 100%;
    padding: 5px 8px;
    font-size: 11px;
    background: #1a1a2e;
    color: #e0e0e0;
    border: 1px solid #0f3460;
    border-radius: 4px;
    outline: none;
    margin-top: 6px;
    box-sizing: border-box;
    cursor: pointer;
}
.admin-modal-select:focus {
    border-color: #4fc3f7;
}
.admin-modal-select option {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 4px;
    font-size: 11px;
}
.admin-modal-select option:checked {
    background: #0f3460;
    color: #4fc3f7;
}
.admin-modal-footer {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #0f3460;
    background: rgba(15, 20, 40, 0.3);
}

/* ── Unit Edit Floating Window ──────────────────── */
.ue-float {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    z-index: 10000;
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(79,195,247,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ueFloatIn 0.18s ease-out;
}
@keyframes ueFloatIn {
    from { transform: translate(-50%, -50%) scale(0.95); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.ue-float.ue-dragged {
    /* Once dragged, remove centering transform */
    transform: none;
    animation: none;
}
.ue-float-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #0f1b38;
    border-bottom: 1px solid #0f3460;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: #ff9800;
}
.ue-float-header:active { cursor: grabbing; }
.ue-float-close {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 14px;
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ue-float-close:hover { background: #5a2020; color: #ef9a9a; border-color: #e53935; }
.ue-float-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    max-height: calc(100vh - 180px);
}
.ue-float-footer {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid #0f3460;
    background: rgba(15, 20, 40, 0.3);
}
.ue-btn-save {
    flex: 1;
    background: #1b5e20 !important;
    color: #a5d6a7 !important;
    font-weight: 700;
    border: 1px solid #2e7d32 !important;
}
.ue-btn-save:hover { background: #2e7d32 !important; }
.ue-btn-cancel { flex: 1; }

/* Preview row: symbol + label */
.ue-preview-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(79,195,247,0.1);
}
.ue-symbol-box {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.2);
    border: 1px solid #0f3460;
    border-radius: 6px;
    overflow: hidden;
}
.ue-symbol-box svg { max-width: 44px; max-height: 44px; }
.ue-preview-info { flex: 1; min-width: 0; }
.ue-unit-label {
    font-size: 13px;
    font-weight: 700;
    color: #4fc3f7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ue-unit-id {
    font-size: 10px;
    color: #555;
    font-family: monospace;
    margin-top: 2px;
}

/* Two-column field grid */
.ue-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
}
.ue-field { display: flex; flex-direction: column; }
.ue-span2 { grid-column: span 2; }
.ue-field label {
    font-size: 10px;
    color: #90caf9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    font-weight: 600;
}
.ue-input {
    width: 100%;
    padding: 5px 8px;
    font-size: 11px;
    background: #1a1a2e;
    color: #e0e0e0;
    border: 1px solid #0f3460;
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
}
.ue-input:focus { border-color: #4fc3f7; }
.ue-input option { background: #1a1a2e; color: #e0e0e0; }

/* Stat bar row (range slider + value) */
.ue-stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ue-stat-val {
    font-size: 11px;
    font-weight: 700;
    min-width: 36px;
    text-align: right;
    font-family: monospace;
    color: #e0e0e0;
}
/* Range slider custom styling */
.ue-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #1a1a2e;
    outline: none;
    cursor: pointer;
}
.ue-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 2px solid #4fc3f7;
    cursor: pointer;
}
.ue-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 2px solid #4fc3f7;
    cursor: pointer;
}
/* Color-coded track fills via JS-set background gradients */
.ue-range-str { accent-color: #4caf50; }
.ue-range-mor { accent-color: #2196f3; }
.ue-range-ammo { accent-color: #ff9800; }
.ue-range-sup { accent-color: #f44336; }

/* Position row */
.ue-pos-row {
    display: flex;
    gap: 4px;
    align-items: center;
}
.ue-pos-input { flex: 1; min-width: 0; }
.ue-pick-btn {
    padding: 4px 8px;
    font-size: 14px;
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 4px;
    color: #e0e0e0;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}
.ue-pick-btn:hover { background: #0f3460; border-color: #4fc3f7; }

/* Destroyed checkbox */
.ue-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #ef5350 !important;
    cursor: pointer;
    padding: 4px 0;
}
.ue-check-label input[type="checkbox"] {
    accent-color: #f44336;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Status message at bottom */
.ue-status {
    margin-top: 8px;
    font-size: 11px;
    min-height: 16px;
}
.ue-status.admin-success { color: #4caf50; }
.ue-status.admin-error { color: #ef9a9a; }

/* ── God View Banner (persistent warning) ─────── */
.god-view-banner {
    position: fixed;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: rgba(244, 67, 54, 0.85);
    color: #fff;
    padding: 4px 20px;
    border-radius: 0 0 6px 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4);
    animation: god-view-pulse 2s ease-in-out infinite;
}
.god-view-banner:hover { background: rgba(244, 67, 54, 1); }
@keyframes god-view-pulse {
    0%, 100% { opacity: 0.85; }
    50%      { opacity: 1; }
}

/* ── Unit Context Menu (reuses .ctx-menu) ──────── */
#unit-ctx-menu {
    min-width: 220px;
    max-width: 280px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 0;
    overflow-x: hidden;
}
#unit-ctx-menu .ctx-item {
    padding: 5px 12px;
    font-size: 12px;
}

/* ── Elegant Unit Info Card (inside context menu) ── */
.unit-info-card {
    padding: 0;
    border-bottom: 1px solid rgba(15, 52, 96, 0.5);
}
.unit-info-header {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px 4px;
}
.unit-info-side-bar {
    width: 4px;
    min-height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
    margin-top: 2px;
}
.unit-info-title {
    flex: 1;
    min-width: 0;
}
.unit-info-name {
    font-size: 13px;
    font-weight: 700;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.unit-info-type {
    font-size: 10px;
    color: #777;
    margin-top: 1px;
}
.unit-info-status {
    flex-shrink: 0;
}
.unit-status-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.unit-info-stats {
    padding: 2px 10px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.unit-stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.unit-stat-label {
    font-size: 9px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 32px;
    flex-shrink: 0;
}
.unit-stat-bar {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}
.unit-stat-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.unit-stat-value {
    font-size: 10px;
    font-weight: 700;
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}
.unit-info-ranges {
    padding: 3px 12px 5px;
    font-size: 10px;
    color: #aaa;
    display: flex;
    gap: 10px;
}
.unit-info-command {
    padding: 4px 12px 8px;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.unit-info-command-line {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Dashboard sortable headers ──────────────────── */
.admin-dashboard-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.admin-dashboard-table th.sortable:hover {
    color: #4fc3f7;
}
.admin-dashboard-table th.sort-active {
    color: #4fc3f7;
}
.admin-dashboard-table th .sort-arrow {
    font-size: 8px;
    margin-left: 2px;
    opacity: 0.6;
}

/* ── Unit Status Badge (on tooltip) ──────────── */
.unit-tooltip {
    font-size: 12px !important;
    border: 1px solid rgba(79, 195, 247, 0.3) !important;
    background: rgba(16, 24, 48, 0.95) !important;
    color: #e0e0e0 !important;
}

/* ── Admin Session Steps Guide ──────────────── */
.admin-steps-guide {
    font-size: 10px;
    color: #aaa;
    line-height: 1.6;
    padding: 6px 8px;
    background: #0a1628;
    border: 1px solid #1a3a5c;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* ── Session Wizard Step Indicator ──────────── */
.wizard-steps-indicator {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    justify-content: center;
}
.wizard-step-dot {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    font-size: 10px;
    color: #666;
    border-radius: 12px;
    background: rgba(15, 52, 96, 0.3);
    transition: all 0.2s;
}
.wizard-step-dot span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(15, 52, 96, 0.5);
    font-size: 10px;
    font-weight: 700;
    color: #888;
}
.wizard-step-dot.active {
    color: #4fc3f7;
    background: rgba(15, 52, 96, 0.6);
}
.wizard-step-dot.active span {
    background: #0d3460;
    color: #4fc3f7;
}
.wizard-step-dot.done {
    color: #81c784;
}
.wizard-step-dot.done span {
    background: #1b5e20;
    color: #a5d6a7;
}

/* ── CoC Bulk Action Bar ───────────────────── */
.coc-bulk-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px;
    background: rgba(15, 52, 96, 0.3);
    border: 1px solid rgba(15, 52, 96, 0.5);
    border-radius: 4px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

/* ── Unit Type Editor Floating Window ─────────── */
.utype-float { width: 560px; }
.utype-layout {
    display: flex;
    gap: 14px;
}
.utype-form-col { flex: 1; min-width: 0; }
.utype-preview-col {
    width: 140px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.utype-section {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(79,195,247,0.08);
}
.utype-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.utype-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #4fc3f7;
    margin-bottom: 6px;
}
.utype-sidc-input {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.5px;
}
.utype-preview-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.utype-preview-card {
    background: rgba(0,0,0,0.25);
    border: 1px solid #0f3460;
    border-radius: 6px;
    padding: 6px;
    text-align: center;
}
.utype-preview-label {
    font-size: 9px;
    font-weight: 700;
    color: #90caf9;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.utype-preview-symbol {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.utype-preview-symbol svg { max-width: 52px; max-height: 52px; }
.utype-preview-sidc-text {
    font-size: 8px;
    color: #555;
    font-family: monospace;
    margin-top: 2px;
    word-break: break-all;
}
.utype-preview-stats {
    font-size: 10px;
    color: #aaa;
    line-height: 1.6;
    margin-top: 4px;
    padding: 6px;
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
}
.utype-preview-stats .utype-stat-line {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}
.utype-preview-stats .utype-stat-val {
    color: #e0e0e0;
    font-weight: 600;
    font-family: monospace;
}

/* ── Unit Type Registry ──────────────────────── */
.unit-type-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: #1a1a2e;
    border-radius: 4px;
    margin-bottom: 3px;
    font-size: 11px;
    border-left: 3px solid #1565c0;
    cursor: pointer;
    transition: background 0.12s;
}
.unit-type-item:hover { background: #222844; }
.unit-type-item.is-hq { border-left-color: #ff9800; }
.unit-type-preview {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.unit-type-info {
    flex: 1;
    min-width: 0;
}
.unit-type-label {
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.unit-type-stats {
    font-size: 9px;
    color: #888;
    white-space: nowrap;
}
.unit-type-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

/* ── Sidebar Credits ─────────────────────────── */
#sidebar-credits {
    padding: 6px 12px;
    text-align: center;
    font-size: 10px;
    color: #555;
    border-top: 1px solid rgba(15, 52, 96, 0.3);
    flex-shrink: 0;
    letter-spacing: 0.3px;
}
#sidebar-credits span {
    color: #666;
}
#sidebar-credits .credits-sep {
    margin: 0 4px;
    color: #444;
}
#sidebar-credits .app-version {
    color: #4fc3f7;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 9px;
    opacity: 0.7;
}

/* ── Map Control Overlay (top-right, Leaflet control) ── */
.map-ctrl-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    pointer-events: auto;
}
.map-ctrl-groups {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.map-ctrl-toggle-btn {
    width: 100%;
    height: 16px;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 5px 5px 0 0;
    background: rgba(16, 24, 48, 0.75);
    color: #8eafc0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    margin-bottom: 2px;
}
.map-ctrl-toggle-btn:hover {
    background: rgba(26, 82, 118, 0.8);
    color: #fff;
    border-color: #4fc3f7;
}
/* ── Collapsed state: larger pill button ── */
.map-ctrl-toggle-btn.collapsed {
    width: auto;
    min-width: 36px;
    height: 30px;
    padding: 0 14px;
    font-size: 15px;
    border-radius: 5px;
    border: 1px solid rgba(79, 195, 247, 0.45);
    background: rgba(16, 24, 48, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    color: #4fc3f7;
    gap: 6px;
    margin-bottom: 0;
}
.map-ctrl-toggle-btn.collapsed:hover {
    background: rgba(26, 82, 118, 0.9);
    border-color: #4fc3f7;
    color: #fff;
    box-shadow: 0 2px 12px rgba(79, 195, 247, 0.25);
}
.map-ctrl-overlay {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2px;
    background: rgba(16, 24, 48, 0.85);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 5px;
    padding: 3px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
}
.map-ctrl-overlay .topbar-icon-btn {
    width: 30px;
    height: 28px;
    font-size: 14px;
    color: #bbb;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
    padding: 0;
}
.map-ctrl-overlay .topbar-icon-btn:hover {
    background: rgba(26, 82, 118, 0.8);
    border-color: #4fc3f7;
    color: #fff;
}
.map-ctrl-overlay .topbar-icon-btn.toggled-off {
    opacity: 0.35;
}
.map-ctrl-overlay .topbar-icon-btn.toggled-off:hover {
    opacity: 0.6;
}

/* ── CoC User Assign Button (improved) ───────── */
.coc-user-assign-btn {
    font-size: 11px;
    width: 22px;
    height: 18px;
    padding: 0;
    border-radius: 3px;
    background: rgba(76, 175, 80, 0.08);
    border: 1px solid rgba(76, 175, 80, 0.25);
    color: #81c784;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    opacity: 0;
}
.coc-node:hover .coc-user-assign-btn {
    opacity: 1;
}
.coc-user-assign-btn:hover {
    background: rgba(76, 175, 80, 0.25);
    color: #a5d6a7;
    border-color: #4caf50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.3);
}

/* ── Dashboard clickable unit name ───────────── */
.dashboard-unit-name {
    cursor: pointer;
    transition: color 0.12s;
    color: #e0e0e0;
}
.dashboard-unit-name:hover {
    color: #4fc3f7;
    text-decoration: underline;
}

/* ── Terrain Overlay Styles ──────────────────── */
.terrain-legend {
    background: rgba(26, 26, 46, 0.92);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 11px;
    color: #e0e0e0;
    line-height: 1.6;
    max-height: 260px;
    overflow-y: auto;
    backdrop-filter: blur(6px);
}
.terrain-legend b {
    color: #4fc3f7;
    font-size: 12px;
}
.terrain-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.terrain-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.2);
    vertical-align: middle;
}

.terrain-tooltip {
    background: rgba(26, 26, 46, 0.95) !important;
    border: 1px solid rgba(79, 195, 247, 0.3) !important;
    border-radius: 6px !important;
    color: #e0e0e0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
}
.terrain-tooltip::before {
    border-right-color: rgba(79, 195, 247, 0.3) !important;
}

/* Terrain admin painting */
.terrain-paint-toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}
.terrain-paint-toolbar select {
    background: #1a1a2e;
    color: #e0e0e0;
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
}
.terrain-paint-toolbar button {
    font-size: 11px;
    padding: 3px 10px;
}
.terrain-stats-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.terrain-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    color: #1a1a2e;
    font-weight: 600;
}

/* Terrain analysis progress bar */
.terrain-progress-bar {
    width: 100%;
    height: 14px;
    background: rgba(15, 52, 96, 0.6);
    border-radius: 7px;
    border: 1px solid rgba(79, 195, 247, 0.25);
    overflow: hidden;
    position: relative;
}
.terrain-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1b5e20, #2e7d32, #43a047);
    border-radius: 7px;
    transition: width 0.3s ease;
    position: relative;
}
.terrain-progress-fill.error {
    background: linear-gradient(90deg, #c62828, #e53935);
}
.terrain-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.08) 50%,
        transparent 100%
    );
    animation: terrain-progress-shine 1.5s ease-in-out infinite;
}
@keyframes terrain-progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* ── Map Objects (Obstacles & Structures) ─────── */
.map-obj-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.map-obj-place-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: #0d1628;
    border: 1px solid #1a3a5c;
    border-radius: 4px;
    color: #ccc;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
}
.map-obj-place-btn:hover {
    background: #162a4a;
    border-color: #4fc3f7;
    color: #fff;
}
.map-obj-place-btn.active {
    background: #1b5e20;
    border-color: #4caf50;
    color: #a5d6a7;
}
.map-obj-btn-icon {
    font-size: 14px;
    flex-shrink: 0;
}
.map-obj-btn-label {
    font-size: 10px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-obj-list-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    margin-bottom: 2px;
    background: #0a1628;
    border-radius: 3px;
    font-size: 11px;
}
.map-obj-list-item span:first-child {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.map-obj-list-del {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.map-obj-list-del:hover {
    opacity: 1;
}

/* Map object marker icon styles */
.map-obj-icon {
    background: none !important;
    border: none !important;
}
/* Ensure invisible hit-area rectangles for map objects stay invisible */
.map-obj-icon path,
.leaflet-overlay-pane path[stroke="none"] {
    outline: none !important;
}
.map-obj-point {
    font-size: 18px;
    text-align: center;
    line-height: 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid;
    background: rgba(10, 22, 40, 0.8);
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.15s;
}
.map-obj-point:hover {
    transform: scale(1.15);
}
.map-obj-svg-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    cursor: pointer;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
    transition: transform 0.15s;
}
.map-obj-svg-wrap:hover {
    transform: scale(1.15);
}
/* NATO line decoration markers (non-interactive) */
.map-obj-deco {
    background: none !important;
    border: none !important;
    pointer-events: none;
}
.map-obj-tooltip {
    background: rgba(10, 22, 40, 0.92) !important;
    border: 1px solid rgba(79, 195, 247, 0.3) !important;
    color: #e0e0e0 !important;
    font-size: 11px !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
}

/* ── Bottom Command Panel ─────────────────────── */
/* Two states: collapsed (tab bar) ↔ open (wide content). */
#command-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(calc(-50% - 130px));
    width: clamp(340px, 28vw, 440px);
    z-index: 2000;
    background: rgba(11, 17, 34, 0.97);
    border: 1px solid rgba(79, 195, 247, 0.18);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    box-shadow:
        0 -3px 24px rgba(0, 0, 0, 0.5),
        0 4px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(79, 195, 247, 0.08),
        0 -1px 8px rgba(79, 195, 247, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Subtle top accent glow line */
#command-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 195, 247, 0.3), transparent);
    pointer-events: none;
    z-index: 1;
}
/* Resize handle at top edge */
.cmd-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    cursor: ns-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.15s;
}
.cmd-resize-handle:hover {
    background: linear-gradient(180deg, rgba(79, 195, 247, 0.25), transparent);
}
#command-panel.resizing {
    transition: none !important;
}
#command-panel.resizing .cmd-tab-panel {
    transition: none !important;
}
/* Expand to full width on hover or when pinned */
#command-panel.hovered,
#command-panel.expanded {
    width: clamp(700px, 62vw, 1000px);
}
/* Default: tab panels hidden (collapsed/minimized) */
#command-panel .cmd-tab-panel {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}
/* On hover or when pinned (.expanded) → show at full maximized size */
#command-panel.hovered .cmd-tab-panel.active,
#command-panel.expanded .cmd-tab-panel.active {
    max-height: var(--cmd-panel-height, 50vh);
    height: var(--cmd-panel-height, 320px);
    min-height: 300px;
    opacity: 1;
    padding-top: 8px;
    padding-bottom: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
/* Prevent collapsed panel from blocking elements behind it */
#command-panel:not(.hovered):not(.expanded) {
    pointer-events: none;
}
#command-panel:not(.hovered):not(.expanded) #command-panel-header,
#command-panel:not(.hovered):not(.expanded) #command-panel-header * {
    pointer-events: auto;
}
/* Hide meta badges and toggle when collapsed (only show tabs) */
#command-panel:not(.hovered):not(.expanded) .cmd-meta,
#command-panel:not(.hovered):not(.expanded) .cmd-toggle-btn {
    display: none;
}
/* Radio messages container sizing */
#command-panel .cmd-radio-messages {
    max-height: calc(50vh - 100px);
    min-height: 140px;
}
/* Textarea and input row fill space (Orders tab) */
#cmd-orders .cmd-input-row {
    flex: 1 1 0;
    display: flex;
    align-items: stretch;
    min-height: 0;
}
#cmd-orders .cmd-input-row .cmd-textarea {
    min-height: 60px;
    max-height: none;
    height: 100%;
    flex: 1;
}
/* Radio tab: messages take priority, input row is compact */
#cmd-radio .cmd-radio-messages {
    flex: 1;
    max-height: none;
    min-height: 80px;
}
#cmd-radio .cmd-input-row {
    flex: 0 0 auto;
    align-items: flex-end;
}
#cmd-radio .cmd-input-row .cmd-textarea {
    min-height: 42px;
    max-height: 80px;
    height: 42px;
    flex: 1;
    resize: none;
}
#command-panel .cmd-input-row .cmd-send-btn {
    align-self: center;
}
/* Action buttons column (pick coords + submit) */
.cmd-input-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-self: stretch;
    justify-content: flex-start;
    padding-top: 4px;
}
/* Pick-coordinates button */
.cmd-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 6px;
    color: #4fc3f7;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.cmd-action-btn svg {
    display: block;
    flex-shrink: 0;
}
.cmd-action-btn:hover {
    background: rgba(79, 195, 247, 0.15);
    border-color: rgba(79, 195, 247, 0.4);
    color: #81d4fa;
}
.cmd-action-btn.active {
    background: rgba(79, 195, 247, 0.2);
    border-color: rgba(79, 195, 247, 0.5);
    color: #4fc3f7;
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.3);
    animation: pick-pulse 1.2s ease-in-out infinite;
}
/* Cancel orders button — red/danger accent */
.cmd-cancel-btn {
    color: #ef5350;
    background: rgba(239, 83, 80, 0.08);
    border-color: rgba(239, 83, 80, 0.25);
}
.cmd-cancel-btn:hover {
    color: #ff7043;
    background: rgba(239, 83, 80, 0.18);
    border-color: rgba(239, 83, 80, 0.45);
}
@keyframes pick-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(79, 195, 247, 0.2); }
    50% { box-shadow: 0 0 12px rgba(79, 195, 247, 0.5); }
}
/* Map crosshair cursor during coordinate picking */
/* Force crosshair cursor on EVERYTHING when picking/LOS mode is active */
.map-picking, .map-picking *,
.map-los-checking, .map-los-checking * {
    cursor: crosshair !important;
}

/* When coordinate-picking or LOS-checking is active, make all interactive
   Leaflet layers AND their children transparent to mouse events so clicks
   fall through to the map tile layer. Individual elements are faded via JS
   only when the cursor is directly over them (see units.js, map_objects.js). */
.map-picking .leaflet-marker-pane,
.map-picking .leaflet-marker-pane *,
.map-picking .leaflet-overlay-pane,
.map-picking .leaflet-overlay-pane *,
.map-picking .leaflet-shadow-pane,
.map-picking .leaflet-shadow-pane *,
.map-picking .leaflet-popup-pane,
.map-picking .leaflet-popup-pane *,
.map-picking .leaflet-tooltip-pane,
.map-picking .leaflet-tooltip-pane *,
.map-los-checking .leaflet-marker-pane,
.map-los-checking .leaflet-marker-pane *,
.map-los-checking .leaflet-overlay-pane,
.map-los-checking .leaflet-overlay-pane *,
.map-los-checking .leaflet-shadow-pane,
.map-los-checking .leaflet-shadow-pane *,
.map-los-checking .leaflet-popup-pane,
.map-los-checking .leaflet-popup-pane *,
.map-los-checking .leaflet-tooltip-pane,
.map-los-checking .leaflet-tooltip-pane * {
    pointer-events: none !important;
    cursor: crosshair !important;
}

/* ── Radio Channel Toggle ─────────────────────── */
.radio-channel-toggle {
    display: flex;
    gap: 1px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 1px;
    margin-left: auto;
}
.radio-ch-btn {
    padding: 2px 8px;
    font-size: 9px;
    font-weight: 600;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: #667;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.radio-ch-btn:hover {
    color: #b0c4de;
    background: rgba(79, 195, 247, 0.08);
}
.radio-ch-btn.active {
    color: #4fc3f7;
    background: rgba(79, 195, 247, 0.15);
}

/* ── All Units Button ─────────────────────────── */
.cmd-chip-btn {
    height: 20px;
    padding: 0 6px;
    font-size: 10px;
    font-weight: 600;
    background: transparent;
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 3px;
    color: #90caf9;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.15s;
    white-space: nowrap;
}
.cmd-chip-btn:hover {
    background: rgba(79, 195, 247, 0.12);
    color: #4fc3f7;
    border-color: rgba(79, 195, 247, 0.4);
}

/* ── Log Export Button ────────────────────────── */
.log-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    background: transparent;
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 4px;
    color: #90caf9;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.log-export-btn:hover {
    background: rgba(79, 195, 247, 0.12);
    color: #4fc3f7;
    border-color: rgba(79, 195, 247, 0.4);
}
.log-export-btn span {
    font-size: 10px;
}

/* ── Log Item Icons ───────────────────────────── */
.log-time {
    color: #556;
    font-size: 10px;
    font-family: 'Consolas', 'Courier New', monospace;
    margin-right: 4px;
}
.log-icon {
    margin-right: 2px;
}

/* ── Radio LED (new message indicator) ───────── */
.radio-led {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 5px;
    border-radius: 8px;
    background: #e53935;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 6px rgba(229, 57, 53, 0.6), 0 0 12px rgba(229, 57, 53, 0.3);
    animation: radio-led-blink 1s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes radio-led-blink {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 6px rgba(229, 57, 53, 0.7), 0 0 14px rgba(229, 57, 53, 0.4);
    }
    50% {
        opacity: 0.25;
        box-shadow: 0 0 2px rgba(229, 57, 53, 0.2);
    }
}
#command-panel-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: linear-gradient(180deg, rgba(15, 27, 56, 0.8) 0%, rgba(11, 17, 34, 0.4) 100%);
    border-bottom: 1px solid rgba(79, 195, 247, 0.08);
    cursor: default;
    user-select: none;
}
.cmd-tabs {
    display: flex;
    gap: 2px;
}
.cmd-tab-btn {
    padding: 4px 14px;
    font-size: 11px;
    font-weight: 600;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #667788;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    letter-spacing: 0.4px;
}
.cmd-tab-btn:hover {
    color: #b0c4de;
    background: rgba(79, 195, 247, 0.06);
}
.cmd-tab-btn.active {
    color: #4fc3f7;
    background: rgba(79, 195, 247, 0.1);
    border-color: rgba(79, 195, 247, 0.2);
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.05);
}
.cmd-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cmd-author-badge {
    font-size: 10px;
    color: #81c784;
    font-weight: 600;
    white-space: nowrap;
}
.cmd-datetime-badge {
    font-size: 10px;
    color: #90caf9;
    font-family: 'Consolas', 'Courier New', monospace;
    white-space: nowrap;
    opacity: 0.7;
}
.cmd-toggle-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 10px;
    background: transparent;
    border: 1px solid rgba(79, 195, 247, 0.15);
    border-radius: 4px;
    color: #778899;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.cmd-toggle-btn:hover {
    background: rgba(79, 195, 247, 0.1);
    color: #4fc3f7;
    border-color: rgba(79, 195, 247, 0.3);
}

/* Command tab panels */
.cmd-tab-panel {
    display: none;
    padding: 0 12px;
}
.cmd-tab-panel.active {
    display: block;
}

/* Selected units row */
.cmd-selected-units {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 5px;
    min-height: 24px;
}
.cmd-unit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    flex: 1;
    align-items: center;
    min-height: 20px;
}
.cmd-hint {
    color: #556677;
    font-size: 10px;
    font-style: italic;
}
.cmd-chip-clear {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 11px;
    background: transparent;
    border: 1px solid rgba(239, 83, 80, 0.2);
    border-radius: 3px;
    color: #888;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.cmd-chip-clear:hover {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
    border-color: rgba(239, 83, 80, 0.4);
}

/* Input row (shared between orders & radio) */
.cmd-input-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}
.cmd-textarea {
    flex: 1;
    padding: 8px 12px;
    background: rgba(8, 12, 24, 0.7);
    border: 1px solid rgba(79, 195, 247, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    resize: none;
    min-height: 52px;
    max-height: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow-y: auto;
}
.cmd-textarea:focus {
    outline: none;
    border-color: rgba(79, 195, 247, 0.3);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.05);
}
.cmd-textarea::placeholder {
    color: #3a4a5c;
    font-style: italic;
}
.cmd-send-btn {
    width: 34px;
    height: 34px;
    margin-top: 9px;
    padding: 0;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    border: 1px solid rgba(76, 175, 80, 0.35);
    border-radius: 8px;
    color: #c8e6c9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.cmd-send-btn:hover {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    border-color: rgba(76, 175, 80, 0.6);
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.3);
    color: #fff;
}
.cmd-send-btn:active {
    transform: scale(0.94);
}
.cmd-send-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Unit chip (reuses .orders-unit-chip concept but refined) */
.cmd-unit-chips .orders-unit-chip {
    padding: 1px 7px;
    font-size: 9px;
    border-radius: 10px;
}

/* ── Radio Panel ─────────────────────────────── */
.cmd-radio-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.radio-clear-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #999;
    cursor: pointer;
    font-size: 12px;
    padding: 3px 8px;
    line-height: 1;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
    min-width: 24px;
}
.radio-clear-btn:hover {
    color: #ef5350;
    border-color: rgba(239, 83, 80, 0.4);
}
.cmd-radio-select {
    flex: 1;
    padding: 4px 8px;
    font-size: 11px;
    background: rgba(10, 16, 30, 0.8);
    border: 1px solid rgba(79, 195, 247, 0.15);
    border-radius: 5px;
    color: #e0e0e0;
    cursor: pointer;
    outline: none;
}
.cmd-radio-select:focus {
    border-color: rgba(79, 195, 247, 0.35);
}
.cmd-radio-select option {
    background: #0d1628;
    color: #e0e0e0;
}
.cmd-radio-freq {
    font-size: 9px;
    font-weight: 700;
    color: #4caf50;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    opacity: 0.7;
}
.cmd-radio-messages {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 32px;
    flex: 1;
}
.radio-msg {
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.45;
    max-width: 85%;
    word-break: break-word;
    position: relative;
    transition: background 0.15s;
}
.radio-msg.msg-own {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(33, 100, 200, 0.10));
    border: 1px solid rgba(33, 150, 243, 0.25);
    border-radius: 12px 12px 12px 4px;
    color: #b3d9ff;
}
.radio-msg.msg-other {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.10), rgba(56, 142, 60, 0.06));
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 12px 12px 4px 12px;
    color: #c8e6c9;
}
.radio-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}
.radio-msg-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 8px;
    color: #556;
    flex-shrink: 0;
    white-space: nowrap;
}
.radio-msg-sender {
    font-size: 9px;
    font-weight: 700;
    color: #90caf9;
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}
.radio-from {
    color: inherit;
}
.radio-arrow {
    color: #556;
    font-weight: 400;
    margin: 0 3px;
    font-size: 10px;
}
.radio-to {
    color: #78909c;
    font-weight: 600;
}
.radio-msg.msg-own .radio-msg-sender {
    color: #64b5f6;
}
.radio-msg.msg-other .radio-msg-sender .radio-from {
    color: #81c784;
}
/* msg-order from→to colors */
.radio-msg.msg-order .radio-msg-sender .radio-from {
    color: #ffa726;
}
.radio-msg.msg-order .radio-msg-sender .radio-to {
    color: #ffcc80;
}
/* msg-unit from→to colors */
.radio-msg.msg-unit .radio-msg-sender .radio-from {
    color: #66bb6a;
}
.radio-msg.msg-unit .radio-msg-sender .radio-to {
    color: #a5d6a7;
}
.radio-msg-text {
    color: #ddd;
}
/* Reply button on unit messages */
.radio-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(79, 195, 247, 0.10);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 10px;
    color: #4fc3f7;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.15s, transform 0.1s;
    white-space: nowrap;
    line-height: 1.4;
    flex-shrink: 0;
    margin-left: 4px;
}
.radio-msg:hover .radio-reply-btn {
    opacity: 1;
}
.radio-reply-btn:hover {
    background: rgba(79, 195, 247, 0.25);
    border-color: rgba(79, 195, 247, 0.5);
    color: #fff;
    transform: scale(1.05);
}
.radio-reply-btn:active {
    transform: scale(0.95);
}
.radio-msg.msg-system {
    align-self: center;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    color: #667;
    font-size: 10px;
    font-style: italic;
    text-align: center;
    max-width: 100%;
    border-radius: 8px;
}
.radio-empty-hint {
    color: #445;
    font-size: 10px;
    font-style: italic;
    text-align: center;
    padding: 8px;
}

/* ── Smoke polygon animation ──────────────────────── */
.smoke-polygon {
    animation: smoke-drift 4s ease-in-out infinite;
    filter: blur(2px);
}
.smoke-cloud {
    animation: smoke-cloud-drift 5s ease-in-out infinite;
    filter: blur(6px);
}
.smoke-cloud:nth-child(odd) {
    animation-delay: -2s;
    animation-duration: 6s;
}
@keyframes smoke-drift {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.35; }
}
@keyframes smoke-cloud-drift {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    33% { opacity: 0.4; transform: scale(1.05); }
    66% { opacity: 0.55; transform: scale(0.95); }
}

/* ── Artillery / combat impact effects ──────────── */
.impact-flash {
    animation: impact-flash-anim 0.6s ease-out forwards;
}
@keyframes impact-flash-anim {
    0% { opacity: 1; }
    30% { opacity: 0.9; }
    100% { opacity: 0; }
}
.impact-blast {
    animation: impact-blast-anim 3s ease-out forwards;
}
@keyframes impact-blast-anim {
    0% { opacity: 0.8; }
    20% { opacity: 0.6; }
    100% { opacity: 0; }
}
.impact-shockwave {
    animation: impact-shock-anim 2s ease-out forwards;
}
@keyframes impact-shock-anim {
    0% { opacity: 0.6; }
    100% { opacity: 0; }
}
.impact-smoke {
    animation: impact-smoke-anim 20s ease-out forwards;
    filter: blur(4px);
}
@keyframes impact-smoke-anim {
    0% { opacity: 0.3; }
    30% { opacity: 0.2; }
    100% { opacity: 0; }
}

/* ── KDialogs – Themed modal dialogs ───────────── */
.kdialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: kdialog-fadein 0.15s ease-out;
}
@keyframes kdialog-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.kdialog {
    background: #1e2a3a;
    border: 1px solid rgba(79,195,247,0.25);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(79,195,247,0.08);
    min-width: 280px;
    max-width: 400px;
    width: 90vw;
    animation: kdialog-slidein 0.2s ease-out;
    overflow: hidden;
}
@keyframes kdialog-slidein {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.kdialog.kdialog-dangerous {
    border-color: rgba(239,83,80,0.35);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(239,83,80,0.1);
}
.kdialog-header {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #b0bec5;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.15);
}
.kdialog-dangerous .kdialog-header {
    color: #ef9a9a;
}
.kdialog-body {
    padding: 14px 16px;
}
.kdialog-message {
    font-size: 12.5px;
    line-height: 1.55;
    color: #cfd8dc;
    word-break: break-word;
}
.kdialog-input,
.kdialog-select {
    width: 100%;
    margin-top: 10px;
    padding: 7px 10px;
    font-size: 12px;
    background: #151e2c;
    color: #e0e0e0;
    border: 1px solid rgba(79,195,247,0.2);
    border-radius: 5px;
    outline: none;
    transition: border-color 0.15s;
}
.kdialog-input:focus,
.kdialog-select:focus {
    border-color: rgba(79,195,247,0.5);
    box-shadow: 0 0 6px rgba(79,195,247,0.15);
}
.kdialog-footer {
    display: flex;
    gap: 8px;
    padding: 10px 16px 12px;
    justify-content: flex-end;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.08);
}
.kdialog-btn {
    padding: 6px 16px;
    font-size: 11.5px;
    font-weight: 500;
    border-radius: 5px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.2px;
}
.kdialog-btn:focus-visible {
    outline: 2px solid rgba(79,195,247,0.5);
    outline-offset: 1px;
}
.kdialog-btn-cancel {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
    color: #90a4ae;
}
.kdialog-btn-cancel:hover {
    background: rgba(255,255,255,0.1);
    color: #b0bec5;
}
.kdialog-btn-confirm,
.kdialog-btn-ok {
    background: rgba(79,195,247,0.15);
    border-color: rgba(79,195,247,0.3);
    color: #4fc3f7;
}
.kdialog-btn-confirm:hover,
.kdialog-btn-ok:hover {
    background: rgba(79,195,247,0.25);
    border-color: rgba(79,195,247,0.45);
    color: #81d4fa;
}
.kdialog-btn-danger {
    background: rgba(239,83,80,0.15);
    border-color: rgba(239,83,80,0.3);
    color: #ef5350;
}
.kdialog-btn-danger:hover {
    background: rgba(239,83,80,0.25);
    border-color: rgba(239,83,80,0.45);
    color: #ff7043;
}

/* ── Height Top Markers (elevation peaks) ──────────────── */
.height-top-icon {
    background: transparent !important;
    border: none !important;
}
.height-top-marker {
    text-align: center;
    white-space: nowrap;
}
.height-top-label {
    font-family: 'Arial Narrow', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #5D3A1A;
    text-shadow:
        -1px -1px 0 rgba(255,255,255,0.8),
         1px -1px 0 rgba(255,255,255,0.8),
        -1px  1px 0 rgba(255,255,255,0.8),
         1px  1px 0 rgba(255,255,255,0.8),
         0    0   3px rgba(255,255,255,0.6);
    line-height: 1;
    margin-top: -1px;
    letter-spacing: 0.5px;
}

