*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, sans-serif;
    background: #111;
    color: #eee;
}

/* ── Loading screen ─────────────────────────────────────────────────────── */
.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    font-size: 1.2rem;
    color: #888;
}

/* ── Login page ─────────────────────────────────────────────────────────── */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #0d1117;
}

.login-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 2.5rem 2rem;
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    text-align: center;
}

.login-card input {
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #0d1117;
    color: #eee;
    font-size: 1rem;
    width: 100%;
}

.login-card input:focus {
    outline: none;
    border-color: #58a6ff;
}

.login-card button {
    padding: 0.7rem;
    background: #238636;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
}

.login-card button:hover  { background: #2ea043; }
.login-card button:disabled { opacity: 0.5; cursor: default; }

.error-msg {
    color: #f85149;
    font-size: 0.9rem;
    text-align: center;
}

/* ── Map page ───────────────────────────────────────────────────────────── */
.map-root {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#map {
    position: absolute;
    inset: 0;
}

/* ── Layer Panel ─────────────────────────────────────────────────────────── */
.layer-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    min-width: 210px;
    max-width: 265px;
    background: rgba(42, 45, 56, 0.93);
    border-radius: 7px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.5);
    color: #eee;
    font-size: 13px;
    backdrop-filter: blur(4px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 9px 13px;
    background: rgba(255,255,255,0.07);
    border: none;
    border-radius: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.04em;
}
.panel-header:hover { background: rgba(255,255,255,0.13); }
.panel-open .panel-header { border-radius: 7px 7px 0 0; }
.panel-chevron { font-size: 9px; opacity: 0.6; }

.panel-body {
    padding: 4px 0 8px;
    max-height: 72vh;
    overflow-y: auto;
}

.layer-group {
    padding: 2px 0;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.layer-group:first-child { border-top: none; }

/* group-title kept for any remaining static usage */
.group-title {
    padding: 5px 13px 2px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #999;
    font-weight: 700;
}

/* Collapsible group toggle button */
.group-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    padding: 5px 13px 2px;
    background: none;
    border: none;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #999;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}
.group-toggle:hover { color: #ddd; }
.group-chevron {
    font-size: 11px;
    width: 10px;
    display: inline-block;
    text-align: center;
}

/* Subgroup (nested collapsible within a group) */
.layer-subgroup {
    margin-left: 16px;
    padding-left: 4px;
    border-left: 1px solid rgba(255,255,255,0.08);
}
.subgroup-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    padding: 4px 10px 2px;
    background: none;
    border: none;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #999;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}
.subgroup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 8px;
}
.subgroup-toggle:hover { color: #ddd; }
.subgroup-chevron {
    font-size: 11px;
    width: 10px;
    display: inline-block;
    text-align: center;
}

/* RSRP legend subtitle within RF Coverage group */
.legend-subtitle {
    padding: 4px 0 2px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #888;
    font-weight: 600;
}

.layer-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 13px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.1s;
    user-select: none;
}
.layer-row:hover { background: rgba(255,255,255,0.06); }
.layer-row input[type="checkbox"] { cursor: pointer; margin: 0; }

.layer-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2);
}

