* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Texas County/MSA Comparison */
.tx-compare-workflow {
    display: grid;
    gap: 12px;
    margin: 16px 0;
}

.tx-compare-step {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
}

.tx-step-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
    color: #475569;
    margin-bottom: 10px;
}

.tx-compare-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
}

.tx-compare-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tx-compare-control-group label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.tx-compare-control-group select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
}

.tx-compare-control-group select:focus-visible {
    outline: 2px solid var(--cpi);
    outline-offset: 1px;
}

.tx-category-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    margin: 0;
}

.tx-category-btn {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 12px;
    min-height: 42px;
}

.tx-category-btn:hover {
    border-color: var(--gdp);
    box-shadow: 0 4px 10px rgba(203, 96, 21, 0.15);
}

.tx-category-btn.active {
    background: linear-gradient(135deg, var(--gdp-dark), var(--cpi));
    color: #fff;
    border-color: transparent;
}

.tx-compare-summary {
    margin-bottom: 12px;
    color: #475569;
    font-size: 0.95rem;
}

.tx-compare-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 10px;
}

.tx-map-card {
    grid-column: 1 / -1;
}

.regional-employment-wide {
    grid-column: 1 / -1;
}

.regional-employment-rate-card canvas {
    height: 330px;
    max-height: 360px;
}

#regionalEmploymentWagesChart {
    height: 1080px;
    max-height: 1140px;
}

#regionalEmploymentIndustryChart {
    height: 590px;
    max-height: 640px;
}

.tx-map-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 14px;
}

.tx-map-pane {
    display: grid;
    gap: 6px;
}

.tx-map-pane-label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.tx-map {
    height: 360px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.tx-map .leaflet-control-zoom {
    border: 1px solid #d1d9e5;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.tx-map .leaflet-control-attribution {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.86);
}

.tx-map-tooltip {
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    border: 1px solid #334155;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 8px;
}

.tx-map-tooltip::before {
    border-top-color: rgba(15, 23, 42, 0.96);
}

#tx-compare .section-header > div:last-child {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.demo-compare-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0 14px;
}

.demo-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.demo-control-group label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.demo-control-group select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.demo-control-group select:focus-visible {
    outline: 2px solid var(--gdp);
    outline-offset: 1px;
}

.demo-compare-summary {
    margin-bottom: 14px;
    color: #475569;
    font-size: 0.95rem;
}

.demo-compare-highlights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.demo-location-card {
    border-radius: 18px;
    padding: 18px;
    color: #ffffff;
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.14);
}

.demo-location-card.demo-left {
    background: linear-gradient(135deg, rgba(203, 96, 21, 0.98), rgba(232, 129, 53, 0.9));
}

.demo-location-card.demo-right {
    background: linear-gradient(135deg, rgba(0, 47, 108, 0.98), rgba(74, 120, 214, 0.88));
}

.demo-location-eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.76);
}

.demo-location-title {
    margin: 0 0 14px;
    font-size: 1.25rem;
    line-height: 1.25;
}

.demo-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.demo-stat-pill {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 12px 14px;
    backdrop-filter: blur(6px);
}

.demo-stat-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 4px;
}

.demo-stat-pill strong {
    font-size: 1.4rem;
    line-height: 1.1;
}

.demo-compare-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
    gap: 16px;
}

.demo-chart-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.demo-card-note,
.demo-note {
    font-size: 0.88rem;
}

.demo-race-card {
    grid-column: 1 / -1;
}

.demo-chart-frame {
    position: relative;
    min-height: 380px;
}

.demo-chart-frame.medium {
    min-height: 320px;
}

.demo-chart-frame.small {
    min-height: 280px;
}

#regional-demographics .section-header > div:last-child {
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .tx-compare-charts {
        grid-template-columns: 1fr;
    }

    .tx-compare-controls {
        grid-template-columns: 1fr;
    }

    .tx-category-nav {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .tx-map-wrap {
        grid-template-columns: 1fr;
    }

    .tx-map-card {
        grid-column: auto;
    }

    .tx-map {
        height: 300px;
    }

    .demo-compare-toolbar,
    .demo-compare-highlights,
    .demo-compare-grid,
    .demo-stat-grid {
        grid-template-columns: 1fr;
    }

    .demo-chart-frame,
    .demo-chart-frame.medium,
    .demo-chart-frame.small {
        min-height: 300px;
    }
}

:root {
    --gdp: #CB6015;
    --gdp-dark: #a34c0f;
    --cpi: #002F6C;
    --cpi-dark: #001d42;
    --bg: #f6f7fb;
    --panel: #ffffff;
    --glass: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.5);
    --accent-strip: linear-gradient(90deg, var(--gdp), var(--cpi));
    --text: #0f172a;
    --muted: #4b5563;
    --border: #e4e7ec;
    --shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
    --radius: 14px;
    --safe-top: env(safe-area-inset-top, 0);
    --safe-bottom: env(safe-area-inset-bottom, 0);
    --safe-left: env(safe-area-inset-left, 0);
    --safe-right: env(safe-area-inset-right, 0);
}

@media (max-width: 640px) {
    :root {
        --radius: 10px;
    }
}

html, body {
    height: 100%;
    max-width: 100%;
}

html {
    font-size: clamp(16px, calc(14px + 0.25vw), 18px);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f6f7fb;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: clip;
}

img,
svg,
canvas {
    max-width: 100%;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 20000;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--cpi-dark);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform 0.15s ease;
}

.skip-link:focus {
    transform: translateY(0);
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.notification-region {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 15000;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border: 2px solid var(--cpi);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow);
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notification-region.visible {
    opacity: 1;
    transform: translateY(0);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 10% 0%, rgba(203, 96, 21, 0.11), transparent 30%),
        radial-gradient(circle at 90% 6%, rgba(31, 58, 112, 0.07), transparent 27%),
        linear-gradient(180deg, #fffaf5 0%, #f8f6f3 42%, #f2f5f9 100%);
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }
}

