/* Apply Outfit font globally to the website layout */
body, html {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    font-family: 'Outfit', sans-serif;
}

:root {
    --header-height: 100px;
    --primary-brand: #1e718a;
}

#map-zoom-display {
    position: absolute;
    top: 70px;
    right: 50px; /* Positions it nicely right beside your left sidebars */
    background: rgba(15, 23, 42, 0.85); /* Dark slate theme */
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    z-index: 10;
    pointer-events: none; /* Mouse clicks pass right through onto the map */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px); /* Modern frosted-glass texture */
    transition: background 0.2s ease;
}

#coordinate-display {
    position: absolute;
    top: 10px;
    right: 50px; /* Positions it nicely right beside your left sidebars */
    background: rgba(15, 23, 42, 0.85); /* Dark slate theme */
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    z-index: 10;
    pointer-events: none; /* Mouse clicks pass right through onto the map */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px); /* Modern frosted-glass texture */
    transition: background 0.2s ease;
}

#app-header {
    height: var(--header-height);
    background-color: var(--primary-brand);
    border-bottom: 1px solid #1c6b82;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.company-logo {
    width: auto;
    height: calc(var(--header-height) - 20px);
    color: var(--primary-brand);
}

#app-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.client-badge {
    font-size: 14px;
    font-weight: 400;
    background: #e0ecff;
    color: #475569;
    padding: 3px 8px;
    border-radius: 12px;
    margin: 8px 10px;
    display: flex;
}

#map-location-searchbar {
    position: absolute;
    top: 35px;
    left: 40%;
    width: 320px;
    z-index: 10;
    font-family: Outfit, sans-serif;
}

#location-search-input {
    width: 100%;
    padding: 10px 16px 10px 10px;
    font-size: 13px;
    font-weight: 500;
    font-family: Outfit, sans-serif;
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    background: rgba(255, 255, 255, 0.95);
    box-sizing: border-box;
    outline: none;
    transition: background 0.2s;
}

#location-search-clear {
    display: none;
    position: absolute;
    right: 14px;
    top: 10px;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.15s;
    user-select: none;
}

#location-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    border: 1px solid #f1f5f9;
}

.date-display {
    font-size: 18px;
    color: #ffffff;
}

#map {
    position: absolute;
    top: var(--header-height);
    bottom: 0;
    z-index: 1;
}

/* Lefthand side sidebar floating container for the layer toggle and legend*/
#left-sidebar-container {
    position: absolute;
    top: calc(var(--header-height) - 80px);
    left: 20px;
    bottom: 20px;
    width: 300px;
    height: calc(100% - 40px);
    max-height: calc(100% - 40px);
    z-index: 10; /* Forces sidebar to float above map */
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 15px;
}

#right-sidebar-container {
    position: absolute;
    top: calc(var(--header-height) + 40px);
    right: 10px;
    width: 50px;
    height: auto;
    max-height: calc(100% - 40px);
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 15px;
}

.left-sidebar-card {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 20px 20px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.2);
    font-family: Outfit, sans-serif;
    box-sizing: border-box;
    /*flex-shrink: 1;*/
    /*overflow-y: auto;*/;
    display: flex;
    flex-direction: column;
}

/* Hide default markers on master layer group blocks */
.sidebar-layer-group summary::-webkit-details-marker,
.sidebar-layer-group summary::marker {
    display: none !important;
}

/* Animate the chevron down when open */
.sidebar-layer-group[open] .group-chevron {
    transform: rotate(90deg);
    color: #1e718a !important;
}

#sidebar-layer-toggle {
    flex-shrink: 0 !important;
    max-height: 45%;
    overflow-y: auto;
}

#sidebar-legend {
    flex-grow: 1;
    min-height: 150px;
    overflow: hidden;
}

#dynamic-legend-container {
    flex-grow: 1;
    overflow-y: auto !important;
    padding-right: 4px;
}

#popup-stack-sidebar {
    position: absolute;
    top: 20px;
    left: 340px;
    bottom: 20px;
    width: 300px;
    z-index: 4;
    /*flex-shrink: 1;*/
    display: none;
    flex-direction: column !important;
    border: 1px solid rgba(30, 113, 138, 0.25);
    animation: slideOutRight 0.22s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    max-height: calc(100% - 40px) !important;
}
/* Horizontal glide entrance motion script */
@keyframes slideOutRight {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#drawer-list-content {
    flex-grow: 1;
    overflow-y: auto !important;
    padding-right: 4px;
    margin-top: 10px;
}

