/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4117A1;
    --secondary-color: #6b3fcf;
    --accent-color: #E74C3C;
    --background-light: #f8f5ff;
    --background-dark: #0D0D0D;
    --text-light: #FFFFFF;
    --text-dark: #1a0a2e;
    --border-color: #ddd0f5;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-large: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background-color: var(--background-light);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

body.dark-mode {
    background-color: var(--background-dark);
    color: var(--text-light);
}

/* App Container */
#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 15px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Main Container */
main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    background-color: #E8EEF7;
}

.leaflet-container {
    background-color: #E8EEF7;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Remove tile grid boundaries */
.leaflet-tile {
    outline: none !important;
    border: none !important;
}

.leaflet-tile-pane canvas {
    outline: none !important;
    border: none !important;
}

/* Control Panel */
.control-panel {
    width: 320px;
    background: white;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px 20px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.dark-mode .control-panel {
    background: #2A2A2A;
    color: var(--text-light);
    border-right-color: #444;
}

.panel-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .panel-section {
    border-bottom-color: #444;
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-color);
}

body.dark-mode .panel-section h3 {
    color: var(--secondary-color);
}

/* Info Box */
.info-box {
    background: var(--background-light);
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 10px;
}

body.dark-mode .info-box {
    background: #3A3A3A;
    color: var(--text-light);
}

.info-box p {
    margin-bottom: 6px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* About Text */
.about-text {
    font-size: 12px;
    line-height: 1.5;
    color: #666;
}

body.dark-mode .about-text {
    color: #AAA;
}

/* ── Control Panel Header (site brand + settings button) ── */
.control-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 4px 14px 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--secondary-color);
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.site-brand-icon {
    font-size: 22px;
    line-height: 1;
}

.site-brand-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.3px;
}

body.dark-mode .site-brand-name {
    color: var(--text-light);
}

body.dark-mode .site-brand-icon img {
    filter: brightness(0) invert(1);
}

body.dark-mode .control-panel-header {
    border-bottom-color: var(--secondary-color);
}

/* ── Provider filter checkbox list ─────────────────────────── */
.provider-filter-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.provider-filter-item {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    padding: 5px 6px;
    border-radius: 6px;
    transition: background 0.15s;
    user-select: none;
}

.provider-filter-item:hover {
    background: #f0f4f8;
}

body.dark-mode .provider-filter-item:hover {
    background: #3a3a3a;
}

.provider-filter-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--secondary-color);
}

.provider-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.15);
}

.provider-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
}

body.dark-mode .provider-label {
    color: var(--text-light);
}

/* Version + ISED date info below the panel header */
.site-version-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: -8px 0 6px 0;
    padding-left: 2px;
}
.site-version-info span {
    font-size: 9.5px;
    color: #aaa;
    line-height: 1.5;
    letter-spacing: 0.01em;
}
.site-version-info .version-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
    opacity: 0.85;
}
.site-version-info .version-link:hover {
    opacity: 1;
    border-bottom-style: solid;
}
body.dark-mode .site-version-info span {
    color: #666;
}

/* Tagline below the panel header */
.site-tagline {
    font-size: 11px;
    color: #777;
    margin: 4px 0 16px 0;
    line-height: 1.4;
}

body.dark-mode .site-tagline {
    color: #999;
}

