/* ── GLOBAL UI COMPACT SCALE ────────────────────────────────────────────────
   Thu nhỏ tất cả UI containers 85% để tăng mật độ thông tin hiển thị.
   Map (#map, .leaflet-container) KHÔNG bị ảnh hưởng — chỉ panels/modals/popup.
   Nút chức năng (.gm-left-controls, .gm-bottom-controls) GIỮ 100% để dễ chạm.
   Popup (.leaflet-popup.pin-popup) đã có zoom 0.85 riêng từ trước.
──────────────────────────────────────────────────────────────────────────── */
.search-wrapper,
.floating-menu,
.welcome-modal-content,
.contrib-dialog,
#side-panel,
#bottom-panel,
#daily-briefing-panel,
#eph-timeline-bar,
#eph-panel {
    zoom: 0.85;
}

/* ── LIQUID GLASS COMPONENT ────────────────────────────────────────────────
   --glass-edge-color is updated dynamically by getSkyQualityAssessment()
   in app.js based on current sky conditions:
     Deep Cyan    → Clear/Milkyway conditions
     Vibrant Magenta → High Burn Score (≥65)
     Muddy Orange → Haze penalty active (humidity≥75 + visibility≤12km)
     Red          → Extreme CAPE (>1500)
──────────────────────────────────────────────────────────────────────────── */
:root {
    --glass-edge-color: rgba(0, 255, 204, 0.95);
}

.liquid-glass {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-edge-color);
    box-shadow:
        /* Outer volume shadow */
        0 8px 32px rgba(0, 0, 0, 0.95),
        /* Inner top-left light reflection (simulates concave glass surface) */
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        /* Inner bottom edge depth */
        inset 0 -1px 0 rgba(0, 0, 0, 0.95),
        /* Chromatic aberration edge glow – uses the dynamic color variable */
        0 0 0 1px var(--glass-edge-color),
        /* Liquid volume inner ambient scatter */
        inset 0 0 24px rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    transition: box-shadow 0.6s ease, border-color 0.6s ease;
}

body {
    margin: 0;
    padding: 0;
    background-color: #09090b;
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    overscroll-behavior: none;
}
#map { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; }

/* ── Search wrapper: ẩn mặc định trên mobile, hiện khi .mobile-open ─ */
@media (max-width: 600px) {
    .search-wrapper { display: none; }
    .search-wrapper.mobile-open { display: block !important; }
}

/* ── TOP HUD ──────────────────────────────────────────────────────── */
#top-hud {
    position: fixed;
    top: env(safe-area-inset-top, 16px);
    left: 16px;
    right: 16px;
    z-index: 1000;
    padding: 10px 14px 10px;
    border-radius: 20px;
    /* Inherits liquid-glass animation from Phase 1 */
}

.hud-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hud-row--top {
    justify-content: space-between;
    min-height: 34px;
}
.hud-row--status {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    justify-content: space-between;
    gap: 8px;
}

.hud-location {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.hud-loc-icon {
    font-size: 13px;
    flex-shrink: 0;
    opacity: 0.8;
}
.hud-loc-text {
    font-size: 13px;
    font-weight: 600;
    color: #ffcc00;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-search-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.95);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
}
.hud-search-btn:hover  { background: rgba(255, 255, 255, 0.95); }
.hud-search-btn:active { transform: scale(0.90); }
.hud-search-btn.active {
    background: rgba(16, 185, 129, 0.95);
    border-color: rgba(16, 185, 129, 0.95);
    color: #10b981;
}

.hud-status-text {
    font-size: 12px;
    font-weight: 600;
    color: #e4e4e7;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hud-score-badge {
    font-size: 12px;
    font-weight: 800;
    font-family: 'Geist', monospace;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.95);
    color: #10b981;
    flex-shrink: 0;
    letter-spacing: 0.3px;
    transition: color 0.4s, background 0.4s, border-color 0.4s;
}

/* Search drawer – ẩn mặc định, .open hiện nó */
.hud-search-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                padding-top 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s ease;
    opacity: 0;
}
.hud-search-drawer.open {
    max-height: 360px;
    padding-top: 10px;
    opacity: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 8px;
}
/* search-container bên trong drawer không cần border-radius riêng */
#top-hud .search-container {
    border-radius: 14px;
}

/* ── BOTTOM DECK ──────────────────────────────────────────────────── */
#bottom-deck {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 12px) + 12px);
    left: 16px;
    right: 16px;
    z-index: 999;
    padding: 10px 12px;
    border-radius: 20px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Ẩn deck khi bottom-panel đang mở (body.bottom-active được set bởi app.js) */
body.bottom-active #bottom-deck {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.deck-grid {
    display: grid;
    grid-template-columns: 52px 1fr 46px 52px 46px 68px;
    align-items: center;
    gap: 4px;
}
.deck-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 2px;
}
.deck-cell + .deck-cell {
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.deck-label {
    font-size: 7.5px;
    font-weight: 700;
    color: #52525b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.deck-val {
    font-size: 17px;
    font-weight: 800;
    font-family: 'Geist', monospace;
    color: #e4e4e7;
    line-height: 1;
    white-space: nowrap;
    transition: color 0.4s;
}
.deck-val--sm {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    white-space: normal;
}
.deck-cell--score .deck-val {
    font-size: 20px;
    color: #10b981;
}
.deck-cell--condition {
    padding: 0 6px;
}
.deck-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(99, 102, 241, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.95);
    color: #818cf8;
    border-radius: 10px;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    letter-spacing: 0.2px;
}
.deck-open-btn:hover  { background: rgba(99, 102, 241, 0.95); border-color: rgba(99, 102, 241, 0.95); }
.deck-open-btn:active { transform: scale(0.93); }

/* Mobile: collapse deck-grid thành 2 hàng khi màn nhỏ */
@media (max-width: 420px) {
    .deck-grid {
        grid-template-columns: 48px 1fr 44px 50px 44px 60px;
        gap: 2px;
    }
    .deck-val { font-size: 15px; }
    .deck-cell--score .deck-val { font-size: 18px; }
}

/* ── MAP CLEARANCE ──────────────────────────────────────────────── */
/* Đảm bảo không có gì clip map layer */
body { overflow: hidden; }


/* --- GOOGLE MAPS STYLE SEARCH BAR --- */
.search-wrapper {
    position: absolute;
    top: 24px;
    top: calc(env(safe-area-inset-top, 0px) + 24px);
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 420px;
    z-index: 1000;
}

@media (max-width: 600px) {
    .search-wrapper {
        top: 24px;
        top: calc(env(safe-area-inset-top, 0px) + 12px);
    }
}
/* Final Mobile Overrides */
@media (max-width: 600px) {
    .floating-menu, #app-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 20px) !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        z-index: 2000 !important;
        background: rgba(20, 20, 20, 0.98) !important;
        animation: slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    .search-wrapper {
        top: 24px !important;
        top: calc(env(safe-area-inset-top, 0px) + 20px) !important;
    }
}