.page {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px calc(clamp(12px, 4vw, 32px) + var(--safe-left)) 40px calc(clamp(12px, 4vw, 32px) + var(--safe-right));
    padding-top: calc(28px + var(--safe-top));
    padding-bottom: calc(40px + var(--safe-bottom));
}

@media (max-width: 640px) {
    .page {
        padding: calc(16px + var(--safe-top)) calc(12px + var(--safe-left)) calc(32px + var(--safe-bottom)) calc(12px + var(--safe-right));
    }
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 16px;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand > div:last-child {
    min-width: 0;
}

.logo {
    width: 200px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--panel);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    .topbar {
        margin-bottom: 16px;
    }
    
    .logo {
        width: 140px;
        height: 63px;
        padding: 8px;
    }
    
    .logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .brand {
        gap: 10px;
    }
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.brand h1 {
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 700;
    color: var(--text);
}

.brand-subtitle {
    max-width: 360px;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.35;
}

.top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.social-links a,
.top-actions > .link {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
}

.social-links a:focus-visible,
.top-actions > .link:focus-visible,
a:focus-visible,
summary:focus-visible,
select:focus-visible {
    outline: 3px solid var(--cpi);
    outline-offset: 3px;
}

button, .link {
    font: inherit;
}

button {
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

button:focus-visible {
    outline: 2px solid var(--cpi);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    button {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 48px;
    }
}

/* Main Tab Navigation */
.main-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 30px 0 16px;
    justify-content: center;
}

.main-tab-btn {
    padding: 13px 24px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    color: #64748b;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.main-tab-btn:hover {
    color: #334155;
    border-color: var(--gdp);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(203, 96, 21, 0.15);
}

.main-tab-btn:active {
    transform: translateY(-1px);
}

.main-tab-btn:focus-visible {
    outline: 2px solid var(--cpi);
    outline-offset: 2px;
}

.main-tab-btn.active {
    background: linear-gradient(135deg, var(--gdp-dark), #7f390b);
    color: white;
    border-color: var(--gdp);
    box-shadow: 0 4px 16px rgba(203, 96, 21, 0.3);
}

.main-tab-btn.active::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 8px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.35);
}

/* Sub-tabs Container */
.sub-tabs-container {
    display: none;
    margin-bottom: 20px;
}

.sub-tabs-container.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.sub-tab-nav {
    display: flex;
    gap: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    justify-content: center;
}

.sub-tab-btn {
    padding: 10px 24px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-user-select: none;
    user-select: none;
}

.sub-tab-btn:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.sub-tab-btn:active {
    transform: scale(0.98);
}

.sub-tab-btn:focus-visible {
    outline: 2px solid var(--cpi);
    outline-offset: 1px;
    border-radius: 8px;
}

.sub-tab-btn.active {
    background: white;
    color: var(--text);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
    font-weight: 700;
}

.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

button.primary {
    background: var(--gdp-dark);
    color: #fff;
    box-shadow: 0 8px 20px rgba(203, 96, 21, 0.25);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

button.primary:hover { 
    background: #7f390b;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(203, 96, 21, 0.3);
}

button.primary:active { 
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(203, 96, 21, 0.2);
}

button.primary:focus-visible {
    outline: 2px solid var(--gdp);
    outline-offset: 2px;
    box-shadow: 0 8px 20px rgba(203, 96, 21, 0.25);
}

button.ghost {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
    white-space: nowrap;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

button.ghost:hover { 
    border-color: var(--gdp); 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(203, 96, 21, 0.15);
    background: #f9fafc;
}

button.ghost:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

button.ghost:focus-visible {
    outline: 2px solid var(--cpi);
    outline-offset: 2px;
    border-color: var(--cpi);
}

.link {
    text-decoration: none;
    color: var(--cpi);
    font-weight: 600;
}

.hero {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: clamp(18px, 4vw, 28px);
    padding-top: calc(clamp(18px, 4vw, 28px) + 8px);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 2fr 1.1fr;
    gap: clamp(16px, 3vw, 28px);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
}

.hero > *,
.stat-cards > *,
.section-header > * {
    min-width: 0;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 0 0 999px 999px;
    background: var(--accent-strip);
    opacity: 0.9;
}

.hero h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.25;
    margin-bottom: 10px;
}

.lede {
    color: var(--muted);
    margin-bottom: 16px;
}

.control-label {
    margin: 4px 0 7px;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
    position: sticky;
    top: calc(12px + var(--safe-top));
    z-index: 2;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px) saturate(1.1);
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.controls label {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.controls input {
    width: 160px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s ease;
}

.controls input:focus {
    outline: 2px solid rgba(0, 47, 108, 0.2);
    border-color: var(--cpi);
    box-shadow: 0 0 0 3px rgba(0, 47, 108, 0.08);
}

.controls input:focus-visible {
    outline: 2px solid var(--cpi);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 47, 108, 0.12);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    margin-left: auto;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--cpi);
}

.checkbox-label input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status {
    color: var(--muted);
    font-size: 0.95rem;
}
.status.success { color: #176b3a; font-weight: 700; }
.status.warn { color: #8a3f0b; font-weight: 700; }
.status.error { color: #b91c1c; font-weight: 700; }

.dashboard-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
}

.dashboard-status-row .status {
    margin: 0;
}

.inline-navigation {
    min-height: 44px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #0b5cab;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.inline-navigation:hover {
    background: rgba(0, 47, 108, 0.07);
    color: var(--cpi);
}

.data-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
}

.card {
    padding: 20px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: floatIn 0.45s ease both;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px) saturate(1.05);
    -webkit-backdrop-filter: blur(8px) saturate(1.05);
}

.card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.card .muted { color: var(--muted); font-size: 0.95rem; }

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.report-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--gdp-dark), #7f390b);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(203, 96, 21, 0.25);
    -webkit-user-select: none;
    user-select: none;
    border: none;
    cursor: pointer;
}

.report-download-btn:hover {
    background: linear-gradient(135deg, var(--cpi), var(--cpi-dark));
    box-shadow: 0 4px 16px rgba(0, 47, 108, 0.35);
    transform: translateY(-2px);
}

.report-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 47, 108, 0.25);
}