/* Settings button inside the left panel */
.btn-panel-settings {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    font-size: 19px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.btn-panel-settings:hover {
    background: #dce6ef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

body.dark-mode .btn-panel-settings {
    background: #3a3a3a;
    border-color: #555;
    color: white;
}

body.dark-mode .btn-panel-settings:hover {
    background: #4a4a4a;
}

/* Info Panel */
.info-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 480px;           /* wider to fit band tables */
    max-height: 100vh;
    background: white;
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-large);
    z-index: 1050;          /* above control panel (999) and search (1100 only for search input) */
    overflow-y: auto;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

body.dark-mode .info-panel {
    background: #2A2A2A;
    color: var(--text-light);
    border-left-color: #444;
}

.info-panel.hidden {
    transform: translateX(100%);
}

.panel-header {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.panel-content {
    padding: 20px;
    font-size: 13px;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 350px;
    max-height: 100vh;
    background: white;
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-large);
    z-index: 1001;
    overflow-y: auto;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

body.dark-mode .settings-panel {
    background: #2A2A2A;
    color: var(--text-light);
    border-left-color: #444;
}

.settings-panel.hidden {
    transform: translateX(100%);
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.setting-group input[type="range"] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--secondary-color);
}

.setting-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

#opacity-value {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Buttons */
.btn-primary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #5a2cc0;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Loading Indicator — small pill in the top-right of the map */
.loading-indicator {
    position: fixed;
    top: 12px;
    right: 12px;
    background: rgba(65, 23, 161, 0.85);
    color: white;
    padding: 5px 10px 5px 8px;
    border-radius: 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.25);
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.loading-indicator.hidden {
    opacity: 0;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* On mobile: nudge below the top bar */
@media (max-width: 768px) {
    .loading-indicator {
        top: calc(40px + env(safe-area-inset-top, 0px) + 8px);
        right: 8px;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: 6px;
    box-shadow: var(--shadow-large);
    z-index: 997;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

/* On mobile, lift toast above the 56px bottom nav bar */
@media (max-width: 768px) {
    .toast {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 12px);
    }
}

.toast.hidden {
    display: none;
}

.toast.success {
    background: #2ECC71;
}

.toast.error {
    background: #E74C3C;
}

.toast.info {
    background: #3498DB;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Leaflet Popup */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: var(--shadow-large);
}

.leaflet-popup-content {
    font-size: 13px;
    line-height: 1.6;
}

.leaflet-popup-tip {
    background: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .control-panel {
        width: 280px;
    }
    
    .info-panel,
    .settings-panel {
        width: 300px;
    }
}

/* ── Mobile thin top bar (branding only) ───────────────────── */
.mobile-top-bar {
    display: none; /* hidden on desktop */
}

/* ── Mobile bottom tab bar ──────────────────────────────────── */
.mobile-bottom-nav {
    display: none; /* hidden on desktop */
}

/* ── Mobile bottom sheets ───────────────────────────────────── */
.mobile-bottom-sheet {
    display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
    /* ── Thin top bar ── */
    .mobile-top-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        color: white;
        height: calc(40px + env(safe-area-inset-top, 0px));
        padding-top: env(safe-area-inset-top, 0px);
        flex-shrink: 0;
        z-index: 1200;
        position: relative;
    }

    .mobile-top-bar-title {
        font-size: 15px;
        font-weight: 700;
        letter-spacing: -0.2px;
        opacity: 0.95;
    }

    /* Hide the desktop header (if any) */
    .header { display: none; }

    /* ── main fills between top bar and bottom nav ── */
    main {
        height: calc(100dvh - 40px - env(safe-area-inset-top, 0px) - 56px - env(safe-area-inset-bottom, 0px));
    }

    /* ── Bottom tab bar ── */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--panel-bg, #fff);
        border-top: 1px solid var(--border-color, #e0e6ed);
        z-index: 1200;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.10);
    }

    body.dark-mode .mobile-bottom-nav {
        background: #1e2a32;
        border-top-color: #2e3a44;
    }

    .mobile-tab-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        cursor: pointer;
        color: #6b7c8d;
        font-size: 10px;
        font-weight: 500;
        padding: 6px 2px 4px;
        transition: color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        min-width: 0;
    }

    .mobile-tab-btn svg {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }

    .mobile-tab-btn span:not(.tab-satellite-icon):not(.tab-live-icon):not(.tab-back-icon) {
        font-size: 10px;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .tab-satellite-icon {
        font-size: 20px;
        line-height: 1;
    }

    .mobile-tab-btn:hover,
    .mobile-tab-btn:active {
        color: var(--primary-color);
    }

    body.dark-mode .mobile-tab-btn {
        color: #8a9baa;
    }

    body.dark-mode .mobile-tab-btn:hover,
    body.dark-mode .mobile-tab-btn:active {
        color: #c8d8e8;
    }

    /* Active tab highlight */
    .mobile-tab-btn.active {
        color: var(--secondary-color);
    }

    body.dark-mode .mobile-tab-btn.active {
        color: #9b6ee8;
    }

    /* Satellite tab active state (reuses .satellite-toggle-btn.active) */
    .mobile-tab-btn.satellite-toggle-btn.active {
        color: var(--secondary-color);
    }

    /* ── Bottom sheets ── */
    .mobile-bottom-sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        background: var(--panel-bg, #fff);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
        z-index: 1150;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: 75dvh;
        overflow: hidden;
    }

    body.dark-mode .mobile-bottom-sheet {
        background: #1e2a32;
    }

    .mobile-bottom-sheet.open {
        transform: translateY(0);
    }

    .mobile-sheet-handle {
        width: 36px;
        height: 4px;
        background: #c0cdd8;
        border-radius: 2px;
        margin: 10px auto 6px;
        flex-shrink: 0;
    }

    body.dark-mode .mobile-sheet-handle {
        background: #3a4a55;
    }

    .mobile-sheet-content {
        padding: 8px 16px 16px;
    }

    .mobile-sheet-scrollable {
        overflow-y: auto;
        max-height: calc(75dvh - 30px);
        padding-bottom: 8px;
    }

    /* Search sheet: search input row */
    #mobile-search-sheet .mobile-search-wrap {
        display: flex;
        align-items: center;
        gap: 8px;
        background: var(--input-bg, #f4f6f8);
        border: 1px solid var(--border-color, #e0e6ed);
        border-radius: 10px;
        padding: 0 10px;
        height: 44px;
    }

    body.dark-mode #mobile-search-sheet .mobile-search-wrap {
        background: #253340;
        border-color: #3a4a55;
    }

    #mobile-search-sheet .map-search-icon {
        font-size: 16px;
        flex-shrink: 0;
    }

    #mobile-search-sheet .mobile-search-input {
        flex: 1;
        border: none;
        background: transparent;
        font-size: 15px;
        color: var(--text-color, #2c3e50);
        outline: none;
        min-width: 0;
    }

    body.dark-mode #mobile-search-sheet .mobile-search-input {
        color: #c8d8e8;
    }

    #mobile-search-sheet .mobile-search-input::placeholder {
        color: #9aabb8;
    }

    #mobile-search-sheet .map-search-clear {
        background: none;
        border: none;
        cursor: pointer;
        color: #9aabb8;
        font-size: 14px;
        padding: 4px;
        flex-shrink: 0;
    }

    /* Search sheet content: reverse so results grow upward above the input */
    #mobile-search-sheet .mobile-sheet-content {
        display: flex;
        flex-direction: column-reverse;
        gap: 8px;
        padding-bottom: 12px;
    }

    /* Search results inside the sheet */
    #mobile-search-sheet .map-search-results {
        position: static;
        margin-top: 0;
        border-radius: 10px;
        max-height: 45dvh;
        overflow-y: auto;
        box-shadow: none;
        border: 1px solid var(--border-color, #e0e6ed);
    }

    body.dark-mode #mobile-search-sheet .map-search-results {
        border-color: #3a4a55;
    }

    /* ── Control panel on mobile: hidden (content shown in filters sheet) ── */
    .control-panel {
        display: none !important;
    }

    /* ── Info panel & settings panel: slide up from bottom ── */
    .info-panel,
    .settings-panel {
        width: 100%;
        right: auto;
        left: 0;
        top: auto;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        max-height: 80dvh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-bottom: 0;
    }

    .info-panel:not(.hidden),
    .settings-panel:not(.hidden) {
        transform: translateY(0);
    }

    /* Keep the panel header (with the ✕ button) always visible at the top */
    .info-panel .panel-header,
    .settings-panel .panel-header {
        position: sticky;
        top: 0;
        z-index: 10;
        border-radius: 16px 16px 0 0;
    }

    /* Hide the desktop floating search box on mobile */
    .map-search {
        display: none !important;
    }

    /* Hide desktop-only floating buttons on mobile */
    .locate-btn,
    .satellite-toggle-btn:not(.mobile-tab-btn),
    .marker-toggle-btn {
        display: none !important;
    }
}