/* --- WELCOME MODAL --- */
.welcome-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.welcome-modal-content {
    background-color: #050a1f;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    max-width: 450px;
    text-align: center;
    color: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.95), 0 0 30px rgba(0, 255, 204, 0.95) inset;
    animation: zoom-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.welcome-modal-content h2 {
    color: #ffcc00;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}
.welcome-modal-content p {
    font-size: 14px;
    color: #a1a1aa;
    line-height: 1.6;
    margin-bottom: 25px;
}
.welcome-btn {
    background: #00ffcc;
    color: #000;
    border: none;
    padding: 12px 30px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.welcome-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.95);
}
@keyframes zoom-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.moon-phase-info {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.full-moon-warning {
    color: #ff4444;
    font-weight: 800;
    font-size: 12px;
    margin-top: 5px;
    animation: flash-red 1s infinite alternate;
}

@keyframes flash-red {
    from { opacity: 0.5; }
    to { opacity: 1; text-shadow: 0 0 10px #ff0000; }
}

.times-up-notice {
    color: #ff4444;
    font-weight: 800;
    font-size: 11px;
    margin-left: 8px;
    display: inline-block;
    animation: flash-red 1s infinite alternate;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(9, 9, 11, 0.95);
    border-radius: 24px;
    padding: 4px 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 30px -10px rgba(0,0,0,0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-container:focus-within {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 2px rgba(16, 185, 129, 0.95), 0 20px 40px -15px rgba(0,0,0,0.95);
    transform: translateY(-1px);
}

.menu-btn, .search-btn, .layers-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.2s;
}

.menu-btn:hover, .search-btn:hover, .layers-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.96);
}

.menu-btn:active, .search-btn:active, .layers-btn:active {
    transform: scale(0.9);
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    padding: 8px 4px;
    outline: none;
}

.search-input::placeholder { color: #888; }

.divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.95);
    margin: 0 8px;
}

.autocomplete-list {
    background: rgba(9, 9, 11, 0.95);
    border-radius: 16px;
    margin-top: 8px;
    padding: 8px 0;
    list-style: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 20px 40px -15px rgba(0,0,0,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    color: #eee;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.autocomplete-item:hover { background: rgba(255, 255, 255, 0.1); }

.floating-menu {
    position: absolute;
    top: 70px;
    top: calc(70px + env(safe-area-inset-top, 0px));
    left: 12px;
    right: auto;
    width: 320px;
    background: rgba(9, 9, 11, 0.95);
    border-radius: 24px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 20px 40px -15px rgba(0,0,0,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 1001;
    color: #fff !important;
    display: none;
    padding-bottom: 12px;
}

@media (max-width: 600px) {
    .search-wrapper { max-width: none; }
}

@keyframes slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.floating-menu.active { display: block; }

.menu-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.menu-header button[title="Đóng"] {
    flex-shrink: 0;
    width: 24px; height: 24px;
    border: none;
    background: rgba(255,255,255,0.06);
    color: #64748b;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    font-family: inherit;
}
.menu-header button[title="Đóng"]:hover {
    background: rgba(255,255,255,0.95);
    color: #f8fafc;
}

/* Premium Scan Slider */
.scan-slider-container {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
}

#radiusVal {
    background: rgba(16, 185, 129, 0.95);
    padding: 2px 8px;
    border-radius: 20px;
    font-family: inherit;
    color: #34d399;
}

.premium-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
}

.premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #10b981;
    border: 3px solid #18181b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scan Results Styling */
.scan-results-info {
    font-size: 13px;
    color: #888;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.opp-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 16px;
    margin: 0 12px 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.opp-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -8px rgba(0,0,0,0.95);
}

.opp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.opp-spot {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

.opp-score {
    font-size: 14px;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.opp-time {
    font-size: 13px;
    color: #ddd;
    margin-bottom: 6px;
}

.opp-weather {
    font-size: 12px;
    color: #aaa;
    display: flex;
    gap: 10px;
}

.premium-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.95);
}

.premium-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #10b981;
    border: 3px solid #18181b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.premium-date-picker {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0 4px;
    height: 36px;
    font-size: 11px;
    min-width: 0;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
    color-scheme: dark;
    transition: all 0.3s;
}

.premium-date-picker:focus {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.inline-scan-btn {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.95);
    color: #10b981;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 16px;
    flex-shrink: 0;
}

.inline-scan-btn:hover {
    background: rgba(16, 185, 129, 0.95);
    border-color: #10b981;
    transform: scale(0.94);
}

.inline-scan-btn.loading {
    animation: pulse 1.5s infinite;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

.menu-section { padding: 12px 16px; }
.section-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.layer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.layer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
}

.layer-thumb {
    width: 100%;
    aspect-ratio: 1;
    background: #333;
    border-radius: 8px;
    margin-bottom: 4px;
    border: 2px solid transparent;
    background-size: cover;
}