/* Hide the browser's  default black triangle marker entirely */
#drawer-list-content details summary::-webkit-details-marker,
#drawer-list-content details summary::marker {
    display: none !important;
}

/* Rotate custom arrow 90 degrees when the parent details component opens */
#drawer-list-content details[open] .accordion-chevron {
    transform: rotate(90deg);
    color: #1e718a;
}

#load-more-records-btn:hover {
    background: #e2e8f0 !important;
    color: #1e718a !important;
    border-color: #1e718a !important;
}

.right-sidebar-card {
    pointer-events: auto;
    background: #94a3b8;
    border-radius: 12px;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.2);
    font-family: Outfit, sans-serif;
    box-sizing: border-box;
    flex-shrink: 1;
}

.sidebar-card h2 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #1e293b;
}

.sidebar-card hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.control-group {
    margin-bottom: 0;
}

.control-group h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin: 0 0 10px 0;
}

.toggle-container {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

.toggle-container input {
    flex-shrink: 0;
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 15px;
    color: #475569;
}

.legend-color {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border-radius: 4px;
    display: inline-block;
}

.legend-label {
    line-height: 18px;
}

.legend-subheading {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #94a3b8;
    margin: 15px 0 8px 0;
}

/* Legend Collapsing Styling */
.legend-summary-header {
    cursor: pointer;
    justify-content: space-between;
    user-select: none;
    outline: none;
    padding: 4px 0;
    margin: 15px 0 8px 0;
    display: flex;
    align-items: center;
    list-style: none;
}

.legend-summary-header::-webkit-details-marker, .legend-summary-header::marker {
    /*color: #94a3b8;*/
    /*font-size: 11px;*/
    /*transition: transform 0.2s ease;*/
    display: none;
}

details[open] .legend-summary-header::-webkit-details-marker, details[open] .legend-summary-header::marker {
    color: #1e718a;
}

.legend-summary-header .legend-subheading {
    margin: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.legend-summary-title {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    pointer-events: none;
}

.legend-chevron-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: transform .2s cubic-bezier(0.4, 0, 0.2, 1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

details[open] .legend-chevron-icon {
    transform: rotate(-180deg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e718a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.legend-summary-header:hover .legend-summary-title::after {
    content: " (Click to expand)";
    display: block;
    font-size: 10px;
    color: #1e718a;
    text-transform: none;
    font-weight: 400;
}

details[open] .legend-summary-header:hover .legend-summary-title::after {
    content: " (Click to collapse)";
    display: block;
    font-size: 10px;
    color: #1e718a;
    text-transform: none;
    font-weight: 400;
}

.legend-items-drawer {
    padding-left: 4px;
    margin: 6px;
}

.sidebar-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    color: #475569 !important;
    transition: all 0.2s ease;
    cursor: pointer !important;
    z-index: 10;
    margin: 5px;
}

#print-map-btn {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='512' width='512' fill='%23475569' viewBox='0 0 512 512'%3E%3Cpath d='m422.5 99v-24c0-41.355-33.645-75-75-75h-184c-41.355 0-75 33.645-75 75v24z'/%3E%3Cpath d='m118.5 319v122 26 15c0 16.568 13.431 30 30 30h214c16.569 0 30-13.432 30-30v-15-26-122zm177 128h-80c-8.284 0-15-6.716-15-15s6.716-15 15-15h80c8.284 0 15 6.716 15 15s-6.716 15-15 15zm0-64h-80c-8.284 0-15-6.716-15-15s6.716-15 15-15h80c8.284 0 15 6.716 15 15s-6.716 15-15 15z'/%3E%3Cpath d='m436.5 129h-361c-41.355 0-75 33.645-75 75v120c0 41.355 33.645 75 75 75h13v-80h-9c-8.284 0-15-6.716-15-15s6.716-15 15-15h24 304 24c8.284 0 15 6.716 15 15s-6.716 15-15 15h-9v80h14c41.355 0 75-33.645 75-75v-120c0-41.355-33.645-75-75-75zm-309 94h-48c-8.284 0-15-6.716-15-15s6.716-15 15-15h48c8.284 0 15 6.716 15 15s-6.716 15-15 15z'/%3E%3C/svg%3E");
    background-size: 20px 20px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Change colour on hover */
#print-map-btn:hover {
    background-color: #f8fafc !important;
    transform: translateY(-1px);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='512' width='512' fill='%231e718a' viewBox='0 0 512 512'%3E%3Cpath d='m422.5 99v-24c0-41.355-33.645-75-75-75h-184c-41.355 0-75 33.645-75 75v24z'/%3E%3Cpath d='m118.5 319v122 26 15c0 16.568 13.431 30 30 30h214c16.569 0 30-13.432 30-30v-15-26-122zm177 128h-80c-8.284 0-15-6.716-15-15s6.716-15 15-15h80c8.284 0 15 6.716 15 15s-6.716 15-15 15zm0-64h-80c-8.284 0-15-6.716-15-15s6.716-15 15-15h80c8.284 0 15 6.716 15 15s-6.716 15-15 15z'/%3E%3Cpath d='m436.5 129h-361c-41.355 0-75 33.645-75 75v120c0 41.355 33.645 75 75 75h13v-80h-9c-8.284 0-15-6.716-15-15s6.716-15 15-15h24 304 24c8.284 0 15 6.716 15 15s-6.716 15-15 15h-9v80h14c41.355 0 75-33.645 75-75v-120c0-41.355-33.645-75-75-75zm-309 94h-48c-8.284 0-15-6.716-15-15s6.716-15 15-15h48c8.284 0 15 6.716 15 15s-6.716 15-15 15z'/%3E%3C/svg%3E");
}

#user-guide-btn {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0ZW0iIGhlaWdodD0iNGVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgoJPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIgLz4KCTxwYXRoIGZpbGw9IiM0NzU1NjkiIGQ9Ik0xMi44MzggMTcuNjM4cS4zNjItLjM2My4zNjItLjg4OHQtLjM2Mi0uODg4dC0uODg4LS4zNjJ0LS44ODcuMzYzdC0uMzYzLjg4N3QuMzYzLjg4OHQuODg3LjM2MnQuODg4LS4zNjNNMTEuMDUgMTQuMTVoMS44NXEwLS44MjUuMTg4LTEuM3QxLjA2Mi0xLjNxLjY1LS42NSAxLjAyNS0xLjIzOFQxNS41NSA4LjlxMC0xLjQtMS4wMjUtMi4xNVQxMi4xIDZxLTEuNDI1IDAtMi4zMTIuNzVUOC41NSA4LjU1bDEuNjUuNjVxLjEyNS0uNDUuNTYzLS45NzVUMTIuMSA3LjdxLjggMCAxLjIuNDM4dC40Ljk2MnEwIC41LS4zLjkzOHQtLjc1LjgxMnEtMS4xLjk3NS0xLjM1IDEuNDc1dC0uMjUgMS44MjVNMTIgMjJxLTIuMDc1IDAtMy45LS43ODd0LTMuMTc1LTIuMTM4VDIuNzg4IDE1LjlUMiAxMnQuNzg4LTMuOXQyLjEzNy0zLjE3NVQ4LjEgMi43ODhUMTIgMnQzLjkuNzg4dDMuMTc1IDIuMTM3VDIxLjIxMyA4LjFUMjIgMTJ0LS43ODggMy45dC0yLjEzNyAzLjE3NXQtMy4xNzUgMi4xMzhUMTIgMjIiIC8+Cjwvc3ZnPgo=");
    background-size: 25px 25px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Change colour on hover */
#user-guide-btn:hover {
    background-color: #f8fafc !important;
    transform: translateY(-1px);
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0ZW0iIGhlaWdodD0iNGVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgoJPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIgLz4KCTxwYXRoIGZpbGw9IiMxZTcxOGEiIGQ9Ik0xMi44MzggMTcuNjM4cS4zNjItLjM2My4zNjItLjg4OHQtLjM2Mi0uODg4dC0uODg4LS4zNjJ0LS44ODcuMzYzdC0uMzYzLjg4N3QuMzYzLjg4OHQuODg3LjM2MnQuODg4LS4zNjNNMTEuMDUgMTQuMTVoMS44NXEwLS44MjUuMTg4LTEuM3QxLjA2Mi0xLjNxLjY1LS42NSAxLjAyNS0xLjIzOFQxNS41NSA4LjlxMC0xLjQtMS4wMjUtMi4xNVQxMi4xIDZxLTEuNDI1IDAtMi4zMTIuNzVUOC41NSA4LjU1bDEuNjUuNjVxLjEyNS0uNDUuNTYzLS45NzVUMTIuMSA3LjdxLjggMCAxLjIuNDM4dC40Ljk2MnEwIC41LS4zLjkzOHQtLjc1LjgxMnEtMS4xLjk3NS0xLjM1IDEuNDc1dC0uMjUgMS44MjVNMTIgMjJxLTIuMDc1IDAtMy45LS43ODd0LTMuMTc1LTIuMTM4VDIuNzg4IDE1LjlUMiAxMnQuNzg4LTMuOXQyLjEzNy0zLjE3NVQ4LjEgMi43ODhUMTIgMnQzLjkuNzg4dDMuMTc1IDIuMTM3VDIxLjIxMyA4LjFUMjIgMTJ0LS43ODggMy45dC0yLjEzNyAzLjE3NXQtMy4xNzUgMi4xMzhUMTIgMjIiIC8+Cjwvc3ZnPgo=");
}

#data-sources-btn {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0ZW0iIGhlaWdodD0iNGVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgoJPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIgLz4KCTxwYXRoIGZpbGw9IiM0NzU1NjkiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTIyIDEyYzAgNS41MjMtNC40NzcgMTAtMTAgMTBTMiAxNy41MjMgMiAxMlM2LjQ3NyAyIDEyIDJzMTAgNC40NzcgMTAgMTBNMTEgOGExIDEgMCAwIDAgMSAxaC4wMDhhMSAxIDAgMSAwIDAtMkgxMmExIDEgMCAwIDAtMSAxbTEgOWExIDEgMCAwIDAgMS0xdi01YTEgMSAwIDEgMC0yIDB2NWExIDEgMCAwIDAgMSAxIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIC8+Cjwvc3ZnPgo=");
    background-size: 25px 25px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Change colour on hover */
#data-sources-btn:hover {
    background-color: #f8fafc !important;
    transform: translateY(-1px);
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0ZW0iIGhlaWdodD0iNGVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgoJPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIgLz4KCTxwYXRoIGZpbGw9IiMxZTcxOGEiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTIyIDEyYzAgNS41MjMtNC40NzcgMTAtMTAgMTBTMiAxNy41MjMgMiAxMlM2LjQ3NyAyIDEyIDJzMTAgNC40NzcgMTAgMTBNMTEgOGExIDEgMCAwIDAgMSAxaC4wMDhhMSAxIDAgMSAwIDAtMkgxMmExIDEgMCAwIDAtMSAxbTEgOWExIDEgMCAwIDAgMS0xdi01YTEgMSAwIDEgMC0yIDB2NWExIDEgMCAwIDAgMSAxIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIC8+Cjwvc3ZnPgo=");
}

#open-analytics-btn {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgoJPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIgLz4KCTxwYXRoIGZpbGw9IiM0NzU1NjkiIGQ9Im0xNiAxMS43OGw0LjI0LTcuMzNsMS43MyAxbC01LjIzIDkuMDVsLTYuNTEtMy43NUw1LjQ2IDE5SDIydjJIMlYzaDJ2MTQuNTRMOS41IDh6IiAvPgo8L3N2Zz4K");
    background-size: 25px 25px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Change colour on hover */
#open-analytics-btn:hover {
    background-color: #f8fafc !important;
    transform: translateY(-1px);
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgoJPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIgLz4KCTxwYXRoIGZpbGw9IiMxZTcxOGEiIGQ9Im0xNiAxMS43OGw0LjI0LTcuMzNsMS43MyAxbC01LjIzIDkuMDVsLTYuNTEtMy43NUw1LjQ2IDE5SDIydjJIMlYzaDJ2MTQuNTRMOS41IDh6IiAvPgo8L3N2Zz4K);
}

