:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface-1: #fcfcfb;
  --border: #e4e2dc;
  --grid: #ebe9e4;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #77756f;
  --accent: #2a78d6;
  --series-region: #2a78d6;
  --series-state: #eb6834;
  --series-us: #1baf7a;
  --bar: #2a78d6;
  --ai-automate: #104281; --ai-augment: #2a78d6; --ai-moderate: #86b6ef; --ai-low: #d6d4cd;
  --ai-on-dark: #ffffff; --ai-on-light: #0b0b0b;
  --brand-bar: #14304d; --brand-ink: #f4f6f8; --brand-sub: #a9b8c8;
  --brand-orange: #e8772e; --brand-green: #3a9a5b; --brand-blue: #2a78d6;
  --map-na: #e4e2dc;
  --map-line: #fcfcfb;
  --seq-0: #cde2fb; --seq-1: #9ec5f4; --seq-2: #5598e7; --seq-3: #256abf; --seq-4: #104281;
  --div-0: #b8322f; --div-1: #e8837a; --div-2: #f6d0cc; --div-3: #cde2fb; --div-4: #6da7ec; --div-5: #1c5cab;
  --openings: #52514e;
  --grads: #2a78d6;
  --good-icon: #0ca30c;
  --warn-icon: #fab219;
  --crit-icon: #d03b3b;
  --comp-natural: #e87ba4;
  --comp-domestic: #008300;
  --comp-international: #6250d6;
  --bar-track: #ecebe7;
  --good: #006300;
  --bad: #b42e2e;
  --flag: #8a5a00;
  --flag-bg: #fdf3dc;
  --radius: 10px;
  --font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface-1: #1a1a19;
    --border: #2e2e2b;
    --grid: #2a2a27;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #9a998f;
    --accent: #3987e5;
    --series-region: #3987e5;
    --series-state: #d95926;
    --series-us: #199e70;
    --bar: #3987e5;
    --ai-automate: #9ec5f4; --ai-augment: #5598e7; --ai-moderate: #24508a; --ai-low: #3a3a37; --ai-on-dark: #0b0b0b; --ai-on-light: #f0efec;
    --brand-bar: #0d1b2a; --brand-sub: #8ea1b5;
    --map-na: #2e2e2b;
    --map-line: #1a1a19;
    --seq-0: #1d3554; --seq-1: #24508a; --seq-2: #2f6db8; --seq-3: #5598e7; --seq-4: #9ec5f4;
    --div-0: #f0a39c; --div-1: #d65a52; --div-2: #6a2b28; --div-3: #24476f; --div-4: #3f80d6; --div-5: #9ec5f4;
    --openings: #c3c2b7;
    --grads: #3987e5;
    --comp-natural: #d55181;
    --comp-domestic: #008300;
    --comp-international: #9085e9;
    --bar-track: #262624;
    --good: #5cc35c;
    --bad: #ec7a7a;
    --flag: #f2c46b;
    --flag-bg: #3a2f17;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211;
  --surface-1: #1a1a19;
  --border: #2e2e2b;
  --grid: #2a2a27;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #9a998f;
  --accent: #3987e5;
  --series-region: #3987e5;
  --series-state: #d95926;
  --series-us: #199e70;
  --bar: #3987e5;
  --ai-automate: #9ec5f4; --ai-augment: #5598e7; --ai-moderate: #24508a; --ai-low: #3a3a37; --ai-on-dark: #0b0b0b; --ai-on-light: #f0efec;
  --brand-bar: #0d1b2a; --brand-sub: #8ea1b5;
  --map-na: #2e2e2b;
  --map-line: #1a1a19;
  --seq-0: #1d3554; --seq-1: #24508a; --seq-2: #2f6db8; --seq-3: #5598e7; --seq-4: #9ec5f4;
  --div-0: #f0a39c; --div-1: #d65a52; --div-2: #6a2b28; --div-3: #24476f; --div-4: #3f80d6; --div-5: #9ec5f4;
  --openings: #c3c2b7;
  --grads: #3987e5;
  --comp-natural: #d55181;
  --comp-domestic: #008300;
  --comp-international: #9085e9;
  --bar-track: #262624;
  --good: #5cc35c;
  --bad: #ec7a7a;
  --flag: #f2c46b;
  --flag-bg: #3a2f17;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.demo-note { margin: 0; padding: 10px 0; font-size: 13.5px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