.layer-item.active .layer-thumb { border-color: #10b981; box-shadow: 0 0 0 1px rgba(16,185,129,0.95); }
.layer-name { font-size: 11px; color: #ccc; }

.layer-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.overlay-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}

.overlay-item:hover { background: rgba(255,255,255,0.05); }
.overlay-info { display: flex; align-items: center; flex: 1; min-width: 0; padding-right: 8px; }
.overlay-icon { font-size: 18px; flex-shrink: 0; margin-right: 10px; }
.overlay-text { font-size: 13px; color: #fff !important; line-height: 1.3; }

.toggle-switch {
    width: 32px;
    height: 18px;
    background: #444;
    border-radius: 9px;
    position: relative;
    transition: background 0.3s;
}

.overlay-item.active .toggle-switch { background: #10b981; }
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}
.overlay-item.active .toggle-switch::after { transform: translateX(14px); }

/* --- RESPONSIVE ADJUSTMENTS --- */

        /* Tăng cường độ tương phản toàn cục của lớp Tile để dễ nhìn hơn */
        .leaflet-tile-pane {
            filter: contrast(1.2) saturate(1.2) brightness(1.1);
        }

        /* Bottom Panel UI (Google Maps-like Bottom Sheet) */
        #bottom-panel {
            position: absolute;
            bottom: -100%;
            left: 0;
            right: 0;
            background: rgba(12, 15, 23, 0.72);
            -webkit-backdrop-filter: blur(26px) saturate(1.3);
            backdrop-filter: blur(26px) saturate(1.3);
            border-top: 1px solid rgba(255,255,255,0.12);
            z-index: 1005;
            transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            flex-direction: column;
            color: #fff;
            max-height: 70vh;
            border-radius: 32px 32px 0 0;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 -10px 40px -10px rgba(0,0,0,0.95);
            padding-bottom: env(safe-area-inset-bottom, 0);
        }
        #bottom-panel.active {
            bottom: 0;
        }

        /* Drag handle for mobile feel */
        #bottom-panel::before {
            content: '';
            width: 40px;
            height: 4px;
            background: rgba(255,255,255,0.95);
            border-radius: 2px;
            margin: 8px auto 0;
            display: block;
        }

        .bp-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 20px;
        }
        .bp-title {
            font-weight: 600;
            font-size: 16px;
        }
        .bp-close {
            background: rgba(255,255,255,0.1);
            border: none;
            color: #fff;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .bp-content {
            display: flex;
            overflow-x: auto;
            padding: 0 20px 20px;
            gap: 12px;
            scrollbar-width: none;
        }
        .bp-content::-webkit-scrollbar { display: none; }

        .hour-block {
            min-width: 68px;
            background: transparent;
            border-radius: 20px;
            padding: 16px 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            border: 1px solid transparent;
            cursor: pointer;
            touch-action: manipulation;
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .hour-block:hover {
            transform: translateY(-2px);
            background: rgba(255, 255, 255, 0.05) !important;
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
        }
        .hb-time { font-size: 12px; color: #888; margin-bottom: 8px; transition: color 0.3s; }
        .hb-icon { font-size: 24px; margin-bottom: 8px; }
        .hb-temp { font-weight: 600; font-size: 15px; }
        .hb-cloud { font-size: 10px; color: #aaa; margin-top: 4px; }

        /* Day/Night Themes for Bottom Panel */
        .hour-block.is-day {
            background: #ffffff !important;
            color: #1a1a1a !important;
            border-color: #e0e0e0 !important;
        }
        .hour-block.is-day .hb-time { color: #555 !important; }
        .hour-block.is-day .hb-cloud { color: #666 !important; }

        .hour-block.is-night {
            background: #1a1a1a !important;
            color: #ffffff !important;
            border-color: #333 !important;
        }
        .hour-block.is-night .hb-time { color: #999 !important; }

        /* Day Divider */
        .day-divider {
            min-width: 4px;
            background: #ffcc00;
            border-radius: 2px;
            margin: 0 4px;
            height: 100%;
            box-shadow: 0 0 10px rgba(255, 204, 0, 0.95);
        }

        /* Astronomy Side Panel UI (Floating Card on Web) */
        #side-panel {
            position: fixed;
            top: 70px;
            bottom: 24px;
            right: 12px;
            width: 400px;
            max-width: calc(100vw - 24px);
            background: rgba(9, 9, 11, 0.95);
            border-radius: 32px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            z-index: 1006;
            transform: translateX(calc(100% + 60px));
            transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            flex-direction: column;
            color: #fff;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), -10px 0 40px -10px rgba(0,0,0,0.95);
            overflow: hidden;
        }
        #side-panel.active {
            transform: translateX(0);
        }

        @media (max-width: 600px) {
            #side-panel {
                top: 0;
                right: 0;
                width: 100%;
                max-width: none;
                bottom: 0;
                border-radius: 0;
                border: none;
                z-index: 1010;
                transform: translateX(100%);
            }
            #side-panel.active { transform: translateX(0); }
        }

        .sp-header {
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .sp-title { font-weight: 600; font-size: 18px; color: #10b981; }
        .sp-close {
            background: rgba(255,255,255,0.1);
            border: none;
            color: #fff;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .sp-content {
            padding: 20px;
            overflow-y: auto;
            flex-grow: 1;
        }

        /* Tooltip & Other Overrides */
        .custom-spot-tooltip {
            background: rgba(9, 9, 11, 0.95) !important;
            border: 1px solid rgba(255,255,255,0.1) !important;
            border-radius: 16px !important;
            padding: 12px 16px !important;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 30px -10px rgba(0,0,0,0.95) !important;
            font-family: 'Geist', sans-serif !important;
        }
        .leaflet-tooltip-top::before { border-top-color: rgba(30,30,30,0.95) !important; }

        .leaflet-tooltip-top:before { border-top-color: rgba(30, 30, 30, 0.95) !important; }
        .leaflet-tooltip-bottom:before { border-bottom-color: rgba(30, 30, 30, 0.95) !important; }

.my-loc-tooltip {
    background: rgba(239,68,68,0.95) !important;
    border: 1px solid rgba(239,68,68,0.95) !important;
    color: #fca5a5 !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
}
.my-loc-tooltip::before { border-top-color: rgba(239,68,68,0.95) !important; }

/* --- POINT LOCATION MARKER (no popup) --- */
.point-location-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f97316;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.95), 0 2px 8px rgba(0,0,0,0.95);
    animation: point-pulse 2s ease-in-out infinite;
}
@keyframes point-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(249,115,22,0.95), 0 2px 8px rgba(0,0,0,0.95); }
    50%       { box-shadow: 0 0 0 7px rgba(249,115,22,0.10), 0 2px 8px rgba(0,0,0,0.95); }
}

/* --- CUSTOM PIN MARKER & POPUP --- */
.custom-pin {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-marker {
    width: 20px;
    height: 20px;
    background: #ea4335;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.95);
}

.pin-inner {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.leaflet-popup.pin-popup {
    z-index: 3000 !important;
    pointer-events: auto !important;
}

.leaflet-popup-pane {
    z-index: 3000 !important;
}

.leaflet-popup.pin-popup .leaflet-popup-content-wrapper {
    background: rgba(9, 9, 11, 0.95) !important;
    color: #fff !important;
    border-radius: 24px;
    padding: 0;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 20px 40px -15px rgba(0,0,0,0.95);
    border: 1px solid rgba(255,255,255,0.95);
    width: 395px;
    max-width: 90vw;
    /* Scale toàn bộ popup (kể cả inline font-size) xuống 85% */
    zoom: 0.85;
}

.leaflet-popup.pin-popup .leaflet-popup-tip {
    background: rgba(25, 25, 25, 0.95) !important;
    zoom: 0.85;
}

.leaflet-popup.pin-popup .leaflet-popup-content {
    margin: 0 !important;
    width: 395px !important;
    max-width: 90vw !important;
    font-family: 'Geist', sans-serif;
}

.pin-popup-content {
    background: transparent;
    border: none;
    border-radius: 24px;
    padding: 20px;
    color: #fff;
    width: 395px;
    max-width: 100%;
    position: relative;
    box-sizing: border-box;
}

.popup-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 20px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    z-index: 100;
    transition: color 0.2s;
}
.popup-close:hover { color: #fff; }

.popup-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    padding: 0;
    border-bottom: 2px solid rgba(255,204,0,0.95);
    padding-bottom: 10px;
}
.ph-info { width: 100%; }
.ph-title {
    font-weight: 800;
    line-height: 1.2;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #ffcc00;
    margin-bottom: 4px;
}
.ph-title::before { content: '📍'; font-size: 15px; }

.gmap-btn {
    background: #3b82f6;
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 700;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s;
    display: inline-block;
    padding: 4px 10px;
    font-size: 10px;
}
.gmap-btn:hover {
    background: #2563eb;
    transform: scale(0.96);
}


.popup-body {
    max-height: 340px;
    overflow-y: auto;
    overflow-x: hidden !important;
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.95) transparent;
}
.popup-body::-webkit-scrollbar { width: 4px; }
.popup-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.95); border-radius: 2px; }