/* ── Site detail table (used inside info panel) ─────────── */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.detail-table th,
.detail-table td {
    padding: 4px 7px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.detail-table th {
    background: #f0f4f8;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
    width: 110px;
}

.detail-table td {
    color: #222;
    word-break: break-word;
    overflow-wrap: break-word;
}

body.dark-mode .detail-table th {
    background: #3a3a3a;
    color: #ccc;
    border-color: #555;
}

body.dark-mode .detail-table td {
    color: #ddd;
    border-color: #555;
}

/* Sector <details> expand/collapse indicator */
details > summary {
    list-style: none;
    user-select: none;
    cursor: pointer;
    /* Prevent Safari from showing its own disclosure triangle */
    -webkit-appearance: none;
    appearance: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::marker { display: none; }
details > summary::before {
    content: '▶';
    font-size: 9px;
    margin-right: 6px;
    color: #888;
    transition: transform 0.2s;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
details[open] > summary::before {
    transform: rotate(90deg);
}

/* Band table alternating rows */
#tower-info-content tbody tr:nth-child(even) {
    background: #f7f9fb;
}
#tower-info-content tbody tr:hover {
    background: #ede5f8;
}

body.dark-mode #tower-info-content tbody tr:nth-child(even) {
    background: #2e2e2e;
}
body.dark-mode #tower-info-content tbody tr:hover {
    background: #2d0e7a;
}
body.dark-mode #tower-info-content tbody td {
    border-color: #555;
    color: #ddd;
}
body.dark-mode #tower-info-content thead th {
    background: #2d0e7a;
    color: #bbb;
    border-color: #555;
}

/* ── Map Search Box ─────────────────────────────────────── */
.map-search {
    position: fixed;
    /* vertically: 12px from top (no header) */
    top: 12px;
    /* horizontally: centred over the map area (right of the 320px panel) */
    left: calc(320px + (100vw - 320px) / 2);
    transform: translateX(-50%);
    z-index: 1100;          /* above Leaflet controls (z-index 1000) */
    width: min(500px, calc(100vw - 360px));
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    pointer-events: auto;
}

.map-search-input-wrap {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    padding: 0 12px;
    height: 46px;
    gap: 8px;
}

body.dark-mode .map-search-input-wrap {
    background: #2a2a2a;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.map-search-icon {
    font-size: 17px;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0.6;
}

.map-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    color: var(--text-dark);
    min-width: 0;
}

body.dark-mode .map-search-input {
    color: var(--text-light);
}

