:root {
    --bg-main: #f8f9fa;
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --card-bg: rgba(255, 255, 255, 0.5);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --accent-blue: #2563eb;
    --sidebar-width: 360px;
    
    /* Layer Colors */
    --clr-grid: #ef4444;
    --clr-sub: #ef4444;
    --clr-vni: #f97316;
    --clr-vni-fiber: #00fbff;
    --clr-energy: #d946ef;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.dark-theme {
    --bg-main: #0f172a;
    --sidebar-bg: rgba(15, 23, 42, 0.75);
    --card-bg: rgba(30, 41, 59, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: dark) {
    body:not(.light-theme) {
        --bg-main: #0f172a;
        --sidebar-bg: rgba(15, 23, 42, 0.75);
        --card-bg: rgba(30, 41, 59, 0.6);
        --border-color: rgba(255, 255, 255, 0.1);
        --text-primary: #f8fafc;
        --text-muted: #94a3b8;
        --shadow: 0 8px 32px rgba(0,0,0,0.4);
        --glass-bg: rgba(15, 23, 42, 0.85);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
    body:not(.light-theme) h1 { color: #fff; }
    body:not(.light-theme) .strategy-popup { color: #f8f9fa; }
    body:not(.light-theme) .topology-overlay { background: rgba(15, 23, 42, 0.95); color: #f8fafc; }
    body:not(.light-theme) .topology-header { border-color: rgba(255,255,255,0.05); }
    body:not(.light-theme) .topo-subtitle { color: #aaa; }
    body:not(.light-theme) .zoom-controls { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); }
    body:not(.light-theme) .topology-footer { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.05); }
    body:not(.light-theme) .topo-nav-hint { background: rgba(255,255,255,0.03); color: #888; }
    body:not(.light-theme) .topo-legend { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.05); }
    body:not(.light-theme) .topo-tooltip { background: rgba(30, 32, 35, 0.95); border-color: rgba(255, 255, 255, 0.1); color: white; }
    body:not(.light-theme) .topo-tooltip .detail-row { color: #aaa; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg-main); color: var(--text-primary); transition: background 0.3s, color 0.3s; }

/* Gatekeeper Paywall */
.gatekeeper-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, #1e293b, #0f172a);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    font-family: 'Outfit', sans-serif;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 rgba(26, 115, 232, 0); border-color: rgba(255, 255, 255, 0.1); }
    50% { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(26, 115, 232, 0.4); border-color: rgba(26, 115, 232, 0.5); }
    100% { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 rgba(26, 115, 232, 0); border-color: rgba(255, 255, 255, 0.1); }
}

.paywall-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 2rem;
    width: 100%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: white;
    animation: pulseGlow 4s infinite ease-in-out;
}

.brand-badge {
    background: #1a73e8;
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.1rem;
    margin-bottom: 1.5rem;
}

.paywall-header h1 {
    font-size: 2rem;
    margin: 0;
    font-weight: 900;
}

.paywall-header p {
    color: #94a3b8;
    margin: 1rem 0 2.5rem 0;
}

.pay-option .price {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 1rem 0;
}

.pay-option .price span {
    font-size: 1rem;
    color: #94a3b8;
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    background: #1a73e8;
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.primary-btn:hover {
    background: #1557b0;
    transform: translateY(-2px);
}

.divider {
    margin: 2rem 0;
    position: relative;
    color: #475569;
    font-weight: 800;
    font-size: 0.8rem;
}

.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.promo-option input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: white;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

.secondary-btn {
    width: 100%;
    padding: 0.8rem;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.error-msg {
    color: #ff3e3e;
    font-size: 0.85rem;
    margin-top: 1rem;
    font-weight: 600;
}

/* Rest of the app container */
.app-container { position: relative; height: 100vh; width: 100vw; overflow: hidden; }

@keyframes slideInDesktop {
    from { transform: translateX(-40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Sidebar */
.sidebar {
    position: absolute; top: 20px; left: 20px; bottom: 20px;
    width: var(--sidebar-width); background: var(--sidebar-bg);
    border: 1px solid var(--border-color); border-radius: 16px;
    display: flex; flex-direction: column; overflow-y: auto; box-shadow: var(--shadow); z-index: 1001;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInDesktop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    transform: translateX(calc(-100% - 40px)) !important;
}

/* Desktop Sidebar Toggle Button */
.desktop-toggle-btn {
    position: absolute;
    top: 20px;
    left: calc(var(--sidebar-width) + 40px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    z-index: 1002;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s, background 0.2s, color 0.2s;
}

.desktop-toggle-btn:hover {
    background: var(--accent-blue);
    color: #fff;
    transform: scale(1.08);
}

.desktop-toggle-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.desktop-toggle-btn.collapsed {
    left: 20px;
}

.desktop-toggle-btn.collapsed svg {
    transform: rotate(180deg);
}

.brand-section { padding: 32px 24px; border-bottom: 1px solid var(--border-color); text-align: center; }
.logo-link { display: inline-block; transition: 0.3s; }
.logo-link:hover { transform: scale(1.05); }
.logo { max-width: 160px; margin-bottom: 16px; border-radius: 4px; }
h1 { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 700; line-height: 1.2; margin-bottom: 6px; color: var(--accent-blue); }
.dark-theme h1 { color: #fff; }
.tagline { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }

/* General Controls */
.top-controls { padding: 16px 24px; border-bottom: 1px solid var(--border-color); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.toggle-pill {
    flex: 1 1 calc(50% - 8px); padding: 8px; font-size: 0.75rem; font-weight: 600; border-radius: 20px;
    border: 1px solid var(--border-color); cursor: pointer; text-align: center; transition: 0.2s; white-space: nowrap; min-width: 120px;
}
.toggle-pill.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3); }
.toggle-pill.secondary { border-color: #8e44ad; color: #8e44ad; }
.toggle-pill.secondary:hover { background: #8e44ad; color: white; }
.toggle-pill.secondary.active { background: #8e44ad; color: white; }

.btn-mini {
    background: transparent;
    border: 1px solid #ccc;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-mini:hover { background: #eee; }
.btn-mini.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}
.btn-mini.active:hover {
    background: #1557b0;
    border-color: #1557b0;
}
.dark-theme .btn-mini {
    border-color: rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}
.dark-theme .btn-mini:hover {
    background: rgba(255, 255, 255, 0.1);
}
.dark-theme .btn-mini.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}
.dark-theme .btn-mini.active:hover {
    background: #3b82f6;
    border-color: #3b82f6;
}

/* Layer Items */
.layer-section { padding: 24px; border-bottom: 1px solid var(--border-color); }
.section-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }

.state-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.state-pill {
    display: flex; align-items: center; justify-content: center; padding: 6px; font-size: 0.7rem; font-weight: 700; border-radius: 6px;
    border: 1px solid var(--border-color); background: var(--card-bg); cursor: pointer; transition: 0.2s;
}
.state-pill input { display: none; }
.state-pill:hover { border-color: var(--accent-blue); transform: translateY(-1px); }
.state-pill.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); box-shadow: 0 4px 10px rgba(0,74,153,0.3); }

.layer-box { margin-bottom: 12px; padding: 12px; background: var(--card-bg); border-radius: 10px; border: 1px solid transparent; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.layer-box:hover { border-color: var(--border-color); transform: translateX(4px); background: rgba(255, 255, 255, 0.05); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.layer-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.layer-top input[type="checkbox"], #master-select {
    appearance: none; -webkit-appearance: none;
    width: 36px; height: 20px; background: rgba(148, 163, 184, 0.3); border-radius: 20px;
    position: relative; cursor: pointer; outline: none; transition: 0.3s;
    border: 1px solid var(--border-color);
    vertical-align: middle;
}
.layer-top input[type="checkbox"]::after, #master-select::after {
    content: ''; position: absolute; top: 1px; left: 2px;
    width: 16px; height: 16px; background: #fff; border-radius: 50%;
    transition: 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.layer-top input[type="checkbox"]:checked, #master-select:checked {
    background: var(--accent-blue); border-color: var(--accent-blue);
}
.layer-top input[type="checkbox"]:checked::after, #master-select:checked::after {
    left: calc(100% - 18px);
}
.layer-label { flex: 1; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.color-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Strategic Site Labels */
.leaflet-tooltip.site-label {
    display: none;
    background: white;
    color: #000;
    font-weight: 700;
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid #000;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    white-space: nowrap;
}

/* Premium dual-pseudo-element custom bordered arrows */
.leaflet-tooltip.site-label::before {
    border-color: transparent !important;
}

.leaflet-tooltip.site-label::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border: 5px solid transparent;
    background: transparent;
}

.leaflet-tooltip-right.site-label::before {
    border-right-color: #000 !important;
}
.leaflet-tooltip-right.site-label::after {
    left: 0;
    margin-left: -10px;
    top: 50%;
    margin-top: -5px;
    border-right-color: #fff;
}

.leaflet-tooltip-left.site-label::before {
    border-left-color: #000 !important;
}
.leaflet-tooltip-left.site-label::after {
    right: 0;
    margin-right: -10px;
    top: 50%;
    margin-top: -5px;
    border-left-color: #fff;
}

.leaflet-tooltip-top.site-label::before {
    border-top-color: #000 !important;
}
.leaflet-tooltip-top.site-label::after {
    bottom: 0;
    margin-bottom: -10px;
    left: 50%;
    margin-left: -5px;
    border-top-color: #fff;
}

.leaflet-tooltip-bottom.site-label::before {
    border-bottom-color: #000 !important;
}
.leaflet-tooltip-bottom.site-label::after {
    top: 0;
    margin-top: -10px;
    left: 50%;
    margin-left: -5px;
    border-bottom-color: #fff;
}
.show-labels .leaflet-tooltip.site-label,
.isolate-labels .leaflet-tooltip.site-label {
    display: block;
    pointer-events: auto;
    cursor: grab;
}
.show-labels .leaflet-tooltip.site-label:active,
.isolate-labels .leaflet-tooltip.site-label:active {
    cursor: grabbing;
}

.strategy-popup {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-primary) !important;
}

.strategy-popup-title {
    color: var(--accent-blue) !important;
}

.strategy-popup-status {
    color: var(--text-muted) !important;
}

.strategy-popup-status span {
    color: #059669 !important;
}

.strategy-popup-desc {
    color: var(--text-muted) !important;
}

/* Leaflet Popup Premium Dark Mode Style */
.dark-theme .leaflet-popup-content-wrapper,
.dark-theme .leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.95) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

@media (prefers-color-scheme: dark) {
    body:not(.light-theme) .leaflet-popup-content-wrapper,
    body:not(.light-theme) .leaflet-popup-tip {
        background: rgba(15, 23, 42, 0.95) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }
}

.opacity-slider-wrap { display: flex; align-items: center; gap: 8px; opacity: 0.6; transition: 0.3s; }
.layer-box:has(input:checked) .opacity-slider-wrap { opacity: 1; }
.opacity-slider { flex: 1; height: 4px; border-radius: 2px; cursor: pointer; }

/* Map & Overlays */
.map-view { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; }
#map { height: 100%; width: 100%; }

/* Topology Premium Overlay */
.topology-overlay {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    z-index: 2000;
    display: none;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-theme .topology-overlay {
    background: rgba(20, 22, 25, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.topology-header {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.dark-theme .topology-header { border-color: rgba(255,255,255,0.05); }

.topo-title-wrap h2 { margin: 0; font-family: 'Outfit', sans-serif; font-size: 1.5rem; letter-spacing: -0.5px; }
.topo-subtitle { margin: 4px 0 0; font-size: 0.85rem; color: #666; }
.dark-theme .topo-subtitle { color: #aaa; }

.topo-controls { display: flex; align-items: center; gap: 20px; }
.zoom-controls { display: flex; gap: 5px; border: 1px solid rgba(0,0,0,0.1); padding: 4px; border-radius: 8px; background: rgba(0,0,0,0.03); }
.dark-theme .zoom-controls { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); }

.zoom-controls .btn-mini { width: 30px; height: 30px; font-weight: bold; font-size: 1.1rem; padding: 0; display: flex; justify-content: center; align-items: center; border: none; }
.zoom-controls .btn-mini:hover { background: var(--primary); color: white; }

.close-topo { font-size: 2rem; cursor: pointer; color: #999; line-height: 1; }
.close-topo:hover { color: #ff3e3e; }

#topology-cy {
    flex: 1;
    width: 100%;
}

.topology-footer {
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.02);
    border-top: 1px solid rgba(0,0,0,0.05);
}
.dark-theme .topology-footer { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.05); }

.topo-nav-hint {
    padding: 8px 30px;
    font-size: 0.7rem;
    color: #888;
    background: rgba(0,0,0,0.03);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    gap: 15px;
}
.dark-theme .topo-nav-hint { background: rgba(255,255,255,0.03); color: #888; }

.topo-legend {
    position: absolute;
    bottom: 45px;
    left: 25px;
    z-index: 1005;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    padding: 14px 18px;
    color: #f8fafc;
    cursor: grab;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.8rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.topo-legend:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}
.topo-legend:active {
    cursor: grabbing;
}
body:not(.light-theme) .topo-legend {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}
.light-theme .topo-legend {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #1e293b;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
.light-theme .legend-drag-handle {
    border-right-color: rgba(0, 0, 0, 0.15) !important;
}
.light-theme .legend-drag-handle div div {
    background: #64748b !important;
}
.dark-theme .topo-legend {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}

.topo-legend-item { display: flex; align-items: center; gap: 8px; font-weight: 600; }

.topo-tooltip {
    position: absolute;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    pointer-events: none;
    z-index: 3000;
    display: none;
    min-width: 200px;
}

.dark-theme .topo-tooltip {
    background: rgba(30, 32, 35, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.topo-tooltip strong { display: block; margin-bottom: 4px; font-family: 'Outfit', sans-serif; font-size: 1rem; }
.topo-tooltip .detail-row { margin-top: 4px; font-size: 0.75rem; color: #666; }
.dark-theme .topo-tooltip .detail-row { color: #aaa; }

.legend-container {
    position: absolute; bottom: 90px; right: 24px; z-index: 1000;
    background: var(--glass-bg); 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 16px; border-radius: 12px; border: 1px solid var(--glass-border);
    box-shadow: var(--shadow); font-size: 0.75rem; width: 180px;
    transition: all 0.3s ease;
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.legend-section { margin-bottom: 12px; }
.legend-section:last-child { margin-bottom: 0; }
.legend-section h4 { 
    margin-bottom: 8px; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    font-size: 0.65rem; 
    letter-spacing: 0.5px; 
    font-weight: 700;
}
.legend-item { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-weight: 500; }
.legend-item .color-dot { width: 12px; height: 12px; box-shadow: 0 0 4px rgba(0,0,0,0.2); }


/* Modal Editor */
.modal { display: none; position: fixed; z-index: 2000; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.modal-content {
    background: var(--sidebar-bg); margin: 5% auto; padding: 32px; width: 640px; 
    border-radius: 12px; border: 1px solid var(--border-color); position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.close { position: absolute; right: 20px; top: 15px; font-size: 24px; cursor: pointer; }
.config-editor-wrap { max-height: 400px; overflow-y: auto; margin-top: 16px; border: 1px solid var(--border-color); border-radius: 6px; }
.id-input { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--card-bg); color: var(--text-primary); }

.save-btn {
    width: 100%; margin-top: 20px; padding: 14px; border: none; border-radius: 8px;
    background: var(--accent-blue); color: #fff; font-weight: 700; cursor: pointer; transition: 0.2s;
}
.save-btn:hover { background: #003d80; transform: translateY(-1px); }

/* Buttons */
.footer-buttons { padding: 24px; border-top: 1px solid var(--border-color); margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.btn-line {
    width: 100%; padding: 10px; border-radius: 6px; border: 1px solid var(--border-color);
    background: var(--card-bg); color: var(--text-primary); font-weight: 600; cursor: pointer; transition: 0.2s;
}
.btn-line:hover { background: var(--accent-blue); color: #fff; }

.contact-link {
    display: block;
    text-align: center;
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.contact-link:hover {
    background: var(--accent-blue);
    color: #fff !important;
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.export-pill {
    position: absolute; top: 24px; right: 24px; z-index: 1000;
    background: var(--accent-blue); color: #fff; border: none; padding: 12px 24px;
    border-radius: 50px; font-weight: 700; box-shadow: 0 4px 15px rgba(0,74,153,0.3); cursor: pointer;
}

/* Mobile Responsive */
.mobile-menu-btn {
    display: none;
    position: absolute; top: 20px; left: 20px; z-index: 99999;
    background: var(--sidebar-bg); color: var(--text-primary); border: 1px solid var(--border-color);
    width: 48px; height: 48px; border-radius: 50%;
    box-shadow: var(--shadow); cursor: pointer;
    align-items: center; justify-content: center;
    pointer-events: auto;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
@media (max-width: 768px) {
    .desktop-toggle-btn { display: none !important; }
    .mobile-menu-btn { display: flex; }
    .sidebar {
        top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 60vh;
        border-radius: 24px 24px 0 0;
        border-left: none; border-right: none; border-bottom: none;
        transform: translateY(100%);
        animation: none; /* Override desktop animation */
    }
    .sidebar.mobile-open { transform: translateY(0); }
    
    .legend-container {
        display: block !important;
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: auto;
        top: auto;
        z-index: 10000;
        width: 120px;
        height: 36px;
        overflow: hidden;
        padding: 8px 12px;
        border-radius: 18px;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        box-shadow: 0 4px 15px rgba(0,0,0,0.25);
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        cursor: pointer;
        animation: none;
    }

    .legend-container::before {
        content: "📊 Legend";
        display: block;
        font-weight: bold;
        font-family: 'Outfit', sans-serif;
        color: var(--text-primary);
        font-size: 0.8rem;
        text-align: center;
        line-height: 18px;
    }

    .legend-container .legend-section {
        opacity: 0;
        transition: opacity 0.3s ease;
        margin-top: 12px;
    }

    /* Expand when hovered or tapped */
    .legend-container:hover,
    .legend-container:active,
    .legend-container:focus-within {
        height: 280px;
        width: 200px;
        border-radius: 12px;
        overflow-y: auto;
        padding: 16px;
    }

    .legend-container:hover::before,
    .legend-container:active::before,
    .legend-container:focus-within::before {
        content: "📊 Map Legend";
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 6px;
        margin-bottom: 8px;
    }

    .legend-container:hover .legend-section,
    .legend-container:active .legend-section,
    .legend-container:focus-within .legend-section {
        opacity: 1;
    }

    .export-pill { top: auto; bottom: 80px; right: 20px; }

    /* Mobile Topology Premium Overlay */
    .topology-overlay {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        height: 100vh !important;
        width: 100vw !important;
    }

    .topology-header {
        padding: 16px 20px !important;
    }

    .topo-title-wrap h2 {
        font-size: 1.6rem !important;
    }

    .topo-subtitle {
        font-size: 0.95rem !important;
    }

    .topo-controls {
        gap: 15px !important;
    }

    .zoom-controls .btn-mini {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.4rem !important;
    }

    .close-topo {
        font-size: 2.8rem !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .topo-nav-hint {
        padding: 10px 20px !important;
        font-size: 0.85rem !important;
    }

    .topo-legend {
        padding: 15px 20px !important;
        font-size: 0.95rem !important;
        gap: 15px !important;
    }
}

/* Locked Features & Lock Badges */
.locked-feature {
    opacity: 0.65;
    position: relative;
    border-color: rgba(239, 68, 68, 0.2) !important;
}
.locked-feature * {
    cursor: not-allowed !important;
    pointer-events: none;
}
.locked-feature:hover {
    border-color: rgba(239, 68, 68, 0.4) !important;
    background: rgba(239, 68, 68, 0.05) !important;
}
.state-pill.locked-feature {
    background: rgba(239, 68, 68, 0.03) !important;
}
.toggle-pill.locked-feature {
    border-color: rgba(239, 68, 68, 0.2) !important;
    color: var(--text-muted) !important;
}
.toggle-pill.locked-feature:hover {
    background: rgba(239, 68, 68, 0.05) !important;
    color: var(--text-muted) !important;
}
.lock-badge {
    margin-left: auto;
    font-size: 0.8rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    cursor: pointer !important;
    background: transparent;
    border-radius: inherit;
    pointer-events: auto !important;
}
#close-upsell:hover {
    color: #ef4444 !important;
    transform: scale(1.1);
}

/* Premium Glassmorphic Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.99));
    z-index: 15000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 1;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
    font-family: 'Outfit', sans-serif;
    visibility: visible;
}

.loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3.5rem;
    border-radius: 2.5rem;
    width: 90%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: white;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.loader-logo {
    margin-bottom: 2rem;
}

.loader-brand-img {
    max-width: 140px;
    border-radius: 6px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Spinner Styles */
.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(26, 115, 232, 0.1);
    border-top: 4px solid var(--accent-blue);
    border-right: 4px solid rgba(26, 115, 232, 0.5);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-glow {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26, 115, 232, 0.2) 0%, transparent 70%);
    filter: blur(8px);
    animation: pulseGlowCircle 2s infinite ease-in-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseGlowCircle {
    0%, 100% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.9; }
}

.loader-content h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #ffffff;
    letter-spacing: -0.5px;
    font-family: 'Outfit', sans-serif;
}

.loader-content p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.8rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
    border-radius: 10px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite linear;
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.progress-percent {
    font-size: 0.85rem;
    font-weight: 700;
    color: #3b82f6;
    letter-spacing: 0.5px;
}

/* Collapsible Sections */
.collapsible-section {
    padding: 24px;
}
.section-header {
    user-select: none;
    transition: color 0.2s ease;
}
.section-header:hover .toggle-icon {
    color: var(--accent-blue) !important;
}
.collapsible-content {
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-icon.rotated {
    transform: rotate(90deg);
    color: var(--accent-blue) !important;
}

/* Success Toast Notification */
.success-toast {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    opacity: 0;
    backdrop-filter: blur(8px);
}

.success-toast::before {
    content: "✓";
    font-weight: 900;
    font-size: 1.2rem;
}

.success-toast.show {
    bottom: 40px;
    opacity: 1;
}

/* Paywall Benefits Section */
.paywall-benefits {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    margin: 0.5rem 0 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.25rem;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.benefit-icon {
    font-size: 1.25rem;
    line-height: 1.2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.benefit-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.benefit-text strong {
    font-size: 0.9rem;
    color: #ffffff;
    font-weight: 700;
}

.benefit-text span {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.3;
}

/* Demo Request Button styling */
.demo-request-container {
    text-align: center;
    margin: 1.5rem 0 0.5rem 0;
}

.demo-request-btn {
    display: inline-block;
    padding: 10px 24px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.25s, border-color 0.25s, transform 0.25s;
}

.demo-request-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #60a5fa;
    transform: translateY(-1px);
}

/* Subtle premium pulsing keyframes for locked features */
@keyframes lockedPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
        border-color: rgba(59, 130, 246, 0.3);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
        border-color: rgba(59, 130, 246, 0.6);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
        border-color: rgba(59, 130, 246, 0.3);
    }
}

.layer-box.pulse-attention {
    animation: lockedPulse 2s infinite ease-in-out;
    background: rgba(59, 130, 246, 0.04) !important;
}

/* Premium styling and 3s breathing pulse for the top viewer upgrade badge */
#viewer-upgrade-badge {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ef4444, #3b82f6);
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    z-index: 2000;
    letter-spacing: 0.5px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: badgePulse 3s infinite ease-in-out;
}

#viewer-upgrade-badge:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

@keyframes badgePulse {
    0% {
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 4px 22px rgba(59, 130, 246, 0.6);
    }
    100% {
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    }
}

/* Sidebar Layer Search Input Style */
.layer-search-wrap {
    padding: 12px 24px 8px;
}

#layer-search-input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

#layer-search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.05);
    background: var(--bg-main);
}

/* Mobile Paywall Optimization */
@media (max-width: 480px) {
    .paywall-card {
        padding: 1.5rem !important;
        border-radius: 1.5rem !important;
    }
    .paywall-header h1 {
        font-size: 1.5rem !important;
    }
    .pay-option .price {
        font-size: 2.5rem !important;
    }
}

/* Staggered entrance animation for layer-box inside expanded collapsible sections */
@keyframes layerBoxFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.collapsible-content.expanded .layer-box {
    opacity: 0;
    animation: layerBoxFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.collapsible-content.expanded .layer-box:nth-child(1) { animation-delay: 0.04s; }
.collapsible-content.expanded .layer-box:nth-child(2) { animation-delay: 0.08s; }
.collapsible-content.expanded .layer-box:nth-child(3) { animation-delay: 0.12s; }
.collapsible-content.expanded .layer-box:nth-child(4) { animation-delay: 0.16s; }
.collapsible-content.expanded .layer-box:nth-child(5) { animation-delay: 0.2s; }
.collapsible-content.expanded .layer-box:nth-child(6) { animation-delay: 0.24s; }
.collapsible-content.expanded .layer-box:nth-child(7) { animation-delay: 0.28s; }
.collapsible-content.expanded .layer-box:nth-child(8) { animation-delay: 0.32s; }
.collapsible-content.expanded .layer-box:nth-child(9) { animation-delay: 0.36s; }
.collapsible-content.expanded .layer-box:nth-child(10) { animation-delay: 0.4s; }

/* --- SCREEN ROTATION & LANDSCAPE OPTIMIZATIONS --- */

/* gatekeeper-overlay and paywall-card scrollability on small heights */
@media (max-height: 600px) {
    .gatekeeper-overlay {
        align-items: flex-start !important;
        overflow-y: auto !important;
        padding: 20px !important;
    }
    .paywall-card {
        margin: 20px auto !important;
        padding: 1.5rem !important;
        border-radius: 1.5rem !important;
    }
}

/* Paywall options side-by-side responsiveness */
.paywall-options {
    display: flex;
    flex-direction: column;
}
@media (min-width: 576px) and (min-height: 320px) {
    .paywall-options {
        flex-direction: row;
        align-items: stretch;
        gap: 1.5rem;
    }
    .pay-option, .promo-option {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .divider {
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 2rem;
    }
    .divider::before, .divider::after {
        top: 0 !important;
        left: 50% !important;
        width: 1px !important;
        height: 35% !important;
        transform: translateX(-50%);
    }
    .divider::after {
        top: auto !important;
        bottom: 0 !important;
    }
    .divider::before { left: 50% !important; }
    .divider::after { left: 50% !important; }
}

/* Landscape Mode Screen Rotation Mobile Layout (max-height < 500px and orientation landscape) */
@media (max-width: 992px) and (orientation: landscape) {
    .desktop-toggle-btn { display: none !important; }
    .mobile-menu-btn {
        display: flex !important;
        top: 10px !important;
        left: 10px !important;
        width: 38px !important;
        height: 38px !important;
    }
    
    .sidebar {
        top: 10px !important;
        left: 10px !important;
        bottom: 10px !important;
        right: auto !important;
        width: 290px !important;
        height: calc(100vh - 20px) !important;
        border-radius: 12px !important;
        border: 1px solid var(--border-color) !important;
        transform: translateX(-115%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        animation: none !important;
        z-index: 10001 !important;
    }
    .sidebar.mobile-open {
        transform: translateX(0) !important;
    }
    
    /* Make brand section and buttons very compact for small heights */
    .brand-section {
        padding: 12px 16px !important;
    }
    .brand-section .logo {
        max-width: 90px !important;
        margin-bottom: 6px !important;
    }
    .brand-section h1 {
        font-size: 0.95rem !important;
        margin-bottom: 2px !important;
    }
    .brand-section .tagline {
        font-size: 0.65rem !important;
    }
    
    .top-controls {
        padding: 10px 16px !important;
        gap: 6px !important;
    }
    .toggle-pill {
        padding: 6px 8px !important;
        font-size: 0.65rem !important;
        min-width: 100px !important;
    }
    
    .layer-section {
        padding: 12px 16px !important;
    }
    .state-grid {
        gap: 6px !important;
    }
    .state-pill {
        padding: 4px !important;
        font-size: 0.65rem !important;
    }
    
    .footer-buttons {
        padding: 12px 16px !important;
    }
    .footer-buttons p {
        margin-top: 4px !important;
    }
    
    /* Reposition Legend and KML export pill so they sit side-by-side or stack neatly without overlap */
    .legend-container {
        left: auto !important;
        right: 10px !important;
        bottom: 10px !important;
        z-index: 10000 !important;
        width: 110px !important;
        height: 32px !important;
        overflow: hidden !important;
        padding: 6px 10px !important;
        border-radius: 16px !important;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
    .legend-container::before {
        content: "📊 Legend" !important;
        display: block !important;
        font-weight: bold !important;
        font-size: 0.75rem !important;
        text-align: center !important;
        line-height: 18px !important;
    }
    .legend-container:hover,
    .legend-container:active,
    .legend-container:focus-within {
        height: 200px !important;
        width: 180px !important;
        border-radius: 12px !important;
        padding: 12px !important;
        overflow-y: auto !important;
    }
    .legend-container:hover::before,
    .legend-container:active::before,
    .legend-container:focus-within::before {
        content: "📊 Map Legend" !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding-bottom: 4px !important;
        margin-bottom: 6px !important;
    }
    
    .export-pill {
        top: auto !important;
        bottom: 50px !important;
        right: 10px !important;
        padding: 8px 16px !important;
        font-size: 0.75rem !important;
        z-index: 10000 !important;
    }
    
    /* Optimize Premium Topology Overlay for mobile landscape */
    .topology-overlay {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        height: 100vh !important;
        width: 100vw !important;
    }
    .topology-header {
        padding: 8px 16px !important;
    }
    .topo-title-wrap h2 {
        font-size: 1.1rem !important;
    }
    .topo-subtitle {
        font-size: 0.75rem !important;
        margin: 0 !important;
    }
    .topo-controls {
        gap: 8px !important;
    }
    .zoom-controls .btn-mini {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.1rem !important;
    }
    .close-topo {
        font-size: 1.8rem !important;
        width: 32px !important;
        height: 32px !important;
    }
    .topo-nav-hint {
        padding: 6px 16px !important;
        font-size: 0.65rem !important;
    }
    .topo-legend {
        padding: 8px 16px !important;
        font-size: 0.75rem !important;
        gap: 10px !important;
    }
}

/* Print Styles for PDF Report Generation */
@media print {
    body, html {
        width: 100%;
        height: auto;
        overflow: visible !important;
        background: white !important;
        color: black !important;
    }
    .sidebar, .top-controls, .export-pill, .legend-container, #close-topology, #viewer-upgrade-badge, .mode-indicator, .topo-title-bar, .topo-toolbar, .topo-legend {
        display: none !important;
    }
    .map-view, #topology-overlay {
        position: relative !important;
        width: 100% !important;
        height: 600px !important;
        page-break-after: always;
        background: transparent !important;
    }
    .topology-container {
        width: 100% !important;
        height: 100% !important;
    }
    #path-analysis-panel {
        position: relative !important;
        top: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        page-break-before: always;
    }
    .collapsible-content {
        display: block !important;
        max-height: none !important;
    }
    .data-pill {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1 !important;
    }
    .primary-btn, .secondary-btn, .tab-btn {
        display: none !important;
    }
    
    body::before {
        content: "ACMA Strategic Mapper - Network Route Report";
        display: block;
        font-size: 24px;
        font-weight: bold;
        text-align: center;
        margin-bottom: 20px;
        color: #0f172a;
        font-family: 'Outfit', sans-serif;
    }
}


