/* childcare-deserts.css — child care deserts map (childcare-deserts.html, js/childcare-deserts.js).
   Site tokens from pages.css; the class colors are a single-hue sequential ramp (light → dark),
   readable with color-vision deficiencies and always paired with a text label. Prefix: cd-. */
:root {
  --cd-0: #FBE7A1; --cd-1: #EF9D3A; --cd-2: #B54A12; --cd-3: #6E220A; --cd-na: #AEB8C4;
  --cd-line: #ffffff; --cd-county: #14324F; --cd-sel: #0B1F33; --cd-center: #17784A; --cd-school: #2468A8;
}
:root[data-theme="dark"] {
  --cd-0: #4B4226; --cd-1: #8C5A22; --cd-2: #D06A2A; --cd-3: #F6B48A; --cd-na: #5B6878;
  --cd-line: #0B1520; --cd-county: #DCE6F0; --cd-sel: #FFFFFF; --cd-center: #5FD08F; --cd-school: #6CB0F0;
}
/* dark: the same ramp runs dim → bright, so the most severe class is the most visible on the dark basemap */

.cd-page main { padding-top: 18px; padding-bottom: 40px; }
.cd-page .card { margin: 14px 0; min-width: 0; }
.cd-page h1 { margin: 4px 0 6px; font-size: 1.8rem; line-height: 1.2; overflow-wrap: anywhere; }
.cd-page h2 { font-size: 1.15rem; margin: 0 0 8px; }
.cd-page h3 { font-size: 1rem; margin: 0 0 6px; color: var(--ink); }
.cd-page h4 { font-size: .92rem; margin: 14px 0 6px; color: var(--ink); }
.cd-kicker, .cd-eyebrow { font-size: .76rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.cd-lede { max-width: 72ch; color: var(--text); margin: 6px 0; }
.cd-stamp { display: inline-block; margin: 6px 0; padding: 6px 10px; border-radius: 8px; background: var(--warn-bg); border: 1px solid var(--warn-border);
  color: var(--warn-text); font-weight: 700; font-size: .84rem; max-width: 100%; box-sizing: border-box; }
.cd-small { font-size: .82rem; color: var(--muted); margin: 6px 0; }
.cd-warn { color: var(--warn-text); }
.cd-page a { overflow-wrap: anywhere; }
.cd-page .btn { min-height: 36px; }
.cd-page .btn-sm { min-height: 32px; padding: 6px 12px; font-size: .84rem; }

/* dashboard */
.cd-tiles { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.cd-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; min-width: 0; box-shadow: var(--shadow-sm); }
.cd-tile b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.cd-tile span { display: block; font-size: .86rem; font-weight: 600; margin-top: 4px; }
.cd-tile small { display: block; font-size: .74rem; color: var(--muted); margin-top: 4px; }
.cd-tile-big { background: var(--navy); border-color: var(--navy); color: #fff; }
.cd-tile-big b { font-size: 2.6rem; color: var(--gold); }
.cd-tile-big span { color: #fff; }
.cd-tile-big small { color: #C9D6E3; }
.cd-cc-head p { margin: 2px 0 8px; }
.cd-counties { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; }
.cd-cbtn { display: grid; grid-template-columns: 112px minmax(0, 1fr) 52px; align-items: center; gap: 8px; width: 100%; min-height: 30px;
  background: none; border: 0; border-radius: 6px; padding: 3px 4px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.cd-cbtn:hover { background: var(--hover); }
.cd-cbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.cd-cname { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-cpct { font-size: .86rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.cd-bar { display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: var(--track); gap: 1px; }
.cd-bar i { display: block; height: 100%; }
.cd-bar i[style="width:0.00%"] { display: none; }
.cd-seg-3, .cd-sw-3 { background: var(--cd-3); }
.cd-seg-2, .cd-sw-2 { background: var(--cd-2); }
.cd-seg-1, .cd-sw-1 { background: var(--cd-1); }
.cd-seg-0, .cd-sw-0 { background: var(--cd-0); }
.cd-seg-na, .cd-sw-na { background: var(--cd-na); }

/* toolbar */
.cd-mapsec { margin-top: 18px; }
.cd-mapsec:focus { outline: none; }
.cd-toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; margin-bottom: 8px; }
.cd-toolbar fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cd-toolbar legend { font-size: .76rem; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: 4px; width: 100%; }
.cd-seg label, .cd-overlays label { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); font-size: .86rem; font-weight: 600; cursor: pointer; }
.cd-seg label:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.cd-seg input, .cd-overlays input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.cd-search { display: flex; gap: 6px; flex: 1 1 280px; min-width: 0; }
.cd-search input { flex: 1 1 auto; min-width: 0; min-height: 36px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
#cd-status:empty { display: none; }
#cd-status { margin: 4px 0 8px; }

/* map + panel */
.cd-mapgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.cd-mapbox { position: relative; min-width: 0; }
.cd-map { height: min(72vh, 640px); min-height: 420px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); z-index: 0; }
.cd-map.cd-placing, .cd-map.cd-placing .leaflet-interactive { cursor: crosshair; }
.cd-legend { position: absolute; left: 10px; bottom: 26px; z-index: 500; max-width: min(320px, calc(100% - 20px)); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: .78rem; box-shadow: var(--shadow-sm); }
.cd-legend b { display: block; font-size: .78rem; margin-bottom: 4px; }
.cd-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cd-legend li { display: flex; align-items: center; gap: 6px; }
.cd-sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; flex: none; border: 1px solid rgba(0,0,0,.15); }
.cd-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.cd-dot-center { background: var(--cd-center); border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--cd-center); }
.cd-dot-school { background: #fff; border: 2px solid var(--cd-school); }
.cd-dot-pin { background: var(--gold); border: 2px solid var(--navy); }
.cd-zoomhint { position: absolute; top: 10px; right: 10px; z-index: 500; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: .78rem; }
.cd-zoomhint[hidden] { display: none; }
.cd-pin span { display: block; width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--gold); border: 3px solid var(--navy); box-shadow: 0 2px 6px rgba(0,0,0,.35); }

.cd-panel { margin: 0 !important; max-height: min(72vh, 640px); min-height: 420px; overflow-y: auto; box-sizing: border-box; }
.cd-pillrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.cd-pill { display: inline-flex; font-size: .76rem; font-weight: 800; border-radius: 999px; padding: 2px 10px; white-space: nowrap; color: #1B2633; }
.cd-pill-0 { background: var(--cd-0); } .cd-pill-1 { background: var(--cd-1); }
.cd-pill-2 { background: var(--cd-2); color: #fff; } .cd-pill-3 { background: var(--cd-3); color: #fff; }
.cd-pill-na { background: var(--cd-na); }
:root[data-theme="dark"] .cd-pill-0, :root[data-theme="dark"] .cd-pill-1 { color: #fff; }
:root[data-theme="dark"] .cd-pill-2, :root[data-theme="dark"] .cd-pill-3, :root[data-theme="dark"] .cd-pill-na { color: #10181F; }
:root[data-theme="dark"] .cd-pill-na { color: #fff; }
.cd-hypo-tag { font-size: .74rem; font-weight: 700; color: var(--warn-text); background: var(--warn-bg); border: 1px dashed var(--warn-border); border-radius: 999px; padding: 1px 8px; }
.cd-ratio { margin: 6px 0 2px; font-size: .95rem; }
.cd-ratio b { font-size: 2rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.cd-ratio-na { color: var(--muted); }
.cd-dots { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 8px; }
.cd-seat { width: 18px; height: 18px; border-radius: 4px; background: var(--cd-center); }
.cd-eq { font-weight: 800; color: var(--muted); }
.cd-kid { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }
.cd-kid-part { background: linear-gradient(90deg, var(--ink) var(--p), var(--track) var(--p)); }
.cd-more { font-size: .8rem; font-weight: 800; }
.cd-need { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info-text); font-size: .9rem; }
.cd-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.cd-fact { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.cd-fact b { display: block; font-size: 1.08rem; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cd-fact b small { font-size: .74rem; color: var(--muted); font-weight: 600; }
.cd-fact span { display: block; font-size: .76rem; color: var(--muted); }
.cd-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.cd-fact-text { font-size: .8rem; color: var(--muted); background: var(--surface-2); border-left: 3px solid var(--accent); padding: 6px 8px; border-radius: 4px; user-select: all; }
.cd-near { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: .86rem; }
.cd-near span { display: block; color: var(--muted); font-size: .78rem; }
.cd-near a { font-size: .8rem; font-weight: 700; display: inline-block; min-height: 24px; line-height: 24px; }

/* what if */
.cd-hypo { padding: 8px 10px; border: 1px dashed var(--warn-border); background: var(--warn-bg); color: var(--text); border-radius: 8px; margin: 6px 0 10px; }
.cd-wi-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.cd-wi-cap { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; flex: 1 1 220px; max-width: 360px; }
.cd-wi-cap input { width: 100%; min-height: 24px; accent-color: var(--accent); }
.cd-wi-sum { font-weight: 600; margin: 12px 0 6px; }
.cd-scroll { overflow-x: auto; max-width: 100%; }
.cd-wi-table, .cd-p-table { border-collapse: collapse; width: 100%; font-size: .86rem; font-variant-numeric: tabular-nums; }
.cd-wi-table th, .cd-wi-table td, .cd-p-table th, .cd-p-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.cd-wi-table small { color: var(--muted); }

/* method, families */
.cd-list { padding-left: 1.3em; margin: 6px 0; }
.cd-list li { margin: 4px 0; }
.cd-links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cd-links li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.cd-links a { font-weight: 700; display: inline-block; min-height: 24px; }
.cd-links span { display: block; font-size: .84rem; color: var(--muted); }

.cd-print { display: none; }
.cd-page [hidden] { display: none !important; }

@media (max-width: 1000px) {
  .cd-mapgrid { grid-template-columns: minmax(0, 1fr); }
  .cd-panel { max-height: none; min-height: 0; }
  .cd-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cd-tile-big { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .cd-page h1 { font-size: 1.45rem; }
  .cd-counties, .cd-links { grid-template-columns: minmax(0, 1fr); }
  .cd-map { height: 62vh; min-height: 360px; }
  .cd-legend { position: static; max-width: none; margin-top: 8px; box-shadow: none; }
  .cd-cbtn { grid-template-columns: 96px minmax(0, 1fr) 48px; }
  .cd-search { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cd-page * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .cd-sw, .cd-bar i, .cd-pill { forced-color-adjust: none; }
}

/* print: one-page county summary only */
@media print {
  @page { size: letter portrait; margin: 0.5in; }
  .cd-page .topbar, .cd-page .site-foot, .cd-page .skip-link, .cd-page main > *:not(#cd-print) { display: none !important; }
  .cd-page main { padding: 0; max-width: none; }
  body.cd-page { background: #fff; color: #111; }
  .cd-print { display: block; color: #111; font-size: 10.5pt; }
  .cd-print h1 { font-size: 17pt; margin: 0 0 4px; color: #111; }
  .cd-p-sub { margin: 0 0 10px; color: #444; }
  .cd-p-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 12px; }
  .cd-p-stats div { border: 1px solid #999; border-radius: 6px; padding: 6px 8px; }
  .cd-p-stats b { display: block; font-size: 15pt; }
  .cd-p-stats span { font-size: 8.5pt; color: #333; }
  .cd-p-table { font-size: 9pt; margin: 8px 0; }
  .cd-p-table caption { text-align: left; font-weight: 700; margin-bottom: 4px; }
  .cd-p-table th, .cd-p-table td { border-bottom: 1px solid #bbb; padding: 3px 6px; color: #111; }
  .cd-p-small { font-size: 8.5pt; color: #333; margin: 6px 0; }
}