#chart-disclaimer {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10; /* Guarantees it sits above the canvas */
    background-color: rgba(229, 247, 253, 0.9); /* Slightly translucent backplate */
    border-radius: 6px;
    border: 0.5px solid #b4dde6;
    padding: 5px 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    color: #1e718a;
    pointer-events: none; /* Hovering over the text box won't block chart tooltips! */
    display: none; /* Using display block/none is cleaner than visibility rules */
}

/* Dual slider parent container */
.dual-slider-container {
    position: relative;
    width: 100%;
    height: 35px;
    display: flex;
    align-items: center;
}

/* Base overlay style for both range inputs */
.chart-range-slider {
    position: absolute;
    width: 100%;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    z-index: 2;
}

/* Enable thumb dragging only */
.chart-range-slider::-webkit-slider-thumb {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: #1e718a;
    cursor: pointer;
    pointer-events: auto;
    -webkit-appearance: none;
}

.chart-range-slider::-moz-range-thumb {
    height: 14px;
    width: 14px;
    border: none;
    border-radius: 50%;
    background: #1e718a;
    cursor: pointer;
    pointer-events: auto;
}

/* Clean background visual track */
.slider-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    z-index: 1;
}

/* Force MapLibre popups to adopt Outfit font*/
.maplibregl-popup-content {
    font-family: 'Outfit', sans-serif;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    min-width: 300px;
}