/* Update Map Controls Group */
.map-controls-group {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-btn {
    width: 48px;
    height: 48px;
    background: rgba(9, 9, 11, 0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.control-btn:hover {
    background: rgba(24, 24, 27, 0.95);
    transform: scale(0.94);
}

/* Loading State */
.loading-spinner {
    padding: 40px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

@media (max-width: 600px) {
    .map-controls-group {
        bottom: 80px;
    }
}

/* --- 3D Ephemeris Paths --- */
.ephemeris-sun-path { filter: drop-shadow(0 0 5px rgba(245,158,11,0.95)); }
.ephemeris-moon-path { filter: drop-shadow(0 0 5px rgba(96,165,250,0.95)); }
.ephemeris-mw-path { filter: drop-shadow(0 0 6px rgba(255,255,255,0.95)); }

/* Dim Base Map when Planner is Active */
.leaflet-container.planner-active .leaflet-tile-pane {
    filter: brightness(0.9) contrast(1.05) saturate(0.9);
    transition: filter 0.4s ease;
}
.leaflet-container .leaflet-tile-pane {
    transition: filter 0.4s ease;
}

/* ────────────────────────────────────────────────────────────────────────────
   EPHEMERIS – Responsive Two-Component Architecture
   ────────────────────────────────────────────────────────────────────────────

   Component 1 : #eph-timeline-bar  – always-visible bottom scrubber
   Component 2 : #eph-panel         – tabbed content panel
                                       Mobile  – bottom sheet above bar
                                       Desktop – right-docked draggable window
   ──────────────────────────────────────────────────────────────────────── */

/* ── GLOBAL TIMELINE BAR ───────────────────────────────────────────────── */
#eph-timeline-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    height: 48px;
    padding: 0 12px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    align-items: center;
    gap: 10px;
    background: rgba(8, 8, 10, 0.95);
    border-top: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 -6px 30px rgba(0,0,0,0.95);
}
#eph-timeline-bar.visible { display: flex; }

.etb-play {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255, 70, 0, 0.9);
    border: 1px solid rgba(255,255,255,0.95);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.12s, background 0.2s;
}
.etb-play:active { transform: scale(0.88); }

.etb-time {
    font-size: 12px;
    font-weight: 800;
    font-family: 'Geist Mono', 'SF Mono', ui-monospace, monospace;
    color: #fff;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 3px 7px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.4px;
    min-width: 82px;
    text-align: center;
}

.etb-slider {
    flex: 1;
    min-width: 0;
    height: 3px !important;
    accent-color: #ff4500;
}

.etb-toggle {
    width: 30px; height: 30px;
    border-radius: 7px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: #a1a1aa;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.18s;
}
.etb-toggle:hover { background: rgba(255,70,0,0.95); color: #ff6b35; border-color: rgba(255,70,0,0.95); }
.etb-toggle.panel-open { background: rgba(255,70,0,0.95); color: #ff6b35; border-color: rgba(255,70,0,0.95); }

/* ── VISUAL PLANNER PANEL ──────────────────────────────────────────────── */
#eph-panel {
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    z-index: 9100;
    background: rgba(9, 9, 11, 0.96);
    border: 1px solid rgba(255,255,255,0.07);
    box-sizing: border-box;
    overflow: hidden;
    left: 0; right: 0;
    bottom: 48px;
    height: 45vh;
    border-radius: 14px 14px 0 0;
    border-bottom: none;
    transition: opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(100%);
    will-change: transform, opacity;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.95);
}
#eph-panel.visible {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}

/* ── PANEL HEADER ──────────────────────────────────────────────────────── */
.eph-ph {
    position: sticky;
    top: 0;
    background: rgba(9, 9, 11, 0.98);
    z-index: 2;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    user-select: none;
}
.eph-ph-drag-zone {
    display: flex;
    justify-content: center;
    padding: 7px 0 3px;
    cursor: grab;
}
.eph-ph-drag-zone:active { cursor: grabbing; }
.eph-ph-handle {
    width: 34px; height: 3px;
    background: rgba(255,255,255,0.95);
    border-radius: 2px;
}
.eph-ph-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px 6px;
    gap: 8px;
}
.eph-ph-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.eph-ph-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.eph-ph-title {
    font-size: 10px;
    color: #71717a;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    white-space: nowrap;
}
.eph-dso-select {
    flex: 1;
    min-width: 0;
    max-width: 130px;
    background: rgba(179,102,255,0.08);
    color: #c084fc;
    border: 1px solid rgba(179,102,255,0.95);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    text-overflow: ellipsis;
}
.eph-icon-btn {
    width: 26px; height: 26px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #71717a;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.18s;
}
.eph-icon-btn:hover { background: rgba(255,255,255,0.95); color: #fff; }
.eph-icon-btn.eph-close-btn:hover { background: rgba(239,68,68,0.95); color: #f87171; border-color: rgba(239,68,68,0.95); }

/* ── TABS ──────────────────────────────────────────────────────────────── */
.eph-tabs {
    display: flex;
    gap: 3px;
    padding: 5px 12px 6px;
}
.eph-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #52525b;
    font-size: 10px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}
.eph-tab.active {
    background: rgba(255, 70, 0, 0.95);
    color: #fb923c;
    box-shadow: inset 0 0 0 1px rgba(255, 70, 0, 0.95);
}
.eph-tab:not(.active):hover { background: rgba(255,255,255,0.06); color: #a1a1aa; }

/* ── PANEL BODY ────────────────────────────────────────────────────────── */
.eph-panel-body {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(45vh - 90px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.eph-tab-pane {
    visibility: hidden;
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(5px);
    width: 100%;
}
.eph-tab-pane.active {
    visibility: visible;
    position: relative;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ── TIMELINE CANVAS TAB ───────────────────────────────────────────────── */
.eph-legend {
    display: flex;
    gap: 12px;
    padding: 6px 14px 4px;
    font-size: 9px;
    color: #71717a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.eph-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}
.eph-canvas-wrap {
    position: relative;
    margin: 0 12px 8px;
    height: 62px;
    border-radius: 6px;
    background: rgba(0,0,0,0.95);
    overflow: hidden;
}
.eph-needle {
    position: absolute;
    left: 50%;
    top: 0; bottom: 0;
    width: 1.5px;
    background: linear-gradient(to bottom, rgba(255,69,0,0.9), rgba(255,69,0,0.95));
    z-index: 10;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 0 5px rgba(255,69,0,0.95);
}
.eph-tl-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100%; height: 100%;
    cursor: grab;
}
.eph-tl-scroll::-webkit-scrollbar { display: none; }
.eph-tl-scroll:active { cursor: grabbing; }
.eph-tl-inner {
    position: relative;
    width: max-content;
    height: 100%;
    display: flex;
}

/* ── GEAR TAB ──────────────────────────────────────────────────────────── */
.eph-gear-panel { padding: 8px 12px 12px; }

.eph-gear-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.eph-gear-label {
    font-size: 10px;
    font-weight: 700;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.eph-gear-value {
    font-size: 10px;
    color: #6ee7b7;
    font-family: 'Geist Mono', monospace;
    white-space: nowrap;
}
.eph-gear-spacer { flex: 1; }
.eph-gear-btn {
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.95);
    color: #fbbf24;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.eph-gear-btn:hover { background: rgba(251,191,36,0.95); }

.eph-gear-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.eph-fov-checkbox { display: none; }
.eph-toggle-track {
    display: flex;
    align-items: center;
    width: 30px; height: 16px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.95);
    padding: 2px;
    transition: background 0.2s, border-color 0.2s;
    box-sizing: border-box;
}
.eph-fov-checkbox:checked + .eph-toggle-track {
    background: rgba(16, 185, 129, 0.95);
    border-color: rgba(16, 185, 129, 0.95);
}
.eph-toggle-thumb {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #52525b;
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
}
.eph-fov-checkbox:checked + .eph-toggle-track .eph-toggle-thumb {
    background: #10b981;
    transform: translateX(14px);
}

.eph-gear-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
    align-items: start;
}
.eph-gear-sublabel {
    font-size: 8.5px;
    color: #52525b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.eph-focal-val {
    color: #10b981;
    font-weight: 800;
    font-size: 9px;
    font-family: 'Geist Mono', monospace;
}
.eph-fov-select {
    width: 100%;
    background: rgba(255,255,255,0.05);
    color: #e4e4e7;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}
.eph-focal-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.eph-focal-slider {
    flex: 1;
    height: 3px !important;
}
.eph-focal-num {
    width: 44px;
    background: rgba(255,255,255,0.05);
    color: #10b981;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 3px 4px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    font-family: 'Geist Mono', monospace;
    outline: none;
}

.eph-fov-readout {
    display: none;
    margin-top: 8px;
    background: rgba(16,185,129,0.06);
    border: 1px solid rgba(16,185,129,0.95);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 10px;
    font-family: 'Geist Mono', monospace;
    color: #6ee7b7;
    text-align: center;
}
.eph-exposure-guide {
    display: none;
    margin-top: 6px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 7px 10px;
}

/* ────────────────────────────────────────────────────────────────────────────
   DESKTOP (≥ 1024px) – Right-docked draggable sidebar
   ──────────────────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
    #eph-panel,
    #eph-panel.visible {
        left: auto !important;
        right: 16px !important;
        bottom: 64px !important;
        max-height: none !important;
        height: auto !important;
        width: 320px !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255,255,255,0.08) !important;
        border-bottom: 1px solid rgba(255,255,255,0.08) !important;
        box-shadow: -6px 6px 40px rgba(0,0,0,0.95) !important;
    }
    #eph-panel {
        display: none;
        opacity: 0;
        transform: translateX(340px);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.22s ease;
    }
    #eph-panel.visible {
        display: block;
        opacity: 1;
        transform: translateX(0);
    }

    .eph-panel-body {
        max-height: calc(100vh - 200px);
    }

    .eph-ph-drag-zone { cursor: move; }
    .eph-ph-handle { background: rgba(255,255,255,0.08); }
}

/* ────────────────────────────────────────────────────────────────────────────
   MOBILE (< 1024px) – Bottom sheet above timeline bar
   ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .eph-panel-body {
        max-height: calc(45vh - 90px);
    }
}


        /* Side Panel Details */
        .sp-weather-card {
            background: rgba(18, 22, 33, 0.5);
            -webkit-backdrop-filter: blur(18px) saturate(1.2);
            backdrop-filter: blur(18px) saturate(1.2);
            padding: 20px;
            border-radius: 24px;
            margin-bottom: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 28px rgba(0,0,0,0.4);
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .sp-section-title {
            color: #38bdf8;
            font-size: 14px;
            margin: 20px 0 16px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            padding-bottom: 8px;
            text-align: center;
        }
        .sp-chart-container {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.05);
            padding: 16px;
            border-radius: 20px;
            margin-bottom: 20px;
            position: relative;
            display: flex;
            justify-content: center;
        }
        #timeline-canvas {
            cursor: crosshair;
            display: block;
            margin: 0 auto;
            touch-action: none;
        }
        .sp-cloud-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-bottom: 20px;
        }
        .cloud-item {
            background: rgba(255,255,255,0.04);
            -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255,255,255,0.09);
            padding: 16px 10px;
            border-radius: 16px;
            text-align: center;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
        }
        .cloud-item .label { font-size: 11px; color: #a1a1aa; margin-bottom: 6px; }
        .cloud-item .val { font-size: 18px; font-weight: 700; font-family: 'Geist', sans-serif; }
        .cloud-item .val.good { color: #10b981; }
        .cloud-item .val.warn { color: #f59e0b; }
        .cloud-item .val.bad { color: #ef4444; }

        .sp-info-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }
        .info-item {
            background: rgba(255,255,255,0.04);
            -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255,255,255,0.09);
            padding: 12px;
            border-radius: 16px;
            font-size: 12px;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
        }

        .warning-box {
            padding: 10px;
            border-radius: 8px;
            margin-bottom: 15px;
            font-size: 12px;
            font-weight: 600;
            background: rgba(255, 170, 0, 0.95);
            border: 1px solid rgba(255, 170, 0, 0.95);
            color: #ffdd99;
        }
        .warning-box.crit {
            background: rgba(255, 0, 0, 0.95);
            border-color: rgba(255, 0, 0, 0.95);
            color: #ff9999;
        }

        /* Day Separator in bottom panel */
        .hour-block[id^="day-"] {
            border-left: 2px solid rgba(255, 204, 0, 0.95);
            background: rgba(255, 204, 0, 0.05);
        }

        /* ── Breakdown Analysis Table ── */
        .sp-breakdown-table {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 16px;
        }
        .bd-row {
            display: grid;
            grid-template-columns: 22px 1fr 42px;
            align-items: start;
            gap: 6px;
            padding: 10px 12px;
            background: transparent;
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.05);
        }
        .bd-icon { font-size: 14px; line-height: 1.4; }
        .bd-label {
            font-size: 11px;
            color: #ccc;
            font-weight: 600;
            line-height: 1.3;
        }
        .bd-note {
            grid-column: 2 / 4;
            font-size: 10px;
            color: #777;
            line-height: 1.3;
            margin-top: 1px;
        }
        .bd-delta {
            font-size: 12px;
            font-weight: 800;
            text-align: right;
            font-family: monospace;
            line-height: 1.4;
        }
        .bd-delta.penalty { color: #ef4444; }
        .bd-delta.bonus   { color: #10b981; }
        .bd-delta.neutral { color: #a1a1aa; }
        .bd-total-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            margin-top: 8px;
            background: transparent;
            border-radius: 16px;
            border: 1px solid rgba(255,255,255,0.1);
        }
        .bd-total-label {
            font-size: 13px;
            font-weight: 700;
            color: #fff;
        }
        .bd-total-val {
            font-size: 18px;
            font-weight: 900;
            font-family: monospace;
        }

/* ── Bottom panel drag-to-scroll ─────────────────────────────── */
#bp-content {
    cursor: grab;
    user-select: none;
}
#bp-content.dragging {
    cursor: grabbing;
}

/* ── Recommended Spots Premium Styling ────────────────────────── */
.spot-marker-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.spot-marker-container:hover {
    opacity: 1;
}

.spot-marker-pulse {
    position: absolute;
    width: 300%;
    height: 300%;
    border-radius: 50%;
    animation: spot-pulse 2.5s infinite;
    z-index: -1;
}

.spot-marker-core {
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 10px rgba(0,0,0,0.95);
}

.spot-marker-dot {
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
}

.spot-marker-label {
    position: absolute;
    bottom: -45px;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.95);
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,1);
    font-weight: 500;
    transition: opacity 0.3s;
}

body.bottom-active .spot-marker-label {
    opacity: 0;
    pointer-events: none;
}

@keyframes spot-pulse {
    0% { transform: scale(0.4); opacity: 0.8; }
    100% { transform: scale(1.2); opacity: 0; }
}

/* Premium Tooltip */
.premium-spot-tooltip {
    background: rgba(9, 9, 11, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    padding: 12px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 30px -10px rgba(0,0,0,0.95) !important;
    color: #fff !important;
    font-family: 'Geist', sans-serif !important;
}

.premium-spot-tooltip:before {
    border-top-color: rgba(9, 9, 11, 0.95) !important;
}

.spot-tooltip-card {
    min-width: 180px;
}

.spot-tooltip-name {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
    color: #10b981;
}

.spot-tooltip-rating {
    font-size: 11px;
    margin-bottom: 8px;
}

.spot-tooltip-desc {
    font-size: 11px;
    color: #ccc;
    font-style: italic;
    line-height: 1.4;
    margin-bottom: 10px;
}

.spot-tooltip-hint {
    font-size: 10px;
    color: #888;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 6px;
}


/* Ultimate Mobile Overrides to ensure Bottom Sheet */
@media (max-width: 600px) {
    #app-menu.floating-menu, .floating-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: 32px 32px 0 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 20px) !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        z-index: 2000 !important;
        background: rgba(9, 9, 11, 0.95) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 -10px 40px -10px rgba(0,0,0,0.95) !important;
        display: none;
    }
    #app-menu.floating-menu.active, .floating-menu.active {
        display: block !important;
        animation: slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
}

/* --- Tùy chỉnh Copyright Bar (Attribution) --- */
.leaflet-control-attribution {
    font-size: 10px !important;
}

/* --- Cụm Phím Chức Năng (Cạnh Trái) --- */
.gm-left-controls {
    position: absolute;
    left: 12px;
    bottom: 30px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 30px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.gm-left-controls:hover,
.gm-left-controls:focus-within,
.gm-left-controls:active {
    opacity: 1;
}

.gm-btn {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: rgba(43, 43, 40, 0.95);
    color: #fff;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.95);
    padding: 0;
    font-size: 24px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gm-btn:hover {
    background: rgba(60, 60, 55, 0.95);
    transform: scale(1.05);
}

.gm-zoom-group {
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(43, 43, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.95);
}

.gm-zoom-group .gm-btn {
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: transparent;
}

.gm-zoom-group .gm-btn:hover {
    transform: none;
    background: rgba(60, 60, 55, 0.95);
}

.gm-zoom-group .gm-btn:first-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaflet-control-zoom {
    display: none !important;
}

@media (max-width: 600px) {
    .gm-left-controls {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
        gap: 8px;
        max-height: calc(100vh - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - 160px);
    }
    .gm-left-controls .gm-btn {
        width: 38px;
        height: 38px;
        border-radius: 19px;
    }
    .gm-zoom-group {
        border-radius: 19px;
    }
}

/* Landscape / màn hình thấp: nén thêm để không che search/kèo thơm */
@media (max-height: 600px) {
    .gm-left-controls {
        gap: 6px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 60px);
    }
    .gm-left-controls .gm-btn {
        width: 34px;
        height: 34px;
        border-radius: 17px;
    }
    .gm-zoom-group {
        border-radius: 17px;
    }
}

/* --- Tùy chỉnh Scrollbar Toàn Hệ Thống (Dark Theme) --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.95);
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* --- Khắc phục lỗi ẩn Lượt Truy Cập trên Mobile (Leaflet CSS override) --- */
@media (max-width: 500px) {
    .leaflet-control-attribution {
        width: auto !important;
        height: auto !important;
        white-space: nowrap !important;
        overflow: visible !important;
        background: rgba(9, 9, 11, 0.95) !important;
        color: #ddd !important;
    }

    .leaflet-control-attribution a[title="A JavaScript library for interactive maps"] {
        display: none !important;
    }
    .leaflet-control-attribution svg {
        display: none !important;
    }
}

/* ── FIX: Side panel timeline wrapper – contain the red needle ──────── */
.sp-timeline-wrapper {
    position: relative;
    height: 80px;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(0,0,0,0.95);
    margin-bottom: 8px;
}

/* ── POPUP: new component classes ───────────────────────────────────── */
.popup-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 204, 0, 0.95);
}
.popup-topbar-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffcc00;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.popup-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    font-family: inherit;
}
.popup-icon-btn:hover { background: rgba(255,255,255,0.95); color: #fff; }
.popup-icon-btn.bookmark { color: #888; }
.popup-icon-btn.bookmark.active { color: #fbbf24; background: rgba(251,191,36,0.95); border-color: rgba(251,191,36,0.95); }

.popup-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: #ccc;
    gap: 8px;
}
.popup-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
.popup-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
}
.pc-label {
    font-size: 10px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.pc-value {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}
.pc-sub {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}
.popup-coords {
    font-size: 11px;
    color: #777;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.popup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.popup-action-btn {
    height: 36px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    transition: all 0.2s;
}
.popup-action-forecast {
    background: rgba(99, 102, 241, 0.95);
    border-color: rgba(99, 102, 241, 0.95);
    color: #818cf8;
}
.popup-action-forecast:hover { background: rgba(99, 102, 241, 0.95); }
.popup-action-planner {
    background: rgba(168, 85, 247, 0.95);
    border-color: rgba(168, 85, 247, 0.95);
    color: #c084fc;
}
.popup-action-planner:hover { background: rgba(168, 85, 247, 0.95); }
.popup-action-contrib {
    background: rgba(52, 211, 153, 0.95);
    border-color: rgba(52, 211, 153, 0.95);
    color: #34d399;
}
.popup-action-contrib:hover { background: rgba(52, 211, 153, 0.95); }

/* ── SCAN MODAL: new opp-card children ─────────────────────────────── */
.opp-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 5px;
}
.opp-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.opp-spot-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.opp-dist {
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 3px;
}
.opp-score {
    font-size: 13px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
    color: #e4e4e7;
    border: 1px solid rgba(255,255,255,0.95);
}
.opp-score.score-great { background: rgba(16,185,129,0.95); border-color: rgba(16,185,129,0.95); color: #34d399; }
.opp-score.score-good  { background: rgba(234,179,8,0.95);  border-color: rgba(234,179,8,0.95);  color: #fbbf24; }
.opp-score.score-ok    { background: rgba(99,102,241,0.95); border-color: rgba(99,102,241,0.95); color: #818cf8; }

.opp-time-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    margin-bottom: 4px;
}
.opp-date   { color: #e4e4e7; font-weight: 600; }
.opp-sep    { color: #444; }
.opp-window { color: #a1a1aa; }
.opp-weather-row {
    display: flex;
    gap: 10px;
}
.opp-wx {
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ── IC (SVG icon inline) ───────────────────────────────────────────── */
.ic {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    pointer-events: none;
}

/* ── ALERT MONITOR: Bell button active state ────────────────────────── */
#gm-alert.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.95);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.95);
    animation: am-pulse 2s ease-in-out infinite;
}
@keyframes am-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(56,189,248,0.95); }
    50%       { box-shadow: 0 0 0 3px rgba(56,189,248,0.95), 0 0 0 1px rgba(56,189,248,0.95); }
}

/* ── ALERT MONITOR: Settings panel ──────────────────────────────────── */
#alert-panel {
    position: fixed;
    left: 56px;
    top: 100px;
    width: 276px;
    z-index: 900;
    background: rgba(8, 8, 18, 0.96);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 14px;
    display: none;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.95);
}
#alert-panel.active { display: flex; }

.am-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.am-panel-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.3px;
}
.am-panel-close {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0; font-family: inherit;
    transition: background 0.2s, color 0.2s;
}
.am-panel-close:hover { background: rgba(255,255,255,0.95); color: #e2e8f0; }

/* Status bar */
.am-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 9px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
}
.am-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #334155;
    flex-shrink: 0;
    transition: background 0.3s;
}
.am-status-on .am-status-dot {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e99;
}
.am-status-text {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    flex: 1;
    transition: color 0.3s;
}
.am-status-on .am-status-text { color: #86efac; }
.am-status-time {
    font-size: 10px;
    color: #334155;
    font-variant-numeric: tabular-nums;
}

/* Groups */
.am-group { display: flex; flex-direction: column; gap: 8px; }
.am-group-label {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}
.am-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0 -2px;
}

