/* ── Reset & layout ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; margin: 0; padding: 0; }

/* ── Navbar ─────────────────────────────────────────────────────────────── */
#navbar {
    height: 54px;
    background: #0f1117;
    border-bottom: 1px solid #2a2a3a;
    flex-shrink: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
}

#app-title {
    color: #e0e8ff;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

#stats-bar {
    color: #6070a0;
    font-size: 12px;
    white-space: nowrap;
    flex-grow: 1;
    text-align: center;
}

/* ── Navbar About button ────────────────────────────────────────────────── */
#navbar-about {
    flex-shrink: 0;
    background: none;
    border: 1px solid #2a2a3a;
    border-radius: 5px;
    color: #6070a0;
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
#navbar-about:hover { color: #c0ccf0; border-color: #4a4a6a; }

/* ── Search ─────────────────────────────────────────────────────────────── */
#search-wrap {
    position: relative;
    width: 260px;
    flex-shrink: 0;
}

#search-input {
    width: 100%;
    padding: 6px 12px;
    background: #1e2130;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    color: #d0d8f0;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

#search-input::placeholder { color: #5060a0; }
#search-input:focus { border-color: #4a8ad4; }
#search-input.searching { border-color: #6878b8; background: #1e2130; }
#search-input.searching::placeholder { color: #6878b8; }

#search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    z-index: 2000;
    background: #1a1c2e;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    list-style: none;
    margin: 0; padding: 0;
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

