
  :root{
    color-scheme: light dark;
    --bg:#f6f6f3; --surface:#ffffff; --surface2:#eef1ed; --ink:#17211c; --ink2:#48554d; --ink3:#71807a;
    --line:#dde2dc; --line2:#c3cdc2;
    --accent:#297a0e; --accent-ink:#1e5c0a; --accent-soft:#e4efdc;
    --mean:#c26d0a; --marker:#b3261e;
    --shadow:0 1px 2px rgba(23,33,28,.06), 0 8px 24px rgba(23,33,28,.06);
    --radius:14px;
    --grow-h:350; --mid-h:60; --shrink-h:170;
    --label-scale:1.5;
    --ghost-color:#444444;
  }
  @media (prefers-color-scheme: dark){
    :root{
      --bg:#10140f; --surface:#181d18; --surface2:#20261f; --ink:#eef2ec; --ink2:#b7c2b4; --ink3:#8b998c;
      --line:#2c352c; --line2:#3d493d;
      --accent:#67c43e; --accent-ink:#9fe07f; --accent-soft:#26331d;
      --mean:#e79a3c; --marker:#ff7a6e;
      --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    }
  }
  *{box-sizing:border-box}
  html{-webkit-text-size-adjust:100%; scrollbar-gutter:stable both-edges}
  html,body{overflow-x:hidden; overflow-x:clip}
  body{margin:0;background:var(--bg);color:var(--ink);font-family:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:16px;line-height:1.55}
  .mono{font-family:"IBM Plex Sans",system-ui,sans-serif}
  main{max-width:1280px;margin:0 auto;padding:28px 10px 64px}
  @media (max-width:560px){ main{padding:20px 6px 48px} }
  h1{font-size:clamp(28px,4.6vw,42px);line-height:1.1;margin:0 0 10px;font-weight:700;letter-spacing:-.01em}
  h2{font-size:clamp(19px,2.8vw,24px);margin:0;font-weight:700;letter-spacing:-.01em}
  h3{font-size:16px;margin:0 0 4px;font-weight:600}
  p{margin:0 0 12px}
  .lede{font-size:clamp(15.5px,2.2vw,17.5px);color:var(--ink2);max-width:74ch;margin:0}
  .lede strong{color:var(--ink)}
  /* shared header */
  .page-tools{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin:0 0 18px}
  .page-logo-link{display:block;border-radius:8px}
  .page-logo-link:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
  .page-logo{height:81px;width:auto;display:block}
  @media (max-width:640px){ .page-logo{height:66px} }
  .settings-btn{appearance:none;display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);background:var(--surface);color:var(--ink2);font:inherit;font-size:13.5px;font-weight:600;padding:7px 13px;border-radius:999px;cursor:pointer;box-shadow:var(--shadow)}
  .settings-btn svg{width:15px;height:15px}
  .settings-btn:hover{color:var(--ink);border-color:var(--accent)}
  .settings-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  @media (prefers-color-scheme: dark){ }
  .settings-section-title{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink3);margin:18px 0 8px}
  .settings-section-title:first-of-type{margin-top:12px}
  .settings-display{display:flex;flex-direction:column;gap:14px;padding:4px 0 16px;border-bottom:1px solid var(--line)}
  .settings-display .ctl-group{width:100%}
  .settings-display .seg{align-self:flex-start}
  svg.usmap.nolabels text.stlabel{opacity:0}
  .tilegrid.nolabels .tbox span{opacity:0}
  .reset-btn{appearance:none;border:1px solid var(--line);background:var(--surface);color:var(--accent-ink);font:inherit;font-size:13px;font-weight:600;padding:5px 11px;border-radius:999px;cursor:pointer}
  @media (prefers-color-scheme: dark){ .reset-btn{color:var(--accent)} }
  .reset-btn:hover{border-color:var(--accent)}
  .reset-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  /* stat tiles */
  .tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:20px 0 18px}
  @media (max-width:640px){ .tiles{grid-template-columns:1fr} }
  .tile{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:15px 16px 12px;box-shadow:var(--shadow)}
  .tile .k{font-size:12px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--ink3);margin:0 0 4px}
  .tile .v{font-family:"IBM Plex Sans",system-ui,sans-serif;font-size:clamp(21px,3vw,26px);font-weight:600;line-height:1.15;margin:0}
  .tile .s{font-size:13.5px;color:var(--ink2);margin:5px 0 0}
  /* sections & controls */
  section{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:22px 22px 18px;margin:0 0 18px;box-shadow:var(--shadow)}
  @media (max-width:560px){ section{padding:17px 14px 13px} }
  /* the map section runs nearly edge-to-edge so the country fills the page width */
  section.map-section{padding-left:8px;padding-right:8px}
  @media (max-width:560px){ section.map-section{padding-left:5px;padding-right:5px} }
  .sec-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:6px 16px;margin-bottom:4px}
  .sec-tag{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ink3)}
  .sec-note{color:var(--ink2);font-size:14.5px;max-width:80ch}
  .controls{display:flex;flex-direction:column;flex-wrap:wrap;gap:16px 26px;align-items:flex-start;margin:0 0 18px;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
  .ctl-group{display:flex;flex-direction:column;gap:7px}
  .ctl-label{font-size:12px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--ink3)}
  .seg{display:inline-flex;background:var(--surface2);border:1px solid var(--line);border-radius:10px;padding:3px;gap:2px;flex-wrap:wrap}
  .seg button{appearance:none;border:0;background:transparent;color:var(--ink2);font:inherit;font-size:14.5px;font-weight:600;padding:8px 13px;border-radius:7px;cursor:pointer}
  .seg button:hover{color:var(--ink)}
  .seg button[aria-pressed="true"]{background:var(--surface);color:var(--accent-ink);box-shadow:0 1px 3px rgba(0,0,0,.14)}
  @media (prefers-color-scheme: dark){ .seg button[aria-pressed="true"]{color:var(--accent)} }
  .seg button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  /* With 23 categories the "States by" row wraps to several lines; slightly
     tighter buttons keep it compact and readable. */
  #segMetric button{padding:7px 10px;font-size:13.5px}
  /* map */
  .mapwrap{position:relative;margin-top:6px;-webkit-tap-highlight-color:transparent}
  svg.usmap{width:100%;height:auto;display:block;outline:none;-webkit-tap-highlight-color:transparent}
  /* No black bounding-box flash on tap/click: browsers draw two different
     rectangles over an SVG shape's bounding box when it is tapped or takes
     focus — the mobile tap highlight (a brief dark box that fades out) and
     the focus outline, which for SVG is a rectangle around the shape's
     bounding box rather than an outline following the shape itself.
     Suppress both on the map and the tile boxes. The states are
     pointer-only controls — keyboard users select states from the table
     and the ranking buttons, which keep their visible focus rings — so
     removing these rectangles costs no keyboard affordance. */
  .mapwrap *{-webkit-tap-highlight-color:transparent}
  svg.usmap *:focus,svg.usmap *:focus-visible{outline:none}
  .tbox{outline:none}
  /* transform-origin is set per state from JavaScript to that state's area
     centroid (centre of mass), positioned inside its bounding box — not the
     box's centre — so each shape shrinks toward the middle of its landmass. */
  svg.usmap path.state{stroke:var(--surface);stroke-width:1.1;cursor:pointer;transition:transform .85s cubic-bezier(.25,.8,.3,1), fill .5s ease;transform-box:fill-box;transform-origin:center;outline:none;-webkit-tap-highlight-color:transparent}
  /* No hover or selection outline on states: a clicked state used to keep
     the dark, thicker hover stroke (on touch screens the hover style
     sticks after a tap), which read as a heavy selection ring around
     whichever state was selected. Every state now keeps the same thin
     outline at all times — the detail box below the map is what shows
     which state is selected. */
  svg.usmap path.state.missing{stroke-dasharray:3 3;cursor:pointer}
  svg.usmap path.ghost{fill:none;stroke:var(--ghost-color);stroke-width:1.1;stroke-dasharray:5 4;opacity:.55;pointer-events:none}
  svg.usmap circle.ghostdot{fill:none;stroke:var(--ghost-color);stroke-width:1.1;stroke-dasharray:3 2.4;opacity:.55;pointer-events:none}
  svg.usmap.noghost path.ghost,svg.usmap.noghost circle.ghostdot{opacity:0}
  .legend .ghostsw{border:1.5px dashed var(--ghost-color);background:transparent}
  svg.usmap text.stlabel{font-family:"IBM Plex Sans",sans-serif;font-size:calc(10.5px * var(--label-scale));font-weight:600;fill:var(--ink);paint-order:stroke;stroke:var(--surface);stroke-width:calc(2.6px * var(--label-scale));pointer-events:none;text-anchor:middle;dominant-baseline:central}
  svg.usmap text.stlabel.small{font-size:calc(8.5px * var(--label-scale))}
  svg.usmap circle.dcdot{fill:var(--surface);stroke:var(--ink2);stroke-width:1.4;cursor:pointer;transition:r .85s cubic-bezier(.25,.8,.3,1), fill .5s ease;outline:none;-webkit-tap-highlight-color:transparent}
  .tooltip{position:absolute;pointer-events:none;background:var(--surface);border:1px solid var(--line2);border-radius:9px;padding:9px 12px;font-size:13px;box-shadow:0 6px 20px rgba(0,0,0,.16);opacity:0;transition:opacity .12s;z-index:5;max-width:250px}
  .tooltip .tt-n{font-weight:700;font-size:14px}
  .tooltip .tt-v{font-family:"IBM Plex Sans",system-ui,sans-serif;font-weight:600}
  .tooltip .tt-r{color:var(--ink2)}
  .legend{display:block;font-size:13px;color:var(--ink2);margin:12px 2px 2px}
  .legend:empty{margin:0}
  .legend .sw{display:inline-block;width:22px;height:11px;border-radius:3px;margin-right:7px;vertical-align:-1px;border:1px solid var(--line)}
  .legend-grad-wrap{width:100%}
  .legend-ends{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 1px 5px}
  .legend-end{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--ink2);line-height:1.2;white-space:nowrap}
  .legend-end .tri{display:inline-block;width:0;height:0;flex:none}
  .legend-end .tri-left{border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:8px solid currentColor}
  .legend-end .tri-right{border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:8px solid currentColor}
  .legend .grad-full{display:block;width:100%;height:14px;border-radius:4px;border:1px solid var(--line)}
  /* tiles layout */
  .tilegrid{display:grid;grid-template-columns:repeat(12,1fr);grid-template-rows:repeat(7,1fr);gap:3px;margin-top:8px;aspect-ratio:12/7.4;width:100%}
  .tcell{display:flex;align-items:center;justify-content:center;position:relative;min-height:0;min-width:0}
  .tbox{position:relative;aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;border-radius:7px;border:1px solid var(--surface);cursor:pointer;transition:width .85s cubic-bezier(.25,.8,.3,1),height .85s cubic-bezier(.25,.8,.3,1),background-color .5s ease;flex:none;z-index:1}
  .tbox:hover{z-index:3}
  .tbox span{font-size:calc(11px * var(--label-scale));font-weight:700;color:var(--ink);paint-order:stroke;pointer-events:none;line-height:1}
  @media (max-width:560px){ .tbox span{font-size:calc(8.5px * var(--label-scale))} .tilegrid{gap:2px} }
  [hidden]{display:none !important}
  /* detail + insight */
  .insight{margin-top:16px;background:var(--accent-soft);border-radius:10px;padding:13px 16px;font-size:14.5px}
  .insight strong{color:var(--accent-ink)}
  @media (prefers-color-scheme: dark){ .insight strong{color:var(--accent)} }
  .detail{margin-top:14px;border:1px solid var(--line);border-radius:10px;background:var(--surface2);padding:16px}
  .detail-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 16px;justify-content:space-between}
  .detail-name{font-size:20px;font-weight:700}
  .detail-size{font-family:"IBM Plex Sans",system-ui,sans-serif;font-size:15px;font-weight:600}
  .detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}
  @media (max-width:640px){ .detail-grid{grid-template-columns:1fr 1fr} }
  .dcell{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:9px 12px}
  .dcell .dk{font-size:11.5px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--ink3)}
  .dcell .dv{font-family:"IBM Plex Sans",system-ui,sans-serif;font-size:16.5px;font-weight:600;margin-top:1px}
  .dcell .dr{font-size:12.5px;color:var(--ink2)}
  .detail p.note{font-size:13.5px;color:var(--ink2);margin:10px 0 0}
  /* rankings */
  .rank-cols{display:grid;grid-template-columns:1fr 1fr;gap:8px 34px;margin-top:10px}
  @media (max-width:720px){ .rank-cols{grid-template-columns:1fr} }
  .rank-h{font-size:13px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ink3);margin:8px 0 8px}
  .rank-row{display:grid;grid-template-columns:145px 1fr;align-items:center;gap:10px;padding:5px 4px;border-radius:7px;cursor:pointer;border:0;background:none;width:100%;font:inherit;text-align:left;color:inherit}
  .rank-row:hover{background:var(--surface2)}
  .rank-row:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
  .rank-row .nm{font-size:14.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .rank-row .track{height:16px;background:var(--surface2);border-radius:4px;overflow:hidden}
  .rank-row .fillb{height:100%;border-radius:4px;transition:width .6s ease}
  /* table */
  .table-scroll{overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;margin-top:8px}
  table{width:100%;border-collapse:collapse;font-size:14.5px;min-width:0}
  th,td{padding:8px 9px;text-align:right;border-bottom:1px solid var(--line);white-space:nowrap}
  th{font-size:12px;letter-spacing:.05em;text-transform:uppercase;color:var(--ink3);font-weight:600;border-bottom:2px solid var(--line)}
  th:first-child,td:first-child{text-align:left}
  td.num,th.num{font-family:"IBM Plex Sans",system-ui,sans-serif;font-size:14px}
  th.rank-col,td.rank-col{text-align:center;width:54px}
  td.rank-col{color:var(--ink2);font-weight:600}
  tbody tr.selected td.rank-col{color:inherit}
  th.state-col,td.state-col{text-align:left}
  .th-sort{appearance:none;border:0;background:none;padding:0;margin:0;font:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit;cursor:pointer;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
  th.num .th-sort{justify-content:flex-end}
  th.rank-col .th-sort{justify-content:center}
  th.state-col .th-sort{justify-content:flex-start}
  .th-sort:hover{color:var(--ink)}
  .th-sort:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:3px}
  th[aria-sort="ascending"],th[aria-sort="descending"]{color:var(--accent-ink)}
  @media (prefers-color-scheme: dark){ th[aria-sort="ascending"],th[aria-sort="descending"]{color:var(--accent)} }
  .sort-arrow{font-size:10px;line-height:1;flex:none}
  tbody tr{cursor:pointer}
  tbody tr:hover td{background:var(--surface2)}
  tbody tr.selected td{background:var(--accent-soft);font-weight:600}
  tbody tr:last-child td{border-bottom:0}
  .axis-note{font-size:12.5px;color:var(--ink3);margin-top:8px}
  /* With only the selected category's columns the table is narrow enough
     to fit a phone without sideways scrolling: tighten cell padding and
     let the column headers wrap instead of forcing a wide table. */
  @media (max-width:560px){
    table{font-size:13.5px}
    th,td{padding:7px 5px}
    th{white-space:normal;line-height:1.3}
    td.num,th.num{font-size:12.5px}
    td:first-child{white-space:normal}
    td.state-col{white-space:normal}
    td.rank-col,th.rank-col{width:42px}
    .th-sort{white-space:normal}
  }
  /* explainers + footer */
  .two-col{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:0 0 18px}
  @media (max-width:720px){ .two-col{grid-template-columns:1fr} }
  .plain-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px 22px}
  .plain-card p,.plain-card li{font-size:14.5px;color:var(--ink2)}
  .plain-card p{margin:0 0 8px}
  .plain-card p strong,.plain-card li strong{color:var(--ink)}
  .plain-card ul{margin:0;padding-left:18px}
  .plain-card li{margin-bottom:5px}
  footer{font-size:13.5px;color:var(--ink2)}
  footer a{color:var(--accent-ink)}
  @media (prefers-color-scheme: dark){ footer a{color:var(--accent)} }
  .src-toggle{display:inline-flex;align-items:center;gap:7px;background:none;border:0;padding:2px 0;margin:0 0 4px;font-family:"IBM Plex Sans",sans-serif;font-size:16px;font-weight:600;color:var(--ink);cursor:pointer}
  .src-toggle .src-arrow{width:14px;height:14px;flex:none;transition:transform .25s ease}
  .src-toggle[aria-expanded="true"] .src-arrow{transform:rotate(90deg)}
  .src-body p{margin:0 0 8px;max-width:92ch}
  .copyline{color:var(--ink3);font-size:13px;margin-top:14px}
  @media (prefers-reduced-motion: reduce){
    svg.usmap path.state,.tbox,.rank-row .fillb,svg.usmap circle.dcdot{transition:none}
    .src-toggle .src-arrow{transition:none}
  }