/* Interval buttons */
.am-iv-row { display: flex; gap: 6px; }
.am-iv-btn {
    flex: 1; padding: 6px 0;
    border-radius: 8px;
    font-size: 11px; font-weight: 600;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #64748b;
    cursor: pointer; font-family: inherit;
    transition: all 0.15s;
}
.am-iv-btn.active { background: rgba(56,189,248,0.95); border-color: rgba(56,189,248,0.95); color: #38bdf8; }
.am-iv-btn:not(.active):hover { background: rgba(255,255,255,0.07); color: #94a3b8; }

/* Trigger cards */
.am-trigger-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 9px 10px;
    display: flex; flex-direction: column; gap: 8px;
}
.am-trigger-row {
    display: flex; align-items: center; gap: 8px;
}
.am-trigger-name {
    flex: 1;
    font-size: 12px; font-weight: 500;
    color: #cbd5e1;
}

/* Toggle switch */
.am-tog { cursor: pointer; flex-shrink: 0; }
.am-tog input { display: none; }
.am-tog-track {
    display: block;
    width: 32px; height: 18px;
    border-radius: 9px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.95);
    position: relative;
    transition: background 0.2s, border-color 0.2s;
}
.am-tog input:checked ~ .am-tog-track {
    background: rgba(56,189,248,0.95);
    border-color: rgba(56,189,248,0.95);
}
.am-tog-thumb {
    position: absolute;
    top: 2px; left: 2px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #475569;
    transition: transform 0.2s, background 0.2s;
}
.am-tog input:checked ~ .am-tog-track .am-tog-thumb {
    transform: translateX(14px);
    background: #38bdf8;
}

