:root {
    --sl-color-primary-600: var(--highlight-green); /* Default thumb color */
    --sl-color-primary-500: var(--highlight-green); /* Hover/active thumb color */

    /* Primary Colors */
    --primary-blue: #0d6aff;
    --primary-grey: #403c3f;

    /* Secondary Colors */
    --blue: #2827f7;
    --dark-blue: #062390;
    --darker-blue: #071f78;
    --sky-blue: #68c2fb;
    --aqua-blue: #6fe6fd;
    --light-aqua-blue:#6fe5fd56;
    --lighter-aqua-blue:#90e8fa46;

    /* Greens */
    --mint-green: #85fbeb;
    --lime-green: #7af9b4;
    --spring-green: #71e68b;
    --apple-green: #82f984;
    --apple-green-dark: #00f704;

    --grass-green: #6cd46f;
    --forest-green: #43894d;

    /* Neutral Colors */
    --bg-white: #ffffff;
    --bg-light: #f3f4f6;
    --bg-gray: #e5e7eb;
    --bg-dark: #1f2937;

    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;

    /* Border Colors */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;

    /* Highlight Colors */
    --highlight-green: #82f984;
    --highlight-yellow: #f9ea46;
    --error: #ef4444;
    --info: #3b82f6;

    /* Opacity variants */
    --overlay-dark: rgba(0, 0, 0, 0.5);
    --overlay-light: rgba(255, 255, 255, 0.9);

    --highlight-pink: #e603c0;

    --panel-bg: var(--light-aqua-blue);
    --panel-header: var(--lighter-aqua-blue);
    --header: var(--primary-blue);
    --border-highlight: 5px solid var(--apple-green-dark);
    --border-panel: 5px solid var(--panel-bg);

    /* Map control tokens */
    --ctrl-bg: rgba(255, 255, 255, 0.97);
    --ctrl-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    --ctrl-radius: 6px;
    --ctrl-border: 1px solid rgba(0, 0, 0, 0.1);
    --ctrl-font-size: 12px;
}



/* #region Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    font-family: 'Barlow', sans-serif;
    display: grid;
    grid-template:
        
        "panel-1  map      panel-2"  1fr
        "panel-1    title   panel-2" 40px
        "panel-1    info   panel-2" 120px
        "panel-1  stats    panel-2"  100px
        / max-content   1fr   max-content;
    height: 100vh;
    overflow: hidden;
}
/* #endregion */

/* #region Map */

#dashboard-title {
    grid-area: title;
    background-color: #6fe5fd46;
    color: var(--header);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    font-family: 'Barlow', sans-serif;
    box-shadow: 0 4px 6px -2px rgba(123, 47, 255, 0.35);
    
}

.dashboard-title-main {
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.05em;
}

.dashboard-subtitle {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.85;
}

#info-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--header);
    display: flex;
    align-items: center;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.15s;
}
#info-toggle-btn:hover { opacity: 1; }

#info-toggle-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

body.info-collapsed #info-toggle-icon {
    transform: rotate(-180deg);
}

body.info-collapsed {
    grid-template:
        "panel-1  map      panel-2"  1fr
        "panel-1    title   panel-2" 40px
        "panel-1  stats    panel-2"  100px
        / max-content   1fr   max-content;
}

body.info-collapsed #information-panel {
    display: none;
}
#map-container {
    grid-area: map;
    position: relative;
}

.maplibregl-ctrl-group {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* #endregion */

/* #region Search */
#map-top-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    pointer-events: none;
}

#bar-left,
#bar-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    pointer-events: auto;
    flex-shrink: 0;
}

#bar-center {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}

#search-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    pointer-events: auto;
}

#filter-row {
    display: flex;
    align-items: top;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-right: 6px;
}

#controls-row {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}
mapbox-search-box [class*="--SearchBox"] {
    --borderRadius: 0px !important;
}

mapbox-search-box [class*="--Input"] {
    height: 30px !important;
    border-radius: 0px !important;
}

.filter-select {
    flex-shrink: 0;
    min-width: 75px;
    max-width: 120px;
}

