:root {
    --green: #7256d3;
    --blue: #3498db;
    --cyan: #00f2fe;
    --purple: #9b59b6;
    --dark: #1a1a1b;
    --trans: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    background: #111;
}

.mapboxgl-ctrl-logo {
    transform: scale(0.5) !important;
    transform-origin: bottom left !important;
    opacity: 0.25 !important;
}
.mapboxgl-ctrl-attrib {
    font-size: 7px !important;
    opacity: 0.2 !important;
    background: transparent !important;
    padding: 0 2px !important;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: 1;
}

/* --- WAZE-STYLE NAV BANNER --- */
.nav-banner {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 4000;
    display: none;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    transition: var(--trans);
}

/* Top card: turn arrow + distance + street */
.waze-turn-card {
    background: linear-gradient(135deg, #1a6b3c 0%, #4a2594 100%);
    color: #fff;
    padding: 14px 16px 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 3px solid #0e3d22;
}

.waze-arrow {
    font-size: 38px;
    min-width: 46px;
    text-align: center;
    color: rgba(255,255,255,0.95);
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.waze-turn-info { flex: 1; overflow: hidden; }

.waze-turn-dist {
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
}

.waze-turn-street {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.waze-turn-street.street-fade-out {
    opacity: 0;
    transform: translateY(-4px);
}
.waze-turn-street.street-fade-in {
    opacity: 1;
    transform: translateY(0);
}

.waze-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.7);
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bottom strip: ETA | mins | dist | recalc */
.waze-strip {
    background: #1e2128;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.waze-stat {
    flex: 1;
    text-align: center;
}

.waze-stat-val {
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.waze-stat-label {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.waze-vdivider {
    width: 1px;
    height: 26px;
    background: rgba(255,255,255,0.1);
    margin: 0 4px;
}

.waze-recalc {
    background: rgba(38,198,218,0.12);
    border: 1px solid rgba(38,198,218,0.35);
    color: #26c6da;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.top-nav {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 106px; /* leave room for sys-hud pill (~90px wide + 4px gap) */
    z-index: 3000;
    transition: var(--trans);
}

.input-group {
    background: #fff;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.address-fields-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.address-side-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

.address-primary-actions {
    display: flex;
    gap: 7px;
    width: 100%;
    flex: 0 0 auto;
}

.inputs-container {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.input-row {
    display: flex;
    align-items: center;
    background: #f1f3f5;
    border-radius: 8px;
    margin-bottom: 5px;
    padding-right: 10px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.addr-input {
    background: transparent;
    border: none;
    padding: 8px 10px;
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    box-sizing: border-box;
    font-size: 13px;
    outline: none;
    font-weight: 500;
    color: #333;
}

.loc-btn {
    background: none;
    border: none;
    color: var(--blue);
    cursor: pointer;
    font-size: 14px;
    flex: 0 0 auto;
}

.suggestions {
    position: absolute;
    background: white;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 4000;
    display: none;
    border: 1px solid rgba(0,0,0,0.06);
    overflow: hidden;
    animation: sugg-drop 0.16s ease;
}
@keyframes sugg-drop {
    from { opacity:0; transform:translateY(-6px) scale(0.98); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}

.suggestion-item {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #222;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.12s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.suggestion-item::before {
    content: '\f3c5';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 11px;
    flex-shrink: 0;
    opacity: 0.6;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover, .suggestion-item:active { background: #f0f4ff; }
.suggestion-item.history-item::before { content: '\f1da'; }

/* --- UI FLOTANTE DINÁMICA --- */
#speedo-float,
#recenter-btn {
    position: absolute;
    z-index: 2000;
    transition: var(--trans);
}

#speedo-float {
    left: 15px;
    width: 65px;
    height: 65px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border: 4px solid var(--dark);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

#recenter-btn {
    right: 15px;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: var(--blue);
    cursor: pointer;
    font-size: 14px;
}

.pos-min  { bottom: 92px !important; }
.pos-dash { bottom: 262px !important; }
.pos-routes { bottom: 390px !important; }

.speed-val {
    font-size: 22px;
    font-weight: 900;
    color: var(--dark);
    line-height: 1;
}

.speed-unit {
    font-size: 8px;
    font-weight: 800;
    color: #999;
    text-transform: uppercase;
}

/* --- FIRE TRUCK MARKER --- */
/* Wrapper siempre 44×58 - no cambia tamaño al tiltar (evita que Mapbox reancle) */
.truck-wrapper {
    position:relative; width:44px; height:58px;
    display:flex; align-items:center; justify-content:center;
}
.truck-2d-view { display:flex; align-items:center; justify-content:center; }
.truck-3d-view { display:none; }
.truck-wrapper.view-3d .truck-2d-view { display:none; }
.truck-wrapper.view-3d .truck-3d-view { display:block; }

/* Botón fullscreen */
#fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2000;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: var(--dark);
    cursor: pointer;
    font-size: 14px;
    transition: var(--trans);
}

.nav-active #fullscreen-btn { top: 195px; }
.nav-active #grade-btn { top: 241px; }

/* --- PANEL INFERIOR --- */
.bottom-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #14161b;
    border-radius: 24px 24px 0 0;
    padding: 10px 18px 18px 18px;
    box-shadow: 0 -1px 0 rgba(255,255,255,0.06), 0 -16px 48px rgba(0,0,0,0.55);
    z-index: 2100;
    transition: var(--trans);
    height: 380px;
    overflow: hidden;
}

.state-min    { transform: translateY(calc(100% - 82px)); }
.state-dash   { transform: translateY(calc(100% - 252px)); }
.state-routes { transform: translateY(0); }

.v2i-badge {
    font-size: 8px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    border: 1px solid #eee;
    color: #bbb;
    letter-spacing: 0.3px;
}

.v2i-online {
    background: rgba(114,86,211, 0.12);
    color: var(--green);
    border-color: var(--green);
    animation: v2i-pulse 2.5s ease-in-out infinite;
}

@keyframes v2i-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(114,86,211,0); }
    50%       { box-shadow: 0 0 0 4px rgba(114,86,211,0.25); }
}
@keyframes v2i-pulse-day {
    0%, 100% { box-shadow: 0 0 0 0 rgba(114,86,211,0); }
    50%       { box-shadow: 0 0 0 4px rgba(114,86,211,0.45); }
}

/* Congestion badge inside turn card */
.nav-congestion-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: none;
    align-self: flex-start;
    margin-top: 3px;
}

.btn-main {
    background: var(--green);
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 14px;
    font-weight: 800;
    width: 100%;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.3px;
    margin-top: 10px;
}

.btn-main:disabled { background: #ccc; cursor: not-allowed; }

.route-card {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1.5px solid #eef0f2;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    cursor: pointer;
    transition: 0.18s;
    color: #333;
    background: #fafafa;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.route-card:hover { background: #f4f6ff; border-color: #d8dcf0; }
.route-card:active { transform: scale(0.97); background: #ecf0ff; }

/* Route options panel header */
.route-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f2f4;
}
.route-panel-title {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #aaa;
}
.route-panel-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 8px;
    transition: 0.15s;
}
.route-panel-toggle:active { background: #f1f3f5; }

/* Input clear button */
.input-clear-btn {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 0 4px;
    font-size: 13px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
    line-height: 1;
}
.input-clear-btn.visible {
    opacity: 1;
    pointer-events: auto;
}
.input-clear-btn:active { color: #e74c3c; }

.nav-active .top-nav    { transform: translateY(-200%); opacity:0; pointer-events:none; }
.nav-active .nav-banner { display: flex; }
.routes-open .top-nav   { transform: translateY(-200%); opacity:0; pointer-events:none; }

/* Clip any overflow so slid-away elements don't peek */
#map { overflow: hidden; }

/* --- GRADE OVERLAY BUTTON + LEYENDA --- */
#grade-btn {
    position: absolute;
    top: 62px;
    right: 15px;
    z-index: 2000;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: var(--dark);
    cursor: pointer;
    font-size: 13px;
    transition: var(--trans);
}

#grade-btn.active { background: #e74c3c; color: #fff; }

#audio-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f3f5;
    color: var(--dark);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: var(--trans);
    flex-shrink: 0;
}
#audio-btn.mode-alerts { background: #f39c12; color: #fff; }
#audio-btn.mode-off    { background: #2c2c2c; color: #666; }

#grade-legend {
    position: absolute;
    top: 158px;
    right: 10px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 10px 14px;
    z-index: 2000;
    display: none;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: grab;
}

#grade-legend:active { cursor: grabbing; }

#grade-legend .leg-title { font-size: 9px; color: #999; margin-bottom: 7px; }

.leg-item { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.leg-bar  { width: 18px; height: 4px; border-radius: 2px; }

/* --- SAVINGS PANEL (post-ruta) --- */
#savings-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: #1a1a1b;
    color: #fff;
    border-radius: 20px;
    padding: 28px 24px 20px;
    z-index: 5000;
    display: none;
    min-width: 290px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

#savings-panel.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.savings-title {
    font-size: 11px;
    font-weight: 800;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.savings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
}

.savings-row:last-of-type { border-bottom: none; }
.savings-val { font-weight: 900; }
.savings-green { color: var(--green); }
.savings-dismiss {
    background: rgba(255,255,255,0.08);
    border: none;
    color: #fff;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-weight: 800;
    margin-top: 18px;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- SATELLITE BUTTON --- */
#satellite-btn {
    position: absolute;
    top: 109px;
    right: 15px;
    z-index: 2000;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: var(--dark);
    cursor: pointer;
    font-size: 13px;
    transition: var(--trans);
    border: none;
}
#satellite-btn.active { background: rgba(52,152,219,0.12); color: #3498db; border: 1.5px solid #3498db; }
.nav-active #satellite-btn { top: 287px; }

/* --- OTHER UNIT MARKERS --- */
.other-unit-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid rgba(255,255,255,0.95);
    box-shadow: 0 3px 12px rgba(0,0,0,0.45);
    cursor: pointer;
    font-size: 20px;
    transition: 0.15s;
}
.other-unit-marker:hover { transform: scale(1.12); }

/* --- QUICK DISPATCH CHIPS --- */
#quick-chips {
    overflow-x: auto;
    white-space: nowrap;
    margin-bottom: 8px;
    padding-bottom: 2px;
}
#quick-chips::-webkit-scrollbar { display: none; }
.quick-chip {
    display: inline-block;
    background: #f8f9fa;
    border: 1.5px solid #e8eaed;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 5px;
    white-space: nowrap;
    transition: 0.15s;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
}
.quick-chip:active { transform: scale(0.95); }
.quick-chip:hover, .quick-chip:active { background: #e8f4fd; border-color: var(--blue); color: var(--blue); }
.quick-chip.hospital:hover, .quick-chip.hospital:active { background: #fdecea; border-color: #e74c3c; color: #e74c3c; }
.quick-section-label {
    font-size: 9px;
    font-weight: 800;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* --- UNIT SELECTOR ROW --- */
#unit-row { display: flex; gap: 6px; margin-bottom: 10px; align-items: center; }
#unit-type-sel {
    flex: 1;
    background: #f1f3f5;
    border: none;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #333;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    cursor: pointer;
}
#unit-callsign {
    width: 80px;
    background: #f1f3f5;
    border: none;
    border-radius: 10px;
    padding: 8px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
}
#share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e0e3e8;
    background: #f1f3f5;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: var(--trans);
    display: flex;
    align-items: center;
    justify-content: center;
}
#share-btn.active {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(114,86,211,0.2);
}