.maplibregl-popup-close-button {
    background-color: transparent;
    border: 0;
    border-radius: 0 3px 0 0;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.right-sidebar-drawer {
    position: absolute;
    top: 120px;
    /* 70px right placement positions it perfectly to the left of your 46px button card panel! */
    right: 70px;
    width: 350px;
    height: calc(80vh - 140px); /* Stretches dynamically down the side page viewport */
    max-height: 750px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: -5px 5px 25px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    z-index: 1000;
    font-family: 'Outfit', sans-serif;
    /* Hardware-accelerated sliding transition initialization */
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

/* 🌟 Trigger class managed smoothly via JavaScript interaction toggles */
.right-sidebar-drawer.open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

/* Sidebar Button Base Styling Reset Override */
.sidebar-btn {
    width: 34px;
    height: 34px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.15s ease;
}
.sidebar-btn:hover {
    background-color: #f1f5f9;
}

/* Tab Selection Headings Strip Control Buttons */
.drawer-tab-header {
    flex-grow: 1;
    background: none;
    border: none;
    padding: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    text-align: center;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}
.drawer-tab-header.active {
    color: #1e718a;
    border-bottom-color: #1e718a;
    background-color: #ffffff;
}

/* Data Source Resource Link Elements */
.registry-link {
    font-size: 11.5px;
    color: #1e718a;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin: 4px 0;
}
.registry-link:hover {
    text-decoration: underline;
}

/* Metadata Licence Badges Container */
.license-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    background-color: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.provenance-item {
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 4px;
}
/* ==========================================================================
   BOTTOM ANALYTICS PANEL WORKSPACE STYLING MATRIX ARCHITECTURE
   ========================================================================== */

.bottom-analytics-workspace {
    position: absolute;
    bottom: 0;
    left: 20px;
    /* Keeps clearance spacing margin for left side panels and timeline slider footprints */
    right: 20px;
    height: 340px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px 16px 0 0; /* Smooth top card edge curves */
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.12);
    z-index: 1050; /* Floats on top of timeline HUD cards but ducks below welcome modals */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    box-sizing: border-box;

    /* Hardware animation translation presets */
    transform: translateY(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Panel Active State Activation Class Toggled Via Javascript */
.bottom-analytics-workspace.open {
    transform: translateY(0);
}

.analytics-header-strip {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.analytics-close-x-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.1s ease;
}
.analytics-close-x-btn:hover {
    color: #ef4444;
}

.analytics-grid-body {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: calc(100% - 41px); /* Accounts for Header strip layout constraint */
    box-sizing: border-box;
}

/* Grid Column A: Input Criteria Panel Controls Menu */
.analytics-controls-column {
    width: 280px;
    background-color: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Grid Column B: Graphic Canvas Plot Frame */
.analytics-graphic-column {
    flex-grow: 1;
    background-color: #ffffff;
    padding: 16px;
    min-width: 0; /* Essential constraint fix prevents chart layout blowouts inside Flex blocks */
    box-sizing: border-box;
}

.control-field-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-field-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-dropdown-input {
    width: 100%;
    padding: 6px 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 12.5px;
    color: #334155;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease;
}
.analytics-dropdown-input:focus {
    border-color: #1e718a;
}
.analytics-dropdown-input:disabled {
    background-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.analytics-metrics-readout-box {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    font-size: 11.5px;
    margin-top: auto; /* Pushes informational card down to pin perfectly to bottom boundary */
}

/* Autocomplete Suggestion Tray */
.chart-autocomplete-tray {
    position: absolute;
    bottom: 32px; /* Pulls up above input since layout is pinned to screen floor boundary */
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    max-height: 120px;
    overflow-y: auto;
    z-index: 1100;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.08);
    border-radius: 6px;
}
/*========================================
TIMELINE FILTERING PANEL AND CONTAINERS
========================================*/

.time-filter-panel {
    position: absolute;
    bottom: 50px;
    right: 10px;
    z-index: 12;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    font-family: Outfit, sans-serif;
    overflow: hidden;
    width: 550px;
}

.time-filter-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    background-color: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-bottom: 1px solid transparent;
}

/* Add a subtle top divider line only when the panel is open */
.time-filter-panel[open] .time-filter-header {
    border-bottom: 1px solid #e2e8f0;
}

.time-filter-header:hover {
    background-color: #f1f5f9;
}

.time-filter-header::-webkit-details-marker,
.time-filter-header::marker {
    display: none;
}

/* Custom CSS Arrow Indicator */
.time-filter-header::after {
    content: "▲"; /* Pointing up since the HUD unfolds upwards */
    font-size: 0.75rem;
    color: #64748b;
    transition: transform 0.2s ease;
}

/* Rotate the arrow downward when the panel expands */
.time-filter-panel[open] .time-filter-header::after {
    transform: rotate(180deg);
}

#timeline-filter-hud {
    background: #ffffff;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#timeline-filter-hud input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1e718a;
    border: 2px solid #ffffff;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
#timeline-filter-hud input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1e718a;
    border: 2px solid #ffffff;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#timeline-range-label {
    font-size: 12px;
    font-weight: 600;
    color: #1e718a;
    background: #e0f2fe;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #bde4f4;
    width: 150px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

#timeline-switch {
    cursor: pointer;
    width: 15px;
    height: 15px;
    accent-color: #1e718a;
}

#timeline-current-date {
    color: #475569;
    font-weight: 700;
}

#timeline-date-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.date-from-to-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.timeline-date-input {
    font-family: Outfit;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #1e718a;
    outline: none;
    background: #ffffff;
    width: 90px;
    font-variant-numeric: tabular-nums;
}

