@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-serif-display.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/fonts/dm-sans-variable.woff2') format('woff2-variations'),
       url('/fonts/dm-sans-variable.woff2') format('woff2');
}

:root {
    --bg-main: #f0f4f8;
    --bg-card: #ffffff;
    --bg-subtle: #f8fafc;
    --text-main: #0d1b2e;
    --text-muted: #4a6380;
    --text-sub: #7a92a8;
    --primary: #0369a1;
    --primary-light: #e0f2fe;
    --primary-mid: #bae6fd;
    --navy: #0c2d55;
    --accent-green: #0f7a3e;
    --accent-red: #c0192a;
    --accent-amber: #b45309;
    --border: #cdd8e3;
    --border-light: #e8eef4;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius-lg: 14px;
    --radius-md: 9px;
    --radius-sm: 5px;
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-stack: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --header-bg: #ffffff;
    --header-border: var(--border);
    --logo-color: var(--navy);
    --nav-link: var(--text-muted);
}

[data-theme="dark"] {
    --bg-main: #0b1622;
    --bg-card: #142132;
    --bg-subtle: #101d2c;
    --text-main: #e8f1f9;
    --text-muted: #7fa8c8;
    --text-sub: #4d7592;
    --primary: #38bdf8;
    --primary-light: #0c2d45;
    --primary-mid: #164766;
    --navy: #90c8f0;
    --accent-green: #34d17a;
    --accent-red: #f87171;
    --accent-amber: #fbbf24;
    --border: #1e3652;
    --border-light: #162b42;
    --header-bg: #0e1d2f;
    --header-border: #1a2e44;
    --logo-color: #90c8f0;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    background-color: var(--bg-main); 
    color: var(--text-main); 
    font-family: var(--font-stack); 
    font-size: 16px; 
    line-height: 1.65; 
    overflow-wrap: break-word; 
    -webkit-font-smoothing: antialiased; 
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header { 
    background: var(--header-bg); 
    border-bottom: 1px solid var(--header-border); 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    width: 100%;
    box-shadow: var(--shadow-sm); 
    transition: background 0.25s ease, border-color 0.25s ease;
}

.header-inner { 
    max-width: 1240px; 
    margin: 0 auto; 
    padding: 0 20px; 
    height: 62px; 
    display: flex; 
    align-items: center; 
    gap: 20px; 
}

.logo { 
    display: flex; 
    align-items: baseline; 
    gap: 10px;
    flex-shrink: 0;
}

.logo a { 
    font-family: var(--font-display); 
    font-size: 1.35rem; 
    color: var(--logo-color); 
    text-decoration: none; 
}

.logo-sub { 
    font-size: 0.72rem; 
    font-weight: 600; 
    color: var(--text-sub); 
    text-transform: uppercase; 
    letter-spacing: 0.06em; 
    display: none; 
}

@media (min-width: 640px) {
    .logo-sub { display: inline; }
}

.nav-links { 
    margin-left: auto; 
    display: flex; 
    align-items: center;
    gap: 4px; 
}

.nav-links a { 
    color: var(--nav-link); 
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: 600; 
    padding: 6px 12px; 
    border-radius: var(--radius-sm); 
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover { 
    color: var(--primary); 
    background: var(--primary-light); 
}

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

.theme-toggle-btn {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle .bar {
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.2s ease;
    display: block;
}

@media (max-width: 768px) {
    .header-inner {
        justify-content: space-between;
        padding: 0 16px;
    }
    .header-actions { margin-left: auto; }
    .menu-toggle { display: flex; }
    .logo { min-width: 0; flex: 1 1 auto; }
    .logo a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 62px;
        left: 0;
        right: 0;
        background: var(--header-bg);
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px;
        gap: 2px;
        box-shadow: var(--shadow-md);
    }
    .nav-links.active { display: flex; }
    .nav-links a { width: 100%; padding: 12px 16px; font-size: 1.05rem; }
}

/* ==========================================================================
   LAYOUT & CARDS
   ========================================================================== */
#contentout { display: grid; grid-template-columns: 1fr; gap: 24px; max-width: 1240px; margin: 0 auto; padding: 24px 16px; }
@media (min-width: 992px) { #contentout { grid-template-columns: 2.6fr 1fr; padding: 32px 24px; } }
main#content { width: 100%; min-width: 0; }
aside#right { position: sticky; top: 86px; align-self: start; }

.block-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; margin-bottom: 20px; box-shadow: var(--shadow-sm); overflow: hidden; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.block-card:hover { box-shadow: var(--shadow-md); }

.category-eyebrow { color: var(--primary); font-weight: 800; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.10em; display: block; margin-bottom: 6px; }
.profile-main-title { font-family: var(--font-display); font-size: 3.2rem; color: var(--navy); line-height: 1.1; margin-bottom: 12px; word-break: break-word; }
.profile-subtitle { color: var(--text-muted); font-size: 1rem; margin-top: 6px; max-width: 600px; }
.card-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; color: var(--navy); margin-bottom: 18px; }
.highlight-summary-banner { background: var(--primary-light); border-left: 4px solid var(--primary); padding: 16px 20px; border-radius: var(--radius-md); font-size: 1rem; line-height: 1.7; color: var(--text-main); font-weight: 500; margin-top: 16px; }

/* ==========================================================================
   GRIDS & TABLES
   ========================================================================== */
.hero-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 24px; }
.stat-box-hero { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 16px; text-align: center; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; display: block; margin-bottom: 5px; line-height: 1.2;}
.stat-hero-value { font-family: var(--font-display); font-size: 2.4rem; color: var(--navy); display: block; margin: 6px 0 4px; line-height: 1;}

.table-scroll { overflow-x: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); scrollbar-width: thin; scrollbar-color: var(--border) transparent;}
.seo-data-table-wrapper { overflow-x: auto; max-height: 360px; overflow-y: auto; }
.seo-data-table { width: 100%; min-width: 400px; border-collapse: collapse; text-align: left; font-size: 0.9rem; background: var(--bg-card); }
.seo-data-table th, .seo-data-table td { padding: 11px 15px; border-bottom: 1px solid var(--border-light); }
.seo-data-table th { background: var(--primary-light); color: var(--navy); font-weight: 800; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; position: sticky; top: 0; z-index: 10; }
.seo-data-table tbody tr:hover { background: var(--bg-subtle); }
.seo-data-table tr:last-child td { border-bottom: none; }