.filter-select::part(combobox) {
    padding: 7.5px 8px;
    background: var(--primary-blue);
    border: none;
    border-radius: 0px;
    font-family: 'Barlow', sans-serif;
    font-size: 11px;
    color: #fff;
    min-height: unset;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    gap: 2px;
}

.filter-select::part(display-input) {
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: 11px;
    color: #fff;
    -webkit-text-fill-color: #fff;
}

.filter-select::part(expand-icon) {
    font-size: 11px;
    color: #fff;
}

.filter-select::part(tag) {
    background: transparent;
    border: 0px solid rgba(255, 255, 255, 0.7);
    border-radius: 0px;
    padding: 0px;
    height: fit-content;
}

.filter-select::part(tag__content) {
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-size: 10px;
    line-height: normal;
}

.filter-select::part(tag__remove-button__base) {
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
}

.filter-select::part(clear-button) {
    color: var(--highlight-green);
}

.filter-select::part(listbox) {
    background: #fff;
    border: 1px solid var(--primary-blue);
    border-radius: 0px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding-block: 4px;
    font-family: 'Barlow', sans-serif;
}

.filter-select wa-option::part(base) {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    color: var(--primary-grey);
    border-radius: 0px;
}

.filter-select wa-option::part(base):hover {
    background: #f0f5ff;
    color: var(--primary-blue);
}

.filter-select wa-option[aria-selected="true"]::part(base) {
    background: #e8efff;
    color: var(--primary-blue);
    font-weight: 500;
}

.filter-select wa-option::part(checked-icon) {
    color: var(--primary-blue);
}

#reset-filters-btn::part(base) {
    background: #fff;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    border-radius: 0px;
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    white-space: nowrap;
    height: 30px;
    min-height: unset;
    padding-block: 0;
}


#reset-filters-btn::part(base):hover {
    background: #f0f5ff;
    border-color: #0050cc;
    color: #0050cc;
}

/* #endregion */

