@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,600;0,9..144,700;0,9..144,800;1,9..144,400&family=Commissioner:wght@400;500;600;700&display=swap');

/* ================================================================
   RESET & VARIABLES
   ================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0f1419;
    --bg-dark: #0a0d10;
    --surface: #1a1f26;
    --surface-hover: #22282f;
    --surface-elevated: #252b33;
    --border: #2d343d;
    --border-light: #363d47;
    --text: #e7e9ea;
    --text-secondary: #a8b3c0;
    --text-muted: #6e7a8a;
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-bg: rgba(59, 130, 246, 0.15);
    --accent: #f59e0b;
    --accent-bg: rgba(245, 158, 11, 0.12);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --map-bg: #000000;
    --radius: 0;
    --radius-sm: 0;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
    --transition: 0.15s ease;
    --transition-fast: 0.1s ease;
    --transition-slow: 0.3s ease;
    --z-base: 1;
    --z-dropdown: 100;
    --z-header: 200;
    --z-overlay: 500;
    --z-modal: 1000;
    --z-tooltip: 1000;
    --z-skip-link: 10000;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;
    --space-4xl: 48px;
    --text-xs: 10px;
    --text-sm: 11px;
    --text-base: 12px;
    --text-md: 13px;
    --text-lg: 14px;
    --text-xl: 15px;
    --text-2xl: 16px;
    --text-3xl: 18px;
    --text-4xl: 22px;
    --max-width: 1200px;
    --header-height: 56px;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Commissioner', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: var(--text-lg);
    line-height: 1.6;
    min-height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    z-index: var(--z-skip-link);
    text-decoration: none;
    font-weight: 500;
}
.skip-link:focus { top: 0; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

mark {
    background: var(--accent-bg);
    color: var(--accent);
    padding: 0 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); }

/* ================================================================
   SITE HEADER
   ================================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    height: 100%;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; }
.logo-icon { color: var(--accent); }
.logo-text {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: var(--text-3xl);
    letter-spacing: -0.5px;
}

/* Header search */
.header-search-wrapper {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.header-search .search-input {
    width: 100%;
    padding: 8px 12px 8px 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: var(--text-md);
}
.header-search .search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface-elevated);
}
.header-search .search-input::placeholder { color: var(--text-muted); }

/* Header nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: color var(--transition);
}
.nav-link:hover {
    color: var(--text);
    text-decoration: none;
}
.nav-link.active {
    color: var(--accent);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
}

/* Mobile nav drawer */
.mobile-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    padding: var(--space-lg);
    z-index: var(--z-header);
}
.mobile-nav.open { display: block; }

.mobile-nav-search {
    position: relative;
    margin-bottom: var(--space-lg);
}
.mobile-nav-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.mobile-nav-search .search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: var(--text-lg);
}
.mobile-nav-search .search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.mobile-nav-link {
    display: block;
    padding: 12px 0;
    color: var(--text);
    font-size: var(--text-2xl);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    width: 100%;
}
.mobile-nav-link:hover { color: var(--accent); text-decoration: none; }

/* ================================================================
   SEARCH DROPDOWN
   ================================================================ */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    max-height: 400px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
    display: none;
    box-shadow: var(--shadow-lg);
}
.search-dropdown.visible { display: block; }

.search-result {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.search-result:hover,
.search-result.selected {
    background: var(--surface-hover);
}

.search-result-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    display: flex;
}

.search-result-text {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    display: block;
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-subtitle {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.search-result-type {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-md);
}

/* ================================================================
   PAGE CONTAINER
   ================================================================ */
.page-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl);
    min-height: calc(100vh - var(--header-height));
}

.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-4xl) 0;
    color: var(--text-muted);
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-error {
    text-align: center;
    padding: var(--space-4xl) 0;
}
.page-error h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-4xl);
    margin-bottom: var(--space-md);
}
.page-error p {
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

.loading-shimmer {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--border-light); }

/* ================================================================
   HOME PAGE
   ================================================================ */
.home-page { max-width: 960px; margin: 0 auto; }

.home-hero {
    text-align: center;
    padding: var(--space-4xl) 0 var(--space-3xl);
}

.home-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--text);
}
.home-title em {
    color: var(--accent);
    font-style: italic;
}

.home-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-2xl);
    margin-bottom: var(--space-2xl);
}

.home-search-wrapper {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.home-search {
    position: relative;
}
.home-search .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.home-search .search-input-lg {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: var(--text-2xl);
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text);
    font-family: inherit;
    transition: border-color var(--transition);
}
.home-search .search-input-lg:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}
.home-search .search-input-lg::placeholder { color: var(--text-muted); }

/* Home sections */
.home-section {
    margin-bottom: var(--space-4xl);
}
.home-section-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border);
}

/* Quick cards */
.quick-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.quick-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: var(--space-lg);
}

.quick-card-title {
    font-family: 'Commissioner', sans-serif;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: var(--space-md);
}

