/* Layout: a working map tool. A High Road Policy masthead across the top; under it the control rail on
   the left, the map, and the results panel on the right (one tabbed panel under the map on phones).
   Brand: High Road Policy, as in the Wage Atlas and the Federal Impacts Dashboard (Carnellian, ink and
   white; Roboto for text, Jost for display). */
@font-face { font-family: "Roboto"; font-weight: 400; font-display: swap; src: url("fonts/roboto-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-display: swap; src: url("fonts/roboto-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-display: swap; src: url("fonts/roboto-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap; src: url("fonts/jost-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 900; font-display: swap; src: url("fonts/jost-latin-900-normal.woff2") format("woff2"); }
:root {
  --bg: #f7f7f7;
  --panel: #ffffff;
  --ink: #222222;
  --ink-2: #4d4d4d;
  --ink-3: #6b6b6b;
  --line: #e6e3de;
  --line-2: #bdb5a9;
  --accent: #b31b1b;
  --accent-text: #b31b1b;
  --accent-ink: #ffffff;
  --accent-soft: #f6e3e3;
  --land: #ffffff;
  --water: #dde2e4;
  --nland: #efedea;
  --hatch: rgba(34, 34, 34, 0.45);
  --zone-line: rgba(34, 34, 34, 0.14);
  --county-line: rgba(34, 34, 34, 0.5);
  --region-line: #222222;
  --cc-halo: #ffffff;
  --site: #222222;
  --site-halo: #ffffff;
  --radius-fill: rgba(34, 34, 34, 0.06);
  --block: rgba(34, 34, 34, 0.28);
  --block-on: #222222;
  --label: #222222;
  --label-halo: rgba(255, 255, 255, 0.9);
  --tip-bg: #222222;
  --tip-ink: #f2f2f2;
  --warn-bg: #fbf1d9;
  --warn-ink: #6b4a06;
  /* Home areas: the brand's Carnellian ramp (brand-kit/charts/hrp_theme.py) stretched to six classes.
     Fewer jobs light, more jobs dark, in both themes. */
  --r0: #f6e3e3; --r1: #e8b4b4; --r2: #d47575; --r3: #b31b1b; --r4: #8a1515; --r5: #5c0d0d;
  /* Child care programs: the brand's categorical colors, leaving out Carnellian so markers stand
     apart from the shaded areas. Each type also has its own shape. */
  --cc-dcc: #006699; --cc-sdcc: #4b7b2b; --cc-gfdc: #73508f; --cc-fdc: #d47500; --cc-sacc: #222222; --cc-sbcc: #8c8579;
  /* Earnings bands, low to high: lighter to darker. */
  --pay0: #d8d2c9; --pay1: #a2998b; --pay2: #4d4d4d;
  --road: #4d4d4d; --road-case: rgba(255, 255, 255, 0.85);
  --logo-ink: #222222; --logo-red: #b31b1b; --logo-dash: #ffffff;
  --font-ui: "Roboto", Arial, "Helvetica Neue", sans-serif;
  --font-display: "Jost", Futura, "Trebuchet MS", Arial, sans-serif;
  --rail: 300px;
  --rpanel: 380px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161616; --panel: #222222; --ink: #f2f2f2; --ink-2: #d0ccc6; --ink-3: #a39e96;
    --line: #383838; --line-2: #5a5753; --accent: #c0362e; --accent-text: #f28b82; --accent-ink: #ffffff; --accent-soft: #3a2320;
    --land: #2b2b2b; --water: #141516; --nland: #1f1f1f; --hatch: rgba(242, 242, 242, 0.4);
    --zone-line: rgba(242, 242, 242, 0.12); --county-line: rgba(242, 242, 242, 0.45); --region-line: #d0ccc6;
    --cc-halo: #161616; --site: #ffffff; --site-halo: #161616; --radius-fill: rgba(242, 242, 242, 0.08);
    --block: rgba(242, 242, 242, 0.3); --block-on: #ffffff; --label: #f2f2f2; --label-halo: rgba(22, 22, 22, 0.85);
    --tip-bg: #f2f2f2; --tip-ink: #161616;
    --warn-bg: #33290f; --warn-ink: #f1d68f;
    --r0: #f9c1ba; --r1: #f0978c; --r2: #e06a5e; --r3: #c0443a; --r4: #933029; --r5: #672a24;
    --cc-dcc: #5aa9d6; --cc-sdcc: #86b665; --cc-gfdc: #b195cc; --cc-fdc: #f0a04b; --cc-sacc: #f2f2f2; --cc-sbcc: #a39e96;
    --pay0: #d0ccc6; --pay1: #8f877b; --pay2: #4a4a4a;
    --road: #d0ccc6; --road-case: rgba(22, 22, 22, 0.7);
    --logo-ink: #ffffff; --logo-red: #ffffff; --logo-dash: transparent;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161616; --panel: #222222; --ink: #f2f2f2; --ink-2: #d0ccc6; --ink-3: #a39e96;
  --line: #383838; --line-2: #5a5753; --accent: #c0362e; --accent-text: #f28b82; --accent-ink: #ffffff; --accent-soft: #3a2320;
  --land: #2b2b2b; --water: #141516; --nland: #1f1f1f; --hatch: rgba(242, 242, 242, 0.4);
  --zone-line: rgba(242, 242, 242, 0.12); --county-line: rgba(242, 242, 242, 0.45); --region-line: #d0ccc6;
  --cc-halo: #161616; --site: #ffffff; --site-halo: #161616; --radius-fill: rgba(242, 242, 242, 0.08);
  --block: rgba(242, 242, 242, 0.3); --block-on: #ffffff; --label: #f2f2f2; --label-halo: rgba(22, 22, 22, 0.85);
  --tip-bg: #f2f2f2; --tip-ink: #161616;
  --warn-bg: #33290f; --warn-ink: #f1d68f;
  --r0: #f9c1ba; --r1: #f0978c; --r2: #e06a5e; --r3: #c0443a; --r4: #933029; --r5: #672a24;
  --cc-dcc: #5aa9d6; --cc-sdcc: #86b665; --cc-gfdc: #b195cc; --cc-fdc: #f0a04b; --cc-sacc: #f2f2f2; --cc-sbcc: #a39e96;
  --pay0: #d0ccc6; --pay1: #8f877b; --pay2: #4a4a4a;
  --road: #d0ccc6; --road-case: rgba(22, 22, 22, 0.7);
  --logo-ink: #ffffff; --logo-red: #ffffff; --logo-dash: transparent;
  color-scheme: dark;
}
html, body { height: 100%; }
body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 14px; line-height: 1.45; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

body { display: flex; flex-direction: column; height: 100%; }
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr) var(--rpanel); grid-template-rows: minmax(0, 1fr); flex: 1 1 auto; min-height: 0; }
.app[data-results="hidden"] { grid-template-columns: var(--rail) minmax(0, 1fr) 0; }
.rail, .rpanel { background: var(--panel); overflow-y: auto; min-width: 0; display: flex; flex-direction: column; }
.rail { grid-column: 1; grid-row: 1; border-right: 1px solid var(--line); }
.rpanel { grid-column: 3; grid-row: 1; border-left: 1px solid var(--line); }
.app[data-results="hidden"] .rpanel { display: none; }
.mapwrap { grid-column: 2; grid-row: 1; position: relative; min-width: 0; min-height: 0; background: var(--water); }
.tabs { display: none; border-bottom: 1px solid var(--line); background: var(--panel); }
.tabs button { flex: 1 1 0; border: 0; background: transparent; padding: 11px 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.panelhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.iconbtn { border: 1px solid var(--line-2); background: var(--panel); border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; padding: 4px 8px; color: var(--ink-2); }
.iconbtn:hover { color: var(--ink); border-color: var(--ink-3); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }

.sec { padding: 16px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.sec:last-child { border-bottom: 0; }
/* Masthead: the High Road Policy logo, the tool's name with the ECLC partnership, and "Support this work",
   as on the other High Road Policy tools. */
.masthead { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 12px 20px 12px; background: var(--panel); border-top: 6px solid var(--accent); border-bottom: 1px solid var(--line); }
.logo-link { display: block; flex: none; border-radius: 2px; }
.logo { display: block; width: 168px; height: auto; }
.product { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 320px; border-left: 1px solid var(--line); padding-left: 22px; }
.product .eyebrow { color: var(--accent-text); font-weight: 900; font-size: 11px; letter-spacing: 0.09em; }
.product h1 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 24px; line-height: 1.1; letter-spacing: -0.01em; }
.product p { margin: 0; color: var(--ink-3); font-size: 13px; }
.product .partner { color: var(--ink-2); }
.product .partner strong { font-weight: 500; color: var(--ink); }
.support-link { margin-left: auto; color: var(--accent-text); font-weight: 500; white-space: nowrap; }
/* Credits at the foot of the control rail */
.credits { margin-top: auto; font-size: 12px; color: var(--ink-3); gap: 6px; }
.credits p { margin: 0; }
.credits a { color: inherit; }
.credits .support-link { margin: 0; color: var(--accent-text); }
/* "Support this work" panel (support-panel.js): a dropdown under the link, a bottom sheet on phones. */
.support-panel { position: fixed; z-index: 1000; width: min(320px, calc(100vw - 16px)); padding: 16px 18px 14px; background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-top: 3px solid var(--accent); border-radius: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2); font-size: 13.5px; line-height: 1.5; }
.support-panel:focus { outline: none; }
.support-panel :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.support-panel p { margin: 0 0 8px; color: var(--ink-2); }
.support-panel .support-panel-title { margin: 0 30px 6px 0; font-family: var(--font-display); font-weight: 500; font-size: 21px; line-height: 1.1; letter-spacing: 0.01em; color: var(--ink); }
.support-panel .support-panel-lead { margin-bottom: 2px; font-weight: 600; color: var(--ink); }
.support-panel-steps { margin: 0 0 14px; padding-left: 1.4em; }
.support-panel .support-panel-go { display: block; padding: 9px 12px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-align: center; text-decoration: none; }
.support-panel .support-panel-go:hover { filter: brightness(0.92); }
.support-panel .support-panel-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }
.support-panel-close { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-3); font-size: 22px; line-height: 1; cursor: pointer; }
.support-panel-close:hover { background: var(--accent-soft); color: var(--ink); }
.support-panel.is-sheet { top: auto; right: 0; bottom: 0; left: 0; width: auto; max-height: 85vh; overflow: auto; padding-bottom: max(16px, env(safe-area-inset-bottom)); border-width: 3px 0 0; border-radius: 12px 12px 0 0; }
.support-backdrop { position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, 0.4); }
.eyebrow { font-family: var(--font-display); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.hint { color: var(--ink-3); font-size: 12.5px; margin: 0; }

.seg { display: flex; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; gap: 2px; background: var(--bg); }
.seg button { flex: 1 1 0; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink); }