/* ==========================================================================
   SIDEBAR & TOOLS
   ========================================================================== */
.sidebar-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
#octitle { font-family: var(--font-display); font-size: 1.1rem; color: var(--navy); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.sidebar-links a { display: flex; gap: 6px; color: var(--primary); text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 6px 10px; border-radius: var(--radius-sm); transition: background 0.15s ease, color 0.15s ease; }
.sidebar-links a:hover { background: var(--primary-light); color: var(--navy); }

.tool-container-accent { background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 100%); border: 1px solid var(--primary-mid); }
.tool-input-field { width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 1rem; background: var(--bg-card); color: var(--text-main); margin-top: 8px; outline: none; transition: border-color 0.15s ease; font-family: var(--font-stack);}
.tool-input-field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(3,105,161,0.12); }
.tool-dynamic-feedback { margin-top: 12px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 0.95rem; line-height: 1.6; border-left-width: 4px; }
.sibling-columns-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.sibling-column-box { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.sibling-box-header { display: block; font-size: 0.72rem; font-weight: 800; color: var(--navy); text-transform: uppercase; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; letter-spacing: 0.06em; }
.sibling-navigation-stack { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 576px) {
    .block-card { padding: 18px 16px; }
    .profile-main-title { font-size: 2.1rem; }
    .stat-box-hero .stat-hero-value { font-size: 1.9rem; }
    .hero-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   SHARED PROFILE & DIRECTORY COMPONENTS (Centralized)
   ========================================================================== */

.ci-chip { display:inline-flex; align-items:center; gap:6px; background:var(--bg-subtle); border:1px solid var(--border); border-radius:999px; padding:6px 14px; margin:0 8px 8px 0; font-size:0.85rem; font-weight:700; color:var(--text-main); text-decoration:none; transition:border-color .15s ease, background .15s ease; }
.ci-chip:hover { border-color:var(--primary); background:var(--primary-light); }
.ci-chip-val { color:var(--primary); font-weight:800; }

.hero-stats-grid-4 { display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; margin-top:20px; }
.stat-box-hero-clean { background:var(--bg-card); border:1px solid var(--border-light); border-radius:var(--radius-md); padding:16px; display:flex; flex-direction:column; justify-content:space-between; }
.stat-hero-num { font-family:var(--font-display); font-size:1.65rem; font-weight:800; line-height:1.1; margin:8px 0 6px; }

.growth-badge-row { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-top:4px; }
.growth-pill { display:inline-flex; align-items:center; gap:3px; font-size:0.72rem; font-weight:800; padding:2px 7px; border-radius:4px; }
.growth-pill.positive { background:rgba(16, 185, 129, 0.1); color:var(--accent-green); }
.growth-pill.negative { background:rgba(239, 68, 68, 0.1); color:var(--accent-red); }
.growth-pill-sub { font-size:0.65rem; font-weight:700; color:var(--text-muted); }

.tool-field-label { display:block; font-size:0.72rem; font-weight:800; text-transform:uppercase; letter-spacing:0.04em; color:var(--navy); margin-bottom:8px; }
.tool-ctrl-input { width:100%; height:44px; padding:0 14px; box-sizing:border-box; border:1.5px solid var(--border); border-radius:var(--radius-md); font-size:0.92rem; font-family:var(--font-stack); background:var(--bg-card); color:var(--text-main); transition:all .15s ease; }
.tool-ctrl-input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(0,105,168,.08); }

.ci-role-picker, .loc-search-picker { position:relative; width:100%; }
.ci-role-picker::after, .loc-search-picker::after { content:"▾"; position:absolute; right:14px; top:50%; transform:translateY(-50%); color:var(--primary); pointer-events:none; font-size:1.3rem; font-weight:800; }
.ci-role-search, .loc-search-picker .tool-ctrl-input { padding-right:36px; cursor:pointer; }
.ci-role-group-label, .loc-group-header { position:sticky; top:0; z-index:1; background:var(--bg-subtle); padding:7px 14px; color:var(--text-sub); font-size:.66rem; font-weight:800; text-transform:uppercase; letter-spacing:.05em; border-bottom:1px solid var(--border-light); margin-top:4px; display:flex; justify-content:space-between; align-items:center;}
.ci-role-group-label small, .loc-menu-option small { color:var(--text-muted); white-space:nowrap; font-size:.7rem; font-weight:700; background:var(--bg-subtle); padding:3px 6px; border-radius:4px; border:1px solid var(--border-light); letter-spacing:0; text-transform:none; }
.ci-role-menu, .loc-menu-dropdown { position:absolute; z-index:100; left:0; right:0; top:calc(100% + 5px); max-height:380px; overflow-y:auto; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-md); box-shadow:0 10px 28px rgba(0,0,0,.12); padding:6px; }
.ci-role-menu[hidden], .loc-menu-dropdown[hidden] { display:none; }
.ci-role-option, .loc-menu-option { width:100%; border:0; background:transparent; color:var(--text-main); padding:9px 10px; display:flex; align-items:center; justify-content:space-between; gap:12px; text-align:left; cursor:pointer; border-radius:5px; font:inherit; border-bottom:1px solid var(--border-light); text-decoration:none; transition:background 0.1s ease; }
.ci-role-option:last-child, .loc-menu-option:last-child { border-bottom:none; }
.ci-role-option:hover, .ci-role-option:focus, .loc-menu-option:hover, .loc-menu-option:focus { background:var(--primary-light); color:var(--navy); outline:none; }
.ci-role-option span, .loc-menu-option-content span { min-width:0; white-space:normal; line-height:1.3; font-weight:600; font-size:.84rem; }
.loc-menu-option-content { display:flex; flex-direction:column; gap:2px; }