.quick-card-list {
    list-style: none;
}
.quick-card-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: var(--text-md);
}
.quick-card-list li:hover { background: var(--surface-hover); padding-left: 4px; }
.quick-card-list li:last-child { border-bottom: none; }
.qc-name { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.qc-value { color: var(--accent); font-family: 'Fraunces', serif; font-weight: 600; font-size: var(--text-lg); white-space: nowrap; }

/* Sector grid */
.sector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-sm);
}

.sector-tile {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: border-color var(--transition);
    font-size: var(--text-md);
}
.sector-tile:hover {
    border-color: var(--accent);
    text-decoration: none;
}
.sector-code {
    color: var(--text-muted);
    font-family: 'Fraunces', serif;
    font-size: var(--text-xs);
    font-weight: 600;
}
.sector-name { font-size: var(--text-sm); }

/* State list */
.state-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.state-link {
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    transition: border-color var(--transition);
}
.state-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

/* Home footer */
.home-footer {
    text-align: center;
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--text-sm);
}
.home-footer a { color: var(--text-secondary); }
.home-footer a:hover { color: var(--accent); }
.link-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font: inherit;
    cursor: pointer;
}
.link-btn:hover { color: var(--accent); text-decoration: underline; }

/* ================================================================
   OCCUPATION PAGE
   ================================================================ */
.occ-page { max-width: 960px; margin: 0 auto; }

.occ-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-2xl);
    margin-bottom: var(--space-3xl);
    flex-wrap: wrap;
}

.occ-header-text { flex: 1; min-width: 200px; }

.occ-soc-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-family: monospace;
    margin-bottom: var(--space-sm);
}

.occ-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-xs);
}

.occ-group {
    color: var(--text-muted);
    font-size: var(--text-md);
}

.occ-key-stats {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.key-stat {
    text-align: center;
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    min-width: 120px;
}
.key-stat-value {
    display: block;
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}
.key-stat-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--space-xs);
}

/* Sections */
.occ-section {
    margin-bottom: var(--space-3xl);
}
.occ-section-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border);
}

/* Wage distribution bars */
.wage-bars { max-width: 600px; }
.wage-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 8px 0;
}
.wage-bar-median { font-weight: 600; }
.wage-bar-median .wage-bar-fill { background: var(--accent) !important; }
.wage-bar-label {
    width: 60px;
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}
.wage-bar-track {
    flex: 1;
    height: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
}
.wage-bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s ease;
}
.wage-bar-value {
    width: 80px;
    font-family: 'Fraunces', serif;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
}

/* Occupation map */
.occ-map-container {
    border: 1px solid var(--border);
    background: var(--map-bg);
}
.occ-map {
    width: 100%;
    height: 400px;
    background: var(--map-bg);
}

/* Map tooltip override */
.map-tip {
    background: var(--surface-elevated) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 6px 10px !important;
    font-family: 'Commissioner', sans-serif !important;
    font-size: var(--text-sm) !important;
    box-shadow: var(--shadow) !important;
}
.map-tip strong { color: var(--accent); }
.leaflet-tooltip-left.map-tip::before { border-left-color: var(--border) !important; }
.leaflet-tooltip-right.map-tip::before { border-right-color: var(--border) !important; }

/* Data tables */
.occ-table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-md);
}
.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
}
.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.data-table tbody tr:hover { background: var(--surface-hover); }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--surface-hover); }
.value-cell {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}
.value-cell.higher { color: var(--success); }
.value-cell.lower { color: var(--danger); }

/* Related occupations */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-sm);
}
.related-card {
    display: block;
    padding: var(--space-md) var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: border-color var(--transition);
}
.related-card:hover {
    border-color: var(--accent);
    text-decoration: none;
}
.related-title {
    display: block;
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}
.related-meta {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ================================================================
   AREA PROFILE PAGE
   ================================================================ */
.area-page { max-width: 960px; margin: 0 auto; }

.area-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-2xl);
    margin-bottom: var(--space-3xl);
    flex-wrap: wrap;
}
.area-header-text { flex: 1; }
.area-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-bg);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
}
.area-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

/* Economic overview grid */
.econ-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
}
.econ-stat {
    padding: var(--space-md) var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    text-align: center;
}
.econ-stat-value {
    display: block;
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}
.econ-stat-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--space-xs);
}

/* Filter input */
.area-search-filter { margin-bottom: var(--space-lg); }
.filter-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: var(--text-md);
}
.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}
.filter-input::placeholder { color: var(--text-muted); }

/* ================================================================
   MAP EXPLORER PAGE
   ================================================================ */
.map-page {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.map-controls-bar {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-lg) 0;
    flex-wrap: wrap;
    align-items: flex-end;
}