.layer-label { font-size: 12px; color: #ddd; }

/* RSRP legend */
.rsrp-legend { padding: 3px 13px 2px; }
.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.legend-row span {
    display: inline-block;
    width: 18px;
    height: 11px;
    border-radius: 2px;
    flex-shrink: 0;
}
.legend-row small { font-size: 11px; color: #bbb; font-family: monospace; }

/* ── Legend show button (when panel is hidden) ──────────────────────────── */
.legend-show-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    padding: 7px 12px;
    background: rgba(18, 18, 18, 0.93);
    color: #eee;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 14px rgba(0,0,0,0.5);
}
.legend-show-btn:hover { background: rgba(40, 40, 40, 0.97); }

/* ── Panel hidden state ─────────────────────────────────────────────────── */
.panel-hidden { display: none; }

/* ── Panel header row (toggle + close) ─────────────────────────────────── */
.panel-header-row {
    display: flex;
    align-items: stretch;
    border-radius: 7px 7px 0 0;
    overflow: hidden;
}
.panel-open .panel-header-row { border-radius: 7px 7px 0 0; }

.panel-toggle-btn {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 10px 9px 13px;
    background: rgba(255,255,255,0.07);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.04em;
}
.panel-toggle-btn:hover { background: rgba(255,255,255,0.13); }

.panel-close-btn {
    padding: 9px 11px;
    background: rgba(255,255,255,0.07);
    border: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
}
.panel-close-btn:hover { background: rgba(255,100,100,0.25); color: #fff; }

/* ── Toggle switch ──────────────────────────────────────────────────────── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 17px;
    flex-shrink: 0;
    cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
    position: absolute;
    inset: 0;
    background: #555;
    border-radius: 17px;
    transition: background 0.2s;
}
.toggle-switch input:checked ~ .toggle-track { background: #4caf50; }
.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(13px); }

/* Small toggle for subgroup headers */
.toggle-switch-sm { width: 24px; height: 13px; flex-shrink: 0; }
.toggle-switch-sm .toggle-thumb { width: 9px; height: 9px; top: 2px; left: 2px; }
.toggle-switch-sm input:checked ~ .toggle-track .toggle-thumb { transform: translateX(11px); }

/* ── Fabric legend ──────────────────────────────────────────────────────── */
.fabric-legend { padding: 3px 13px 4px; }
.fabric-legend .legend-row { margin-bottom: 3px; }

/* ── MapLibre popup theming ─────────────────────────────────────────────── */
/* ── Slide-out detail panel ─────────────────────────────────────────────── */
.detail-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 310px;
    background: rgba(30, 33, 42, 0.95);
    backdrop-filter: blur(8px);
    border-right: 1px solid rgba(255,255,255,0.1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    color: #eee;
    font-size: 10px;
}
.detail-panel.dp-open { transform: translateX(0); }
.dp-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}
.dp-close:hover { color: #fff; background: rgba(255,80,80,0.2); }
.dp-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 10px;
}
.dp-body::-webkit-scrollbar { width: 6px; }
.dp-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.dp-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.dp-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }

/* Click marker on map */
.click-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #39ff14;
    background: rgba(57,255,20,0.15);
    box-shadow: 0 0 12px rgba(57,255,20,0.7), 0 0 4px rgba(57,255,20,0.4);
    pointer-events: none;
}

/* MapLibre popup styling (still used for sites/sectors) */
.maplibregl-popup-content {
    background: rgba(30, 33, 42, 0.95);
    color: #eee;
    border-radius: 7px;
    padding: 0;
    box-shadow: 0 2px 18px rgba(0,0,0,0.65);
    font-size: 10px;
    min-width: 160px;
    max-height: 50vh;
    overflow-y: auto;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.08);
}
.maplibregl-popup-tip { border-top-color: rgba(30,33,42,0.95) !important; }
.maplibregl-popup-close-button {
    color: #888; font-size: 16px; padding: 5px 7px;
    background: none; border: none; cursor: pointer;
}
.maplibregl-popup-close-button:hover { color: #fff; background: rgba(255,80,80,0.2); }

.popup-title {
    font-weight: 700;
    font-size: 12px;
    padding: 8px 28px 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    letter-spacing: 0.03em;
}

/* ── Customer banner in fabric popup ─────────────────────────────────── */
.popup-customer-banner {
    margin: 8px 8px 6px;
    padding: 8px 10px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.18), rgba(0, 188, 212, 0.10));
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: 6px;
}
.popup-cust-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    color: #4CAF50;
    letter-spacing: 0.12em;
    margin-bottom: 6px;
}
.popup-cust-row {
    margin-top: 4px;
    padding: 4px 6px;
    background: rgba(0,0,0,0.25);
    border-radius: 4px;
}
.popup-cust-row:first-of-type { margin-top: 2px; }
.popup-cust-line1 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}
.popup-cust-svc {
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.05em;
}
.popup-cust-speeds {
    color: #80deea;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.popup-cust-mrr {
    margin-left: auto;
    color: #4CAF50;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 10px;
}
.popup-cust-line2 {
    margin-top: 2px;
    font-size: 10px;
    color: #aaa;
}

.popup-prospect-banner {
    margin: 8px 8px 4px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.10);
    border-radius: 6px;
    text-align: center;
}
.popup-prospect-badge {
    font-size: 9px;
    font-weight: 700;
    color: #888;
    letter-spacing: 0.12em;
}
.popup-table { width: 100%; border-collapse: collapse; padding-bottom: 4px; }
.popup-table tr:hover { background: rgba(255,255,255,0.05); }
.popup-key {
    color: #888;
    padding: 1px 6px 1px 10px;
    white-space: nowrap;
    vertical-align: top;
    font-family: monospace;
    font-size: 9px;
}
.popup-val {
    color: #ddd;
    padding: 1px 10px 1px 2px;
    word-break: break-word;
    font-size: 10px;
}