.report-download-btn:focus-visible {
    outline: 2px solid var(--cpi);
    outline-offset: 2px;
}

.report-download-btn svg {
    flex-shrink: 0;
}

.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.charts.tx-compare-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: floatIn 0.5s ease both;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
}

.chart-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 0 0 999px 999px;
    background: var(--accent-strip);
    opacity: 0.9;
}

.chart-card h3 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 16px;
    color: var(--text);
}

.chart-availability-note {
    margin: -8px 0 12px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.chart-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

@keyframes floatIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.is-loading .chart-card::after,
.is-loading .card::after,
.is-loading .table-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.65) 50%, rgba(255, 255, 255, 0) 100%);
    animation: shimmer 1.6s infinite;
    opacity: 0.55;
    pointer-events: none;
}

.is-loading canvas {
    opacity: 0.25;
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

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

    .card,
    .chart-card {
        animation: none;
        transition: none;
    }
    .is-loading .chart-card::after,
    .is-loading .card::after,
    .is-loading .table-section::after {
        animation: none;
    }
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.chart-header h3 {
    margin: 0;
    position: relative;
    padding-left: 20px;
}

.chip {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    margin-top: 6px;
    padding: 5px 9px;
    border: 1px solid rgba(0, 47, 108, 0.14);
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px;
    line-height: 1.35;
    color: #334155;
    background: #f1f5f9;
}

.chip.gdp,
.chip.cpi {
    color: #334155;
    background: #f1f5f9;
}

canvas { width: 100%; height: 340px; max-height: 380px; }

.chart-scroll-frame {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
}

.chart-scroll-surface {
    min-width: 100%;
    height: 340px;
}

.chart-scroll-surface canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: none;
}

.table-section {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
}

.table-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 0 0 999px 999px;
    background: var(--accent-strip);
    opacity: 0.9;
}

.section-header,
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

.section-header > div:first-child,
.table-header > div:first-child {
    flex: 1;
}

.section-header h2,
.table-header h2 {
    margin-bottom: 6px;
    font-size: 1.5rem;
    line-height: 1.3;
}

.section-header button,
.table-header button {
    flex-shrink: 0;
    align-self: center;
}

.section-header h2,
.table-header h2 {
    margin-bottom: 4px;
    font-size: 1.5rem;
    line-height: 1.3;
    position: relative;
    padding-left: 20px;
}

.section-header h2::before,
.table-header h2::before,
.chart-header h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-strip);
    box-shadow: 0 2px 6px rgba(203, 96, 21, 0.25);
}

.section-header .chip,
.table-header .eyebrow {
    margin-top: 4px;
}