.ci-table-action-link { display:inline-flex; align-items:center; justify-content:center; padding:6px 12px; background:var(--bg-subtle); color:var(--primary); text-decoration:none; font-size:0.75rem; font-weight:800; border-radius:var(--radius-sm); border:1px solid var(--border); white-space:nowrap; transition:all .15s ease; }
.ci-table-action-link:hover { background:var(--primary); color:#fff; border-color:var(--primary); }

.occ-search-input, .role-table-search, .state-search { width:100%; max-width:360px; padding:10px 14px; border:1.5px solid var(--border); border-radius:var(--radius-md); font-size:0.9rem; font-family:var(--font-stack); background:var(--bg-card); color:var(--text-main); }
.occ-search-input:focus, .role-table-search:focus, .state-search:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(0,105,168,.08); }

.ci-toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; margin:0 0 14px; }
.ci-view-toggle { display:inline-flex; border:1px solid var(--border); border-radius:var(--radius-md); overflow:hidden; }
.ci-view-toggle button { border:none; background:var(--bg-card); color:var(--text-muted); font-size:0.82rem; font-weight:700; padding:8px 14px; cursor:pointer; }
.ci-view-toggle button.active { background:var(--primary); color:#fff; }
.ci-result-count { font-size:0.8rem; color:var(--text-sub); margin-bottom:10px; }

th[data-sort] { cursor:pointer; user-select:none; }
th[data-sort]:hover { color:var(--primary); }
th[data-sort] .sort-arrow { opacity:0.35; font-size:0.7rem; margin-left:3px; }
th[data-sort][data-asc] .sort-arrow { opacity:1; }

.salary-result { margin-top:16px; padding:15px 16px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--bg-subtle); }
.salary-result-main { font-size:1rem; color:var(--text-main); line-height:1.55; }
.salary-result-main strong { color:var(--navy); }