/* Burn slider */
.am-slider-row {
    display: flex; align-items: center; gap: 8px;
}
.am-slider-label { font-size: 10px; color: #64748b; white-space: nowrap; }
.am-range { flex: 1; height: 3px; accent-color: #f97316; cursor: pointer; }
.am-slider-val {
    font-size: 12px; font-weight: 700;
    color: #f97316; min-width: 22px; text-align: right;
}

/* Scenario grid */
.am-sc-grid {
    display: flex; flex-wrap: wrap; gap: 5px;
}
.am-sc-btn {
    font-size: 10px; font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #475569;
    cursor: pointer; font-family: inherit;
    transition: all 0.15s;
    letter-spacing: 0.2px;
}
.am-sc-btn.active {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.95);
    color: var(--sc);
    background: color-mix(in srgb, var(--sc) 15%, transparent);
    border-color: color-mix(in srgb, var(--sc) 40%, transparent);
}
.am-sc-btn:not(.active):hover { background: rgba(255,255,255,0.07); color: #94a3b8; }

/* Toggle button */
.am-start-btn {
    width: 100%; padding: 9px;
    border-radius: 9px;
    font-size: 12px; font-weight: 700;
    background: rgba(56,189,248,0.95);
    border: 1px solid rgba(56,189,248,0.95);
    color: #38bdf8;
    cursor: pointer; font-family: inherit;
    transition: all 0.2s;
}
.am-start-btn:hover { background: rgba(56,189,248,0.95); }
.am-start-btn.am-start-btn-on {
    background: rgba(239,68,68,0.95);
    border-color: rgba(239,68,68,0.95);
    color: #f87171;
}
.am-start-btn.am-start-btn-on:hover { background: rgba(239,68,68,0.95); }

/* Notification hint */
.am-notify-hint {
    display: flex; align-items: center; gap: 5px;
    font-size: 10px; color: #334155;
    justify-content: center;
}

/* ── ALERT MONITOR: Toast notifications ─────────────────────────────── */
#am-toast-wrap {
    position: fixed;
    bottom: 24px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 300px;
}
.am-toast {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(8, 8, 18, 0.95);
    border: 1px solid var(--tc, #38bdf8);
    border-left-width: 3px;
    border-radius: 10px;
    padding: 10px 10px 10px 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.95);
    pointer-events: all;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s, transform 0.3s;
}
.am-toast.am-toast-in { opacity: 1; transform: translateX(0); }
.am-toast-body { flex: 1; line-height: 1.5; font-size: 12px; }
.am-toast-x {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    font-family: inherit;
}
.am-toast-x:hover { color: #fff; }

/* ── ARCH PLANNER: Hide search bar when planner is open ─────────────── */
.search-wrapper.planner-active { display: none !important; }

/* ── ARCH PLANNER: Timeline strip (top) ────────────────────────────── */
#arch-tl-outer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 600;
    background: rgba(16, 14, 28, 0.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    backdrop-filter: blur(24px) saturate(1.3);
    border-bottom: 1px solid rgba(167, 139, 250, 0.3);
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
    padding: 6px 12px 4px;
}
#arch-tl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.arch-tl-brand {
    display: flex;
    align-items: center;
    gap: 6px;
}
.arch-tl-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a78bfa;
    box-shadow: 0 0 6px #a78bfa;
    flex-shrink: 0;
}
.arch-tl-label {
    font-size: 11px;
    font-weight: 700;
    color: #c4b5fd;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
.arch-tl-hint {
    font-size: 10px;
    color: #555;
    font-style: italic;
}
#arch-tl-body {
    position: relative;
    height: 80px;
}
#arch-tl-scroll {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
#arch-tl-scroll::-webkit-scrollbar { display: none; }
#arch-tl-scroll.is-grabbing { cursor: grabbing; }
#arch-tl-canvas {
    display: block;
    height: 80px;
}
#arch-tl-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(167, 139, 250, 0.95);
    pointer-events: none;
    left: 50%;
    transform: translateX(-50%);
}