header.top { padding: 40px 0 24px; border-bottom: 1px solid var(--border); }
.eyebrow {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600; margin: 0 0 6px;
}
h1 { font-family: var(--font-serif); font-weight: 600; font-size: 44px; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 8px; }
.sub { color: var(--text-secondary); margin: 0; font-size: 17px; }
.stamp { margin-top: 14px; font-size: 13.5px; color: var(--text-muted); }

.tiles {
  display: grid; gap: 12px; margin: 24px 0 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tile {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.tile .label { font-size: 14px; color: var(--text-secondary); margin: 0 0 6px; }
.tile .value { font-size: 34px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .ctx { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; }
.up { color: var(--good); } .down { color: var(--bad); }

section.q { margin: 40px 0; }
section.q > h2 {
  font-family: var(--font-serif); font-weight: 600; font-size: 30px; line-height: 1.2; margin: 0 0 6px;
}
section.q > .lede { color: var(--text-secondary); margin: 0 0 16px; max-width: 70ch; }
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card h3 { font-size: 17px; font-weight: 600; margin: 0 0 2px; }
.card .note { font-size: 14px; color: var(--text-muted); margin: 0 0 12px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button {
  font: inherit; font-size: 13px; padding: 4px 12px; border: 0; cursor: pointer;
  background: transparent; color: var(--text-secondary);
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--text-primary); color: var(--surface-1); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--text-secondary); margin: 4px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--text-muted); font-size: 12px; font-family: var(--font-sans); }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .endlabel { font-size: 12px; font-weight: 600; fill: var(--text-secondary); }
.tooltip {
  position: absolute; pointer-events: none; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); white-space: nowrap;
  opacity: 0; transition: opacity 0.1s; z-index: 5;
}
.tooltip .t { font-weight: 600; margin-bottom: 4px; }
.tooltip .r { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.tooltip .r b { color: var(--text-primary); font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 12px; }
.tooltip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th {
  text-align: left; font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  padding: 6px 8px; border-bottom: 1px solid var(--border);
}
td { padding: 8px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barcell { width: 32%; }
.bar { position: relative; height: 10px; background: var(--bar-track); border-radius: 4px; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar); border-radius: 0 4px 4px 0; }
.flag {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--flag);
  background: var(--flag-bg); border-radius: 4px; padding: 0 5px; margin-left: 6px;
}
.lq-hi { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.show-sm { display: none; }
.statecards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 28px 0 40px; }
.statecard { text-decoration: none; color: var(--text-primary); display: grid; gap: 6px; padding: 28px 24px; margin: 0; border-top: 4px solid var(--brand-orange); transition: transform .15s, box-shadow .15s; }
.statecard:nth-child(2) { border-top-color: var(--brand-blue); }
.statecard:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.statecard h2 { font-family: var(--font-serif); font-size: 38px; margin: 0; }
.statecard .go { color: var(--text-secondary); font-size: 14px; }
table.grants tr.totalrow td { font-weight: 600; background: var(--bar-track); }
.citebox { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: 8px; }
.citebox .cite { font-size: 13px; color: var(--text-secondary); margin: 2px 0 6px; max-width: 95ch; }
.notecard p { margin: 0; font-size: 14px; color: var(--text-secondary); } .notecard p + p { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .statecard { transition: none; } .statecard:hover { transform: none; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.appbar { margin-inline: calc(50% - 50vw); background: var(--brand-bar); color: var(--brand-ink); }
.appbar-in { max-width: 1080px; margin: 0 auto; padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { color: var(--brand-ink); text-decoration: none; font-weight: 700; font-size: 21px; letter-spacing: -0.01em; display: inline-flex; align-items: baseline; gap: 0; }
.brand .mark { color: var(--brand-orange); }
.brand .by { font-size: 12px; font-weight: 400; color: var(--brand-sub); margin-left: 10px; letter-spacing: 0.02em; }
.brand:focus-visible, .secnav a:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 3px; border-radius: 4px; }
.picker select { background: rgba(255,255,255,0.08); color: var(--brand-ink); border-color: rgba(255,255,255,0.25); font-size: 14px; max-width: 72vw; }
.picker select option { color: #0b0b0b; background: #fff; }
.stripe { display: grid; grid-template-columns: 1fr 1fr 1fr; height: 4px; }
.stripe i:nth-child(1) { background: var(--brand-orange); } .stripe i:nth-child(2) { background: var(--brand-green); } .stripe i:nth-child(3) { background: var(--brand-blue); }
.secnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 0; }
.secnav a { font-size: 14px; color: var(--text-secondary); text-decoration: none; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-1); }
.secnav a:hover { color: var(--text-primary); border-color: var(--brand-orange); }
.statetable th[data-k] { cursor: pointer; user-select: none; white-space: nowrap; }
.statetable th[aria-sort="ascending"]::after { content: " ↑"; } .statetable th[aria-sort="descending"]::after { content: " ↓"; }
.statetable td { vertical-align: top; }
.rlink { color: var(--text-primary); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--brand-orange); }
.rlink:hover { color: var(--brand-orange); }
section.q > h2 { display: flex; align-items: center; gap: 10px; }
section.q > h2::before { content: ""; width: 4px; height: 0.9em; border-radius: 2px; background: var(--brand-orange); }
#labor > h2::before, #ai > h2::before { background: var(--brand-blue); }
#industry > h2::before, #talent > h2::before { background: var(--brand-green); }
#grants > h2::before { background: var(--brand-orange); }
.stackrows { display: grid; gap: 8px; margin-top: 6px; }
.stackrow { display: grid; grid-template-columns: minmax(120px, 26%) 1fr; gap: 12px; align-items: center; font-size: 13px; color: var(--text-secondary); }
.stack { display: flex; height: 22px; gap: 2px; min-width: 0; }
.stack span { display: grid; place-items: center; font-size: 11px; font-weight: 600; overflow: hidden; white-space: nowrap; }
.stack span:first-child { border-radius: 4px 0 0 4px; } .stack span:last-child { border-radius: 0 4px 4px 0; }
.seg-automate { background: var(--ai-automate); color: var(--ai-on-dark); }
.seg-augment { background: var(--ai-augment); color: var(--ai-on-dark); }
.seg-moderate { background: var(--ai-moderate); color: var(--ai-on-light); }
.seg-low { background: var(--ai-low); color: var(--ai-on-light); }
.legend i.seg-automate, .legend i.seg-augment, .legend i.seg-moderate, .legend i.seg-low { width: 10px; height: 10px; border-radius: 2px; }
.aitag { font-size: 11px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.aitag::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.aitag.automate::before { background: var(--ai-automate); } .aitag.augment::before { background: var(--ai-augment); }
.flowstat .value .of { font-size: 15px; color: var(--text-muted); font-weight: 400; }
.linkbtn { font: inherit; font-size: 13px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.flow-lists > .card { margin: 0; }
#ai .flow-lists { margin-bottom: 16px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; margin: 24px 0 8px; align-items: start; }
.hero .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.mapcard { margin: 0; }
.hero-side { display: grid; gap: 12px; min-width: 0; }
.rankcard { margin: 0; }
#rank { display: grid; gap: 3px; margin-top: 6px; }
.rk { display: grid; grid-template-columns: 20px minmax(0, 1.2fr) minmax(0, 1fr) 66px; gap: 8px; align-items: center; font-size: 13px; color: var(--text-secondary); padding: 1px 4px; border-radius: 4px; }
.rk.me { background: var(--bar-track); color: var(--text-primary); font-weight: 600; }
.rk .rn { color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.rk .rl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk .rl a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--text-muted); }
.rk .rl a:hover { color: var(--text-primary); }
.rk .rb { position: relative; height: 8px; }
.rk .rb span { position: absolute; top: 0; bottom: 0; background: var(--openings); border-radius: 2px; opacity: 0.55; }
.rk.me .rb span { background: var(--accent); opacity: 1; }
.rk .rb i { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--text-muted); }
.rk .rv { text-align: right; font-variant-numeric: tabular-nums; }
#map svg { display: block; width: 100%; height: auto; }
#map .counties path { stroke: var(--map-line); stroke-width: 0.6; cursor: pointer; }
#map .rlines { fill: none; stroke: var(--text-muted); stroke-width: 1; stroke-linejoin: round; pointer-events: none; }
#map .myline { fill: none; stroke: var(--text-primary); stroke-width: 2.5; stroke-linejoin: round; pointer-events: none; }
#map .hover { fill: none; stroke: var(--text-primary); stroke-width: 1.5; pointer-events: none; }
.maplegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.maplegend span { display: inline-flex; align-items: center; gap: 6px; }
.maplegend i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.selectlabel { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
select {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 32px 6px 10px; cursor: pointer;
}
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.chip i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; color: #fff; }
.chip.good i { background: var(--good-icon); }
.chip.warn i { background: var(--warn-icon); color: #1a1a19; }
.chip.crit i { background: var(--crit-icon); }
.chip.na i { background: var(--border); color: var(--text-muted); }
.pchart { display: grid; gap: 10px; margin-top: 8px; }
.pbar { display: grid; grid-template-columns: minmax(140px, 30%) 1fr; gap: 12px; align-items: center; }
.pname { font-size: 14px; color: var(--text-secondary); line-height: 1.3; }
.ptrack { display: grid; gap: 3px; min-width: 0; }
.prow { display: flex; align-items: center; gap: 8px; height: 12px; }
.pfill { display: block; height: 10px; border-radius: 0 4px 4px 0; min-width: 2px; }
.pfill.open { background: var(--openings); }
.pfill.grad { background: var(--grads); }
.prow b { font-size: 12px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.talent td { vertical-align: top; }
.occ { font-weight: 600; font-size: 14px; }
.progs { font-size: 12px; color: var(--text-muted); margin-top: 2px; max-width: 46ch; }
td.edu { font-size: 13px; color: var(--text-secondary); }
.method { margin: 16px 0 0; padding-left: 18px; font-size: 14px; color: var(--text-secondary); display: grid; gap: 4px; max-width: 90ch; }
.legend i.sq { width: 10px; height: 10px; border-radius: 2px; }
.st { color: var(--text-muted); font-size: 12px; margin-left: 6px; }
.flows { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0 20px; }
.flowstat { border-top: 2px solid var(--border); padding-top: 10px; }
.flowstat .label { font-size: 14px; color: var(--text-secondary); margin: 0 0 4px; }
.flowstat .value { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.flowstat .ctx { font-size: 13.5px; color: var(--text-muted); margin-top: 4px; }
.flow-lists { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow-lists > div { min-width: 0; }
.flow-lists h4 { font-size: 13px; font-weight: 600; margin: 0 0 4px; color: var(--text-secondary); }
.flow-lists .barcell { width: 26%; }
.muted { color: var(--text-muted); font-size: 12px; }


/* plain-English takeaways that follow the current view */
.takeaway { margin: 0 0 16px; padding: 12px 16px; max-width: 78ch; font-size: 16.5px; line-height: 1.55;
  color: var(--text-primary); background: var(--surface-1); border: 1px solid var(--border);
  border-left: 4px solid var(--brand-orange); border-radius: 0 var(--radius) var(--radius) 0; }
.takeaway b { font-weight: 700; }
header.top .takeaway { margin: 18px 0 0; }
.card .takeaway { margin: 4px 0 16px; background: transparent; }
.rankcard .note { font-size: 14px; color: var(--text-secondary); }

footer { border-top: 1px solid var(--border); padding: 24px 0 48px; font-size: 13px; color: var(--text-muted); }
footer h4 { color: var(--text-secondary); font-size: 13px; margin: 0 0 6px; }
footer ul { margin: 0 0 16px; padding-left: 18px; }
.err { padding: 40px 0; color: var(--text-secondary); }

@media (max-width: 760px) {
  h1 { font-size: 32px; }
  section.q > h2 { font-size: 24px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .statecards { grid-template-columns: 1fr; }
  .flows, .flow-lists { grid-template-columns: 1fr; }
  .pbar { grid-template-columns: 1fr; gap: 4px; }
  .stackrow { grid-template-columns: 1fr; gap: 4px; }
  .brand .by { display: none; }
  .occ { font-size: 13px; }
  .show-sm.inline-sm { display: inline; }
  .tile .value { font-size: 27px; }
  .barcell { width: 24%; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  td, th { padding: 8px 4px; }
}