#slider-colour-fill-track {
    position: absolute;
    height: 5px;
    background: #1e718a;
    border-radius: 3px;
    top: 5px;
    z-index: 2;
    left: 0;
    right: 0;
}

/* Fix the thumb tracking alignment cutoff points */
#timeline-slider-min, #timeline-slider-max {
    position: absolute;
    width: calc(100% + 8px) !important; /* Forces slider track to gain geometric breathing room */
    left: -4px !important;              /* Offsets padding drift completely */
    -webkit-appearance: none;
    appearance: none;
    background: none;
    pointer-events: none;
    margin: 0;
    outline: none;
}

/*========================================
LAYER DESCRIPTION FLOATING PANEL
========================================*/
/* Floating Popover Panel (Non-Blocking) */
.floating-info-popover {
    position: fixed;
    top: 120px;
    left: 340px;                /* Anchors it right next to your left sidebar */
    width: 320px;               /* Compact floating card width */
    max-height: 75vh;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #cbd5e1;
    z-index: 1000;              /* Sits above map tiles but below top-level dropdowns */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    animation: popoverSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Popover Header */
.popover-header {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.popover-header h3 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.popover-close-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.popover-close-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

/* Popover Body */
.popover-body {
    padding: 12px 14px;
    overflow-y: auto;
    font-size: 12.5px;
    line-height: 1.5;
    color: #334155;
}

/* Container holding both action buttons */
.layer-action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;                  /* Adds space between Info and Filter buttons */
    flex-shrink: 0;           /* Prevents buttons from squishing when layer name wraps */
}

/* Info Button Styling */
.layer-info-btn {
    display: inline-flex;      /* Flexbox forces the child SVG to center perfectly */
    align-items: center;
    justify-content: center;
    width: 22px;               /* Fixed square dimensions matching Filter button height */
    height: 22px;
    padding: 0;                /* Removes default button padding that shifts SVGs */
    margin: 6px;
    background: #e2e8f0;       /* Matching your teal accent color */
    color: #000000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.layer-info-btn:hover {
    background: #cbd5e1;       /* Slightly darker teal hover state */
}

/* Ensure the SVG scales nicely inside the button */
.layer-info-btn svg {
    width: 14px;               /* Compact SVG icon size */
    height: 14px;
    fill: currentColor;
    stroke: currentColor;
    display: block;            /* Prevents baseline inline-block spacing offsets */
}

/* Filter Button Styling (for height parity) */
.layer-filter-trigger-btn {
    height: 22px;              /* Ensures height parity with the info button */
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 22px;
    display: inline-flex;
    align-items: center;
}

/*========================================
WELCOME MODAL DIALOG
========================================*/

/* Backdrop blur filter over page */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Modal window content box */
.modal-window {
    background: #ffffff;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: Outfit, sans-serif;
    animation: modalFadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-title {
    margin: 0;
    padding: 24px 24px 16px 24px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
}

.modal-content {
    padding: 24px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
}

.modal-content h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.modal-content h3:not(:first-child) {
    margin-top: 20px;
}

.modal-content ul {
    margin: 0 0 16px 0;
    padding-left: 20px;
}

.modal-disclaimer-block {
    background-color: #ffe0e0;
    border: 1px solid #ffe0e0;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 10px;
    color: #991b1b
}

.modal-disclaimer-block p {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: #7f1d1d;
}

.modal-footer {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}

.modal-agree-btn {
    background-color: #1e718a;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.modal-agree-btn:hover {
    background-color: #154f61;
}

/* Entry Animation */
@keyframes modalFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ==========================================================================
   MAPLIBRE BASEMAPS PLUGIN OVERRIDES
   ========================================================================== */

/* 1. Target the floating panel container */
.maplibregl-ctrl.maplibre-ctrl-basemap {
    font-family: 'Outfit', sans-serif !important;
    background: transparent;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    padding: 0 !important;
    float: none !important;
    position: relative;
}

/* 2. Style the square layer-stack toggle button icon */
.maplibregl-ctrl.maplibre-ctrl-basemap button {
    width: 40px !important;
    height: 40px !important;
    background-color: #ffffff !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
    color: #475569 !important;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 5px;
}

/* Hide the plugin's original pixelated SVG content */
.maplibregl-ctrl.maplibre-ctrl-basemap button svg {
    display: none !important;
}

/* Inject a clean, high-resolution vector layers icon */
.maplibregl-ctrl.maplibre-ctrl-basemap button::after {
    content: "";
    width: 22px;
    height: 22px;
    display: block;

    /* Modern Lucide-style Layers SVG encoded cleanly as an inline data URL */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease;
}

/* 🌟 HOVER STATE: Rotate/animate slightly and swap the stroke color to your brand hex (#1e718a) */
.maplibregl-ctrl.maplibre-ctrl-basemap button:hover::after {
    transform: translateY(-1px);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e718a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E");
}

/* 3. Style the list container area (the hidden div that expands) */
.maplibregl-ctrl.maplibre-ctrl-basemap > div {
    border: none !important;
}

/* 4. Individual basemap item rows */
.maplibregl-ctrl.maplibre-ctrl-basemap > div > div {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    padding: 4px 8px !important;
    margin-bottom: 4px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: background 0.15s ease;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.maplibregl-ctrl.maplibre-ctrl-basemap > div > div:hover {
    background: #f1f5f9 !important;
}

.maplibregl-ctrl.maplibre-ctrl-basemap > div > div:hover label {
    color: #0f172a !important;
    cursor: pointer;
}

/* Ensure labels inside items inherit styles correctly */
.maplibregl-ctrl.maplibre-ctrl-basemap label {
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    padding: 0 !important;
    cursor: pointer !important;
}

/* 5. Customizing the Native Radio Button Checkbox Rings */
.maplibregl-ctrl.maplibre-ctrl-basemap input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    cursor: pointer !important;
    display: grid !important;
    place-content: center !important;
    transition: all 0.15s ease !important;
    margin: 0 !important;
    position: relative !important;
}

.maplibregl-ctrl.maplibre-ctrl-basemap input[type="radio"]:hover {
    border-color: var(--primary-brand) !important;
}

/* Clear look for when a basemap option is active/checked */
.maplibregl-ctrl.maplibre-ctrl-basemap input[type="radio"]:checked {
    border-color: var(--primary-brand) !important;
    background: var(--primary-brand) !important;
}

/* The inner white dot for checked state */
.maplibregl-ctrl.maplibre-ctrl-basemap input[type="radio"]:checked::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
}