.occ-row td:first-child { cursor:pointer; }
.occ-row .occ-caret { display:inline-block; color:var(--text-sub); margin-right:8px; font-size:0.7rem; transition:transform .15s ease; }
.occ-row.is-open .occ-caret { transform:rotate(90deg); }
.occ-detail-row td { background:var(--bg-subtle); padding:18px 20px; border-top:1px solid var(--border-light); }
.occ-detail-title { font-size:0.84rem; color:var(--navy); margin-bottom:12px; display:block; font-weight:700; }
.occ-range-grid { display:grid; grid-template-columns:repeat(5, 1fr); gap:8px; }
.occ-range-item { text-align:center; padding:9px 5px; background:var(--bg-card); border:1px solid var(--border-light); border-radius:var(--radius-sm); }
.occ-range-item .label { display:block; font-size:0.66rem; text-transform:uppercase; letter-spacing:.04em; color:var(--text-sub); font-weight:700; }
.occ-range-item .value { display:block; margin-top:3px; font-size:0.82rem; font-weight:800; color:var(--text-main); }
.occ-range-item.median { border-color:var(--primary); background:var(--primary-light); }
.occ-range-item.median .value { color:var(--primary); }

.occ-pct-bar { position:relative; height:8px; background:linear-gradient(90deg,var(--border),var(--primary-light),var(--border)); border-radius:4px; margin-top:16px; margin-bottom:6px; }
.occ-pct-bar.h1b-track { background:linear-gradient(90deg,var(--border),#bae6fd,var(--primary)); }
.occ-pct-track { display:flex; justify-content:space-between; font-size:0.7rem; color:var(--text-sub); font-weight:700; }

.occ-group { border:1px solid var(--border); border-radius:var(--radius-md); margin-bottom:12px; overflow:hidden; }
.occ-group-header { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:13px 16px; background:var(--bg-subtle); cursor:pointer; font-weight:800; color:var(--navy); font-size:0.92rem; transition:background .15s ease; }
.occ-group-header:hover { background:var(--primary-light); }
.occ-group-header-main { display:flex; align-items:center; gap:9px; min-width:0; }
.occ-group-caret { color:var(--text-sub); font-size:0.7rem; transition:transform .15s ease; flex-shrink:0; }
.occ-group.is-open .occ-group-caret { transform:rotate(90deg); }
.occ-group-count { font-weight:600; color:var(--text-muted); font-size:0.8rem; white-space:nowrap; }
.occ-group-body { display:none; }
.occ-group.is-open .occ-group-body { display:block; }
.occ-group-table { width:100%; border-collapse:collapse; font-size:0.86rem; }
.occ-group-table th { text-align:left; padding:8px 16px; background:var(--bg-card); color:var(--text-sub); font-size:0.68rem; text-transform:uppercase; letter-spacing:0.05em; border-top:1px solid var(--border-light); }
.occ-group-table td { padding:10px 16px; border-top:1px solid var(--border-light); }
.occ-group-table td:nth-child(2), .occ-group-table td:nth-child(3), .occ-group-table td:nth-child(4),
.occ-group-table th:nth-child(2), .occ-group-table th:nth-child(3), .occ-group-table th:nth-child(4) { text-align:right; }
.occ-category-row { cursor:pointer; transition:background .1s ease; }
.occ-category-row:hover { background:var(--primary-light); }
.occ-category-detail-row td { background:var(--bg-subtle); padding:16px 20px; border-top:1px solid var(--border-light); }
.occ-group-more { padding:11px 16px; border-top:1px solid var(--border-light); background:var(--bg-subtle); display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:0.76rem; color:var(--text-sub); }
.occ-group-more strong { color:var(--navy); }
.occ-group-more button { border:0; background:none; padding:0; color:var(--primary); font:inherit; font-weight:800; cursor:pointer; }
.occ-group-more button:hover { text-decoration:underline; }
.occ-group-empty { padding:16px; color:var(--text-sub); font-size:0.85rem; }

.gauge-fill { transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
.bullet-track-contrast { position: relative; width: 100%; height: 10px; background: var(--border); border-radius: 5px; margin: 28px 0 8px 0; }
.bullet-tick-contrast { position: absolute; top: -20px; transform: translateX(-50%); font-size: 0.7rem; font-weight: 700; color: var(--navy); }
.bullet-tick-contrast::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 2px; height: 10px; background: var(--text-muted); }

.tax-sub-accordion { margin-top: 2px; margin-bottom: 8px; }
.tax-sub-accordion summary { font-size: 0.75rem; font-weight: 600; color: var(--primary); cursor: pointer; display: inline-flex; align-items: center; list-style: none; }
.tax-sub-accordion summary::-webkit-details-marker { display: none; }
.tax-sub-accordion summary::after { content: '+'; font-size: 1.2rem; margin-left: 6px; line-height: 1; }
.tax-sub-accordion[open] summary::after { content: '−'; }
.tax-sub-content { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--border-light); }

@media (max-width: 900px) {
    .hero-stats-grid-4 { grid-template-columns:repeat(2, 1fr); }
}
@media (max-width: 680px) {
    .ci-toolbar { align-items:stretch; }
    .occ-search-input, .role-table-search, .state-search { max-width:none; }
    .ci-view-toggle { width:100%; }
    .ci-view-toggle button { flex:1; }
    .occ-range-grid { grid-template-columns:repeat(5, minmax(58px, 1fr)); overflow-x:auto; }
    .occ-range-item { min-width:58px; }
}
@media (max-width: 540px) {
    .hero-stats-grid-4 { grid-template-columns:1fr; }
}