/* Connect source-specific tokens to the shared site palette. */
:root {--surface2:var(--site-surface-2);--ink2:var(--site-muted);--ink3:var(--site-faint);--line2:var(--site-line);--accent:var(--site-primary);--accent-ink:var(--site-primary);--accent-soft:var(--site-primary-soft);--mean:var(--site-secondary);--marker:var(--site-tertiary)}
body .lede,body .sec-note {max-width:none}
body .sec-note,body .ctl-label,body .legend {font-size:13px}
body .hue-head label {font-size:14px}
body .hue-head label small {font-size:12px}
body .site-scroll-table td,body .site-scroll-table th {font-size:15px}
body .related-tools {background:none;border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:none;margin:36px 0 0;padding:26px 0 0}
body .site-sources {background:none;border:0;border-radius:0;box-shadow:none;margin:24px 0 14px;padding:0}
body footer {text-align:left}
@media(max-width:640px){body .related-tools {margin-top:28px;padding-top:22px}}

/* Center a smaller map on desktop; preserve the full-width mobile map. */
@media (min-width: 769px) {
  #mapSection svg.usmap { width: 80%; margin-inline: auto; }
}

/* Keep labels with their states during the small Texas/Oklahoma separation. */
svg.usmap text.stlabel { transition: transform .85s cubic-bezier(.25,.8,.3,1), opacity .2s ease; }
@media (prefers-reduced-motion: reduce) { svg.usmap text.stlabel { transition: none; } }

/* Main map display controls share a row and wrap on narrow screens. */
.map-display-controls { display:flex; flex-wrap:wrap; align-items:flex-start; gap:16px 26px; max-width:100%; }
.map-display-controls .ctl-group { min-width:0; max-width:100%; }

/* Fade outlines and labels without removing them from the layout. */
svg.usmap path.ghost, svg.usmap circle.ghostdot, .tbox span { transition: opacity .2s ease; }
@media (prefers-reduced-motion: reduce) {
  svg.usmap path.ghost, svg.usmap circle.ghostdot, .tbox span { transition: none; }
}