.map-search-input::placeholder {
    color: #aaa;
}

.map-search-clear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #888;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.map-search-clear:hover {
    color: #333;
}

body.dark-mode .map-search-clear:hover {
    color: #eee;
}

.map-search-results {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}

body.dark-mode .map-search-results {
    background: #2a2a2a;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.map-search-results.hidden {
    display: none;
}

.map-search-results li {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
    color: var(--text-dark);
    transition: background 0.15s;
}

body.dark-mode .map-search-results li {
    color: var(--text-light);
    border-bottom-color: #3a3a3a;
}

.map-search-results li:last-child {
    border-bottom: none;
}

.map-search-results li:hover,
.map-search-results li.active {
    background: #ede5f8;
}

body.dark-mode .map-search-results li:hover,
body.dark-mode .map-search-results li.active {
    background: #2d0e7a;
}

.map-search-results li.search-no-results {
    color: #888;
    cursor: default;
    font-style: italic;
}

.map-search-results li.search-no-results:hover {
    background: transparent;
}

.map-search-result-name {
    font-weight: 600;
}

.map-search-result-detail {
    font-size: 11px;
    color: #777;
    margin-top: 2px;
}

body.dark-mode .map-search-result-detail {
    color: #aaa;
}

/* Desktop-only search box: hidden on mobile */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* ── Mobile banner search ─────────────────────────────────── */
/* The banner search row is hidden by default; shown when search is open */
.mobile-banner-search {
    display: none;
    align-items: center;
    width: 100%;
    gap: 8px;
}

/* Default banner row (hamburger + title + actions) */
.mobile-banner-default {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
}

/* When search is open: hide default row, show search row */
.mobile-banner.search-open .mobile-banner-default {
    display: none;
}

.mobile-banner.search-open .mobile-banner-search {
    display: flex;
}

/* Back arrow button */
.mobile-search-back {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px 4px 0;
    line-height: 1;
    flex-shrink: 0;
}

/* Search input wrapper inside banner */
.mobile-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.18);
    border-radius: 8px;
    padding: 0 10px;
    height: 36px;
    gap: 6px;
    min-width: 0;
}

.mobile-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: white;
    font-size: 15px;
    min-width: 0;
}

.mobile-search-input::placeholder {
    color: rgba(255,255,255,0.65);
}

/* Clear button inside mobile search */
.mobile-search-wrap .map-search-clear {
    color: rgba(255,255,255,0.8);
}

.mobile-search-wrap .map-search-clear:hover {
    color: white;
}

