/* MGLP-Style Creel Data Application */
/* WCAG 2.1 AA Compliant */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {

    line-height: 1.5;
    color: #2c3e50;
    background-color: #f5f7fa;
    overflow: hidden;
    font-family: "Montserrat",
        sans-serif;
    letter-spacing: 0.02em;
}


/* ========== SPLASH SCREEN ========== */
.splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.splash-overlay[hidden] {
    display: none;
}

.splash-card {
    background: white;
    padding: 0;
    max-width: 740px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;

}

.splash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 2px solid #e1e8ed;
    background: #142d3e;
    color: white;
}

.splash-header h1 {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.splash-body-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.splash-body-title h3 {
    margin-bottom: 0;
    margin-left: 20px;
}

.dnr-logo-sm {
    height: 50px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    flex-shrink: 0;

}

.splash-subtitle {
    font-size: 14px;
    color: #6b7c8d;
    margin-bottom: 16px;
}

.splash-body {
    padding: 15px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    color: #2c3e50;
}

.splash-body h3 {
    font-size: 22px;
    color: #1a3d5c;
    margin-bottom: 4px;
    border-bottom: 2px solid #161616;
}

.splash-body h4 {
    margin: 8px 0 2px;
    color: #1a3d5c;
}

.splash-dismiss-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.splash-dismiss-btn:hover {
    color: #ff0000;
}

.splash-dismiss-btn:focus-visible {
    outline: 3px solid #28b7ff;
    outline-offset: 2px;
}

.splash-close-btn {
    margin-top: 20px;
    align-self: flex-start;
    background: #142d3e;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(26, 61, 92, 0.3);

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.splash-close-btn:hover {
    background-color: #28b7ff;
    box-shadow: 0 6px 16px rgba(26, 61, 92, 0.4);
}

.splash-close-btn:focus-visible {
    outline: 3px solid #005fa3;
    outline-offset: 2px;
}

/* ========== Help Modal ========== */
#helpBtn {
    background-color: transparent;
    color: #c0392b;
    border: 2px solid #c0392b;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s;
    gap: 0;
}

#helpBtn:hover {
    background-color: #c0392b;
    color: #ffffff;
    border: 2px solid #c0392b;
}

.help-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.help-modal-overlay[hidden] {
    display: none;
}

.help-modal-card {
    background: white;
    padding: 0;
    max-width: 1000px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 2px solid #e1e8ed;
    background: #142d3e;
    color: white;
}

.help-modal-header h2 {
    font-size: 16px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

.help-close-btn:hover {
    color: #ff0000;
}

.help-modal-body {
    padding: 24px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
}

.help-modal-body ul {
    padding-left: 24px;
    margin: 8px 0 16px;
}

.help-modal-body li {
    margin-bottom: 2px;
}

.help-modal-body p {
    margin-bottom: 12px;
}

/* ========== WCAG: SKIP LINK ========== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 12px 24px;
    background-color: #1a3d5c;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #f39c12;
    outline-offset: 2px;
}

.export-data-container {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    background-color: #f0f3f6;
    border: 1px solid #c5cfda;
    border-radius: 6px;
    padding: 8px 16px;
}

.export-data-label {
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

/* ========== WCAG: SCREEN READER ONLY ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========== WCAG: FOCUS INDICATORS ========== */
/* All interactive elements get a visible, high-contrast focus ring */
:focus-visible {
    outline: 3px solid #005fa3;
    outline-offset: 2px;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid #005fa3;
    outline-offset: 2px;
}

/* ========== WCAG: REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .spinner {
        animation: none;
        border-top-color: #0088cc;
        opacity: 0.6;
    }
}

/* ========== WCAG: HIGH CONTRAST MODE ========== */
@media (forced-colors: active) {
    .filter-chip {
        border: 1px solid ButtonText;
    }

    .generate-btn,
    .action-btn,
    .chart-export-btn {
        border: 1px solid ButtonText;
    }

    .range-slider-fill {
        background: Highlight;
    }
}

/* ========== Export Loading Overlay ========== */
.export-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.export-overlay[hidden] {
    display: none;
}

.export-overlay-card {
    background: white;
    border-radius: 12px;
    padding: 32px 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.export-overlay-card .spinner {
    margin: 0 auto 16px;
}

.export-overlay-card h3 {
    font-size: 18px;
    color: #1a3d5c;
    margin-bottom: 8px;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.export-overlay-card p {
    font-size: 14px;
    color: #4a5c6d;
    line-height: 1.5;
}

.export-overlay-progress {
    margin-top: 12px;
    font-size: 13px;
    color: #005fa3;
    font-weight: 600;
}

/* Main Container */
.app-container {
    display: flex;
    height: calc(100vh - 20px);
    overflow: hidden;
}

/* View Tabs */
.view-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    background-color: #142d3e;
    flex-shrink: 0;
}

.view-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;

    text-transform: uppercase;
}

.view-tab:hover {
    color: #27a1df;
}

.view-tab.active {
    color: #ffffff;
    border-bottom-color: #005fa3;
    background-color: #176790;
}

.map-species-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a3d5c;
    white-space: nowrap;

    text-transform: uppercase;
}