/* ── ARCH PLANNER: Controls overlay (bottom) ───────────────────────── */
#arch-planner-overlay {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 600;
    min-width: 280px;
    max-width: 420px;
    width: calc(100vw - 32px);
    background: rgba(16, 14, 28, 0.62);
    -webkit-backdrop-filter: blur(26px) saturate(1.3);
    backdrop-filter: blur(26px) saturate(1.3);
    border: 1px solid rgba(167, 139, 250, 0.45);
    border-radius: 22px;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1), 0 0 28px rgba(167,139,250,0.18);
}
.arch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.arch-header-brand {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.arch-brand-label {
    font-size: 10px;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}
#arch-loc-name {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.arch-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.arch-close-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
}
.arch-close-btn:hover { background: rgba(255,255,255,0.95); color: #fff; }

.arch-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 6px 0 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
/* Giữ select DSO + ô ngày luôn nằm trong khung (mobile) */
#arch-date-jump {
    max-width: 124px;
    min-width: 0;
    box-sizing: border-box;
    flex-shrink: 1;
}
.arch-leg {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #94a3b8;
}
.arch-leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sun-leg  .arch-leg-dot { background: #ef4444; box-shadow: 0 0 4px #ef4444; }
.moon-leg .arch-leg-dot { background: #3b82f6; box-shadow: 0 0 4px #3b82f6; }
.mw-leg   .arch-leg-dot { background: #e2e8f0; box-shadow: 0 0 4px rgba(226,232,240,0.95); }

.arch-dso-select {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: #c084fc;
    background: rgba(192, 132, 252, 0.08);
    border: 1px solid rgba(192, 132, 252, 0.95);
    border-radius: 6px;
    padding: 3px 6px;
    cursor: pointer;
    font-family: inherit;
    outline: none;
    max-width: 150px;
    min-width: 0;
    flex-shrink: 1;
    text-overflow: ellipsis;
    transition: background 0.15s, border-color 0.15s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='%23c084fc'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 16px;
}
.arch-dso-select:hover {
    background: rgba(192, 132, 252, 0.95);
    border-color: rgba(192, 132, 252, 0.95);
}
.arch-dso-select option {
    background: #1a1a2e;
    color: #e2e8f0;
}

.arch-fov-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.95);
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
    font-size: 11px;
    transition: background 0.15s, border-color 0.15s;
    outline: none;
}
.arch-fov-btn:hover {
    background: rgba(255, 255, 255, 0.95);
}
.arch-fov-btn.active {
    background: rgba(56, 189, 248, 0.95);
    border-color: rgba(56, 189, 248, 0.95);
    color: #38bdf8;
}

.arch-footer {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.arch-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.arch-play-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(168,85,247,0.45), inset 0 1px 0 rgba(255,255,255,0.3);
    transition: transform 0.15s, box-shadow 0.2s;
}
.arch-play-btn:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(168,85,247,0.6); }
.arch-play-btn svg { fill: #fff; }
.arch-time-display {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    line-height: 1;
    text-shadow: 0 0 16px rgba(167,139,250,0.5);
}
.arch-date-footer {
    font-size: 12px;
    color: #64748b;
    margin-left: auto;
}
.arch-bodies-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.arch-body-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    color: #94a3b8;
    white-space: nowrap;
}
.arch-sun-tag  { border-color: rgba(239, 68, 68, 0.95);  color: #fca5a5; }
.arch-moon-tag { border-color: rgba(59, 130, 246, 0.95); color: #93c5fd; }
.arch-mw-tag   { border-color: rgba(226, 232, 240, 0.95); color: #cbd5e1; }

/* ── DAILY BRIEFING: "Tóm tắt ngày" panel ──────────────────────────── */
.db-panel {
    position: fixed !important;
    top: 56px !important;
    right: 12px;
    width: 320px;
    max-height: calc(100dvh - 72px);
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 850;
    background: rgba(8, 10, 18, 0.96);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.95);
}
.db-panel.active { display: flex !important; bottom: auto !important; }

/* Header */
.db-header {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.db-header-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    gap: 8px;
}
.db-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    white-space: nowrap;
}
.db-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.db-meta-str {
    font-size: 10px;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 110px;
}
.db-close {
    width: 22px; height: 22px;
    flex-shrink: 0;
    border: none;
    background: rgba(255,255,255,0.05);
    color: #64748b;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.db-close:hover { background: rgba(255,255,255,0.95); color: #f8fafc; }

/* Row 2: date picker — chiều ngang đầy, không bị che */
.db-date-nav {
    display: flex;
    align-items: center;
    padding: 5px 12px 8px;
    gap: 0;
}
.db-nav-btn {
    width: 36px; height: 32px;
    border-radius: 7px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #64748b;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0; flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.db-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: #e2e8f0; }
.db-nav-btn:disabled { opacity: 0.22; cursor: default; }
.db-date-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
}
.db-date-main {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
}
.db-date-sub {
    font-size: 10px;
    color: #475569;
    white-space: nowrap;
}

/* Scroll body */
.db-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.10) transparent;
}