.map-control-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.map-control-label {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.select-input {
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: var(--text-md);
    cursor: pointer;
}
.select-input:focus { outline: none; border-color: var(--primary); }
.select-compact { max-width: 260px; }

.map-occ-search {
    position: relative;
    min-width: 300px;
}

.map-main-wrapper {
    position: relative;
    border: 1px solid var(--border);
    background: var(--map-bg);
}

.explorer-map {
    width: 100%;
    height: 65vh;
    min-height: 400px;
    background: var(--map-bg);
}

.map-legend-panel {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(15, 20, 25, 0.92);
    border: 1px solid var(--border);
    padding: var(--space-md);
    z-index: 10;
    min-width: 160px;
}
.legend-title {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}
.legend-scale {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.legend-step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.legend-swatch {
    width: 20px;
    height: 14px;
    flex-shrink: 0;
}
.legend-val {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-family: 'Fraunces', serif;
}

.map-info-bar {
    padding: var(--space-md);
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: var(--text-md);
}

.btn-small {
    padding: 6px 10px;
    font-size: var(--text-xs);
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: inherit;
}
.btn-small:hover { border-color: var(--accent); color: var(--accent); }
.btn-muted { color: var(--text-muted); }

/* ================================================================
   COMPARE PAGE
   ================================================================ */
.compare-page { max-width: 800px; margin: 0 auto; }

.page-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--space-2xl);
}

.compare-mode-toggle {
    display: flex;
    gap: 0;
    margin-bottom: var(--space-2xl);
    border: 1px solid var(--border);
    width: fit-content;
}

.toggle-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.toggle-btn.active {
    background: var(--accent-bg);
    color: var(--accent);
}
.toggle-btn:hover:not(.active) { background: var(--surface-hover); }

.compare-panel { margin-bottom: var(--space-2xl); }

.compare-inputs {
    display: flex;
    align-items: flex-end;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.compare-input-group {
    flex: 1;
    min-width: 200px;
}
.compare-input-group label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.compare-search {
    position: relative;
    margin-bottom: var(--space-xs);
}

.compare-selected {
    font-size: var(--text-sm);
    color: var(--accent);
}

.vs-badge {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 var(--space-sm);
    flex-shrink: 0;
    align-self: center;
}

.compare-results { margin-top: var(--space-lg); }

.compare-table th:first-child,
.compare-table td:first-child { text-align: left; }

/* ================================================================
   MODALS
   ================================================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
}
.modal.active { display: flex; }

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-dark);
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
}
.modal-header h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: var(--text-3xl);
    color: var(--text);
}
.modal-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body { padding: 20px; }

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.source-card {
    padding: var(--space-lg);
    background: var(--bg);
    border: 1px solid var(--border);
}
.source-card h4 {
    font-family: 'Commissioner', sans-serif;
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-xs);
}
.source-card p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}
.source-card a { color: var(--primary); font-size: var(--text-sm); }

.source-note {
    grid-column: 1 / -1;
    border-left: 4px solid var(--accent);
    background: var(--accent-bg);
    padding: var(--space-lg);
}
.source-note h4 {
    font-size: var(--text-md);
    margin-bottom: var(--space-xs);
}
.source-note p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.source-disclaimer {
    grid-column: 1 / -1;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* ================================================================
   CUSTOM TOOLTIP (for legacy, if needed)
   ================================================================ */
.custom-tooltip {
    display: none;
    position: fixed;
    z-index: var(--z-tooltip);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: var(--space-md);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    font-size: var(--text-md);
    max-width: 300px;
}

/* ================================================================
   HINT & UTILITY
   ================================================================ */
.hint-text { color: var(--text-muted); font-size: var(--text-md); }

.btn-back {
    display: inline-block;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-md);
    cursor: pointer;
}
.btn-back:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .header-search-wrapper { display: none; }
    .header-nav { display: none; }
    .mobile-menu-btn { display: block; }

    .header-inner { padding: 0 var(--space-lg); }

    .page-container { padding: var(--space-lg); }

    .home-title { font-size: 24px; }
    .home-subtitle { font-size: var(--text-lg); }
    .home-hero { padding: var(--space-2xl) 0 var(--space-xl); }

    .quick-cards { grid-template-columns: 1fr; }

    .sector-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

    .occ-header,
    .area-header { flex-direction: column; }

    .occ-key-stats { width: 100%; justify-content: flex-start; }
    .key-stat { flex: 1; min-width: 100px; }
    .key-stat-value { font-size: var(--text-3xl); }

    .occ-title,
    .area-title,
    .page-title { font-size: 22px; }

    .occ-map { height: 300px; }

    .compare-inputs { flex-direction: column; gap: var(--space-md); }
    .compare-input-group { min-width: 100%; }

    .map-controls-bar { flex-direction: column; }
    .map-occ-search { min-width: 100%; }
    .explorer-map { height: 50vh; min-height: 300px; }

    .econ-grid { grid-template-columns: repeat(2, 1fr); }

    .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .occ-key-stats { flex-wrap: wrap; }
    .key-stat { min-width: 45%; flex: unset; }

    .econ-grid { grid-template-columns: 1fr 1fr; }
    .econ-stat-value { font-size: var(--text-2xl); }

    .sources-grid { grid-template-columns: 1fr; }
}

@media print {
    .site-header,
    .mobile-nav,
    .search-dropdown { display: none !important; }

    body { background: white; color: black; }
    .page-container { max-width: 100%; padding: 0; }
}