.map-species-switcher {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background: white;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.map-species-select {
    padding: 6px 10px;
    border: 2px solid #8a9bb0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1a3d5c;
    cursor: pointer;

    text-transform: uppercase;
}

.map-label-toggle {
    background: #005fa3;
    border: 2px solid #8a9bb0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.map-label-toggle.active {
    background: #ffffff;
    border-color: #005fa3;
}

.map-container {
    position: relative;
}

.map-container:not([hidden]) {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.map-container[hidden] {
    display: none !important;
}

.map-reset-btn {
    background: #005fa3;
    color: #ffffff;
    border: 2px solid #8a9bb0;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;

}

.map-reset-btn:hover {
    background: #28b7ff;
    border-color: #005fa3;
}

/* ========== MAP YEAR ANIMATION ========== */
.map-anim-wrap {
    position: relative;
    padding-left: 8px;
    border-left: 1px solid #c5cfda;
}

.map-anim-toggle {
    background: #005fa3;
    color: #ffffff;
    border: 2px solid #8a9bb0;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Source Sans 3', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.map-anim-toggle:hover:not(:disabled) {
    background: #28b7ff;
}

.map-anim-toggle[aria-expanded="true"] {
    background: #142d3e;
}

.map-anim-toggle:disabled,
.map-anim-btn:disabled,
.map-year-slider:disabled {
    background: #b0bec5;
    border-color: #c5cfda;
    cursor: not-allowed;
}

.map-anim-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: -120px;
    z-index: 60;
    background: #ffffff;
    border: 1px solid #c5cfda;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    padding: 12px;
    width: fit-content;
}

.map-anim-panel[hidden] {
    display: none;
}

.map-anim-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.map-anim-row:last-child {
    margin-bottom: 0;
}

.map-anim-buttons {
    justify-content: center;
    gap: 12px;
}

.map-anim-btn {
    background: #005fa3;
    color: #ffffff;
    border: 2px solid #8a9bb0;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 15px;
    cursor: pointer;
    line-height: 1;
}

.map-anim-btn:hover:not(:disabled) {
    background: #28b7ff;
}

.map-anim-label {
    font-size: 12px;
    font-weight: 600;
    color: #1a3d5c;
    white-space: nowrap;
}

.map-anim-value {
    font-size: 12px;
    font-weight: 700;
    color: #005fa3;
    min-width: 30px;
}

.map-anim-bound {
    font-size: 11px;
    font-weight: 600;
    color: #4a5c6d;
    min-width: 30px;
    text-align: center;
}

.map-anim-track {
    gap: 6px;
}

.map-year-slider,
.map-speed-slider {
    flex: 1;
    accent-color: #005fa3;
}

.map-year-label {
    width: 100%;
    font-size: 14px;
    font-weight: 700;
    color: #1a3d5c;
    text-align: center;
}

/* ========== MAP LOADING OVERLAY ========== */
.map-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.map-loading-overlay[hidden] {
    display: none;
}

.map-loading-overlay p {
    color: #1a3d5c;
    font-size: 15px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ========== MAP EXPORT BUTTON ========== */
.map-export-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    cursor: pointer;
    background: #ffffff;
    color: #1a3d5c;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Source Sans 3', sans-serif;
    white-space: nowrap;
}

.map-export-btn:hover {
    background: #e8f1f8;
}

.map-export-btn.is-busy {
    opacity: 0.5;
    pointer-events: none;
}

.map-export-label {
    line-height: 1;
}

/* ========== LEFT SIDEBAR ========== */
.sidebar {
    width: 400px;
    background-color: #ffffff;
    border-right: 1px solid #e1e8ed;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.sidebar-header {
    padding: 10px;
    background: #142d3e;
    color: white;
    border-bottom: 3px solid #0088cc;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.dnr-logo {
    height: 40px;
    width: auto;
    margin-left: 10px;
    flex-shrink: 0;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;

    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 10px 20px 20px;
    display: flex;
    flex-direction: column;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background-color: #ffffff;
    padding: 16px 20px;
    border-bottom: 2px solid #e1e8ed;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1a3d5c;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.clear-all-btn {
    background-color: transparent;
    color: #c0392b;
    border: 2px solid #c0392b;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-all-btn:hover {
    background-color: #c0392b;
    color: white;
}

/* Filter Items */
.filters-section {
    margin-bottom: 12px;
    border: none;
    padding: 0;
    position: relative;
}

/* Visible "loading filters" indicator, driven by aria-busy on the section. */
.filters-section[aria-busy="true"]::before {
    content: "⏳ Loading filters…";
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #e8f1f8;
    border: 1px solid #b9d4e6;
    border-radius: 6px;
    color: #1a3d5c;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;

}

.filters-section[aria-busy="true"] .filter-select {
    opacity: 0.55;
}

.filter-item {
    margin-bottom: 10px;
}

.filter-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e2d3d;
    margin-bottom: 6px;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #8a9bb0;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    color: #2c3e50;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filter-select option[value=""] {
    display: none;
}