/* Card */
.db-card {
    margin: 0 10px 6px;
    border-radius: 10px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}
.db-card-clickable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.db-card-clickable:hover {
    background: rgba(255,255,255,0.055);
    border-color: rgba(255,255,255,0.95);
}
.db-card-clickable:active { opacity: 0.8; }
.db-card-tap-hint {
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.3;
    transition: opacity 0.15s;
}
.db-card-clickable:hover .db-card-tap-hint { opacity: 0.7; }
.db-card-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px 7px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.db-card-title {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    flex: 1;
}
.db-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 5px;
    border: 1px solid;
    white-space: nowrap;
}
.db-card-body {
    padding: 9px 11px 10px;
}
.db-text {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0;
}

/* Scenario rows inside card */
.db-sc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.db-sc-row:last-child { border-bottom: none; }
.db-sc-chip {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.db-sc-time {
    font-size: 11px;
    color: #475569;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Warning rows */
.db-warn-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 3px 0;
    font-size: 12px;
    color: #f87171;
    line-height: 1.5;
}

/* Empty */
.db-empty-main {
    font-size: 12px;
    color: #475569;
    padding: 16px 20px;
    font-style: italic;
}

/* "Hôm nay" button active */
#gm-today.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.95);
}

@media (max-width: 600px) {
    .db-panel {
        right: 8px !important;
        left: 54px !important;
        width: auto !important;
        top: 52px !important;
        max-height: calc(100dvh - 64px) !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   SKY UI KIT — Pro redesign design-system (dùng chung 7-day / sidebar / arch)
   Tầng hiển thị thuần. Đồng bộ với js/ui-kit.js.
════════════════════════════════════════════════════════════════════════════ */

/* ── Gauge gradient-ring ─────────────────────────────────────────────────── */
.sky-gauge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}
.sky-gauge svg { display: block; overflow: visible; }
.sky-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
}
.sky-gauge--arc .sky-gauge-center { justify-content: flex-end; padding-bottom: 4%; inset: 0 0 0 0; top: 18%; }
.sky-gauge-num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 12px rgba(0,0,0,0.6);
}
.sky-gauge-sub {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.2px;
    max-width: 120px;
}

/* ── Bortle star rating ──────────────────────────────────────────────────── */
.sky-stars { display: inline-flex; align-items: center; gap: 7px; }
.sky-stars-label { font-size: 13px; font-weight: 700; color: #22d3ee; }
.sky-stars-row { display: inline-flex; gap: 1px; font-size: 15px; line-height: 1; }
.sky-star.full  { color: #22d3ee; text-shadow: 0 0 6px rgba(34,211,238,0.5); }
.sky-star.empty { color: rgba(148,163,184,0.28); }
.sky-star.half  {
    position: relative; color: rgba(148,163,184,0.28);
    background: linear-gradient(90deg, #22d3ee 50%, rgba(148,163,184,0.28) 50%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: 0 0 6px rgba(34,211,238,0.35);
}

/* ── Metric icon row ─────────────────────────────────────────────────────── */
.sky-metric-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px;
    padding: 2px 2px 0;
}
.sky-metric { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.sky-metric-ico { width: 16px; height: 16px; }
.sky-metric-ico svg { width: 100%; height: 100%; display: block; }
.sky-metric-val { font-size: 10px; font-weight: 700; color: #cbd5e1; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Glass card (nâng cấp liquid-glass: thêm backdrop blur) ──────────────── */
.sky-glass {
    background: rgba(18, 22, 33, 0.55);
    -webkit-backdrop-filter: blur(22px) saturate(1.25);
    backdrop-filter: blur(22px) saturate(1.25);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.10);
}

/* ── Gradient card (3 ô score 7-day) ─────────────────────────────────────── */
.sky-grad-card {
    position: relative;
    border-radius: 12px;
    padding: 5px 4px 5px;
    text-align: center;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 4px 12px rgba(0,0,0,0.35);
    isolation: isolate;
}
.sky-grad-card--clk { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.sky-grad-card--clk:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 10px 24px rgba(0,0,0,0.45); }
.sky-grad-card--clk:active { transform: translateY(0); opacity: 0.9; }
.sky-grad-title {
    font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.95);
    text-shadow: 0 1px 3px rgba(0,0,0,0.45); margin-bottom: 1px;
}
.sky-grad-pct {
    font-size: 19px; font-weight: 800; line-height: 1.05; color: #fff;
    letter-spacing: -0.5px; font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
.sky-grad-time {
    margin-top: 1px; font-size: 10px; font-weight: 600;
    color: rgba(255,255,255,0.85); font-variant-numeric: tabular-nums;
}

/* ── 7-Day list (cuộn dọc) ───────────────────────────────────────────────── */
.sky7-day {
    margin: 0 8px 6px;
    padding: 7px 8px;
    border-radius: 14px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    transition: border-color .2s, box-shadow .2s;
}
.sky7-day.is-today {
    border-color: rgba(132,204,22,0.55);
    box-shadow: 0 0 0 1px rgba(132,204,22,0.25), 0 0 24px rgba(132,204,22,0.12);
}
.sky7-date { font-size: 12px; font-weight: 700; color: #e2e8f0; margin-bottom: 4px; }
.sky7-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.sky7-metrics { margin-top: 4px; }

/* ── 7-day header (Bortle + sao) ─────────────────────────────────────────── */
.sky7-head { padding: 4px 12px 10px; }
.sky7-head-title { font-size: 18px; font-weight: 800; color: #f1f5f9; }
.sky7-head-loc   { font-size: 13px; color: #94a3b8; margin-top: 2px; }
.sky7-head-bortle { margin-top: 7px; }

/* ── Sidebar gauge card (Detailed Analysis: Burn / Astro) ────────────────── */
.sp-gauge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(18, 22, 33, 0.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid var(--ac, rgba(255,255,255,0.12));
    border-radius: 18px;
    padding: 18px 12px 16px;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 28px rgba(0,0,0,0.4);
    transition: border-color .5s;
}
.sp-gauge-lbl {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    max-width: 90%;
}
/* Score + Độ tin cậy = 2 vòng tròn ngang hàng */
.sp-gauge-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    width: 100%;
}
.sp-gauge-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
}

/* ── Sidebar timeline card (High fidelity light/dark curve) ──────────────── */
.sp-tl-card {
    position: static;          /* scroll cùng nội dung side panel */
    background: rgba(14, 17, 26, 0.92);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    backdrop-filter: blur(22px) saturate(1.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 12px 12px 10px;
    margin-bottom: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 24px rgba(0,0,0,0.6);
}
.sp-tl-title { font-size: 13px; font-weight: 700; color: #e2e8f0; margin-bottom: 8px; }
.sp-tl-head { margin-bottom: 8px; }
.sp-tl-dt { font-size: 15px; font-weight: 800; line-height: 1.2; }
.sp-tl-ctx { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.sp-tl-legend { display: flex; justify-content: space-between; margin-top: 8px; padding: 0 2px; }
.sp-tl-legend span { display: flex; align-items: center; gap: 5px; font-size: 10px; color: #94a3b8; }
.sp-tl-legend i { width: 11px; height: 3px; border-radius: 2px; display: inline-block; }

/* ── Bottom panel 24h charts (Planning Dashboard) ────────────────────────── */
#bp-charts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 8px;
    flex-shrink: 0;
}
#bp-charts:empty { display: none; }
.bp-chart-box {
    height: 96px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 8px 10px 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.bp-chart-box canvas { width: 100% !important; height: 100% !important; }