.field { display: grid; gap: 6px; }
.field label, .field .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.search { position: relative; }
.search input { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); }
.search input::placeholder { color: var(--ink-3); }
.results { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); max-height: 300px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.12); position: absolute; left: 0; right: 0; z-index: 5; }
.results li { padding: 7px 9px; border-radius: 6px; cursor: pointer; display: grid; gap: 1px; }
.results li[aria-selected="true"], .results li:hover { background: var(--accent-soft); }
.results .nm { font-weight: 600; font-size: 13.5px; }
.results .meta { color: var(--ink-2); font-size: 12px; }
select { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.status { font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); margin: 0; }

.sites { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sites li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.sites .nm { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.sites .meta { color: var(--ink-2); font-size: 12px; }
.x { border: 0; background: transparent; cursor: pointer; color: var(--ink-3); padding: 2px 6px; border-radius: 6px; font-size: 16px; line-height: 1; }
.x:hover { color: var(--accent-text); background: var(--accent-soft); }
.empty { color: var(--ink-3); font-size: 13px; margin: 0; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi .v { font-family: var(--font-display); font-weight: 500; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .k { color: var(--ink-2); font-size: 12px; margin-top: 3px; }
.cc-near { font-size: 13px; color: var(--ink-2); margin: 0; display: grid; gap: 6px; }
.cc-near b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cc-near ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px 12px; }
.cc-near li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.cc-near li b { min-width: 1.5em; text-align: right; }
.sym { width: 14px; height: 14px; flex: none; display: inline-block; vertical-align: -2px; }
.cctypes { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 0; }
.cctypes legend { padding: 0; margin-bottom: 4px; }
.ccsrc { font-size: 12px; color: var(--ink-3); margin: 0; }
#cc-types { display: grid; gap: 4px; }
#cc-types .check em { font-style: normal; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: auto; }
.paymix { display: grid; gap: 6px; }
.paymix .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.bar { display: flex; height: 10px; border-radius: 3px; overflow: hidden; background: var(--line); width: 100%; min-width: 64px; }
.bar i { display: block; height: 100%; }
.bar.big { height: 16px; border-radius: 4px; }
.bar .p0 { background: var(--pay0); } .bar .p1 { background: var(--pay1); } .bar .p2 { background: var(--pay2); }
.paykey { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 12px; color: var(--ink-2); }
.paykey span { display: grid; gap: 1px; }
.paykey b { font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.paykey b i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
th.paycol, td.paycol { width: 92px; }
td.paycol .bar { width: 84px; margin-left: auto; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th { text-align: right; font-weight: 600; color: var(--ink-2); padding: 4px 6px; border-bottom: 1px solid var(--line-2); white-space: nowrap; font-size: 11.5px; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
td { text-align: right; padding: 5px 6px; border-bottom: 1px solid var(--line); }
td:first-child { max-width: 150px; }
td .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
td .sub { display: block; color: var(--ink-3); font-size: 11px; }
tr.oos td { color: var(--ink-2); }
.dash { color: var(--ink-3); }
.linkbtn { border: 0; background: transparent; color: var(--accent-text); cursor: pointer; padding: 0; font-weight: 600; font-size: 12.5px; justify-self: start; }
.linkbtn:hover { text-decoration: underline; }
details { font-size: 12.5px; color: var(--ink-2); }
details summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }

.legend { position: absolute; left: 12px; bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 11.5px; color: var(--ink-2); display: grid; gap: 6px; max-width: calc(100% - 24px); }
.legend .ttl { font-weight: 600; color: var(--ink); font-size: 12px; }
.ramp { display: flex; gap: 0; }
.ramp span { display: grid; gap: 2px; min-width: 40px; }
.ramp i { display: block; height: 10px; }
.ramp span:first-child i { border-radius: 3px 0 0 3px; }
.ramp span:last-child i { border-radius: 0 3px 3px 0; }
.ramp em { font-style: normal; font-variant-numeric: tabular-nums; font-size: 10.5px; }
.keyrow { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.keyrow span { display: inline-flex; gap: 6px; align-items: center; }
.keyrow .sym { width: 12px; height: 12px; }
.ring { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--site); box-shadow: 0 0 0 1.5px var(--site-halo); display: inline-block; }
.keyrow .rd { display: inline-block; width: 20px; background: var(--road); border-radius: 2px; }
.keyrow .ttl2 { font-weight: 600; color: var(--ink); }

.mapbtns { position: absolute; right: 12px; top: 12px; display: grid; gap: 6px; }
.mapbtns button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-size: 18px; line-height: 1; display: grid; place-items: center; }
.mapbtns button:hover { border-color: var(--ink-3); }
.mapbtns .wide { width: auto; padding: 0 10px; font-size: 12px; font-weight: 600; }
.mapbtns .sep { height: 4px; }
.tip { position: absolute; pointer-events: none; background: var(--tip-bg); color: var(--tip-ink); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; max-width: 260px; box-shadow: 0 6px 18px rgba(0,0,0,0.2); z-index: 4; }
.tip.pinned { pointer-events: auto; }
.tip b { font-weight: 600; }
.tip .t2 { opacity: 0.8; font-size: 12px; }
.tip a { color: inherit; }
a { color: var(--accent-text); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); font-size: 13px; background: var(--water); }

/* Narrower screens: one side panel with Controls / Results tabs */
@media (max-width: 1279px) {
  .app, .app[data-results="hidden"] { grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .tabs { display: flex; grid-column: 1; grid-row: 1; }
  .rail, .rpanel { grid-column: 1; grid-row: 2; border-left: 0; border-right: 1px solid var(--line); }
  .mapwrap { grid-column: 2; grid-row: 1 / span 2; }
  .app[data-tab="controls"] .rpanel, .app[data-tab="results"] .rail { display: none; }
  .app[data-tab="results"] .rpanel { display: flex; }
  #hide-results, #show-results { display: none !important; }
}
@media (max-width: 820px) {
  .app, .app[data-results="hidden"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: 55vh auto auto; height: auto; min-height: 100%; }
  .mapwrap { grid-column: 1; grid-row: 1; height: 55vh; }
  .tabs { grid-row: 2; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; }
  .rail, .rpanel { grid-row: 3; overflow: visible; border-right: 0; }
  .sec { padding: 14px 16px; }
  .legend { font-size: 11px; }
  .ramp span { min-width: 32px; }
  html, body { height: auto; }
  body { display: block; }
  .masthead { padding: 12px 16px; gap: 6px 16px; }
  .logo { width: 140px; }
  .product { flex-basis: 100%; order: 3; border-left: 0; padding-left: 0; }
  .product h1 { font-size: 21px; }
  .support-link { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