.filter-select:hover:not(:disabled) {
    border-color: #005fa3;
    box-shadow: 0 0 0 3px rgba(0, 95, 163, 0.15);
}

.filter-select:focus {
    outline: none;
    border-color: #005fa3;
    box-shadow: 0 0 0 3px rgba(0, 95, 163, 0.25);
}

.filter-select:disabled {
    background-color: #f0f3f6;
    color: #6b7c8d;
    cursor: not-allowed;
    border-color: #c5cfda;
    opacity: 1;
    /* WCAG: don't reduce opacity on disabled, use color contrast instead */
}

/* Year Range Slider */
.range-slider {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0;
}

.range-slider-track {
    position: relative;
    height: 8px;
    background: #8a9bb0;
    border-radius: 4px;
    margin: 8px 0;
}

.range-slider-fill {
    position: absolute;
    height: 100%;
    background: #005fa3;
    border-radius: 4px;
}

.range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 8px;
    appearance: none;
    background: transparent;
    pointer-events: none;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a3d5c;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #1a3d5c, 0 2px 6px rgba(0, 0, 0, 0.2);
    pointer-events: all;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.range-slider input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a3d5c;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #1a3d5c, 0 2px 6px rgba(0, 0, 0, 0.2);
    pointer-events: all;
    cursor: pointer;
}

.range-slider input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px #005fa3, 0 0 0 6px rgba(0, 95, 163, 0.3);
}

.range-slider input[type="range"]:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px #005fa3, 0 0 0 6px rgba(0, 95, 163, 0.3);
}

.range-slider input[type="range"]:hover::-webkit-slider-thumb {
    background: #2c5f7f;
    transform: scale(1.1);
}