/* --- SETTINGS PANEL --- */
.s-back-btn {
    background:none; border:none; color:var(--blue); font-weight:800;
    font-size:12px; cursor:pointer; padding:0; display:flex;
    align-items:center; gap:5px; font-family:'Inter',sans-serif;
}
.s-section-label {
    font-size:9px; font-weight:800; color:#bbb; text-transform:uppercase;
    letter-spacing:0.8px; margin:14px 0 8px;
}
.s-row {
    display:flex; justify-content:space-between; align-items:center;
    padding:10px 0; border-bottom:1px solid #f1f3f5;
}
.s-row:last-child { border-bottom:none; }
.s-row-label { font-size:12px; font-weight:700; color:#333; }
.s-row-sub   { font-size:10px; color:#aaa; margin-top:1px; }
.unit-type-grid {
    display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-bottom:4px;
}
.unit-btn {
    background:#f1f3f5; border:1.5px solid #e0e3e8; color:#666;
    font-size:12px; font-weight:800; padding:10px 6px; border-radius:10px;
    cursor:pointer; font-family:'Inter',sans-serif; transition:0.15s; text-align:center;
}
.unit-btn.active[data-type="engine"]    { background:#fdecea; border-color:#e74c3c; color:#e74c3c; }
.unit-btn.active[data-type="transport"] { background:#e3f2fd; border-color:#3498db; color:#3498db; }
.unit-btn.active[data-type="battalion"] { background:#fff8e1; border-color:#f39c12; color:#f39c12; }
.unit-btn.active[data-type="medic"]     { background:#f3f0fa; border-color:#7256d3; color:#7256d3; }
.s-toggle {
    position:relative; width:42px; height:24px; background:#ddd;
    border-radius:12px; cursor:pointer; transition:0.25s;
    flex-shrink:0; border:none;
}
.s-toggle.on { background:var(--green); }
.s-toggle::after {
    content:''; position:absolute; width:18px; height:18px;
    background:white; border-radius:50%; top:3px; left:3px;
    transition:0.25s; box-shadow:0 1px 4px rgba(0,0,0,0.25);
}
.s-toggle.on::after { left:21px; }
.s-cycle-btn {
    background:#f1f3f5; border:1.5px solid #e0e3e8; color:#555;
    font-size:11px; font-weight:800; padding:6px 13px; border-radius:20px;
    cursor:pointer; font-family:'Inter',sans-serif; transition:0.15s;
    white-space:nowrap;
}
#unit-callsign-settings {
    background:#f1f3f5; border:none; border-radius:10px;
    padding:7px 10px; font-size:12px; font-weight:600; color:#333;
    outline:none; font-family:'Inter',sans-serif; width:120px; text-align:right;
}

/* --- INCIDENT TYPE CHIPS --- */
.incident-chips { display:flex; gap:5px; margin-bottom:8px; }
.incident-chip {
    flex:1; background:#f8f9fa; border:1.5px solid #e8eaed; color:#888;
    font-size:10px; font-weight:800; padding:7px 3px; border-radius:10px;
    cursor:pointer; text-align:center; font-family:'Inter',sans-serif;
    transition:0.15s; white-space:nowrap; line-height:1.3;
}
.incident-chip:active { transform:scale(0.95); }
.incident-chip.active { background:#fdecea; border-color:#e74c3c; color:#e74c3c; box-shadow:0 2px 8px rgba(231,76,60,0.18); }
.incident-chip.active.ic-vehicle { background:#e3f2fd; border-color:#3498db; color:#3498db; box-shadow:0 2px 8px rgba(52,152,219,0.18); }
.incident-chip.active.ic-medical { background:#f3f0fa; border-color:#7256d3; color:#7256d3; box-shadow:0 2px 8px rgba(114,86,211,0.18); }
.incident-chip.active.ic-wildland { background:#f3f0fa; border-color:#4a2594; color:#4a2594; box-shadow:0 2px 8px rgba(74,37,148,0.18); }

/* --- COMPASS BUTTON --- */
#compass-btn {
    position:absolute; top:156px; right:15px; z-index:2000;
    width:38px; height:38px; background:rgba(255,255,255,0.92);
    backdrop-filter:blur(5px); border-radius:50%; display:none;
    align-items:center; justify-content:center;
    box-shadow:0 4px 15px rgba(0,0,0,0.15); cursor:pointer;
    font-size:18px; transition:var(--trans); border:none;
    color:var(--dark); flex-direction:column;
}
#compass-btn .compass-needle { font-size:16px; line-height:1; transition:transform 0.4s ease; }
#compass-btn .compass-n { font-size:7px; font-weight:900; color:#e74c3c; line-height:1; margin-top:1px; }
.nav-active #compass-btn { top:334px; }

/* --- HINT TOAST --- */
#hint-toast {
    position:absolute; bottom:100px; left:50%; transform:translateX(-50%);
    background:rgba(26,26,27,0.88); color:#fff; padding:10px 18px;
    border-radius:22px; z-index:5000; display:none; font-size:12px;
    font-weight:700; white-space:nowrap; box-shadow:0 8px 28px rgba(0,0,0,0.4);
    backdrop-filter:blur(10px); letter-spacing:0.1px;
}

/* --- ARRIVAL FLASH --- */
@keyframes arrival-pulse {
    0%,100% { box-shadow:0 12px 40px rgba(0,0,0,0.45); }
    25%,75%  { box-shadow:0 0 0 10px rgba(114,86,211,0.4),0 12px 40px rgba(0,0,0,0.45); }
    50%      { box-shadow:0 0 0 20px rgba(114,86,211,0.1),0 12px 40px rgba(0,0,0,0.45); }
}
.arrival-mode .waze-turn-card {
    background:linear-gradient(135deg,#4a2594,#7256d3) !important;
    animation:arrival-pulse 0.9s ease 4;
}

/* --- HYDRANT BUTTON --- */
#hydrant-btn {
    position:absolute; top:203px; right:15px; z-index:2000;
    width:38px; height:38px; background:rgba(255,255,255,0.92);
    backdrop-filter:blur(5px); border-radius:50%; display:flex;
    align-items:center; justify-content:center;
    box-shadow:0 4px 15px rgba(0,0,0,0.15); cursor:pointer;
    font-size:16px; transition:var(--trans); border:none; color:var(--dark);
}
#hydrant-btn.active { background:rgba(52,152,219,0.15); border:1.5px solid #3498db; }
.nav-active #hydrant-btn { top:381px; }

/* --- WIND WIDGET (wildland) --- */
#wind-widget {
    position:absolute; left:15px; z-index:2000; display:none;
    background:rgba(255,255,255,0.95); backdrop-filter:blur(8px);
    border-radius:14px; padding:10px 14px; min-width:95px;
    box-shadow:0 4px 20px rgba(0,0,0,0.15); border:1.5px solid rgba(74,37,148,0.3);
    transition:var(--trans);
}
#wind-widget .wind-title { font-size:8px;font-weight:800;color:#4a2594;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:4px; }
#wind-widget .wind-speed { font-size:22px;font-weight:900;color:#1a1a1b;line-height:1; }
#wind-widget .wind-unit  { font-size:9px;font-weight:700;color:#aaa; }
#wind-widget .wind-dir   { font-size:11px;font-weight:800;color:#555;margin-top:3px;display:flex;align-items:center;gap:4px; }
#wind-widget .wind-arrow { font-size:16px;display:inline-block;transition:transform 0.8s ease; }

/* --- UNIT STATUS CHIPS --- */
.status-chips { display:flex; gap:5px; margin-bottom:10px; }
.status-chip {
    flex:1; background:#f1f3f5; border:1.5px solid #e0e3e8; color:#888;
    font-size:9px; font-weight:800; padding:6px 3px; border-radius:8px;
    cursor:pointer; text-align:center; font-family:'Inter',sans-serif;
    transition:0.15s; white-space:nowrap;
}
.status-chip.active.s-enroute  { background:#fdecea; border-color:#e74c3c; color:#e74c3c; }
.status-chip.active.s-onscene  { background:#fff8e1; border-color:#f39c12; color:#f39c12; }
.status-chip.active.s-available{ background:#f3f0fa; border-color:#7256d3; color:#7256d3; }

/* --- ELEVATION PROFILE --- */
.elev-profile { margin-top:6px; opacity:0.7; }

/* --- IC PANEL --- */
#ic-panel {
    position:fixed; inset:0; z-index:6000; background:#0d1117;
    display:none; flex-direction:column; color:#fff; font-family:'Inter',sans-serif;
}
#ic-panel.visible { display:flex; }
.ic-header {
    background:#161b22; padding:14px 20px 12px;
    border-bottom:1px solid rgba(255,255,255,0.08);
    display:flex; justify-content:space-between; align-items:center; flex-shrink:0;
}
.ic-title { font-size:12px; font-weight:900; letter-spacing:1px; text-transform:uppercase; color:#e74c3c; }
.ic-close { background:rgba(255,255,255,0.08); border:none; color:#fff; width:32px; height:32px; border-radius:50%; cursor:pointer; font-size:14px; display:flex; align-items:center; justify-content:center; }
.ic-body  { display:flex; flex:1; overflow:hidden; }
.ic-sidebar { width:240px; background:#161b22; border-right:1px solid rgba(255,255,255,0.07); overflow-y:auto; flex-shrink:0; padding:10px 12px; }
.ic-map-area { flex:1; position:relative; }
#ic-map { width:100%; height:100%; }
.ic-section-label { font-size:9px; font-weight:800; color:#444; text-transform:uppercase; letter-spacing:0.8px; margin:10px 0 6px; }
.ic-incident-badge { background:#e74c3c18; border:1px solid #e74c3c44; border-radius:10px; padding:10px 12px; margin-bottom:10px; }
.ic-incident-type  { font-size:17px; font-weight:900; color:#e74c3c; }
.ic-incident-time  { font-size:10px; color:#666; margin-top:4px; }
.ic-unit-row { display:flex; align-items:center; gap:10px; padding:8px 6px; border-radius:8px; margin-bottom:4px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.05); }
.ic-unit-emoji    { font-size:18px; line-height:1; }
.ic-unit-callsign { font-size:12px; font-weight:800; }
.ic-unit-meta     { font-size:10px; color:#666; margin-top:2px; }
.ic-unit-eta      { color:#7256d3; font-weight:700; }
.ic-empty         { font-size:11px; color:#444; text-align:center; padding:20px 0; }

/* --- SCBA crew size buttons --- */
.scba-crew-size-btn {
    width:34px; height:34px; border-radius:50%;
    border:1.5px solid #374151; background:#1e2127;
    color:#888; font-size:12px; font-weight:800;
    cursor:pointer; font-family:'Inter',sans-serif;
    transition:0.15s;
}
.scba-crew-size-btn.active {
    background:#e74c3c22; border-color:#e74c3c; color:#e74c3c;
}

/* --- SCBA per-person timer card --- */
.scba-person-card {
    background:#1e2127; border-radius:12px; padding:12px;
    border:1.5px solid #2a2d35; text-align:center;
    transition:border-color 0.4s;
}
.scba-person-card.warning { border-color:#f39c12; }
.scba-person-card.critical { border-color:#e74c3c; animation:scba-pulse 0.8s ease infinite; }
@keyframes mayday-pulse {
    from { box-shadow: 0 0 8px 2px rgba(255,68,68,0.6); }
    to   { box-shadow: 0 0 20px 8px rgba(255,68,68,0.95); }
}
@keyframes scba-pulse {
    0%,100% { box-shadow:0 0 0 0 rgba(231,76,60,0); }
    50%      { box-shadow:0 0 0 8px rgba(231,76,60,0.25); }
}
.scba-person-name { font-size:10px; font-weight:800; color:#aaa; margin-bottom:4px; text-transform:uppercase; }
.scba-person-time { font-size:22px; font-weight:900; color:#fff; font-variant-numeric:tabular-nums; }
.scba-person-bar  { height:4px; background:#2a2d35; border-radius:2px; margin-top:6px; overflow:hidden; }
.scba-person-fill { height:100%; background:#7256d3; border-radius:2px; transition:width 1s linear, background 0.4s; }


/* --- PRE-PLAN MODE --- */
#preplan-btn {
    width:42px; background:#f8f9fa; border:1.5px solid #e8eaed;
    border-radius:12px; cursor:pointer; font-size:15px; flex-shrink:0;
    transition:var(--trans); display:flex; align-items:center; justify-content:center;
}
#preplan-btn.active { background:#3498db1a; border-color:#3498db; }

/* --- VOICE SEARCH --- */
#voice-btn.listening { color:#e74c3c !important; animation:mic-pulse 0.8s ease infinite; }
@keyframes mic-pulse {
    0%,100% { opacity:1; }
    50%      { opacity:0.4; }
}

/* --- NEARBY UNIT ALERT --- */
#nearby-alert {
    position:absolute; top:80px; left:12px; right:12px; z-index:3003;
    background:rgba(231,76,60,0.95); color:#fff; border-radius:14px;
    padding:10px 16px; font-size:11px; font-weight:800; text-align:center;
    display:none; backdrop-filter:blur(10px);
    box-shadow:0 6px 24px rgba(0,0,0,0.3); letter-spacing:0.1px;
    animation:slide-in 0.3s ease;
}
@keyframes slide-in {
    from { transform:translateY(-10px); opacity:0; }
    to   { transform:translateY(0); opacity:1; }
}

/* --- IC HOSPITAL STATUS --- */
.ic-hosp-row {
    display:flex; align-items:center; justify-content:space-between;
    padding:6px 4px; border-bottom:1px solid rgba(255,255,255,0.05);
}
.ic-hosp-row:last-child { border-bottom:none; }
.ic-hosp-name { font-size:11px; font-weight:700; color:#aaa; }
.ic-diversion-btn {
    font-size:9px; font-weight:900; padding:3px 9px; border-radius:8px;
    border:none; cursor:pointer; text-transform:uppercase; letter-spacing:0.3px;
    background:rgba(114,86,211,0.15); color:#7256d3; transition:0.15s;
}
.ic-diversion-btn.diversion {
    background:rgba(231,76,60,0.2); color:#e74c3c;
}

/* --- IC ASSIGN BUTTON --- */
.ic-assign-btn {
    font-size:9px; font-weight:900; padding:3px 8px; border-radius:6px;
    border:1px solid rgba(255,255,255,0.1); cursor:pointer;
    background:rgba(255,255,255,0.05); color:#aaa; transition:0.15s;
    margin-top:3px;
}
.ic-assign-btn.assigned { background:rgba(52,152,219,0.2); color:#3498db; border-color:#3498db44; }

/* --- LANDSCAPE IC IMPROVEMENTS --- */
@media (orientation: landscape) and (max-height: 500px) {
    #ic-panel .ic-body { flex-direction:row; }
    #ic-panel .ic-sidebar { width:200px; font-size:10px; }
    .ic-incident-type { font-size:13px; }
    .ic-unit-row { padding:5px 4px; }
}

/* --- NIGHT MODE UI PANEL --- */
body.night-ui .bottom-panel {
    background: #16202a;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
}
body.night-ui .input-group {
    background: #1e2c3a;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
body.night-ui .input-row { background: #253545; }
body.night-ui .addr-input { color: #e8edf2; }
body.night-ui #app-title  { color: #e8edf2; }
body.night-ui .v2i-badge  { color: #4a6070; border-color: #2a3a48; }
body.night-ui .v2i-online { color: var(--green) !important; border-color: var(--green) !important; }
body.night-ui .incident-chip { background: #1e2c3a; border-color: #2d4055; color: #6a8a9a; }
body.night-ui .incident-chip.active { background: #3a1a1a; border-color: #e74c3c; color: #e74c3c; }
body.night-ui .incident-chip.active.ic-vehicle { background: #1a2a3a; border-color: #3498db; color: #3498db; }
body.night-ui .incident-chip.active.ic-medical { background: #2a1c43; border-color: #7256d3; color: #7256d3; }
body.night-ui .incident-chip.active.ic-wildland { background: #2a1c43; border-color: #4a2594; color: #4a2594; }
body.night-ui .quick-section-label { color: #2d4055; }
body.night-ui .quick-chip { background: #1e2c3a; border-color: #2d4055; color: #6a8a9a; }
body.night-ui .route-card { background: #1e2c3a; border-color: #2d4055; color: #e8edf2; }
body.night-ui .s-section-label { color: #2d4055; }
body.night-ui .s-row { border-color: #1e2c3a; }
body.night-ui .s-row-label { color: #c0cdd8; }
body.night-ui .s-row-sub   { color: #4a6070; }
body.night-ui .unit-btn { background: #1e2c3a; border-color: #2d4055; color: #6a8a9a; }
body.night-ui #view-settings { color: #c0cdd8; }
body.night-ui .loc-btn { color: #4a8aab; }

/* --- SCENE SIZE-UP --- */
.su-check-label {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #1e2127;
    border: 1.5px solid #2a2d35;
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #ccc;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.su-check-label:has(input:checked) {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #1e0a08;
}
#sizeup-modal [type="radio"]:checked + label,
label:has(input[type="radio"]:checked) {
    border-color: #f39c12 !important;
    color: #f39c12 !important;
    background: #1e160a !important;
}

/* --- ERROR TOAST --- */
#error-toast {
    position: absolute;
    bottom: 86px;
    left: 15px;
    right: 15px;
    background: #c0392b;
    color: #fff;
    padding: 13px 16px;
    border-radius: 12px;
    z-index: 5000;
    display: none;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 13px;
    text-align: left;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

#error-toast-message {
    flex: 1 1 auto;
    min-width: 0;
}

#error-toast-dismiss {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

/* ── Chat ─────────────────────────────────────────────────────────────────── */
.qr-btn {
    background: rgba(74,144,217,0.12);
    border: 1px solid rgba(74,144,217,0.3);
    border-radius: 8px;
    color: #4a90d9;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
}
.chat-bubble { border-radius: 12px; padding: 8px 12px; max-width: 85%; font-size: 11px; line-height: 1.4; }
.chat-bubble.out { background: #1d3a5f; color: #e6edf3; align-self: flex-end; border-bottom-right-radius: 3px; }
.chat-bubble.in  { background: #21262d; color: #e6edf3; align-self: flex-start; border-bottom-left-radius: 3px; }
.chat-bubble .cb-from { font-size: 9px; font-weight: 800; color: #4a90d9; margin-bottom: 3px; }
.chat-bubble .cb-time  { font-size: 8px; color: #484f58; margin-top: 3px; text-align: right; }
#chat-messages::-webkit-scrollbar { width: 3px; }
#chat-messages::-webkit-scrollbar-thumb { background: #30363d; border-radius: 2px; }

/* ── Photo button in dispatcher ────────────────────────────────────────────── */
.dsp-photo-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1.5px solid #30363d; }

/* ── Dark bottom panel - default state for all child components ─────────── */
.incident-chip      { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1);  color: #777; }
.quick-chip         { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1);  color: #888; }
.route-card         { background: #1d2029; border-color: rgba(255,255,255,0.08); color: #dde1e7; box-shadow: none; }
.route-card:hover   { background: #252b38; border-color: rgba(255,255,255,0.16); }
.route-card:active  { transform: scale(0.97); background: #2a3045; }
.route-panel-header { border-bottom-color: rgba(255,255,255,0.08); }
.route-panel-title  { color: rgba(255,255,255,0.35); }
.route-panel-toggle:active { background: rgba(255,255,255,0.08); }
#unit-type-sel           { background: rgba(255,255,255,0.07); color: #dde1e7; }
#unit-callsign           { background: rgba(255,255,255,0.07); color: #dde1e7; }
#share-btn               { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: #555; }
.status-chip             { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: #777; }
.s-section-label         { color: rgba(255,255,255,0.28); }
.s-row                   { border-bottom-color: rgba(255,255,255,0.07); }
.s-row-label             { color: #dde1e7; }
.s-row-sub               { color: #555; }
.unit-btn                { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: #888; }
.s-cycle-btn             { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.1); color: #aaa; }
#unit-callsign-settings  { background: rgba(255,255,255,0.07); color: #dde1e7; }
#nfpa-stats              { background: rgba(255,255,255,0.04); color: #aaa; }
.btn-main:disabled       { background: #252830; color: #555; cursor: not-allowed; }
#preplan-btn             { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }

/* ── Dark search / input area ──────────────────────────────────────────────── */
.input-group             { background: #1a1d24; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.input-row               { background: rgba(255,255,255,0.07); }
.addr-input              { color: #dde1e7; }
.addr-input::placeholder { color: rgba(255,255,255,0.22); }
.loc-btn                 { color: rgba(255,255,255,0.4); }
.input-clear-btn         { color: rgba(255,255,255,0.3); }

/* ── Voice listening state ──────────────────────────────────────────────────── */
@keyframes pulse-mic {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
    50%       { box-shadow: 0 0 0 5px rgba(231,76,60,0.3); }
}
.listening { color: #e74c3c !important; animation: pulse-mic 1s ease-in-out infinite; }

/* ── Off-route warning pulse ───────────────────────────────────────────────── */
@keyframes pulse-warn {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

/* ── Day mode - applies whenever .night-ui is absent ──────────────────────── */
body:not(.night-ui) .bottom-panel {
    background: #f0f3f7;
    box-shadow: 0 -1px 0 rgba(0,0,0,0.08), 0 -12px 40px rgba(0,0,0,0.14);
}
/* Header icon buttons have inline rgba(255,255,255,0.08) - invisible on light */
body:not(.night-ui) #view-dash > div:first-child > button {
    background: rgba(0,0,0,0.06) !important;
}
body:not(.night-ui) #app-title           { color: #0d1117; }
body:not(.night-ui) .v2i-badge           { background: #1a2530; color: #6a8a9a; border-color: #2a3a48; }
body:not(.night-ui) .v2i-online          { background: rgba(114,86,211,0.15) !important; animation: v2i-pulse-day 2.5s ease-in-out infinite !important; }
body:not(.night-ui) .input-group         { background: #ffffff; box-shadow: 0 2px 14px rgba(0,0,0,0.09); }
body:not(.night-ui) .input-row           { background: #eaecf2; }
body:not(.night-ui) .addr-input          { color: #0d1117 !important; }
body:not(.night-ui) .addr-input::placeholder { color: rgba(0,0,0,0.3) !important; }
body:not(.night-ui) .loc-btn             { color: #4a6080; }
body:not(.night-ui) .input-clear-btn     { color: rgba(0,0,0,0.28); }
body:not(.night-ui) .incident-chip       { background: #e6eaf0; border-color: #bfc7d4; color: #3d4f60; }
body:not(.night-ui) .incident-chip.active { background: #fdecea; border-color: #e74c3c; color: #c0392b; }
body:not(.night-ui) .incident-chip.active.ic-vehicle  { background: #e8f4fd; border-color: #3498db; color: #2472a4; }
body:not(.night-ui) .incident-chip.active.ic-medical  { background: #f3f0fa; border-color: #7256d3; color: #7256d3; }
body:not(.night-ui) .incident-chip.active.ic-wildland { background: #f3f0fa; border-color: #4a2594; color: #4a2594; }
body:not(.night-ui) .quick-section-label { color: #a8b3be; }
body:not(.night-ui) .quick-chip          { background: #e6eaf0; border-color: #bfc7d4; color: #3d4f60; }
body:not(.night-ui) #preplan-btn         { background: #e6eaf0; border-color: #8fa0b4; }
body:not(.night-ui) .btn-main:disabled   { background: #d8dde5; color: #96a0aa; cursor: not-allowed; }
body:not(.night-ui) .route-card          { background: #ffffff; border-color: #d4dae3; color: #0d1117; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
body:not(.night-ui) .route-card:hover    { background: #edf1f6; border-color: #aab2bf; }
body:not(.night-ui) .route-panel-header  { border-bottom-color: rgba(0,0,0,0.07); }
body:not(.night-ui) .route-panel-title   { color: rgba(0,0,0,0.35); }
body:not(.night-ui) #unit-callsign       { background: #e6eaf0; color: #0d1117; }
body:not(.night-ui) .status-chip         { background: #e6eaf0; border-color: #bfc7d4; color: #3d4f60; }
body:not(.night-ui) .s-row-label         { color: #0d1117; }
body:not(.night-ui) .s-row-sub           { color: #6e7a8a; }
body:not(.night-ui) .unit-btn            { background: #e6eaf0; border-color: #bfc7d4; color: #3d4f60; }
body:not(.night-ui) #unit-callsign-settings { background: #e6eaf0; color: #0d1117; }
body:not(.night-ui) #nfpa-stats          { background: #e0e5ec; color: #4a5568; }
body:not(.night-ui) #share-btn           { background: #e6eaf0; border-color: #bfc7d4; color: #3d4f60; }
body:not(.night-ui) .s-cycle-btn         { background: #e6eaf0; border-color: #bfc7d4; color: #3d4f60; }
body:not(.night-ui) .s-section-label     { color: rgba(0,0,0,0.3); }
body:not(.night-ui) .s-row               { border-bottom-color: rgba(0,0,0,0.07); }

.ls-extra { display: none; }

.ls-collapse-tab {
    display: none;
    position: fixed;
    right: 260px; top: 50%;
    transform: translateY(-50%);
    width: 22px; height: 48px;
    background: #14161b;
    border: 1px solid rgba(255,255,255,0.12);
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 2200;
    padding: 0;
    transition: right 0.3s ease;
}

/* ─── LANDSCAPE MODE (phone rotated) ────────────────────────────────────── */
@media (orientation: landscape) and (max-height: 500px) {

    /* ── RIGHT SIDEBAR ────────────────────────────────────────────────────── */
    .bottom-panel {
        top: 0 !important; bottom: 0 !important;
        left: auto !important; right: 0 !important;
        width: 260px !important; height: 100% !important;
        border-radius: 20px 0 0 20px !important;
        transform: none !important;
        overflow-y: auto !important; overflow-x: hidden !important;
        padding: 10px 14px 16px !important;
        box-sizing: border-box !important;
    }
    .bottom-panel * { box-sizing: border-box; max-width: 100%; }

    /* Drag handle hidden - no swipe in landscape */
    .bottom-panel > div:first-child { display: none !important; }

    /* ── ELEMENTS THAT MUST CLEAR THE SIDEBAR ────────────────────────────── */
    .top-nav    { right: 268px !important; }
    .nav-banner { top: 8px; left: 8px; right: 268px !important; border-radius: 18px; }
    #sys-hud    { right: 268px !important; top: 4px !important; }

    /* Collapse tab visible only in landscape */
    .ls-collapse-tab { display: flex !important; }

    /* Collapsed: sidebar slides off, nav banner + top-nav expand to fill screen */
    .bottom-panel.ls-collapsed { transform: translateX(244px) !important; }
    body.ls-sidebar-collapsed .nav-banner  { right: 22px !important; }
    body.ls-sidebar-collapsed .top-nav     { right: 22px !important; }
    body.ls-sidebar-collapsed #recenter-btn  { right: 16px !important; }
    body.ls-sidebar-collapsed #mayday-btn    { right: 16px !important; }
    body.ls-sidebar-collapsed #hf-voice-btn  { right: 16px !important; }

    /* Hide the nav banner's unit-status row in landscape - sidebar has it */
    #quick-status-bar { display: none !important; }

    /* Stack from bottom: recenter(12) → MAYDAY(62) → voice(108) */
    #mayday-btn   { right: 272px !important; bottom: 62px !important;
                    top: auto !important; transform: none !important;
                    z-index: 5100 !important;
                    transition: right 0.3s cubic-bezier(0.4,0,0.2,1) !important; }
    #hf-voice-btn { right: 272px !important; bottom: 100px !important;
                    top: auto !important; left: auto !important;
                    z-index: 4500 !important;
                    transition: right 0.3s cubic-bezier(0.4,0,0.2,1) !important; }

    body.ls-sidebar-collapsed #hf-voice-btn { right: 16px !important; }

    /* Hide floating tool buttons - accessible via sidebar settings */
    #grade-btn, #satellite-btn, #compass-btn,
    #hydrant-btn, #coverage-btn, #buildings-btn,
    #mutual-aid-btn, #heatmap-btn { display: none !important; }

    /* ── SPEEDO - bottom-left corner ─────────────────────────────────────── */
    #speedo-float {
        left: 12px !important; bottom: 12px !important;
        top: auto !important; right: auto !important;
        width: 54px !important; height: 54px !important;
    }
    .speed-val  { font-size: 16px; }
    .speed-unit { font-size: 8px; }

    /* Recenter: bottom-right of map area - explicit left:auto so it doesn't land on speedo */
    #recenter-btn {
        left: auto !important; right: 272px !important;
        bottom: 12px !important; top: auto !important;
    }

    /* Turns + chat + photo - left side, stacked above speedo */
    #turn-list-btn   { left: 12px !important; bottom: 130px !important; top: auto !important; right: auto !important; }
    #chat-btn        { left: 12px !important; bottom: 78px !important;  top: auto !important; right: auto !important; }
    #scene-photo-btn { left: 12px !important; bottom: 182px !important; top: auto !important; right: auto !important; }

    /* ── COMPACT NAV BANNER ───────────────────────────────────────────────── */
    .waze-turn-card   { padding: 7px 10px; gap: 10px; }
    .waze-arrow       { font-size: 20px; min-width: 26px; }
    .waze-turn-dist   { font-size: 16px; }
    .waze-turn-street { font-size: 9px; margin-top: 1px; }
    .waze-strip       { padding: 5px 10px; }
    .waze-stat-val    { font-size: 11px; }
    .waze-stat-label  { font-size: 8px; }
    .waze-recalc      { font-size: 10px; padding: 4px 7px; }

    /* ── LANDSCAPE-ONLY SIDEBAR EXTRAS ───────────────────────────────────── */
    .ls-extra { display: block !important; }

    /* ── SIDEBAR CONTENT ──────────────────────────────────────────────────── */
    .incident-chips  { flex-wrap: wrap; gap: 4px; }
    .incident-chip   { padding: 5px 8px; font-size: 10px; }
    .status-chip     { padding: 4px 8px; font-size: 10px; }
    .btn-main        { padding: 9px; font-size: 12px; margin-top: 6px; }
    .route-card      { padding: 9px 11px; margin-bottom: 5px; }
    #view-options    { max-height: calc(100vh - 60px) !important; }
    #view-settings   { max-height: calc(100vh - 50px) !important; }
}