/* ── Address Search ─────────────────────────────────────────────────────── */
.map-search {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 320px;
}
.map-search-input {
    width: 100%;
    padding: 9px 14px;
    background: rgba(42, 45, 56, 0.93);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 7px;
    color: #eee;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 14px rgba(0,0,0,0.5);
}
.map-search-input::placeholder { color: #666; }
.map-search-input:focus { border-color: rgba(255,255,255,0.28); }
.map-search-results {
    display: none;
    margin-top: 4px;
    background: rgba(42, 45, 56, 0.97);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 7px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    max-height: 280px;
    overflow-y: auto;
}
.map-search-item {
    padding: 7px 14px;
    font-size: 12px;
    color: #ccc;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.map-search-item:last-child { border-bottom: none; }
.map-search-item:hover, .map-search-item.active { background: rgba(255,255,255,0.09); color: #fff; }
.sr-addr { color: #eee; }
.sr-city { color: #888; font-size: 11px; }
.map-search-empty { padding: 8px 14px; font-size: 12px; color: #666; font-style: italic; }

/* ── Competitive tier badge (in popup) ──────────────────────────────────── */
.comp-tier-badge {
    display: inline-block;
    margin: 6px 10px 4px;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #111;
}

/* ── Cursor coordinates ─────────────────────────────────────────────────── */
.map-coords {
    position: absolute;
    bottom: 30px;
    left: 10px;
    z-index: 50;
    font-size: 11px;
    font-family: monospace;
    color: #ccc;
    background: rgba(42, 45, 56, 0.80);
    padding: 3px 9px;
    border-radius: 4px;
    pointer-events: none;
    backdrop-filter: blur(3px);
    min-width: 170px;
    letter-spacing: 0.02em;
}

/* Trademark mark (next to t3leScope wordmark) */
.tm-mark {
    font-size: 0.42em;
    font-weight: 700;
    vertical-align: super;
    margin-left: 2px;
    opacity: 0.75;
    letter-spacing: 0;
}

/* ── Map brand ─────────────────────────────────────────────────────────── */
.map-brand {
    position: absolute;
    top: 12px;
    left: 55px;
    z-index: 100;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.08em;
    text-shadow:
        0 0 8px rgba(0,0,0,0.9),
        0 0 20px rgba(0,0,0,0.6),
        0 2px 4px rgba(0,0,0,0.8),
        1px 1px 0 rgba(0,0,0,0.5),
        -1px -1px 0 rgba(0,0,0,0.5);
    pointer-events: none;
    user-select: none;
}

/* ── Basemap switcher ──────────────────────────────────────────────────── */
.basemap-switcher {
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 100;
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.basemap-btn {
    padding: 6px 12px;
    background: rgba(42, 45, 56, 0.90);
    color: #aaa;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.04em;
    backdrop-filter: blur(4px);
    transition: background 0.15s, color 0.15s;
}
.basemap-btn:hover { background: rgba(60, 63, 75, 0.95); color: #ddd; }
.basemap-btn.basemap-active {
    background: rgba(76, 175, 80, 0.85);
    color: #fff;
}
.basemap-btn:first-child { border-right: 1px solid rgba(255,255,255,0.1); }

/* ── Pushpin marker ─────────────────────────────────────────────────────── */
.map-pin {
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.65));
    user-select: none;
}

/* ── Competitive Intelligence Panel (left side) ─────────────────────────── */
.comp-panel {
    position: absolute;
    top: 120px;
    left: 10px;
    z-index: 100;
    min-width: 220px;
    max-width: 260px;
    background: rgba(42, 45, 56, 0.93);
    border-radius: 7px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.5);
    color: #eee;
    font-size: 13px;
    backdrop-filter: blur(4px);
}

.comp-panel-hdr {
    display: flex;
    align-items: stretch;
    border-radius: 7px 7px 0 0;
    overflow: hidden;
}

.comp-panel-toggle {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 8px 9px 12px;
    background: rgba(255,255,255,0.07);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.03em;
    gap: 6px;
}
.comp-panel-toggle:hover { background: rgba(255,255,255,0.13); }

.comp-panel-close {
    padding: 9px 11px;
    background: rgba(255,255,255,0.07);
    border: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
}
.comp-panel-close:hover { background: rgba(255,100,100,0.25); color: #fff; }

.comp-panel-body {
    padding: 4px 0 8px;
    max-height: 72vh;
    overflow-y: auto;
}

.comp-tech-section {
    padding: 6px 12px 4px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.comp-tech-section:first-child { border-top: none; }

.comp-tech-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
}

.comp-tech-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.25);
}

.comp-tech-label {
    font-size: 12px;
    font-weight: 600;
    color: #ddd;
}

.comp-tier-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    padding-left: 4px;
}
.comp-tier-row small { font-size: 10px; color: #999; margin-right: 4px; }

.comp-tier-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comp-pvd-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.comp-pvd-btn {
    flex: 1;
    padding: 4px 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    color: #ccc;
    font-size: 11px;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comp-pvd-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* Service status section */
.comp-status-section { border-top: 2px solid rgba(255,255,255,0.12) !important; margin-top: 2px; }

.comp-status-hdr {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #999;
    font-weight: 700;
    margin-bottom: 5px;
}

.comp-status-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
}

.comp-pvd-clear {
    padding: 4px 7px;
    background: rgba(255,80,80,0.15);
    border: 1px solid rgba(255,80,80,0.3);
    border-radius: 5px;
    color: #f88;
    font-size: 11px;
    cursor: pointer;
}
.comp-pvd-clear:hover { background: rgba(255,80,80,0.3); color: #fff; }

/* Provider dropdown (appended to body, fixed position) */
.comp-pvd-dropdown {
    z-index: 9999;
    background: rgba(30, 32, 42, 0.98);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 7px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    overflow: hidden;
}

.comp-pvd-search {
    padding: 7px 10px;
    background: rgba(255,255,255,0.05);
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #eee;
    font-size: 12px;
    outline: none;
}
.comp-pvd-search::placeholder { color: #666; }

.comp-pvd-list {
    overflow-y: auto;
    max-height: 255px;
}

.comp-pvd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    font-size: 12px;
    color: #ccc;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.comp-pvd-item:last-child { border-bottom: none; }
.comp-pvd-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.comp-pvd-item input[type=checkbox] { cursor: pointer; }

/* Show button (visible when panel is hidden) */
.comp-show-btn {
    position: absolute;
    top: 120px;
    left: 10px;
    z-index: 100;
    display: none;
    padding: 7px 12px;
    background: rgba(18, 18, 18, 0.93);
    color: #eee;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 14px rgba(0,0,0,0.5);
}
.comp-show-btn:hover { background: rgba(40, 40, 40, 0.97); }

/* ── Fabric color mode sub-toggles ─────────────────────────────────────── */
.fabric-mode-toggles {
    padding: 2px 0 0 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* ── Legend tag grid (compact color key) ───────────────────────────────── */
.legend-tag-grid {
    display: grid;
    gap: 4px;
    padding: 3px 13px 5px;
}
.legend-tag-grid-4 { grid-template-columns: repeat(4, 1fr); }
.legend-tag-grid-3 { grid-template-columns: repeat(3, 1fr); }
.legend-tag {
    display: block;
    padding: 3px 0;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border: 1px solid rgba(0,0,0,0.3);
    text-align: center;
}

/* ── Clickable legend tag toggle ────────────────────────────────────────── */
span.legend-tag.legend-tag-toggle {
    cursor: pointer;
    background: rgba(255,255,255,0.9) !important;
    color: #333 !important;
    border: 1px solid rgba(255,255,255,0.9) !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
span.legend-tag.legend-tag-toggle:hover { opacity: 0.85; }
span.legend-tag.legend-tag-toggle.legend-tag-off {
    background: transparent !important;
    color: rgba(255,255,255,0.4) !important;
    border-color: rgba(255,255,255,0.25) !important;
}

/* ── Floating provider legend box ──────────────────────────────────────── */
.provider-legend-box {
    position: absolute;
    bottom: 35px;
    right: 280px;
    z-index: 100;
    width: 220px;
    background: rgba(42, 45, 56, 0.93);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    color: #eee;
    font-size: 12px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}
.provider-legend-box.plb-collapsed .plb-body { display: none; }
.provider-legend-box.plb-collapsed .plb-collapse { transform: rotate(-90deg); }

.plb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.plb-title {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    letter-spacing: 0.02em;
}
.plb-collapse {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    transition: transform 0.15s;
}
.plb-collapse:hover { color: #fff; }

.plb-body {
    max-height: 350px;
    overflow-y: auto;
    padding: 4px 0 6px;
}
.plb-group {
    padding: 0;
}
.plb-group-hdr {
    padding: 6px 12px 2px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
}
.plb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px 3px 20px;
}
.plb-row:hover { background: rgba(255,255,255,0.05); }
.plb-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.plb-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ccc;
}
.plb-empty { padding: 10px 12px; color: #666; font-style: italic; font-size: 11px; }
.plb-body::-webkit-scrollbar { width: 6px; }
.plb-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.plb-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.plb-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }

/* Clickable provider rows in legend */
.plb-row-clickable { cursor: pointer; transition: background 0.1s; }
.plb-row-clickable:hover { background: rgba(255,255,255,0.10); }
.plb-row-active { background: rgba(76,175,80,0.20); }
.plb-row-active .plb-name { color: #fff; font-weight: 600; }

/* Provider filter label */
.plb-filter-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    font-size: 11px;
    color: #4CAF50;
    background: rgba(76,175,80,0.10);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.plb-clear-filter {
    background: none;
    border: none;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.plb-clear-filter:hover { color: #fff; }

/* ── Provider search box in legend panel ──────────────────────────────── */
.provider-search-wrap {
    position: relative;
    padding: 4px 13px 2px;
}
.provider-search-input {
    width: 100%;
    padding: 5px 28px 5px 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    color: #eee;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
}
.provider-search-input::placeholder { color: #777; }
.provider-search-input:focus { border-color: rgba(76,175,80,0.5); background: rgba(255,255,255,0.12); }
.provider-search-clear {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.provider-search-clear:hover { color: #fff; }
.provider-search-results {
    margin: 2px 13px 4px;
    background: rgba(42,45,56,0.97);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    overflow: hidden;
}
.provider-search-item {
    padding: 5px 10px;
    font-size: 12px;
    color: #ccc;
    cursor: pointer;
    transition: background 0.1s;
}
.provider-search-item:hover { background: rgba(76,175,80,0.20); color: #fff; }

/* ── Demographic color ramp legend ──────────────────────────────────────── */
.demo-ramp {
    padding: 2px 13px 6px;
}
.demo-ramp-bar {
    height: 10px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.15);
}
.demo-ramp-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #999;
    font-family: monospace;
    margin-top: 2px;
    padding: 0 1px;
}

/* ── Popup collapsible sections ────────────────────────────────────────── */
.popup-section {
    border-top: 1px solid rgba(255,255,255,0.08);
}
.popup-section-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    padding: 4px 10px;
    background: none;
    border: none;
    color: #bbb;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    text-align: left;
}
.popup-section-toggle:hover { color: #fff; }
.popup-section-chevron {
    font-size: 11px;
    transition: transform 0.15s;
    display: inline-block;
}
.popup-section.collapsed .popup-section-body { display: none; }
.popup-section.collapsed .popup-section-chevron { transform: rotate(-90deg); }

/* ── Popup tag grid ────────────────────────────────────────────────────── */
.popup-tag-grid {
    display: grid;
    gap: 3px;
    padding: 4px 10px 6px;
}
.popup-tag-grid-4 { grid-template-columns: repeat(4, 1fr); }
.popup-tag-grid-3 { grid-template-columns: repeat(3, 1fr); }
.popup-tag {
    display: block;
    padding: 1px 0;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    text-align: center;
}
.popup-tag-off {
    background: transparent !important;
    color: rgba(255,255,255,0.45) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
}

/* ── Popup offered speed ───────────────────────────────────────────────── */
.popup-speed {
    padding: 4px 10px;
    font-size: 9px;
    color: #aaa;
    font-style: italic;
}

/* ── Popup sector path button ──────────────────────────────────────────── */
.popup-sector-path {
    display: inline-block;
    margin: 4px 10px 2px;
    padding: 2px 7px;
    font-size: 9px;
    font-weight: 600;
    color: #64b5f6;
    border: 1px solid #64b5f6;
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
    letter-spacing: 0.03em;
}
.popup-sector-path:hover { background: rgba(100,181,246,0.15); }
.popup-sector-path.active { background: rgba(100,181,246,0.25); color: #90caf9; border-color: #90caf9; }

/* ── Broadband Availability table ──────────────────────────────────────── */
.bdc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9px;
    margin-top: 2px;
}
.bdc-table thead th {
    text-align: left;
    font-size: 8px;
    font-weight: 700;
    color: #999;
    padding: 3px 6px 2px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bdc-table thead th:nth-child(3),
.bdc-table thead th:nth-child(4) { text-align: right; }
.bdc-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
.bdc-table tbody tr:hover { background: rgba(255,255,255,0.05); }
.bdc-provider { padding: 2px 6px; color: #ccc; word-break: break-word; }
.bdc-tech { padding: 2px 6px; color: #999; font-size: 8px; }
.bdc-speed { padding: 2px 6px; text-align: right; color: #bbb; font-family: monospace; font-size: 9px; }
tr.bdc-served td { color: #00e5a0; }
tr.bdc-served .bdc-tech { color: #00c090; }
tr.bdc-underserved td { color: #ffe040; }
tr.bdc-underserved .bdc-tech { color: #d4b830; }

/* ── Popup loading ─────────────────────────────────────────────────────── */
.popup-loading {
    padding: 12px 10px;
    color: #888;
    font-style: italic;
    font-size: 11px;
}
.popup-muted { color: #666; font-style: italic; }

/* Blazor error UI */
#blazor-error-ui {
    background: #f85149;
    bottom: 0;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    display: none;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ═══════════════════════════════════════════════════════════════════════
   MARKETING PANEL — Modern dashboard for area selection & summary
   ═══════════════════════════════════════════════════════════════════════ */

/* Tool launch buttons (row) */
.tool-launch-bar {
    position: absolute;
    top: 12px;
    left: 55px;
    z-index: 100;
    display: flex;
    gap: 6px;
    margin-top: 38px;
}
.marketing-launch-btn {
    z-index: 100;
    padding: 5px 10px;
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.9), rgba(13, 71, 161, 0.9));
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}
.marketing-launch-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.45);
}
.marketing-launch-btn .ml-icon { font-size: 11px; }
.marketing-launch-active {
    background: linear-gradient(135deg, rgba(25, 118, 210, 1), rgba(13, 71, 161, 1));
}

/* Path Profile panel styles */
.pp-panel { width: 420px !important; }
.pp-input-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-top: 6px;
}
.pp-input-row label {
    font-size: 11px; font-weight: 600; color: #aaa; white-space: nowrap;
}
.pp-input {
    width: 110px; padding: 5px 8px; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 6px;
    color: #fff; font-size: 12px; text-align: right; outline: none;
}
.pp-input:focus { border-color: #4CAF50; }
.pp-input-group { display: flex; gap: 4px; align-items: center; }
.pp-lock-btn {
    padding: 4px 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
    line-height: 1; color: #555; text-transform: uppercase; transition: all 0.15s;
}
.pp-lock-btn:hover { background: rgba(255,255,255,0.08); color: #888; }
.pp-locked {
    background: rgba(76,175,80,0.2); border-color: #4CAF50; color: #4CAF50;
    box-shadow: 0 0 6px rgba(76,175,80,0.3);
}
.pp-status {
    margin-top: 8px; font-size: 11px; font-weight: 600; color: #4CAF50;
    text-align: center; padding: 8px; background: rgba(76,175,80,0.08);
    border-radius: 6px;
}
.pp-results { padding: 0 !important; }
.pp-stat-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; font-size: 11px; font-weight: 700;
}
.pp-stat { color: #aaa; }
.pp-clear { color: #4CAF50; }
.pp-blocked { color: #F44336; }
.pp-chart {
    width: 100%; height: auto; display: block;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.pp-point-info {
    display: flex; align-items: center; gap: 6px; margin-top: 6px;
    padding: 5px 8px; background: rgba(255,255,255,0.04); border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.06);
}
.pp-point-badge {
    width: 18px; height: 18px; border-radius: 50%; background: #39ff14; color: #000;
    font-size: 10px; font-weight: 900; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pp-point-badge-b { background: #00BCD4; }
.pp-point-name {
    font-size: 10px; font-weight: 700; color: #ddd; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.pp-point-coords {
    font-size: 9px; color: #666; font-family: monospace; white-space: nowrap;
}
.pp-max-height {
    font-size: 9px; color: #FF9800; font-weight: 600; padding: 0 0 0 4px; margin-top: 1px;
}
.pp-calc-status {
    margin-top: 6px; padding: 6px 10px; border-radius: 6px;
    background: rgba(76,175,80,0.1); border: 1px solid rgba(76,175,80,0.25);
    color: #4CAF50; font-size: 10px; font-weight: 700; text-align: center;
    animation: pp-pulse 1.5s ease-in-out infinite;
}
@keyframes pp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.pp-marker {
    width: 22px; height: 22px; border-radius: 50%;
    background: #39ff14; color: #000; font-weight: 900; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #000; cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* Slide-out panel */
.marketing-panel {
    position: absolute;
    top: 82px;
    left: 12px;
    z-index: 99;
    width: 380px;
    max-height: calc(100vh - 94px);  /* viewport minus top offset minus 12px bottom margin */
    background: linear-gradient(180deg, rgba(28, 31, 42, 0.96) 0%, rgba(20, 23, 32, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.03) inset;
    backdrop-filter: blur(20px) saturate(140%);
    color: #f0f0f5;
    overflow-y: auto;
    animation: mp-slide-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes mp-slide-in {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.marketing-panel::-webkit-scrollbar { width: 6px; }
.marketing-panel::-webkit-scrollbar-track { background: transparent; }
.marketing-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.marketing-panel::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

.mp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mp-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
}
.mp-close {
    background: rgba(255,255,255,0.06);
    border: none;
    color: #aaa;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.mp-close:hover { background: rgba(255, 80, 80, 0.25); color: #fff; }

.mp-section {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mp-section:last-child { border-bottom: none; }

.mp-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #888;
    font-weight: 700;
    margin-bottom: 10px;
}
.mp-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.mp-label-row .mp-label { margin-bottom: 0; }

.mp-count-pill {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(76, 175, 80, 0.18);
    color: #4CAF50;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.mp-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.mp-mode-btn {
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #ccc;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.mp-mode-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(76, 175, 80, 0.4);
    color: #fff;
}
.mp-mode-active {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(0, 188, 212, 0.25)) !important;
    border-color: rgba(76, 175, 80, 0.7) !important;
    color: #fff !important;
    box-shadow: 0 0 0 1px rgba(76,175,80,0.4) inset;
}
.mp-mode-wide {
    grid-column: 1 / -1;
}

.mp-hint {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(0, 188, 212, 0.08);
    border-left: 2px solid #00BCD4;
    border-radius: 4px;
    font-size: 11px;
    color: #80deea;
    line-height: 1.4;
}

.mp-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.mp-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.15s;
}
.mp-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mp-btn-primary {
    background: linear-gradient(135deg, #1976D2, #0d47a1);
    color: #fff;
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.35);
}
.mp-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(25, 118, 210, 0.5);
}
.mp-btn-ghost {
    background: rgba(255,255,255,0.05);
    color: #ddd;
    border: 1px solid rgba(255,255,255,0.08);
}
.mp-btn-ghost:hover:not(:disabled) {
    background: rgba(255,255,255,0.10);
    color: #fff;
}

/* ── Summary dashboard view ───────────────────────────────────────── */
.mp-summary {
    animation: mp-fade-in 0.4s ease;
}
@keyframes mp-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ms-header {
    padding: 18px 20px 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: linear-gradient(180deg, rgba(76,175,80,0.06) 0%, transparent 100%);
}
.ms-eyebrow {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #4CAF50;
    font-weight: 700;
    margin-bottom: 4px;
}
.ms-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 6px;
}
.ms-area-name-input {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    background: transparent;
    border: none;
    border-bottom: 1px dashed rgba(255,255,255,0.2);
    outline: none;
    width: 100%;
    padding: 4px 0;
    margin-bottom: 4px;
    line-height: 1.1;
}
.ms-area-name-input::placeholder {
    color: rgba(255,255,255,0.25);
    font-weight: 600;
}
.ms-area-name-input:focus {
    border-bottom-color: #4CAF50;
}
.ms-subtitle {
    font-size: 11px;
    color: #888;
    line-height: 1.5;
}

.ms-hero {
    text-align: center;
    padding: 22px 20px 24px;
    background: radial-gradient(circle at 50% 0%, rgba(76, 175, 80, 0.08), transparent 70%);
}
.ms-hero-num {
    font-size: 52px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #4CAF50 0%, #00BCD4 50%, #7c4dff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.ms-hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #888;
    font-weight: 600;
}

.ms-section {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.ms-section-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #888;
    font-weight: 700;
    margin-bottom: 12px;
}

.ms-empty {
    font-size: 12px;
    color: #666;
    font-style: italic;
    padding: 8px 0;
}

/* Coverage stacked bar */
.ms-stack-bar {
    display: flex;
    height: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
.ms-stack-seg {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.seg-served { background: linear-gradient(90deg, #00e5a0, #4CAF50); }
.seg-under  { background: linear-gradient(90deg, #ffe040, #ff9800); }
.seg-unser  { background: linear-gradient(90deg, #ef5350, #c62828); }

.ms-stack-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ms-stack-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #ccc;
}
.ms-num {
    margin-left: auto;
    color: #888;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.ms-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 2px;
}

/* Stat grid */
.ms-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.ms-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.ms-stat {
    padding: 14px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    text-align: left;
}
.ms-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}
.gradient-text {
    background: linear-gradient(135deg, #4CAF50, #00BCD4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ms-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    font-weight: 600;
    margin-top: 4px;
}

/* Penetration pills (Customer Base) */
.ms-pen-row {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.ms-pen-pill {
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(76, 175, 80, 0.15);
    color: #80e89d;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.ms-pen-pill-dim {
    background: rgba(255,255,255,0.05);
    color: #aaa;
}

/* Opportunity stat sublabel */
.ms-opp-stat .ms-stat-sublabel {
    margin-top: 4px;
    font-size: 9px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-style: italic;
}

/* MRR disclaimer */
.ms-disclaimer {
    font-size: 9px;
    color: #666;
    margin-left: 2px;
}
.ms-disclaimer-text {
    margin-top: 8px;
    font-size: 9px;
    color: #555;
    font-style: italic;
    line-height: 1.4;
}

.ms-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.ms-tag {
    padding: 4px 10px;
    background: rgba(76, 175, 80, 0.12);
    color: #80deea;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Tech breakdown list (used by Inland Presence + expanded competitor detail) */
.ms-tech-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ms-tech-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 7px 10px;
    background: rgba(255,255,255,0.025);
    border-radius: 6px;
    font-size: 12px;
}
.ms-tech-row-name {
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10px;
}
.ms-tech-row-locs {
    color: #4CAF50;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}
.ms-tech-row-speed {
    color: #80deea;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    min-width: 80px;
    text-align: right;
    letter-spacing: 0.01em;
}
.ms-tech-row-speed::after {
    content: ' Mbps';
    color: #555;
    font-size: 9px;
    font-weight: 600;
    margin-left: 3px;
}

/* Competitor rows */
.ms-comp-row {
    position: relative;
    margin-bottom: 4px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.ms-comp-row:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(0,188,212,0.25);
}
.ms-comp-expanded {
    background: rgba(0,188,212,0.08);
    border-color: rgba(0,188,212,0.45) !important;
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.ms-comp-chev {
    margin-left: 10px;
    color: #888;
    font-size: 11px;
    transition: color 0.15s;
}
.ms-comp-expanded .ms-comp-chev { color: #00BCD4; }

/* Expanded detail panel for a competitor */
.ms-comp-detail {
    margin-bottom: 8px;
    padding: 10px 12px 12px;
    background: rgba(0, 188, 212, 0.04);
    border: 1px solid rgba(0,188,212,0.25);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    animation: ms-detail-in 0.25s ease;
}
@keyframes ms-detail-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ms-comp-detail .ms-tech-row {
    background: rgba(0,0,0,0.25);
}
.ms-comp-bar-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.ms-comp-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 188, 212, 0.18), rgba(0, 188, 212, 0.04));
    border-right: 1px solid rgba(0, 188, 212, 0.4);
    animation: ms-bar-grow 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes ms-bar-grow {
    from { width: 0; }
}
.ms-comp-info {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ms-comp-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.ms-comp-num {
    font-size: 12px;
    font-weight: 700;
    color: #4CAF50;
    font-variant-numeric: tabular-nums;
}

/* Tech grid */
.ms-tech-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}
.ms-tech-item {
    text-align: center;
    padding: 10px 2px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
}
.ms-tech-num {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ms-tech-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    font-weight: 600;
    margin-top: 4px;
}

.ms-actions {
    display: flex;
    gap: 8px;
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.ms-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