.range-slider input[type="range"]:hover::-moz-range-thumb {
    background: #2c5f7f;
    transform: scale(1.1);
}

.range-min {
    z-index: 1;
}

.range-max {
    z-index: 2;
    pointer-events: none;
}

.range-max::-webkit-slider-thumb {
    pointer-events: all;
}

.range-max::-moz-range-thumb {
    pointer-events: all;
}

.year-display {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #005fa3;
    margin-top: 4px;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Filter Chips (below each select) */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.filter-chips:empty {
    display: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #005fa3;
    color: white;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.remove-chip {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 2px;
    margin-left: 2px;
    border-radius: 50%;
    transition: background 0.2s;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-chip:hover,
.remove-chip:focus-visible {
    background: rgba(255, 255, 255, 0.25);
}

/* Generate Button */
.generate-btn {
    width: 60%;
    padding: 10px 24px;
    background: #176790;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(30, 132, 73, 0.3);
    margin-top: auto;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.generate-btn:hover:not(:disabled) {
    background: #28b7ff;
    box-shadow: 0 6px 16px rgba(30, 132, 73, 0.4);
    transform: translateY(-2px);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    background: #b0bec5;
    color: #ffffff;
    cursor: not-allowed;
    box-shadow: none;
}

/* Sidebar Scrollbar */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #8a9bb0;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #6b7c8d;
}

.filter-sublabel {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e2d3d;
    margin-bottom: 2px;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.data-toggles {
    margin-bottom: 6px;
}

.metric-subgroup {
    padding-left: 16px;
}

/* ========== RIGHT CONTENT AREA ========== */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    background-color: white;
    border-bottom: 1px solid #e1e8ed;
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a3d5c;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #176790;
    color: white;
    border: none;
    padding: 10px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.action-btn:hover:not(:disabled) {
    background-color: #28b7ff;
    box-shadow: 0 2px 8px rgba(0, 95, 163, 0.3);
}

/* Charts Container */
.charts-container {
    flex: 1;
    overflow: hidden;
    padding: 16px;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.charts-container[hidden],
.map-container[hidden] {
    display: none !important;
}

.charts-container:focus {
    outline: none;
}

.charts-container.is-stale .chart-panel {
    filter: blur(2px);
    opacity: 0.6;
    transition: filter 0.2s ease, opacity 0.2s ease;
    pointer-events: none;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #4a5c6d;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #4a5c6d;
    max-width: 400px;
}

/* Chart Panel */
.chart-panel {
    background-color: white;
    border-radius: 12px;
    padding: 12px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e8ed;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 20px;
}

.chart-row {
    display: contents;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f5f9;
    flex-shrink: 0;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a3d5c;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.chart-export-btn {
    background-color: transparent;
    color: #005fa3;
    border: 2px solid #005fa3;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;

    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-left: 4px;
}

.chart-export-btn:hover {
    background-color: #005fa3;
    color: white;
}

.chart-canvas-container {
    flex: 1;
    position: relative;
    min-height: 0;
}

.regenerate-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    background: #ffd900;
    color: rgb(0, 0, 0);
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 95, 163, 0.35);
    transition: all 0.2s;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.regenerate-btn:hover {
    background: #ff7300;
    transform: translate(-50%, -50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 95, 163, 0.45);
    color: rgb(0, 0, 0);
}

.content-area {
    position: relative;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e1e8ed;
    border-top-color: #005fa3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.loading-state p {
    color: #4a5c6d;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 50vh;
    }

    .content-area {
        height: 50vh;
    }
}

/* ========== ACCESS GATE ========== */
.auth-gate {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: #142d3e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-gate[hidden] {
    display: none;
}

.auth-gate-card {
    background: #fff;
    border-radius: 12px;
    border: 6px solid #1a3d5c;
    padding: 32px;
    width: 90%;
    max-width: 420px;
    text-align: center;

}

.auth-gate-card h1 {
    font-size: 20px;
    color: #1a3d5c;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.auth-gate-sub {
    font-size: 14px;
    color: #4a5c6d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.auth-gate-label {
    display: block;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #1e2d3d;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-gate-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #8a9bb0;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    color: #2c3e50;
}

.auth-gate-input:focus {
    outline: none;
    border-color: #005fa3;
    box-shadow: 0 0 0 3px rgba(0, 95, 163, 0.25);
}

.auth-gate-error {
    min-height: 20px;
    margin: 8px 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #c0392b;
    text-align: left;
}

.auth-gate-btn {
    width: 100%;
    padding: 12px 24px;
    background: #176790;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-gate-btn:hover {
    background: #28b7ff;
}

/* ========== SITE FOOTER ========== */
.site-footer {
    height: 20px;
    background: #d4d4d4;
    border-top: 1px solid #c5cfda;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 12px;
    color: #2c3e50;
    flex-shrink: 0;
    font-weight: 600;
}

.site-footer a {
    color: #00477a;
    text-decoration: underline;
}

.site-footer a:hover {
    color: #142d3e;
}

/* ========== INFO ICON + TOOLTIP ========== */
.info-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid #7a9bb5;
    color: #0870c0;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s;
    user-select: none;
    flex-shrink: 0;
    background: transparent;
    font-family: 'Source Sans 3', sans-serif;
}

.info-icon:hover,
.info-icon:focus-visible {
    border-color: #014d83;
    color: #014d83;
    background: #e8f4ff;
}

.info-tooltip {
    display: none;
    position: fixed;
    z-index: 9999;
    background: #142d3e;
    color: #e8f0f7;
    font-size: 13px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    padding: 8px 10px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    line-height: 1.35;
    white-space: normal;
    max-width: 280px;
    width: max-content;
    font-family: 'Source Sans 3', sans-serif;
}

/* ========== WALKTHROUGH ========== */
.tour {
    position: fixed;
    inset: 0;
    z-index: 10002;
}

.tour[hidden] {
    display: none;
}

.tour-spot {
    position: absolute;
    border-radius: 8px;
    border: 3px solid #28b7ff;
    box-shadow: 0 0 0 9999px rgba(20, 45, 62, 0.6);
    transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease;
    pointer-events: none;
}

.tour-box {
    position: absolute;
    width: 360px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border-top: 4px solid #142d3e;
    border-radius: 8px;
    padding: 16px 18px 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    transition: left 0.2s ease, top 0.2s ease;
}

.tour-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: #4a5c6d;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}

.tour-close:hover {
    background: #e8f1f8;
    color: #142d3e;
}

.tour-count {
    font-size: 11px;
    font-weight: 700;
    color: #005fa3;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.tour-title {
    font-size: 16px;
    font-weight: 700;
    color: #142d3e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    padding-right: 24px;
}

.tour-text {
    font-size: 14px;
    line-height: 1.5;
    color: #2c3e50;
}

.tour-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #e1e8ed;
}

.tour-hide {
    font-size: 12px;
    color: #4a5c6d;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.tour-btns {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.tour-btn {
    padding: 7px 16px;
    background: #176790;
    color: #ffffff;
    border: 2px solid #176790;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.tour-btn:hover:not(:disabled) {
    background: #142d3e;
    border-color: #142d3e;
}

.tour-btn-secondary {
    background: #ffffff;
    color: #176790;
}

.tour-btn-secondary:hover:not(:disabled) {
    color: #ffffff;
}

.tour-btn:disabled {
    background: #f0f3f6;
    border-color: #c5cfda;
    color: #6b7c8d;
    cursor: not-allowed;
}

@media (forced-colors: active) {
    .tour-spot {
        border-color: Highlight;
    }
}

.about-btn {
    font-size: 12px;
    line-height: 1.15;
}

#tourBtn,
.about-btn,
#helpBtn {
    width: 80px;
    flex-shrink: 0;
    justify-content: center;
    text-align: center;
}