/* #region Panels */

    /* #region Panel layout */
        .map-panel {
            overflow-y: auto;
            background: #fff;
            border: 1px solid #e0e0e0;
            box-shadow: 0 4px 16px rgba(0,0,0,0.15);
            padding: 20px 20px 0 20px;
        }

        #panel-1 {
            grid-area: panel-1;
            display: flex;
            flex-direction: column;
            height: 100%;
            overflow: clip;         /* clip without scroll container — keeps overflow-x unaffected */
            box-sizing: border-box;
            width: fit-content;
            --pic-width: min(250px, calc((100vh - 200px) / 4));


        }


        #panel-2 {
            grid-area: panel-2;
            display: flex;
            flex-direction: column;
            height: 100%;
            overflow: clip;
            box-sizing: border-box;
            width: fit-content;
           --pic-width: min(250px, calc((100vh - 200px) / 4));
            /*border: 3px solid var(--primary-blue);*/
        }

        #stats {
            grid-area: stats;
            display: flex;
            justify-content: space-around;
            align-items: stretch;
            gap: 10px;
            padding: 10px 16px;
            background-color: #6fe5fd56;
            /*border-bottom: 3px solid var(--primary-blue);*/
        }

    /* #endregion */

    /* #region Info Panel */

        #information-panel {
            grid-area: info;
            display: flex;
            justify-content: space-around;
            align-items: stretch;
            gap: 1px;
            padding: 10px 0px;
            background-color: #6fe5fd2a;
        }

        .info-tip {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 5px;
            padding: 0 10px;
            border-right: 1px solid #b6d8e8;
        }

        .info-tip:last-child {
            border-right: none;
        }

        .info-tip-header {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .info-tip-icon {
            color: var(--primary-blue);
            font-size: 13px;
            flex-shrink: 0;
        }

        .info-tip-label {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            color: var(--header);
        }

        .info-tip-text {
            font-size: 11.5px;
            color: #374151;
            line-height: 1.35;
        }

    /* #endregion */

    /* #region Stats Panel */

        .stats-category {
            background: #ffffff00;
            border-radius: 8px;
            /*border: 1px solid #e2e5eb;*/
            padding: 8px 16px;
            display: flex;
            flex-direction: column;
            gap: 3px;
            min-width: 160px;
            flex: 1;
            max-width: 240px;
            justify-content: center;
            /*box-shadow: 0 1px 3px rgba(0,0,0,0.06);*/
        }

        .stats-label-row {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .stats-icon {
            color: var(--header);
            font-size: 13px;
        }

        .stats-title {
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #6b7280;
        }

        .stats-value {
            font-size: 26px;
            font-weight: 700;
            color: #111827;
            line-height: 1.1;
        }

    /* #endregion */

    /* #region Category */

        .category-panel {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            width: fit-content;
            border: var(--border-panel);
        }

        .panel-header {
            padding: 10px 20px;
            box-shadow: 0 2px 8px rgba(123, 47, 255, 0.35);
            background-color: var(--panel-header);
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 24px;
            width: fill;
            flex-shrink: 0;         /* header never squishes */
        }

        .panel-content {
            padding: 10px 20px;
            display: flex;
            flex-direction: row;
            align-items: stretch;
            gap: 12px;
            flex: 1;
            min-height: 0;
            width: fit-content;
            background-color: var(--panel-bg);
        }
  
        .panel-title {
            font-family: 'Barlow', sans-serif;
            text-transform: uppercase;
            font-weight: 600;
            font-size: 13px;
            letter-spacing: 0.04em;
            color: var(--header);
        }
 
        .panel-id {
            font-family: 'Barlow', sans-serif;
            text-transform: uppercase;
            font-weight: 600;
            font-size: 11px;
            letter-spacing: 0.04em;
            color: var(--header);
        }

        .panel-pic {
            position: relative;
            width: var(--pic-width);
            aspect-ratio: 3/4;
            flex-shrink: 0;
            align-self: flex-start;
            box-sizing: border-box;
            overflow: hidden;
            background-color: #acabab6c;
            border-radius: 2%;
        }
  
        .panel-pic-img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: none;
            cursor: zoom-in;
        }

        #lightbox-img {
            display: block;
            width: auto;
            height: auto;
            max-width: 85vw;
            max-height: 85vh;
        }


    /* #endregion */

    /* #region ActiveCategory */

        .category-panel.panel-color-active {
            border: var(--border-highlight);
        }

        .category-panel.panel-color-active .panel-header {
            background-color: #90e8fa46;
            box-shadow: 0 2px 8px rgba(13, 106, 255, 0.35);
 
        }

        .category-panel.panel-color-active .panel-header .panel-title,
        .category-panel.panel-color-active .panel-header .panel-id {
            color: var(--header);
        }

        .category-panel.panel-color-active .panel-content {
            background-color: #90e8fa46;

        }



    /* #endregion */

    /* #region Chart */

        .chart-wrapper {
            display: flex;
            flex-direction: column;
            gap: 12px;
            width: 180px;
            height: calc(var(--pic-width) * 4 / 3);
            flex-shrink: 0;
        }

        .chart-slot {
            width: fill;
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .chart-canvas-wrap {
            position: relative;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }

        .chart-slot > canvas {
            flex: 1;
            min-height: 0;
        }

        .chart-legend-div {
            flex-shrink: 0;
            max-height: 64px;
            overflow-y: auto;
            padding: 2px 2px;

        }

        .chart-legend-div::-webkit-scrollbar       { width: 3px; }
        .chart-legend-div::-webkit-scrollbar-track  { background: transparent; }
        .chart-legend-div::-webkit-scrollbar-thumb  { background: #d0d0d0; border-radius: 2px; }

        .chart-legend-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 1px;
        }

        .chart-legend-item {
            display: flex;
            align-items: center;
            gap: 5px;
            font-family: 'Barlow', sans-serif;
            font-size: 11.5px;
            font-weight: 500;
            line-height: 1.3;
            color: #5E5E5E;
            padding: 1px 3px;
            border-radius: 2px;
        }

        .chart-legend-item:hover {
            background: #f0f0f0;
        }

        .chart-legend-item.is-hidden .chart-legend-text {
            text-decoration: line-through;
            opacity: 0.45;
        }

        .chart-legend-box {
            width: 10px;
            height: 10px;
            border-radius: 2px;
            flex-shrink: 0;
        }

        .chart-legend-text {
            word-break: break-word;
        }

        .chart-title {
            font-family: 'Barlow', sans-serif;
            text-transform: uppercase;
            font-weight: 600;
            font-size: 10px;
            letter-spacing: 0.04em;
            color: #AFAFAF;
        }

    /* #endregion */

    /* #region Attribute */

        .panel-attrs {
            position: absolute;
            bottom: 5px;
            left: 5px;
            z-index: 10;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .attr-row {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 6px;
        }

        .attr-select {
            width: 100%;
        }

        .attr-select::part(combobox) {
            background: var(--primary-blue);
            border: none;
            border-radius: 0px;
            font-family: 'Barlow', sans-serif;
            font-size: 10px;
            font-weight: 400;
            color: #ffffff;
            padding: 4px 4px 4px 6px;
            height: fit-content;
            min-height: unset;
            box-shadow: none;
            gap: 2px;
        }

        .attr-select::part(display-input) {
            font-family: 'Barlow', sans-serif;
            font-weight: 500;
            font-size: 12px;
            color: #ffffff;
        }

        .attr-select::part(expand-icon) {
            font-size: 12px;
            color: white;
        }

        .attr-badge {
            background: #FAE49C;
            border-radius: 4px;
            padding: 3px 6px;
            font-family: 'Barlow', sans-serif;
            font-size: 11px;
            font-weight: 500;
            color: #5E5E5E;
            white-space: normal;        /* wrap instead of truncate */
            overflow: visible;
            text-overflow: unset;
            max-width: 180px;
            height: auto;               /* grows with content */
            display: flex;
            align-items: flex-start;    /* top-align when multi-line */
            box-sizing: border-box;
            word-break: break-word;
        }
 

    /* #endregion */

/* #endregion */

/* #region Audit Popups */
    .audit-popup .maplibregl-popup-content {
        padding: 10px 14px;
        border-radius: 8px;
        font-family: 'Barlow', sans-serif;
        font-size: 13px;
        line-height: 1.5;
        color: #333;
        max-width: 280px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    }

    .audit-popup .maplibregl-popup-close-button {
        font-size: 18px;
        color: #666;
        padding: 4px 8px;
        z-index: 1;
    }

    .popup-header {
        padding: 10px 32px 8px 14px;
        font-weight: 600;
        font-size: 12px;
        letter-spacing: 0.04em;
        border-bottom: 1px solid rgba(0,0,0,0.08);
    }

    .popup-container {
        display: flex;
    }

    .popup-form {
        flex: 1;
        min-width: 0;
    }

    .popup-f1 {
        border-right: 1px solid #e0e0e0;
    }

    .popup-f1 .popup-header { background: #fff0e8; color: #7a3010; }
    .popup-f2 .popup-header { background: #e8f0ff; color: #1a3d80; }

    .popup-subheader {
        padding: 6px 14px 7px;
        font-size: 11px;
        font-weight: 600;
        color: #555;
        background: #fafafa;
        border-bottom: 1px solid #eee;
        letter-spacing: 0.02em;
    }

    .popup-row {
        display: flex;
        align-items: baseline;
        padding: 7px 14px;
        border-bottom: 1px solid #eee;
        gap: 10px;
        line-height: 1.4;
    }

    .popup-row:last-of-type { border-bottom: none; }

    .popup-attr {
        flex: 0 0 40%;
        font-size: 13px;
        color: #333;
    }

    .popup-val {
        flex: 1;
        font-size: 13px;
        color: #888;
        font-style: italic;
        text-align: right;
    }

    .popup-val-img {
        display: flex;
        justify-content: flex-end;
        font-style: normal;
        overflow: hidden;
        min-width: 0;
    }

    .popup-val-img img {
        width: 100%;
        max-width: 100%;
        height: 200px;
        object-fit: cover;
        border-radius: 4px;
        cursor: zoom-in;
        display: block;
    }
/* #endregion */

/* #region Drain Popups */
    .drain-popup .maplibregl-popup-content {
        padding: 6px 10px;
        border-radius: 6px;
        font-family: 'Barlow', sans-serif;
        font-size: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.18);
        background: rgba(255,255,255,0.95);
    }

    .drain-popup .maplibregl-popup-close-button { display: none; }

    .drain-popup-inner {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .drain-val {
        color: #222;
        font-weight: 500;
        white-space: nowrap;
    }

    .drain-val-bold {
        font-weight: 700;
    }
/* #endregion */

/* #region Layer Legend */

    .layer-manager,
    .layer-manager-toggle,
    .layer-manager-label,
    .layer-manager-title {
        font-family: 'Barlow', sans-serif;
    }

    .layer-manager-panel {
        padding: 8px 10px;
        background: white;
    }

    .layer-manager-title {
        background: #f5f5f5;
        font-size: 13px;
        font-weight: 600;
        color: #333;
        border-radius: 4px;
        padding: 6px 8px;
        margin-bottom: 6px;
    }

    .layer-manager-item {
        border: none;
        border-bottom: 1px solid #f0f0f0;
        border-radius: 0;
        padding: 6px 4px;
        background: white;
        display: flex;
        align-items: center;
        gap: 8px;
    }

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

    .layer-manager-checkbox {
        accent-color: #007cbf;
        cursor: pointer;
        flex-shrink: 0;
    }

    .layer-manager-label {
        font-size: 13px;
        font-weight: 400;
        color: #666;
        cursor: pointer;
        user-select: none;
    }

    .layer-manager-reorder-controls,
    .layer-manager-btn-move-up,
    .layer-manager-btn-move-down,
    .layer-manager-drag-handle,
    .layer-manager-btn-style,
    .layer-manager-btn-remove,
    .layer-manager-controls,
    .layer-manager-opacity,
    .layer-manager-btn-toggle-all {
        display: none !important;
    }

/* #endregion */

/* #region Upload Control */

    .upload-ctrl {
        position: relative;
    }

    .upload-toggle-btn {
        width: 29px;
        height: 29px;
        background: white;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        color: #333;
        transition: background-color 0.2s;
    }
    .upload-toggle-btn:hover { background-color: #f5f5f5; }

    .upload-panel {
        position: absolute;
        top: 0;
        left: 37px;
        background: white;
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        padding: 12px;
        width: 230px;
        font-family: 'Barlow', sans-serif;
        z-index: 10;
    }

    .upload-panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
        font-weight: 600;
        color: #333;
        border-bottom: 1px solid #eee;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .upload-count {
        font-size: 11px;
        font-weight: 400;
        color: #999;
    }

    .upload-browse-label {
        display: block;
        text-align: center;
        font-size: 12px;
        font-weight: 500;
        color: var(--primary-blue);
        border: 1.5px dashed var(--primary-blue);
        border-radius: 4px;
        padding: 6px;
        cursor: pointer;
        transition: background 0.2s;
        margin-bottom: 8px;
        user-select: none;
    }
    .upload-browse-label:hover { background: #f0f5ff; }

    .upload-layer-item {
        padding: 6px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    .upload-layer-item:last-child { border-bottom: none; }

    .upload-layer-name {
        font-size: 12px;
        font-weight: 500;
        color: #333;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 4px;
    }

    .upload-layer-controls {
        display: flex;
        align-items: flex-end;
        gap: 8px;
    }

    .upload-ctrl-label {
        font-size: 11px;
        color: #999;
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1;
    }

    .upload-color {
        width: 100%;
        height: 24px;
        border: 1px solid #ddd;
        border-radius: 3px;
        cursor: pointer;
        padding: 1px;
    }

    .upload-opacity {
        width: 100%;
        accent-color: #007cbf;
        cursor: pointer;
    }

    .upload-remove-btn {
        background: none;
        border: none;
        color: #ccc;
        font-size: 18px;
        cursor: pointer;
        line-height: 1;
        padding: 0 2px;
        flex-shrink: 0;
        transition: color 0.15s;
        margin-bottom: 1px;
    }
    .upload-remove-btn:hover { color: #e00; }

/* #endregion */

/* #region Download Control */

    .download-ctrl {
        position: relative;
    }

    .download-toggle-btn {
        width: 29px;
        height: 29px;
        background: white;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        color: #333;
        transition: background-color 0.2s;
    }
    .download-toggle-btn:hover { background-color: #f5f5f5; }

    .download-panel {
        position: absolute;
        top: 0;
        left: 37px;
        background: white;
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        padding: 12px;
        width: 210px;
        font-family: 'Barlow', sans-serif;
        z-index: 10;
    }

    .download-panel-header {
        font-size: 13px;
        font-weight: 600;
        color: #333;
        border-bottom: 1px solid #eee;
        padding-bottom: 8px;
        margin-bottom: 6px;
    }

    .download-link {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 4px;
        border-bottom: 1px solid #f0f0f0;
        text-decoration: none;
        color: inherit;
        border-radius: 3px;
        transition: background 0.15s;
    }
    .download-link:last-child { border-bottom: none; }
    .download-link:hover { background: #f5f9ff; }

    .download-link-icon {
        font-size: 16px;
        color: var(--primary-blue);
        flex-shrink: 0;
        line-height: 1;
    }

    .download-link-name {
        display: block;
        font-size: 12px;
        font-weight: 500;
        color: #333;
    }

    .download-link-meta {
        display: block;
        font-size: 10px;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

/* #endregion */

/* #region Point Navigation */

    .point-nav-ctrl {
        display: flex;
        flex-direction: row;
    }

    .point-nav-ctrl wa-button::part(base) {
        background: var(--primary-blue);
        border: 1.5px solid var(--highlight-green);
        border-radius: 0;
        color: #fff;
        min-height: unset;
        height: 29px;
        width: 29px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .point-nav-ctrl wa-button::part(base):hover { background: var(--dark-blue); }

/* #endregion */

/* #region Responsiveness */

/* ─── Desktop overlay ────────────────────────────────────────────────────── */

#desktop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #f5f5f5;
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow', sans-serif;
    text-align: center;
    padding: 40px;
}

.overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 360px;
}

.overlay-title {
    font-size: 18px;
    font-weight: 600;
    color: #3a3a3a;
    letter-spacing: 0.02em;
}

.overlay-body {
    font-size: 14px;
    color: #888;
    line-height: 1.6;
}


/* ─── Responsive: standard laptop 1280–1439px ────────────────────────────── */

@media (min-width: 1280px) and (max-width: 1439px) {

    :root{
        --border-panel: 3px solid var(--panel-bg);
        --border-highlight: 3px solid var(--highlight-green);
    }
    body {
        grid-template:

            "panel-1  map      panel-2"  1fr
            "panel-1   title    panel-2"    30px
            "panel-1    info   panel-2"   110px
            "panel-1  stats    panel-2"  70px
            / max-content   1fr   max-content;
    }

    body.info-collapsed {
        grid-template:
            "panel-1  map      panel-2"  1fr
            "panel-1    title   panel-2" 30px
            "panel-1  stats    panel-2"  70px
            / max-content   1fr   max-content;
    }



    #panel-1, #panel-2 {
        --pic-width: min(150px, calc((100vh - 160px) / 4));
    }

    
    #stats {
            gap: 10px;
            padding: 10px 16px;
    }

    
    #information-panel { padding: 10px 5px; }

    #dashboard-title   { padding: 0 15px;   }

    .dashboard-title-main { font-size: 12px; }


    .info-tip          { padding: 0 9px; gap: 5px;  }
    .info-tip-label    { font-size: 10.5px;   }
    .info-tip-text     { font-size: 10.5px;   }


    .panel-header   { gap: 18px;             padding: 6px 8px;}
    .panel-title    {font-size: 11px;                         }
    .panel-id       {font-size: 10px;                         }
    .panel-content  { gap: 10px;             padding: 8px 8px;}
    .chart-wrapper  { width: 140px; gap: 10px; }
    .chart-slot     { width: 140px; }
    
    .chart-legend-item {font-size: 10px; }

    .audit-popup .maplibregl-popup-content { width: 500px; }

    
    .stats-category {
            padding: 8px 16px;
            gap: 3px;
            min-width: 160px;
            max-width: 240px;
    }

    .stats-label-row { gap: 6px;        }
    .stats-icon      { font-size: 13px; }
    .stats-title     { font-size: 10px; }
    .stats-value     { font-size: 20px; }


    #map-top-bar        { gap: 4px; }
    #filter-row         { gap: 4px; }
    #controls-row       { gap: 4px; }
    #search-container   { gap: 4px; }
    .filter-select { min-width: 58px; max-width: 100px; }
    .filter-select::part(display-input) { font-size: 10px; }
    mapbox-search-box   { max-width: 160px; }
    .attr-select::part(display-input) { font-size: 10.5px; }

}


/* ─── Responsive: tablet landscape / small laptop 1024–1279px ───────────── */

@media (min-width: 1025px) and (max-width: 1279px) {

    body {
        grid-template:
            "panel-1  map      panel-2"  1fr
            "panel-1   title    panel-2"    30px
            "panel-1  stats    panel-2"  70px
            / max-content   1fr   max-content;
    }

     body.info-collapsed {
        grid-template:
            "panel-1  map      panel-2"  1fr
            "panel-1    title   panel-2" 30px
            "panel-1  stats    panel-2"  70px
            / max-content   1fr   max-content;
    }
    .dashboard-title-main { font-size: 12px; }

    #information-panel { display: none; }

    #panel-1, #panel-2 {
        --pic-width: min(150px, calc((100vh - 150px) / 4));
    }


    .panel-header   { gap: 14px; padding: 5px 5px;}
    .panel-content  { gap: 8px; padding: 5px 5px;}
    .chart-wrapper  { width: 130px; gap: 8px; }
    .chart-slot     { width: 130px; }
    .chart-legend-item {font-size: 10px; }

    .panel-title    { font-size: 11px; }
    .panel-id       { font-size: 10px; }
    .attr-badge     { max-width: 100px; }

    #stats          { padding: 6px 12px; gap: 8px; }
    .stats-category { padding: 6px 12px; }
    .stats-value    { font-size: 15px; }

    .audit-popup .maplibregl-popup-content { width: 400px; }

    #map-top-bar         { gap: 3px; }
    #filter-row          { gap: 3px; }
    #controls-row        { gap: 3px; }
    #search-container    { gap: 3px; }
    .filter-select { min-width: 48px; max-width: 78px; }
    .filter-select::part(display-input) { font-size: 9px; }
    mapbox-search-box    { max-width: 120px; }

    #reset-filters-btn::part(base) { padding-inline: 6px; }
    .attr-select::part(display-input) { font-size: 10px; }

}


/* ─── Responsive: short viewport (700–750px) — compress rows ────────────── */

@media (max-height: 600px) {
    body {
        grid-template:
            "panel-1  map      panel-2"  1fr
            "panel-1    title   panel-2"  36px
            "panel-1  stats    panel-2"  70px
            / max-content   1fr   max-content;
    }

    #information-panel { display: none; }

    #stats          { padding: 6px 16px; gap: 8px; }
    .stats-category { padding: 5px 12px; }
    .stats-value    { font-size: 18px; }

    .panel-header   { padding: 5px 5px; }
    .panel-content  { padding: 5px 5px; gap: 8px; }
}


/* ─── Smaller than 1024px — show overlay, hide dashboard ────────────────── */

@media (max-width: 1024px) {
    #desktop-overlay                       { display: flex; }
    body > *:not(#desktop-overlay)         { visibility: hidden; }
}

/* #endregion */