.source-inline-links {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

.source-inline-links a {
    color: #0b5cab;
    font-weight: 600;
    text-decoration: none;
}

.source-inline-links a:hover,
.source-inline-links a:focus-visible {
    text-decoration: underline;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead {
    background: linear-gradient(120deg, rgba(127, 57, 11, 0.98), rgba(0, 47, 108, 0.98));
    color: #fff;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    font-weight: 700;
    letter-spacing: 0.4px;
}

tbody tr:nth-child(even) { 
    background: #f8f9fb;
}

tbody tr:hover { 
    background: #eef2f7;
}

tbody tr:active {
    background: #e1e8ef;
}

.source-note {
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.source-note p {
    margin-top: 6px;
}

.source-note a {
    color: #0b5cab;
    font-weight: 700;
    text-decoration: none;
}

.source-note a:hover,
.source-note a:focus-visible {
    text-decoration: underline;
}

.card-action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gdp-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.chart-accessibility {
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.chart-accessibility-summary {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.chart-data-details {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.chart-data-details summary,
.methodology-details summary {
    cursor: pointer;
    padding: 11px 14px;
    color: var(--cpi);
    font-weight: 700;
}

.chart-data-details[open] summary,
.methodology-details details[open] summary {
    border-bottom: 1px solid var(--border);
}

.chart-data-table-wrap {
    max-height: 420px;
    overflow: auto;
}

.chart-data-table-wrap table {
    min-width: 560px;
    font-size: 0.85rem;
}

.chart-data-table-wrap caption {
    padding: 10px 12px;
    color: var(--text);
    font-weight: 700;
    text-align: left;
}

.methodology-section {
    margin-top: 0;
    padding: clamp(20px, 4vw, 36px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.methodology-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 4px solid transparent;
    border-image: var(--accent-strip) 1;
}

.methodology-heading h2 {
    color: var(--cpi);
    font-size: clamp(1.55rem, 3vw, 2rem);
    line-height: 1.2;
}

.methodology-version {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-align: right;
}

.methodology-lede {
    max-width: 780px;
    margin: -4px 0 18px;
    color: var(--muted);
    line-height: 1.65;
}

.methodology-intro-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.methodology-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.methodology-card h3 {
    margin-bottom: 8px;
    color: var(--cpi);
    font-size: 1.05rem;
}

.methodology-card p,
.methodology-detail-body p,
.authorship-panel p,
.citation-card p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.methodology-details {
    display: grid;
    gap: 8px;
}

.methodology-details details {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.methodology-detail-body {
    display: grid;
    gap: 9px;
    padding: 14px 16px 17px;
}

.source-directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.source-directory p {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.source-directory a {
    color: #0b5cab;
}

.explore-paths {
    padding: 20px;
    border: 1px solid rgba(0, 47, 108, 0.14);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(163, 76, 15, 0.07), rgba(0, 47, 108, 0.07));
}

.explore-paths-heading {
    margin-bottom: 14px;
}

.explore-paths-heading h3 {
    color: var(--cpi);
}

.explore-path-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.explore-path {
    display: grid;
    gap: 5px;
    min-height: 96px;
    padding: 16px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-align: left;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.explore-path:hover {
    border-color: var(--gdp);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.explore-path strong {
    color: var(--cpi);
    font-size: 0.98rem;
}

.explore-path span {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.authorship-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 20px;
    margin-top: 0;
    padding: 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(163, 76, 15, 0.09), rgba(0, 47, 108, 0.08));
}

.compact-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    text-align: left;
}

.compact-footer p + p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.authorship-panel h3,
.citation-card h4 {
    margin-bottom: 8px;
    color: var(--cpi);
}

.authorship-panel p + p {
    margin-top: 8px;
}

.citation-card {
    padding: 16px;
    border: 1px solid rgba(0, 47, 108, 0.18);
    border-radius: 12px;
    background: #fff;
}

.citation-card a {
    display: inline-block;
    margin-top: 10px;
    color: #0b5cab;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-method-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.85rem;
}

footer {
    text-align: center;
    margin-top: 20px;
    color: var(--muted);
    font-size: 0.95rem;
}

@media (max-width: 900px) {
    .methodology-intro-grid,
    .explore-path-grid,
    .source-directory,
    .authorship-panel {
        grid-template-columns: 1fr;
    }

    .methodology-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .methodology-version {
        text-align: left;
    }

    .compact-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 900px) {
    .hero { 
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .topbar { 
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    
    .top-actions { 
        align-self: flex-start;
        flex-wrap: wrap;
        width: 100%;
    }
    
    canvas { 
        height: 300px;
    }
    
    .main-tab-nav {
        gap: 10px;
    }
    
    .main-tab-btn {
        padding: 14px 24px;
        font-size: 15px;
    }

    .charts {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .charts.tx-compare-charts {
        grid-template-columns: 1fr;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 640px) {
    /* ========== TYPOGRAPHY - Professional Hierarchy ========== */
    body {
        font-size: 15px;
        line-height: 1.6;
    }

    .brand h1 {
        font-size: 1.35rem;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: -0.3px;
    }
    
    .eyebrow {
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.8px;
        text-transform: uppercase;
        margin-bottom: 8px;
        color: var(--muted);
    }
    
    h2 {
        font-size: 1.55rem;
        font-weight: 700;
        line-height: 1.3;
        margin-bottom: 12px;
        letter-spacing: -0.4px;
    }

    h3 {
        font-size: 1.1rem;
        font-weight: 600;
        line-height: 1.35;
        letter-spacing: -0.2px;
    }
    
    .lede {
        font-size: 0.95rem;
        line-height: 1.65;
        margin-bottom: 16px;
        color: var(--muted);
    }

    p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    /* ========== HEADER & BRANDING ========== */
    .page {
        padding: 14px 12px 32px;
    }

    .topbar {
        margin-bottom: 18px;
        gap: 12px;
    }
    
    .brand {
        gap: 12px;
        flex: 1;
        align-items: flex-start;
    }

    .brand > div:last-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    .brand h1,
    .brand-subtitle {
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .logo {
        width: 130px;
        height: 58px;
        padding: 8px;
        flex-shrink: 0;
    }
    
    /* ========== HERO SECTION ========== */
    .hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding: 18px;
    }
    
    .stat-cards {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .card {
        padding: 18px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    }
    
    .card h3 {
        font-size: 1.05rem;
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    .card p {
        font-size: 0.9rem;
        line-height: 1.55;
        margin-bottom: 0;
    }

    .card .muted {
        color: var(--muted);
        font-size: 0.85rem;
    }
    
    /* ========== CONTROLS & INPUTS - Touch-Optimized ========== */
    .controls {
        display: flex;
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
        margin-bottom: 16px;
        width: 100%;
        min-width: 0;
    }
    
    .controls label {
        font-weight: 600;
        font-size: 0.85rem;
        color: var(--text);
        display: block;
        margin-bottom: 6px;
        letter-spacing: -0.3px;
    }
    
    .controls input {
        width: 100%;
        padding: 14px 14px;
        font-size: 16px;
        font-family: Arial, Helvetica, sans-serif;
        font-weight: 500;
        border: 1.5px solid var(--border);
        border-radius: 10px;
        background: #fff;
        transition: all 0.25s ease;
        min-height: 48px;
        color: var(--text);
        max-width: 100%;
    }

    .checkbox-label {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .dashboard-status-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
    
    .controls input:active,
    .controls input:focus {
        outline: 3px solid var(--cpi);
        outline-offset: 2px;
        border-color: var(--cpi);
        box-shadow: 0 0 0 4px rgba(0, 47, 108, 0.12);
    }
    
    .controls button {
        width: 100%;
        padding: 16px 16px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 10px;
        transition: all 0.25s ease;
        min-height: 52px;
        text-transform: none;
        letter-spacing: 0;
    }

    .controls button.primary {
        background: linear-gradient(135deg, var(--gdp-dark), #7f390b);
        color: white;
        box-shadow: 0 4px 16px rgba(203, 96, 21, 0.2);
    }

    .controls button.primary:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(203, 96, 21, 0.15);
    }
    
    /* Status text */
    .status {
        font-size: 0.85rem;
        margin-top: 8px;
        font-weight: 500;
        line-height: 1.5;
    }

    .status.success {
        color: #176b3a;
    }

    .status.warn {
        color: #8a3f0b;
    }

    .status.error {
        color: #b91c1c;
    }
    
    /* ========== NAVIGATION TABS ========== */
    .main-tab-nav {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
        margin-bottom: 18px;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        justify-content: flex-start;
        width: 100%;
    }
    
    .main-tab-btn {
        width: 100%;
        max-width: 100%;
        padding: 16px 16px;
        font-size: 15px;
        font-weight: 600;
        text-align: left;
        justify-content: flex-start;
        border-radius: 10px;
        transition: all 0.25s ease;
        min-height: 52px;
        display: flex;
        align-items: center;
        background: white;
        border: 1.5px solid var(--border);
        color: var(--muted);
        letter-spacing: -0.3px;
    }

    .main-tab-btn:active {
        transform: scale(0.98);
    }

    .main-tab-btn.active {
        background: linear-gradient(135deg, var(--gdp-dark), #7f390b);
        color: white;
        border-color: var(--gdp);
        box-shadow: 0 4px 12px rgba(203, 96, 21, 0.2);
    }
    
    .sub-tab-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
        margin-bottom: 18px;
        background: transparent;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }
    
    .sub-tab-btn {
        padding: 12px 14px;
        font-size: 13px;
        font-weight: 600;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        border-radius: 8px;
        transition: all 0.25s ease;
        min-height: 44px;
        background: white;
        border: 1px solid var(--border);
        color: var(--muted);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        letter-spacing: -0.2px;
    }

    .sub-tab-btn:active {
        transform: scale(0.96);
    }

    .sub-tab-btn.active {
        background: linear-gradient(135deg, var(--gdp-dark), var(--cpi));
        color: white;
        border-color: var(--gdp);
        box-shadow: 0 2px 8px rgba(203, 96, 21, 0.15);
    }
    
    /* ========== CHARTS ========== */
    canvas { 
        height: 300px !important;
        max-height: 300px;
        margin: 0;
        padding: 0;
    }
    
    .chart-card {
        padding: 16px;
        margin-bottom: 18px;
        border-radius: 12px;
        background: var(--panel);
        border: 1px solid var(--border);
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    }
    
    .chart-card h3 {
        font-size: 1rem;
        margin-bottom: 14px;
        font-weight: 600;
        color: var(--text);
    }

    .charts {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 18px;
    }
    
    /* ========== SECTION HEADERS & BUTTONS ========== */
    .section-header,
    .table-header { 
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .section-header > div:first-child,
    .table-header > div:first-child {
        width: 100%;
    }

    .section-header > div[style*="display: flex"],
    .table-header > div[style*="display: flex"] {
        width: 100%;
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }
    
    .section-header button,
    .table-header button {
        width: 100%;
        font-size: 13px;
        padding: 12px 14px;
        font-weight: 600;
        border-radius: 8px;
        min-height: 44px;
        transition: all 0.25s ease;
    }

    .section-header button.ghost,
    .table-header button.ghost {
        background: white;
        border: 1.5px solid var(--border);
        color: var(--text);
    }

    .section-header button.ghost:active,
    .table-header button.ghost:active {
        transform: scale(0.97);
        background: #f9fafc;
    }
    
    /* ========== CHIPS ========== */
    .chip {
        font-size: 11px;
        padding: 6px 12px;
        border-radius: 6px;
        font-weight: 600;
        display: inline-block;
        letter-spacing: 0.3px;
    }
    
    /* ========== REVENUE CONTROLS ========== */
    .revenue-controls {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 18px;
    }
    
    .revenue-controls label {
        width: 100%;
        font-weight: 600;
        font-size: 0.85rem;
        margin-bottom: 6px;
        color: var(--text);
        display: block;
        letter-spacing: -0.3px;
    }
    
    .revenue-controls select {
        width: 100%;
        padding: 14px 14px;
        font-size: 16px;
        font-family: Arial, Helvetica, sans-serif;
        border: 1.5px solid var(--border);
        border-radius: 10px;
        background: #fff;
        color: var(--text);
        min-height: 48px;
        font-weight: 500;
        transition: all 0.25s ease;
    }

    .revenue-controls select:active,
    .revenue-controls select:focus {
        outline: 3px solid var(--cpi);
        outline-offset: 2px;
        border-color: var(--cpi);
        box-shadow: 0 0 0 4px rgba(0, 47, 108, 0.12);
    }
    
    /* ========== TABLES ========== */
    .table-section {
        padding: 16px;
        margin-bottom: 18px;
        border-radius: 12px;
    }

    .table-section h3 {
        font-size: 1rem;
        margin-bottom: 14px;
        font-weight: 600;
    }

    .table-wrapper {
        border-radius: 8px;
        overflow: hidden;
    }

    table {
        font-size: 0.85rem;
        margin: 0;
    }

    thead {
        background: linear-gradient(120deg, rgba(203, 96, 21, 0.9), rgba(0, 47, 108, 0.92));
    }
    
    th {
        padding: 12px 10px;
        font-weight: 700;
        font-size: 0.8rem;
        letter-spacing: 0.3px;
        text-transform: uppercase;
    }
    
    td {
        padding: 10px;
        font-size: 0.85rem;
    }

    tbody tr {
        border-bottom: 1px solid var(--border);
    }

    tbody tr:nth-child(even) {
        background: #f8f9fb;
    }

    tbody tr:active {
        background: #eef2f7;
    }

    .source-note {
        margin-top: 14px;
        color: var(--muted);
        font-size: 0.8rem;
        line-height: 1.6;
    }
    
    /* ========== DOWNLOAD BUTTONS ========== */
    .report-download-btn {
        width: 100%;
        padding: 12px 14px;
        font-size: 13px;
        font-weight: 600;
        margin-top: 12px;
        justify-content: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-radius: 8px;
        transition: all 0.25s ease;
        letter-spacing: 0;
    }

    .report-download-btn:active {
        transform: scale(0.97);
    }
    
    /* ========== FOOTER ========== */
    footer {
        font-size: 0.8rem;
        padding: 20px 12px;
        border-top: 1.5px solid var(--border);
        margin-top: 32px;
        line-height: 1.7;
    }
    
    footer p {
        text-align: left;
        font-size: 0.8rem;
        line-height: 1.65;
        margin-bottom: 10px;
        color: var(--muted);
    }

    footer p:first-child {
        color: var(--text);
        font-weight: 600;
        margin-bottom: 12px;
    }

    footer strong {
        font-weight: 600;
    }
    
    /* ========== TOP ACTIONS ========== */
    .top-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .top-actions .social-links {
        gap: 12px;
        order: 2;
        width: 100%;
        justify-content: flex-start;
    }
    
    .top-actions .social-links a {
        font-size: 18px;
        transition: all 0.25s ease;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .top-actions .social-links a:active {
        transform: scale(0.9);
        opacity: 0.8;
    }
    
    .top-actions .link {
        font-size: 13px;
        padding: 10px 14px;
        font-weight: 600;
        border-radius: 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
        background: linear-gradient(135deg, var(--cpi), var(--cpi-dark));
        color: white;
        text-decoration: none;
        transition: all 0.25s ease;
        order: 1;
    }

    .top-actions .link:active {
        transform: scale(0.97);
    }
}

@media (max-width: 480px) {
    /* ========== PAGE & SPACING ========== */
    .page {
        padding: 12px 10px 28px;
        max-width: 100%;
    }

    /* ========== HEADER ========== */
    .topbar {
        margin-bottom: 16px;
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .brand {
        gap: 10px;
        width: 100%;
    }

    .brand h1 {
        font-size: 1.2rem;
        font-weight: 700;
        line-height: 1.25;
    }
    
    .logo {
        width: 110px;
        height: 50px;
        padding: 6px;
    }

    /* ========== TYPOGRAPHY ========== */
    h2 {
        font-size: 1.35rem;
        font-weight: 700;
    }

    h3 {
        font-size: 1rem;
        font-weight: 600;
    }

    .lede {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* ========== HERO SECTION ========== */
    .hero {
        gap: 16px;
        padding: 16px;
    }
    
    .stat-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .card {
        padding: 14px;
    }

    .card h3 {
        font-size: 0.95rem;
    }

    /* ========== CONTROLS ========== */
    .controls {
        gap: 12px;
        margin-bottom: 14px;
    }
    
    .controls input,
    .controls button {
        font-size: 16px;
        padding: 12px 12px;
        min-height: 48px;
    }

    /* ========== CHARTS ========== */
    canvas {
        height: 260px !important;
        max-height: 260px;
    }

    .chart-card {
        padding: 14px;
        margin-bottom: 16px;
    }

    .chart-card h3 {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .charts {
        gap: 14px;
        margin-bottom: 16px;
    }

    /* ========== TABS ========== */
    .main-tab-nav {
        flex-direction: column;
        gap: 6px;
        padding: 6px;
        margin-bottom: 16px;
    }
    
    .main-tab-btn {
        padding: 14px 14px;
        font-size: 13px;
        min-height: 48px;
    }
    
    .sub-tab-nav {
        grid-template-columns: 1fr;
        gap: 6px;
        margin-bottom: 14px;
    }
    
    .sub-tab-btn {
        text-align: center;
        padding: 10px 12px;
        font-size: 12px;
        min-height: 44px;
    }

    /* ========== SECTION HEADERS ========== */
    .section-header button,
    .table-header button {
        font-size: 12px;
        padding: 11px 12px;
        min-height: 44px;
    }

    /* ========== REVENUE CONTROLS ========== */
    .revenue-controls select {
        min-height: 48px;
        padding: 12px 12px;
    }

    /* ========== TABLES ========== */
    .table-section {
        padding: 14px;
        margin-bottom: 16px;
    }

    table {
        font-size: 0.75rem;
    }
    
    th {
        padding: 8px 6px;
        font-size: 0.75rem;
    }
    
    td {
        padding: 7px 6px;
        font-size: 0.75rem;
    }

    /* ========== FOOTER ========== */
    footer {
        padding: 16px 10px;
        font-size: 0.75rem;
    }

    footer p {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }

    /* ========== BUTTONS ========== */
    .report-download-btn {
        padding: 11px 12px;
        font-size: 12px;
        min-height: 44px;
    }

    /* ========== SOCIAL LINKS ========== */
    .top-actions .social-links {
        gap: 10px;
        width: 100%;
    }

    .top-actions .social-links a {
        font-size: 16px;
        padding: 6px;
    }

    .top-actions .link {
        font-size: 12px;
        padding: 8px 12px;
        min-height: 44px;
    }

    /* ========== CHIPS ========== */
    .chip {
        font-size: 10px;
        padding: 5px 10px;
    }
}

/* =============================================
   EDUCATIONAL ATTAINMENT SECTION
   ============================================= */

.edu-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: end;
    margin: 20px 0 24px;
}

.edu-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.edu-control-group label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.edu-control-group select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
}

.edu-control-group select:focus-visible {
    outline: 2px solid var(--cpi);
    outline-offset: 1px;
}

.edu-view-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 720px;
    margin: 18px auto 8px;
    padding: 6px;
    border: 1px solid #d8e0ea;
    border-radius: 14px;
    background: #f5f7fa;
}

.edu-view-btn {
    min-height: 48px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #334155;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.edu-view-btn span {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
}

.edu-view-btn.active,
.edu-view-btn[aria-pressed="true"] {
    border-color: #a34c0f;
    background: #a34c0f;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(163, 76, 15, 0.2);
}

.edu-view-btn.active span,
.edu-view-btn[aria-pressed="true"] span {
    color: #ffffff;
}

.edu-view-btn:focus-visible {
    outline: 3px solid #f3b56c;
    outline-offset: 2px;
}

.edu-view-note {
    margin: 0 auto 16px;
    max-width: 820px;
    color: #526074;
    font-size: 0.9rem;
    text-align: center;
}

.edu-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.edu-chart-wrap {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 16px 10px;
}

.edu-chart-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.edu-chart-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.edu-chart-container {
    position: relative;
    height: 380px;
}

.edu-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 4px 0 16px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.edu-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}

.edu-legend-swatch {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 3px;
    flex-shrink: 0;
}

.edu-note {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .edu-charts-grid {
        grid-template-columns: 1fr;
    }

    .edu-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .edu-view-switch {
        grid-template-columns: 1fr;
    }

    .edu-chart-container {
        height: 300px;
    }
}

/* =============================================
   DECISION GUIDE AND DATA-GENERATED BRIEFS
   ============================================= */

.decision-question-guide {
    margin: 0 0 24px;
    padding: 24px;
    border: 1px solid rgba(0, 47, 108, 0.14);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(203, 96, 21, 0.13), transparent 34%),
        linear-gradient(135deg, #fffaf5 0%, #ffffff 58%, #f4f7fb 100%);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.decision-question-heading {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
    gap: 28px;
    align-items: end;
    margin-bottom: 20px;
}

.decision-question-heading h2 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    line-height: 1.15;
}

.decision-question-heading > p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.decision-question-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.decision-question-card {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 8px;
    min-height: 150px;
    padding: 18px;
    border: 1px solid #d9e1eb;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    text-align: left;
    box-shadow: none;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.decision-question-card:hover {
    transform: translateY(-3px);
    border-color: var(--gdp);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.decision-question-card:focus-visible {
    outline: 3px solid #005ea8;
    outline-offset: 3px;
}

.decision-question-card strong {
    color: #102a56;
    font-size: 0.98rem;
    line-height: 1.35;
}

.decision-question-card > span:last-child {
    color: #5b677a;
    font-size: 0.82rem;
    line-height: 1.5;
}

.decision-question-number {
    width: fit-content;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--gdp);
    color: var(--gdp);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.decision-question-card-about {
    border-color: #9a430d;
    background: linear-gradient(135deg, #d86a1e 0%, #a6470d 58%, #7f3508 100%);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(127, 53, 8, 0.22);
}

.decision-question-card-about strong,
.decision-question-card-about > span:last-child,
.decision-question-card-about .decision-question-number {
    color: #ffffff;
}

.decision-question-card-about .decision-question-number {
    border-bottom-color: rgba(255, 255, 255, 0.9);
}

.decision-question-card-about:hover {
    border-color: #713006;
    box-shadow: 0 16px 30px rgba(127, 53, 8, 0.3);
}

.decision-question-card-about:focus-visible {
    outline-color: #002f6c;
}

.decision-brief:empty {
    display: none;
}

.decision-brief {
    position: relative;
    margin-top: 20px;
    padding: 20px 22px;
    overflow: hidden;
    border: 1px solid #d8e0ea;
    border-left: 5px solid var(--gdp);
    border-radius: 14px;
    background:
        linear-gradient(90deg, rgba(203, 96, 21, 0.055), transparent 35%),
        #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    animation: decisionBriefReveal 280ms ease-out both;
}

.decision-brief::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 5px;
    background: var(--cpi);
    content: '';
}

.decision-brief-heading {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.decision-brief-kicker {
    margin: 0 0 4px;
    color: var(--gdp);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.decision-brief-heading h3 {
    margin: 0;
    color: #102a56;
    font-size: 1.08rem;
    line-height: 1.35;
}

.decision-brief-period {
    flex: 0 0 auto;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #d8e0ea;
    border-radius: 999px;
    background: #f6f8fb;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
}

.decision-brief-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.decision-brief-metrics > div {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #e1e7ef;
    border-radius: 10px;
    background: #f8fafc;
}

.decision-brief-metrics dt {
    margin-bottom: 4px;
    color: #667085;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.decision-brief-metrics dd {
    margin: 0;
    color: #172033;
    font-size: 0.98rem;
    font-weight: 750;
    line-height: 1.35;
}

.decision-brief-reading {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.decision-brief-reading p,
.decision-brief-caution {
    margin: 0;
    color: #465368;
    font-size: 0.86rem;
    line-height: 1.58;
}

.decision-brief-reading strong,
.decision-brief-caution strong {
    color: #1f2f49;
}

.decision-brief-caution {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
    color: #5f6b7d;
    font-size: 0.79rem;
}

@keyframes decisionBriefReveal {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .decision-question-heading {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .decision-question-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .decision-brief-reading {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .decision-question-guide {
        padding: 18px 14px;
        border-radius: 14px;
    }

    .decision-question-grid,
    .decision-brief-metrics {
        grid-template-columns: 1fr;
    }

    .decision-question-card {
        min-height: 0;
        padding: 15px;
    }

    .decision-brief {
        padding: 17px 15px;
    }

    .decision-brief-heading {
        flex-direction: column;
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .decision-question-card,
    .decision-brief {
        animation: none;
        transition: none;
    }
}

.dashboard-search-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.6fr);
    gap: clamp(18px, 4vw, 42px);
    align-items: start;
    margin-bottom: 24px;
    padding: clamp(20px, 4vw, 30px);
    border: 1px solid rgba(203, 96, 21, 0.24);
    border-left: 6px solid var(--gdp);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 8% 10%, rgba(203, 96, 21, 0.09), transparent 34%),
        rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.dashboard-search-heading h2 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.dashboard-search-heading > p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.dashboard-search-form {
    min-width: 0;
}

.dashboard-search-form > label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 800;
}

.dashboard-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.dashboard-search-row input {
    width: 100%;
    min-height: 50px;
    padding: 12px 15px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 1rem;
}

.dashboard-search-row input:focus-visible {
    outline: 3px solid rgba(0, 47, 108, 0.24);
    outline-offset: 2px;
    border-color: var(--cpi);
}

.dashboard-search-row button {
    min-height: 50px;
    padding: 11px 22px;
    border: 2px solid var(--cpi);
    border-radius: 10px;
    background: var(--cpi);
    color: #fff;
    font: inherit;
    font-weight: 800;
}

.dashboard-search-row button:hover {
    background: var(--cpi-dark);
    border-color: var(--cpi-dark);
}

.dashboard-search-row button:focus-visible,
.dashboard-search-result:focus-visible {
    outline: 3px solid var(--gdp);
    outline-offset: 3px;
}

.dashboard-search-hint,
.dashboard-search-status {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.dashboard-search-status {
    min-height: 1.25rem;
    color: var(--cpi);
    font-weight: 700;
}

.dashboard-search-results {
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.13);
}

.dashboard-search-result-list {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dashboard-search-result-list li + li {
    border-top: 1px solid var(--border);
}

.dashboard-search-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 12px;
    width: 100%;
    min-height: 64px;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: var(--text);
    text-align: left;
}

.dashboard-search-result:hover {
    background: #f5f8fc;
}

.dashboard-search-result-title {
    font-weight: 800;
}

.dashboard-search-result-category {
    align-self: start;
    color: var(--gdp-dark);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-search-result-description {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.dashboard-search-empty {
    margin: 0;
    padding: 15px;
    color: var(--muted);
    line-height: 1.5;
}

@media (max-width: 900px) {
    .dashboard-search-panel {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .dashboard-search-panel {
        padding: 18px 14px;
        border-left-width: 4px;
        border-radius: 14px;
    }

    .dashboard-search-row {
        grid-template-columns: 1fr;
    }

    .dashboard-search-row button {
        width: 100%;
    }

    .dashboard-search-result {
        grid-template-columns: 1fr;
    }

    .dashboard-search-result-category,
    .dashboard-search-result-description {
        grid-column: 1;
    }
}

/* Indicator colors make the secondary choices easier to distinguish. */
.sub-tab-btn {
    --indicator-color: #475569;
    --indicator-tint: #f1f5f9;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.sub-tab-btn::before {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--indicator-color);
    content: '';
}

.sub-tab-btn:hover {
    border-color: var(--indicator-color);
    background: var(--indicator-tint);
    color: #172033;
}

.sub-tab-btn:focus-visible {
    outline-color: var(--indicator-color);
}

.sub-tab-btn.active {
    border-color: var(--indicator-color);
    background: var(--indicator-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.sub-tab-btn.active::before {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.sub-tab-btn[data-tab="gdp"] {
    --indicator-color: #b45309;
    --indicator-tint: #fff7ed;
}

.sub-tab-btn[data-tab="cpi"] {
    --indicator-color: #1d4ed8;
    --indicator-tint: #eff6ff;
}

.sub-tab-btn[data-tab="unemployment"] {
    --indicator-color: #0f766e;
    --indicator-tint: #f0fdfa;
}

.sub-tab-btn[data-tab="nonfarm-employment"] {
    --indicator-color: #8a5a00;
    --indicator-tint: #fffbeb;
}

.sub-tab-btn[data-tab="employment"] {
    --indicator-color: #166534;
    --indicator-tint: #f0fdf4;
}

.sub-tab-btn[data-tab="median-home-price"] {
    --indicator-color: #9f1239;
    --indicator-tint: #fff1f2;
}

.sub-tab-btn[data-tab="mortgage-rates"] {
    --indicator-color: #075985;
    --indicator-tint: #f0f9ff;
}

.sub-tab-btn[data-tab="sales-tax"] {
    --indicator-color: #c2410c;
    --indicator-tint: #fff7ed;
}

.sub-tab-btn[data-tab="tax-revenue"] {
    --indicator-color: #1e3a8a;
    --indicator-tint: #eff6ff;
}

.sub-tab-btn[data-tab="tx-compare"] {
    --indicator-color: #9a3412;
    --indicator-tint: #fff7ed;
}

.sub-tab-btn[data-tab="regional-employment"] {
    --indicator-color: #0f766e;
    --indicator-tint: #f0fdfa;
}

.sub-tab-btn[data-tab="regional-demographics"] {
    --indicator-color: #1d4ed8;
    --indicator-tint: #eff6ff;
}

.sub-tab-btn[data-tab="edu-attainment"] {
    --indicator-color: #3f6212;
    --indicator-tint: #f7fee7;
}

.sub-tab-btn[data-tab="about-overview"],
.sub-tab-btn[data-tab="methodology"],
.sub-tab-btn[data-tab="contributors"] {
    --indicator-color: #9a430d;
    --indicator-tint: #fff7ed;
}

/* Keep the institutional mark distinct while giving the product name clear hierarchy. */
.brand-copy {
    min-width: 0;
    padding: 4px 0 5px 18px;
    border-left: 4px solid var(--gdp);
}

.brand h1 {
    max-width: 560px;
    color: #172554;
    font-size: clamp(2rem, 3.4vw, 3.25rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.brand-subtitle {
    max-width: 520px;
    margin-top: 8px;
    color: #525d70;
    font-size: clamp(0.82rem, 1.2vw, 1rem);
    font-weight: 600;
    line-height: 1.35;
}

/* Keep publication navigation distinct from website and social icons. */
.top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}

.publication-links {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 4px;
    border: 1px solid #d8dee8;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.06);
}

.publication-links a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 9px 13px;
    border-radius: 8px;
    color: #243556;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.publication-links a:hover {
    background: #f4e5d7;
    color: #8f3f0b;
}

.publication-links a:focus-visible {
    outline: 3px solid var(--cpi);
    outline-offset: 2px;
}

.top-actions .social-links {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding-left: 8px;
    border-left: 1px solid #d8dee8;
}

.top-actions .social-links a {
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.7);
}

.top-actions .social-links a:hover {
    border-color: #d6dee9;
    background: #ffffff;
    color: #9a430d;
}

@media (max-width: 1100px) {
    .topbar {
        flex-wrap: wrap;
    }

    .top-actions {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .top-actions {
        justify-content: flex-start;
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .publication-links {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }

    .publication-links a {
        width: 100%;
        padding-inline: 6px;
        font-size: 0.8rem;
    }

    .top-actions .social-links {
        width: auto;
        padding-left: 0;
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .brand-copy {
        padding-left: 12px;
        border-left-width: 3px;
    }

    .brand h1 {
        font-size: clamp(1.45rem, 5.2vw, 2.1rem);
        line-height: 1.08;
    }

    .brand-subtitle {
        margin-top: 5px;
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .brand h1 {
        font-size: 1.35rem;
    }

    /* Prevent iOS focus zoom and keep primary controls comfortable on touch screens. */
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        min-height: 48px !important;
        font-size: 16px !important;
    }

    .checkbox-label,
    .tx-category-btn,
    .section-header button,
    .table-header button {
        min-height: 48px !important;
    }
}

@media (max-width: 900px) {
    #regionalEmploymentWagesChart {
        height: 1240px !important;
        max-height: 1300px;
    }

    #regionalEmploymentIndustryChart {
        height: 680px !important;
        max-height: 720px;
    }
}

/* Phone-specific plotting space; desktop chart dimensions remain unchanged. */
@media (max-width: 480px) {
    #employmentChart {
        height: 390px !important;
        max-height: 390px;
    }

    .chart-scroll-surface,
    #salesTaxChart {
        height: 360px !important;
        max-height: 360px;
    }

    #taxChart {
        height: 460px !important;
        max-height: 460px;
    }

    .demo-race-card .demo-chart-frame,
    #regionalDemoRaceChart {
        height: 440px !important;
        min-height: 440px;
        max-height: 440px;
    }
}