/* Results dropdown for mobile — full width, below the banner */
.mobile-search-results {
    position: fixed;
    top: calc(52px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    z-index: 1300;
    border-radius: 0 0 8px 8px;
    margin: 0;
    max-height: 50dvh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* Action buttons group in banner */
.mobile-banner-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

/* Generic icon button in banner (search, etc.) */
.mobile-banner-icon-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    cursor: pointer;
    padding: 5px 7px;
    color: white;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.mobile-banner-icon-btn:hover,
.mobile-banner-icon-btn:active {
    background: rgba(255,255,255,0.3);
}

/* Hide mobile search results on desktop */
@media (min-width: 769px) {
    .mobile-search-results,
    .mobile-banner-search,
    .mobile-banner-default,
    .mobile-banner-actions,
    .mobile-banner-icon-btn {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .map-search {
        left: calc(280px + (100vw - 280px) / 2);
    }
}

/* ── My Carrier pill buttons ─────────────────────────────── */
.carrier-hint {
    font-size: 11px;
    color: #888;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

/* ── Network filter buttons (replaces old carrier-pills) ── */
.network-filter-btns {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 4px;
}

.net-filter-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    color: #444;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1.4;
    width: 100%;
    text-align: left;
}

.net-filter-btn:hover {
    background: #ede5f8;
    border-color: var(--secondary-color);
    color: var(--primary-color);
}

.net-filter-btn.active {
    background: var(--secondary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.net-filter-btn.active .provider-dot {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.7);
}

body.dark-mode .net-filter-btn {
    background: #2c2c2c;
    border-color: #555;
    color: #ccc;
}

body.dark-mode .net-filter-btn:hover {
    background: #2d0e7a;
    border-color: #9b6ee8;
    color: #c8b8f8;
}

body.dark-mode .net-filter-btn.active {
    background: #5a2cc0;
    border-color: #9b6ee8;
    color: #fff;
}

/* ── GPS Locate Button (desktop, floating over map) ─────── */
.locate-btn {
    position: absolute;
    /* Align with Leaflet zoom controls: top-right of the map area */
    top: 80px;   /* below the zoom +/- controls (~74px tall) */
    right: 10px;
    z-index: 1000;
    width: 34px;
    height: 34px;
    background: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.25);
    transition: background 0.2s, box-shadow 0.2s;
    color: #333;
}

.locate-btn:hover {
    background: #f4f4f4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.locate-btn svg {
    width: 100%;
    height: 100%;
}

/* Active/locating state */
.locate-btn.locating {
    color: var(--secondary-color);
    animation: pulse-locate 1s ease-in-out infinite;
}

@keyframes pulse-locate {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

body.dark-mode .locate-btn {
    background: #2a2a2a;
    border-color: rgba(255,255,255,0.3);
    color: #eee;
}

body.dark-mode .locate-btn:hover {
    background: #3a3a3a;
}

/* Hide desktop locate btn on mobile (we use the banner button instead) */
@media (max-width: 768px) {
    .locate-btn {
        display: none;
    }
}

/* ── Satellite / Street view toggle button ───────────────── */
.satellite-toggle-btn {
    position: absolute;
    top: 116px;   /* below locate button (~80px + 34px + 2px gap) */
    right: 10px;
    z-index: 1000;
    width: 34px;
    height: 34px;
    background: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 1px 5px rgba(0,0,0,0.25);
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
    padding: 0;
}

.satellite-toggle-btn:hover {
    background: #f4f4f4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Active state — satellite is ON */
.satellite-toggle-btn.active {
    background: var(--secondary-color);
    border-color: var(--primary-color);
    color: white;
}

.satellite-toggle-btn.active:hover {
    background: var(--primary-color);
}

body.dark-mode .satellite-toggle-btn {
    background: #2a2a2a;
    border-color: rgba(255,255,255,0.3);
}

body.dark-mode .satellite-toggle-btn:hover {
    background: #3a3a3a;
}

body.dark-mode .satellite-toggle-btn.active {
    background: var(--secondary-color);
    border-color: #9b6ee8;
}

@media (max-width: 768px) {
    /* Hide the desktop floating satellite button, but NOT the mobile tab button */
    .satellite-toggle-btn:not(.mobile-tab-btn):not(.mobile-satellite-btn) {
        display: none;
    }

    /* Mobile satellite button lives inside the banner — override the hide above */
    .satellite-toggle-btn.mobile-satellite-btn {
        display: flex;
        position: static;
        width: auto;
        height: auto;
        background: rgba(255,255,255,0.15);
        border: 1px solid rgba(255,255,255,0.4);
        border-radius: 6px;
        box-shadow: none;
        padding: 5px 7px;
        font-size: 18px;
        color: white;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: background 0.2s;
    }

    .satellite-toggle-btn.mobile-satellite-btn:hover,
    .satellite-toggle-btn.mobile-satellite-btn:active {
        background: rgba(255,255,255,0.3);
    }

    .satellite-toggle-btn.mobile-satellite-btn.active {
        background: var(--secondary-color);
        border-color: rgba(255,255,255,0.6);
        color: white;
    }
}

/* ── Mobile locate button (inside the banner) ────────────── */
.mobile-locate-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 6px;
    cursor: pointer;
    padding: 5px 7px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, opacity 0.2s;
}

.mobile-locate-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.mobile-locate-btn:hover,
.mobile-locate-btn:active {
    background: rgba(255,255,255,0.3);
}

/* Pulse animation when locating on mobile */
.mobile-locate-btn.locating {
    animation: pulse-locate 1s ease-in-out infinite;
}

/* ── Explore by City (sidebar) ───────────────────────────── */
.city-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-top: 6px;
}

.city-btn {
    background: #f4f7fa;
    border: 1px solid #dde4ec;
    border-radius: 7px;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.city-btn:hover {
    background: #ede5f8;
    border-color: var(--secondary-color);
    color: var(--primary-color);
}

.city-btn:active {
    background: #c2dff5;
}

/* Dark mode city buttons */
body.dark-mode .city-btn {
    background: #253040;
    border-color: #3a4d62;
    color: #b8cfe0;
}

body.dark-mode .city-btn:hover {
    background: #2d0e7a;
    border-color: var(--secondary-color);
    color: #c8b8f8;
}

/* ── Tower Profile Panel ─────────────────────────────────── */

/* Header: address + provider badges + split-dot preview */
.tower-profile-header {
    padding: 14px 16px 12px;
    border-bottom: 2px solid #e0e6ed;
    background: #f8fafc;
}

body.dark-mode .tower-profile-header {
    background: #232d38;
    border-bottom-color: #3a4a55;
}

.tower-profile-address {
    font-size: 13px;
    font-weight: 700;
    color: #1a2a3a;
    margin-bottom: 4px;
    line-height: 1.3;
}

body.dark-mode .tower-profile-address {
    color: #e0eaf4;
}

.tower-profile-meta {
    font-size: 11px;
    color: #666;
    margin-bottom: 10px;
}

body.dark-mode .tower-profile-meta {
    color: #999;
}

/* Row of provider badges in the header */
.tower-provider-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* Colored pill badge for each provider */
.provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px 3px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.provider-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    flex-shrink: 0;
}

/* ── ISED data disclaimer bar ────────────────────────────── */
.ised-disclaimer {
    font-size: 10px;
    color: #888;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    padding: 5px 14px;
    line-height: 1.4;
}

body.dark-mode .ised-disclaimer {
    color: #8a9baa;
    background: #1a2530;
    border-top-color: #2e3a44;
}

/* ── Tower layer list ─────────────────────────────────────── */
.tower-layers {
    padding: 0 0 12px 0;
}

/* Each height layer */
.tower-layer {
    border-bottom: 1px solid #eef0f3;
    padding: 0;
}

body.dark-mode .tower-layer {
    border-bottom-color: #2e3a44;
}

.tower-layer:last-child {
    border-bottom: none;
}

/* Height marker bar */
.layer-height-marker {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 4px;
    background: #f0f4f8;
    border-top: 1px solid #dde3ea;
    border-bottom: 1px solid #dde3ea;
}

body.dark-mode .layer-height-marker {
    background: #1e2a34;
    border-top-color: #2e3a44;
    border-bottom-color: #2e3a44;
}

.layer-height-label {
    font-size: 12px;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
}

body.dark-mode .layer-height-label {
    color: #a8c4d8;
}

.layer-height-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, #b0bec5, transparent);
    border-radius: 1px;
}

body.dark-mode .layer-height-line {
    background: linear-gradient(to right, #3a5060, transparent);
}

/* Owner rows inside a layer */
.layer-owners {
    padding: 4px 0;
}

/* One row per provider at this height */
.layer-owner-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.12s;
}

.layer-owner-row:last-child {
    border-bottom: none;
}

.layer-owner-row:hover {
    background: #f0f6fc;
}

body.dark-mode .layer-owner-row {
    border-bottom-color: #2a3540;
}

body.dark-mode .layer-owner-row:hover {
    background: #1e2e3a;
}

/* Color stripe on the left of each owner row */
.owner-color-stripe {
    width: 4px;
    min-height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: stretch;
}

.owner-row-main {
    flex: 1;
    min-width: 0;
}

.owner-row-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.owner-provider-name {
    font-size: 12px;
    font-weight: 700;
    color: #1a2a3a;
}

body.dark-mode .owner-provider-name {
    color: #d0e4f4;
}

.owner-licensee {
    font-size: 10px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

body.dark-mode .owner-licensee {
    color: #999;
}

/* Compact band chips */
.owner-bands {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.band-chip {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    background: #e8f0f8;
    color: #2c5282;
    border: 1px solid #c3d4e8;
    white-space: nowrap;
}

body.dark-mode .band-chip {
    background: #1a2e44;
    color: #7ec8f0;
    border-color: #2a4a64;
}

/* Expand arrow */
.owner-expand-arrow {
    font-size: 11px;
    color: #aaa;
    flex-shrink: 0;
    align-self: center;
    transition: transform 0.2s;
}

.layer-owner-row.expanded .owner-expand-arrow {
    transform: rotate(90deg);
}

/* Expanded detail block */
.owner-detail-block {
    display: none;
    padding: 8px 16px 10px 30px;
    background: #fafcff;
    border-bottom: 1px solid #eef0f3;
}

body.dark-mode .owner-detail-block {
    background: #192430;
    border-bottom-color: #2e3a44;
}

.owner-detail-block.visible {
    display: block;
}

/* Sector sub-rows inside expanded detail */
.sector-detail-row {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e0e6ed;
}

body.dark-mode .sector-detail-row {
    border-bottom-color: #2e3a44;
}

.sector-detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sector-detail-title {
    font-size: 11px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

body.dark-mode .sector-detail-title {
    color: #a8c4d8;
}

/* ── Split-dot canvas preview in header ──────────────────── */
.tower-split-dot-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Print Styles */
@media print {
    .header,
    .control-panel,
    .info-panel,
    .settings-panel,
    .loading-indicator,
    .leaflet-control {
        display: none !important;
    }
}

/* ── User Marker Popup ─────────────────────────────────────── */
.user-marker-popup {
    font-family: inherit;
    min-width: 180px;
}

/* Editable lat/lng row in the marker popup */
.ump-coords-row {
    display: flex;
    gap: 5px;
    margin-bottom: 6px;
}

.ump-coord-input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 11px;
    outline: none;
    color: #555;
    /* Hide browser spin arrows — they eat too much space */
    -moz-appearance: textfield;
}
.ump-coord-input::-webkit-inner-spin-button,
.ump-coord-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.ump-coord-input:focus {
    border-color: #3498db;
    color: #222;
}

.ump-label-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
    margin-bottom: 8px;
    outline: none;
}

.ump-label-input:focus {
    border-color: #3498db;
}

.ump-actions {
    display: flex;
    gap: 6px;
}

.ump-btn {
    flex: 1;
    padding: 5px 8px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
}

.ump-save   { background: #2ecc71; color: #fff; }
.ump-save:hover { background: #27ae60; }
.ump-delete { background: #e74c3c; color: #fff; }
.ump-delete:hover { background: #c0392b; }

/* ── Marker list in left control panel ─────────────────────── */
.marker-list-empty {
    font-size: 11px;
    color: #999;
    line-height: 1.5;
    margin: 4px 0 0;
}

.marker-list-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 4px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 3px;
}

.marker-list-row:hover {
    background: #f0f4ff;
}

.marker-list-pin {
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1;
}

.marker-list-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 11px;
    font-family: inherit;
    background: #fff;
    color: #333;
    outline: none;
    transition: border-color 0.15s;
}

.marker-list-input:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 2px rgba(230,126,34,0.15);
}

.marker-list-delete {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #c0392b;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s, background 0.15s;
}

.marker-list-delete:hover {
    opacity: 1;
    background: #fdecea;
}

body.dark-mode .marker-list-row:hover  { background: #2a2a2a; }
body.dark-mode .marker-list-input      { background: #1e1e1e; color: #eee; border-color: #444; }
body.dark-mode .marker-list-input:focus{ border-color: #e67e22; }
body.dark-mode .marker-list-empty      { color: #666; }
body.dark-mode .marker-list-delete:hover { background: #3a1a1a; }

/* ── Permanent marker label tooltip above pin ───────────────── */
.marker-label-tooltip {
    background: rgba(255, 255, 255, 0.92);
    border: 1.5px solid #e67e22;
    border-radius: 4px;
    color: #333;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    pointer-events: none;
}
.marker-label-tooltip::before {
    display: none;
}
body.dark-mode .marker-label-tooltip {
    background: rgba(30, 30, 30, 0.92);
    border-color: #e67e22;
    color: #eee;
}

/* ── Bottom-right Marker FAB Panel ─────────────────────────── */
.marker-fab-panel {
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* "Add Marker" pill button — shown when no markers exist */
.marker-fab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 24px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    transition: background 0.18s, box-shadow 0.18s, border-color 0.18s;
    white-space: nowrap;
    line-height: 1;
}

.marker-fab-btn:hover {
    background: #fff7f0;
    border-color: #e67e22;
    box-shadow: 0 3px 12px rgba(0,0,0,0.28);
}

.marker-fab-btn.active {
    background: #e67e22;
    border-color: #c0392b;
    color: white;
}

.marker-fab-btn.active:hover {
    background: #d35400;
}

.marker-fab-icon {
    font-size: 16px;
    line-height: 1;
}

.marker-fab-label {
    font-size: 12px;
}

/* Marker list card — shown when markers exist */
.marker-fab-list {
    background: white;
    border: 1.5px solid rgba(0,0,0,0.15);
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.18);
    min-width: 220px;
    max-width: 280px;
    overflow: hidden;
}

.marker-fab-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.marker-fab-list-title {
    font-size: 12px;
    font-weight: 700;
    color: #333;
}

.marker-fab-list-actions {
    display: flex;
    gap: 4px;
}

.marker-fab-share-btn,
.marker-fab-add-btn,
.marker-fab-clear-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    padding: 2px 7px;
    font-size: 14px;
    line-height: 1.4;
    color: #555;
    transition: background 0.15s, border-color 0.15s;
}

/* Apple-style share button — same pill shape as + and 🗑, Apple blue icon */
.marker-fab-share-btn {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 3px 7px;
    color: #007aff;   /* Apple blue */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.marker-fab-share-btn svg {
    width: 13px;
    height: 13px;
    display: block;
}

.marker-fab-share-btn:hover {
    background: #e8f0fb;
    border-color: #007aff;
    color: #005ecb;
}

.marker-fab-share-btn:active {
    background: #d0e4f8;
}

.marker-fab-add-btn:hover {
    background: #e8f5e9;
    border-color: #2ecc71;
    color: #27ae60;
}

.marker-fab-clear-btn:hover {
    background: #fdecea;
    border-color: #e74c3c;
    color: #c0392b;
}

/* Scrollable list of marker rows */
.marker-fab-items {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 6px;
}

.marker-fab-empty {
    margin: 8px 4px;
    font-size: 11px;
    color: #aaa;
    text-align: center;
    font-style: italic;
}

/* Dark mode */
body.dark-mode .marker-fab-btn {
    background: #2a2a2a;
    border-color: rgba(255,255,255,0.25);
    color: #eee;
}

body.dark-mode .marker-fab-btn:hover {
    background: #3a3a3a;
    border-color: #e67e22;
}

body.dark-mode .marker-fab-btn.active {
    background: #e67e22;
    border-color: #c0392b;
    color: white;
}

body.dark-mode .marker-fab-list {
    background: #1e1e1e;
    border-color: rgba(255,255,255,0.15);
}

body.dark-mode .marker-fab-list-header {
    background: #2a2a2a;
    border-bottom-color: #333;
}

body.dark-mode .marker-fab-list-title { color: #eee; }

body.dark-mode .marker-fab-add-btn,
body.dark-mode .marker-fab-clear-btn {
    border-color: #444;
    color: #ccc;
}

body.dark-mode .marker-fab-add-btn:hover  { background: #1a3a1a; border-color: #2ecc71; color: #2ecc71; }
body.dark-mode .marker-fab-clear-btn:hover { background: #3a1a1a; border-color: #e74c3c; color: #e74c3c; }

/* On mobile: hide the FAB panel (markers managed via right-click/long-press + popup) */
@media (max-width: 768px) {
    .marker-fab-panel {
        display: none;
    }
}

/* ── Mobile marker mode button (inside banner) ─────────────── */
.mobile-marker-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 6px;
    cursor: pointer;
    padding: 5px 7px;
    color: white;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.mobile-marker-btn:hover,
.mobile-marker-btn:active {
    background: rgba(255,255,255,0.3);
}

.mobile-marker-btn.active {
    background: #e67e22;
    border-color: #c0392b;
}

/* ─────────────────────────────────────────────────────────────
   Always-visible footer links — sticky at the bottom of the
   left control panel (never overlaps the map)
───────────────────────────────────────────────────────────── */
.panel-footer-links {
    position: sticky;
    bottom: 0;
    background: #f5f7fa;
    border-top: 1px solid #dde3ea;
    padding: 7px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    font-size: 11px;
    margin-top: auto;
    box-sizing: border-box;
}

.panel-footer-links a {
    color: var(--secondary-color);
    text-decoration: none;
    white-space: nowrap;
}

.panel-footer-links a:hover {
    text-decoration: underline;
}

.pfl-sep {
    color: #aaa;
    font-size: 10px;
}

body.dark-mode .panel-footer-links {
    background: #222;
    border-top-color: #444;
}

body.dark-mode .panel-footer-links a {
    color: #9b6ee8;
}

/* On mobile: hide the fixed panel footer (mobile has Settings sheet with links) */
@media (max-width: 768px) {
    .panel-footer-links {
        display: none;
    }
}

/* ─────────────────────────────────────────────────────────────
   Near Me — crosshair overlay + tower distance labels
   ───────────────────────────────────────────────────────────── */

/* Crosshair container — absolutely centered within the map-container div,
   pointer-events:none so map interactions pass straight through it.
   The map-container is position:relative (flex:1), so absolute 50%/50%
   lands exactly on map.getCenter() regardless of the left panel width. */
/* ── Desktop "Cell Towers Near Me" toggle row ───────────────── */
.nearme-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 8px 10px;
    background: #f0f4f8;
    border: 1px solid #d5dde5;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.nearme-toggle-row:hover {
    background: #e3eaf2;
}
.nearme-toggle-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
}
.nearme-toggle-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--primary-color);
}
/* The pill track */
.nearme-toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    min-width: 36px;
    height: 20px;
    background: #b0a0d0;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: visible;
    transition: background 0.2s;
}
/* The knob */
.nearme-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: left 0.2s;
    pointer-events: none;
}
/* Active (on nearme.celltowers.ca) */
.nearme-toggle-switch.active {
    background: var(--secondary-color);
}
.nearme-toggle-switch.active .nearme-toggle-knob {
    left: 18px;
}
/* Dark mode */
body.dark-mode .nearme-toggle-row {
    background: #2a2a2a;
    border-color: #3a3a3a;
}
body.dark-mode .nearme-toggle-row:hover {
    background: #333;
}
body.dark-mode .nearme-toggle-label {
    color: #e0e0e0;
}
body.dark-mode .nearme-toggle-switch {
    background: #555;
}
body.dark-mode .nearme-toggle-switch.active {
    background: var(--secondary-color);
}

.nearme-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    display: flex;          /* toggled to flex by JS when IS_NEARME */
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1001;          /* above Leaflet tiles (z-index 400) and controls (z-index 800) */
}

/* Horizontal bar */
.ch-h {
    position: absolute;
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
    border-radius: 1px;
}

/* Vertical bar */
.ch-v {
    position: absolute;
    width: 2px;
    height: 60px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
    border-radius: 1px;
}

/* Center dot */
.ch-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.55);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Tower distance/direction label rendered at the tower endpoint */
.nearme-tower-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.93);
    border: 2px solid #34495E;   /* overridden inline with provider colour */
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    transform: translate(6px, -50%);  /* offset right of the tower dot */
}

.nearme-label-dir {
    font-size: 10px;
    color: #555;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.nearme-label-az {
    font-size: 9px;
    font-weight: 400;
    color: #777;
    letter-spacing: 0;
}

.nearme-label-dist {
    font-size: 12px;
    color: #1a1a1a;
}

/* ── Live tracking button (nearme.celltowers.ca only) ────────── */
.tab-live-icon {
    font-size: 18px;
    line-height: 1;
}

/* Pulsing red glow when live tracking is active */
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.88); }
}

#tab-live.live-active {
    color: #e74c3c;
}

#tab-live.live-active .tab-live-icon {
    display: inline-block;
    animation: live-pulse 1.1s ease-in-out infinite;
}