#search-results.open { display: block; }
#search-results li { padding: 9px 14px; color: #c0ccf0; cursor: pointer; border-bottom: 1px solid #25273a; font-size: 13px; transition: background 0.1s; }
#search-results li:last-child { border-bottom: none; }
#search-results li:hover { background: #252840; }
.sr-meta { color: #6070a0; font-size: 11px; margin-top: 2px; }
/* Activity-match snippet shown below facility name in search results */
.sr-snippet { color: #7888b8; font-size: 11px; margin-top: 3px; line-height: 1.4; font-style: italic; }
/* Highlighted search term within name or snippet */
mark.sr-hl { background: #2a3a70; color: #a8c0f8; border-radius: 2px; padding: 0 1px; }
/* Layer / match-type tag (float right) */
.sr-tag { float: right; font-size: 10px; margin-left: 6px; }
.sr-tag-activity { color: #7a9a50; }

/* ── Main layout ────────────────────────────────────────────────────────── */
#main { display: flex; height: calc(100vh - 54px); }

/* ── Sidebar collapse tab ───────────────────────────────────────────────── */
#sidebar-tab {
    align-self: flex-start;
    margin-top: 10px;
    z-index: 900;
    background: #12141f;
    border: 1px solid #2a2a3a;
    border-left: none;
    border-radius: 0 4px 4px 0;
    color: #6070a0;
    cursor: pointer;
    padding: 6px 4px;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
#sidebar-tab:hover { color: #c0ccf0; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
#sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #12141f;
    border-right: 1px solid #2a2a3a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.25s ease;
}
#sidebar.collapsed {
    width: 0;
    border-right: none;
}

.side-panel { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.side-header {
    background: #0e1020;
    border-bottom: 1px solid #252535;
    padding: 10px 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    min-height: 44px;
}

.side-title   { color: #c0ccf0; font-size: 14px; font-weight: 600; flex-grow: 1; }
.side-badge   { color: #5060a0; font-size: 12px; }

#back-btn { background: none; border: none; color: #6070a0; font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1; transition: color 0.15s; flex-shrink: 0; }
#back-btn:hover { color: #c0ccf0; }

.side-scroll { overflow-y: auto; flex-grow: 1; }
.side-placeholder { color: #5060a0; font-size: 13px; padding: 20px 16px; text-align: center; }

.side-section { padding: 12px 16px; border-bottom: 1px solid #1e2030; }
.side-section-label { color: #4a5280; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; margin-bottom: 8px; }

/* ── Detail panel tabs ──────────────────────────────────────────────────── */
#detail-tabs {
    display: flex;
    flex-shrink: 0;
    background: #0e1020;
    border-bottom: 1px solid #252535;
    overflow-x: auto;
    scrollbar-width: none;
}
#detail-tabs::-webkit-scrollbar { display: none; }

.dtab {
    flex-shrink: 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #5060a0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 8px 10px;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
    white-space: nowrap;
}
.dtab:hover { color: #c0ccf0; }
.dtab.active { color: #c0ccf0; border-bottom-color: #4a8ad4; }

.tab-pane { height: 100%; }

#detail-content {
    display: flex !important;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
}

/* ── Defence tab ────────────────────────────────────────────────────────── */
/* ── Defence sub-tab bar ────────────────────────────────────────────────── */
#defence-subtab-bar {
    display: flex;
    flex-shrink: 0;
    background: #0b0d1a;
    border-bottom: 1px solid #1e2030;
}

.dsubtab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #4a5280;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
}
.dsubtab:hover { color: #a0b0d8; }
.dsubtab.active { color: #a0b0d8; border-bottom-color: #8b1a1a; }

.def-prog { padding: 10px 16px; border-bottom: 1px solid #1e2030; }
.def-prog-name { color: #c0ccf0; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.def-prog-org  { color: #4a5280; font-size: 11px; margin-bottom: 4px; }
.def-prog-obj  { color: #8090b8; font-size: 11px; line-height: 1.5; }
.def-fac-item  { padding: 8px 16px; border-bottom: 1px solid #1a1c2c; }
.def-fac-name  { color: #b0bcde; font-size: 12px; font-weight: 500; }
.def-fac-meta  { color: #404870; font-size: 11px; margin-top: 2px; }

/* ── Vaccine tab ────────────────────────────────────────────────────────── */
.vac-item      { padding: 9px 16px; border-bottom: 1px solid #1a1c2c; cursor: pointer; transition: background 0.12s; }
.vac-item:hover { background: #1c1f35; }
.vac-name      { color: #b0bcde; font-size: 12px; font-weight: 500; }
.vac-meta      { color: #404870; font-size: 11px; margin-top: 2px; }

/* ── Legislation tab ────────────────────────────────────────────────────── */
.leg-year-block { padding: 10px 16px; border-bottom: 1px solid #1e2030; }
.leg-year-head  { color: #c0ccf0; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.leg-table      { width: 100%; border-collapse: collapse; font-size: 11px; }
.leg-table td   { padding: 2px 4px; vertical-align: top; }
.leg-table td:first-child { color: #5060a0; width: 80px; }
.leg-table td:not(:first-child) { color: #8090b8; }
.leg-yn-yes     { color: #1e7e45 !important; font-weight: 600; }
.leg-yn-no      { color: #7a4010 !important; }
.leg-laws       { color: #6878a8; font-size: 10px; margin-top: 4px; font-style: italic; }

/* ── History (Form F) tab ───────────────────────────────────────────────── */
.hist-item      { padding: 10px 16px; border-bottom: 1px solid #1e2030; }
.hist-year      { color: #c0ccf0; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.hist-badge     { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 10px; font-weight: 600; margin-right: 4px; }
.hist-offensive { background: #5a1010; color: #e08080; }
.hist-defensive { background: #0a3a5a; color: #80c0e0; }
.hist-none      { background: #1e2030; color: #5060a0; }
.hist-summary   { color: #7080a0; font-size: 11px; margin-top: 4px; line-height: 1.5; }

/* ── Country list ───────────────────────────────────────────────────────── */
.country-item { padding: 10px 16px; border-bottom: 1px solid #1a1c2c; cursor: pointer; transition: background 0.12s; }
.country-item:hover  { background: #1c1f35; }
.country-item.active { background: #162040; border-left: 3px solid #4a8ad4; }
.country-name { color: #d0d8f0; font-size: 13px; font-weight: 500; }
.country-meta { color: #4a5680; font-size: 11px; margin-top: 3px; }

/* ── Compliance grid (heatmap) ──────────────────────────────────────────── */
.compliance-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: #6070a0; margin-bottom: 8px; align-items: center; }
.leg-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

.compliance-grid { overflow-x: auto; }
.compliance-grid table { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; font-size: 11px; }
.compliance-grid col.yr-col  { width: 36px; }
.compliance-grid col.frm-col { width: calc((100% - 36px) / 7); }
.compliance-grid th { color: #4a5280; font-size: 10px; font-weight: 700; padding: 2px 0 4px; text-align: center; letter-spacing: 0.02em; }
.compliance-grid th.yr-col { text-align: left; color: #3a4060; }
.compliance-grid td { padding: 0; height: 18px; border-radius: 3px; }
.compliance-grid td.yr-col { background: none !important; color: #7080a0; font-size: 11px; font-weight: 500; text-align: left; padding-right: 4px; vertical-align: middle; }

.td-sub { background: #1e7e45; }
.td-ntd { background: #7a4010; }
.td-abs { background: #1c1e2e; }
.td-ltd { background: #8b6914; }

/* ── Facility list in sidebar ───────────────────────────────────────────── */
.fac-item { padding: 9px 16px; border-bottom: 1px solid #1a1c2c; cursor: pointer; transition: background 0.12s; }
.fac-item:hover { background: #1c1f35; }
.fac-name { color: #b0bcde; font-size: 13px; }
.fac-meta { color: #404870; font-size: 11px; margin-top: 3px; }

/* ── Map ─────────────────────────────────────────────────────────────────── */
#map { flex: 1; position: relative; }

/* ── Filter panel ───────────────────────────────────────────────────────── */
#filter-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 800;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    width: 220px;
    max-height: calc(100% - 20px);
    overflow-y: auto;
    font-size: 12px;
}

#fp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f0f2f8;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #dde2f0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.fp-title { font-weight: 700; font-size: 12px; color: #2a3060; letter-spacing: 0.04em; }

#fp-collapse {
    background: none;
    border: none;
    font-size: 16px;
    color: #8090b0;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
#fp-collapse:hover { color: #2a3060; }

.fp-section { padding: 10px 12px; border-bottom: 1px solid #eef0f8; }
.fp-section:last-child { border-bottom: none; }

.fp-label {
    font-size: 10px;
    font-weight: 700;
    color: #6070a0;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.fp-sublabel { font-weight: 400; color: #a0a8c0; font-size: 10px; }

.fp-check {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    color: #2a3060;
    font-size: 12px;
    user-select: none;
}

.fp-check input[type="checkbox"] { margin: 0; cursor: pointer; flex-shrink: 0; }

.fp-layer-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.2);
}

.fp-bsl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 4px;
}

.fp-bsl-note {
    margin-top: 6px;
    font-size: 10px;
    color: #e67e22;
    line-height: 1.4;
}

.fp-bsl-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 2px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.2);
    vertical-align: middle;
}

/* Year controls */
.fp-year-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 2px;
}

#year-input {
    width: 72px;
    flex-shrink: 0;
    padding: 3px 6px;
    background: #eef1fa;
    border: 1px solid #c8d0e8;
    border-radius: 5px;
    font-size: 12px;
    color: #2a3060;
    text-align: center;
    -moz-appearance: textfield;
}
#year-input::-webkit-inner-spin-button,
#year-input::-webkit-outer-spin-button { opacity: 1; }
#year-input:disabled { color: #a0a8c0; background: #f4f5fa; }

#year-slider {
    flex: 1;
    margin: 0;
    accent-color: #4a8ad4;
}

.fp-year-range {
    display: flex;
    justify-content: space-between;
    color: #a0a8c0;
    font-size: 10px;
    margin-top: 2px;
}

/* Action buttons */
.fp-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.fp-btn {
    flex: 1;
    padding: 5px 8px;
    background: #eef1fa;
    border: 1px solid #c8d0e8;
    border-radius: 5px;
    font-size: 11px;
    color: #2a3060;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.fp-btn:hover { background: #dde2f8; }

/* ── Map legend ─────────────────────────────────────────────────────────── */
.map-legend {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    max-width: 170px;
}

.map-legend .leg-title { font-size: 10px; font-weight: 700; color: #555; letter-spacing: 0.06em; margin-top: 6px; margin-bottom: 1px; }
.map-legend .leg-title:first-child { margin-top: 0; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; border: 1px solid rgba(0,0,0,0.15); }
.legend-sq  { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: middle; border: 1px solid rgba(0,0,0,0.15); }

/* ── Facility popup ─────────────────────────────────────────────────────── */
.fac-popup { font-size: 13px; min-width: 180px; }
.fac-popup strong { font-size: 14px; display: block; margin-bottom: 3px; }
.fac-popup .popup-loc { color: #666; font-size: 12px; margin-bottom: 4px; }
.popup-link { color: #2471a3; text-decoration: none; font-size: 12px; display: inline-block; margin-top: 4px; }
.popup-link:hover { text-decoration: underline; }

/* ── Entity modal ───────────────────────────────────────────────────────── */
.year-record { border: 1px solid #e0e4ef; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.yr-head { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: #1a1e40; }
.yr-kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: 13px; }
.yr-kv dt { color: #777; font-weight: normal; margin: 0; }
.yr-kv dd { color: #222; margin: 0; word-break: break-word; }

/* ── About modal headings ───────────────────────────────────────────────── */
.about-heading {
    font-weight: 700;
    font-size: 13px;
    color: #1a1e40;
    margin-top: 1.4em;
    margin-bottom: 0.4em;
    padding-bottom: 3px;
    border-bottom: 1px solid #e0e4ef;
}

/* ── Choropleth tooltip ─────────────────────────────────────────────────── */
.choro-tip {
    background: rgba(255,255,255,0.97);
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
}
.choro-tip strong { color: #1a1e40; }

/* ── Legend hatch swatch ────────────────────────────────────────────────── */
.legend-hatch {
    background: repeating-linear-gradient(
        -45deg,
        #ccc,
        #ccc 1px,
        #fff 1px,
        #fff 4px
    );
    border-color: #bbb;
}

/* ── Remove browser focus outline on Leaflet SVG paths ─────────────────── */
.leaflet-interactive:focus { outline: none; }

/* ── Detail subtitle ────────────────────────────────────────────────────── */
.detail-subtitle { color: #4a5280; font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Year play button ───────────────────────────────────────────────────── */
.fp-play-btn {
    flex-shrink: 0;
    width: 26px; height: 26px;
    padding: 0;
    background: #eef1fa;
    border: 1px solid #c8d0e8;
    border-radius: 4px;
    font-size: 11px;
    color: #2a3060;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.fp-play-btn:hover:not(:disabled) { background: #dde2f8; }
.fp-play-btn:disabled { color: #a0a8c0; cursor: default; }
.fp-play-btn.playing { background: #fde8d0; border-color: #e0a070; color: #8b3a00; }

/* ── Search active result (keyboard nav) ────────────────────────────────── */
#search-results li.sr-active { background: #252840; }

/* ── Text overflow for all list name fields ─────────────────────────────── */
.fac-name, .vac-name, .def-fac-name, .def-prog-name, .country-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Global compliance table ────────────────────────────────────────────── */
.gt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gt-table thead tr { background: #f5f6fa; border-bottom: 2px solid #dde2f0; position: sticky; top: 0; z-index: 1; }
.gt-table th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: #555; letter-spacing: 0.05em; white-space: nowrap; }
.gt-th-sort { cursor: pointer; user-select: none; }
.gt-th-sort:hover { background: #e8eaf8; }
.gt-th-sort.gt-sorted { color: #1a2060; }
.gt-row { cursor: pointer; border-bottom: 1px solid #eef0f8; transition: background 0.1s; }
.gt-row:hover { background: #f0f4ff; }
.gt-row td { padding: 8px 14px; color: #222; }
.gt-rate { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 11px; font-weight: 600; color: #fff; min-width: 38px; text-align: center; }
.gt-rate-none { background: #e0e0e8; color: #666; }

/* ── Scrollbars ─────────────────────────────────────────────────────────── */
.side-scroll::-webkit-scrollbar { width: 4px; }
.side-scroll::-webkit-scrollbar-track { background: transparent; }
.side-scroll::-webkit-scrollbar-thumb { background: #2a2c40; border-radius: 2px; }
#filter-panel::-webkit-scrollbar { width: 4px; }
#filter-panel::-webkit-scrollbar-track { background: transparent; }
#filter-panel::-webkit-scrollbar-thumb { background: #c8cce0; border-radius: 2px; }

/* ── FEATURE 4: Choropleth form selector ────────────────────────────────── */
.fp-form-select { width: 100%; padding: 3px 6px; background: #f0f2fa; border: 1px solid #c8d0e8; border-radius: 4px; font-size: 11px; color: #2a3060; cursor: pointer; }
.fp-form-select:focus { outline: none; border-color: #4a8ad4; }

/* ── FEATURE 5: Trends chart ────────────────────────────────────────────── */
.trends-chart { font-size: 11px; }
.trends-chart text { fill: #444; }
.trends-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; }
.trends-legend-item { display: flex; align-items: center; gap: 4px; }
.trends-legend-line { display: inline-block; width: 24px; height: 3px; border-radius: 2px; }

/* ── FEATURE 8: Flag for review ─────────────────────────────────────────── */
.flag-btn { background: none; border: 1px solid #c0392b; color: #c0392b; border-radius: 3px; font-size: 10px; padding: 1px 6px; cursor: pointer; transition: background 0.15s; }
.flag-btn:hover { background: #fde8e8; }
.flag-badge { display: inline-block; background: #5a1010; color: #e08080; border-radius: 3px; font-size: 10px; padding: 1px 6px; margin-left: 6px; }

/* ── About modal byline ─────────────────────────────────────────────────── */
.about-byline {
    text-align: center;
    font-size: 13px;
    color: #555;
    padding: 6px 0 12px;
    border-bottom: 1px solid #e8eaf0;
    margin-bottom: 16px;
}
.about-byline a { color: #2471a3; text-decoration: none; font-weight: 500; }
.about-byline a:hover { text-decoration: underline; }

/* ── Legend collapsible header ──────────────────────────────────────────── */
.leg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.leg-header-title { font-size: 10px; font-weight: 700; color: #555; letter-spacing: 0.06em; }
.leg-toggle {
    background: none;
    border: none;
    font-size: 11px;
    color: #888;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.leg-toggle:hover { color: #333; }

/* ── Mobile overlay backdrop ────────────────────────────────────────────── */
#mobile-overlay {
    display: none;
    position: fixed;
    top: 54px; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
}
#mobile-overlay.show { display: block; }

/* ── Mobile responsive ──────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* Navbar: hide stats bar, let search fill available space */
    #stats-bar   { display: none; }
    #search-wrap { flex: 1; width: auto; min-width: 0; }
    #app-title   { font-size: 13px; }

    /* Sidebar: fixed overlay sliding in from left */
    #sidebar {
        position: fixed;
        top: 54px;
        left: 0;
        height: calc(100% - 54px);
        width: min(300px, 85vw) !important;
        z-index: 2000;
        transform: translateX(0);
        transition: transform 0.25s ease;
        border-right: 1px solid #2a2a3a;
    }
    #sidebar.collapsed {
        width: min(300px, 85vw) !important; /* keep width; slide out instead */
        transform: translateX(-100%);
    }

    /* Sidebar tab: floating hamburger over the map */
    #sidebar-tab {
        position: fixed;
        top: 64px;
        left: 10px;
        z-index: 2001;
        border: 1px solid #3a3a5a;
        border-radius: 6px;
        padding: 7px 10px;
        background: rgba(15, 17, 23, 0.92);
        font-size: 13px;
        margin: 0;
        align-self: auto;
    }

    /* Map: full width, full remaining height */
    #map { flex: 1; width: 100%; }

    /* Filter panel: wider on mobile, collapsed by default (handled in JS) */
    #filter-panel { width: calc(100vw - 20px); max-width: 300px; }

    /* Legend: hidden on mobile (too much screen real estate) */
    .map-legend { display: none; }
}
