/* Suffolk County Medics: navy field-guide band header; directory grid of agency cards; agency pages as Q&A sheets grouped by section */
:root {
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --surface-2: #E9EEF3;
  --ink: #12202E;
  --ink-2: #4A5868;
  --line: #D5DDE5;
  --navy: #0E2A47;
  --navy-ink: #F2F5F8;
  --red: #C8303A;
  --red-ink: #FFFFFF;
  --ok: #2F6B45;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  --font-body: "Barlow", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C141C; --surface: #142130; --surface-2: #1B2A3B; --ink: #E6ECF2; --ink-2: #A3B1C0; --line: #26384B;
    --navy: #081A2C; --navy-ink: #E6ECF2; --red: #F0646B; --red-ink: #0C141C; --ok: #6FBF8A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C141C; --surface: #142130; --surface-2: #1B2A3B; --ink: #E6ECF2; --ink-2: #A3B1C0; --line: #26384B;
  --navy: #081A2C; --navy-ink: #E6ECF2; --red: #F0646B; --red-ink: #0C141C; --ok: #6FBF8A;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.5; }
a { color: inherit; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1120px; margin: 0 auto; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; background: var(--surface); padding: 8px 12px; }

/* Header band */
.band { background: var(--navy); color: var(--navy-ink); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 64px; height: 26px; flex: none; }
.brand b { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.brand small { display: block; font-family: var(--font-display); font-weight: 600; font-size: .78rem; letter-spacing: .2em; opacity: .8; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 6px; }
.nav a:hover { background: rgba(255,255,255,.1); }
.nav a[aria-current="page"] { background: rgba(255,255,255,.14); }

/* Home hero */
.hero { padding-block: 28px 36px; }
.hero h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .02em; text-wrap: balance; }
.hero p { margin: 0; max-width: 62ch; font-size: 1.1rem; opacity: .9; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 22px; font-variant-numeric: tabular-nums; }
.stats div { display: flex; flex-direction: column; }
.stats strong { font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1; }
.stats span { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }

/* Directory controls */
main { padding-block: 24px 48px; }
.controls { display: grid; gap: 12px; margin-bottom: 18px; }
.search { position: relative; }
.search input { width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { font: inherit; font-size: .92rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--navy-ink); }
.count { color: var(--ink-2); font-size: .95rem; margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.card { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-decoration: none; min-width: 0; }
.card:hover { border-color: var(--ink-2); }
.card h2 { font-size: 1.05rem; margin: 0; line-height: 1.25; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--ink-2); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: var(--surface-2); color: var(--ink); }
.tag.amb { background: var(--red); color: var(--red-ink); }
.meter { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter i b { display: block; height: 100%; width: 0; background: var(--ok); }
.empty { padding: 24px 0; color: var(--ink-2); }

/* Agency page */
.crumbs { font-size: .9rem; padding-top: 18px; }
.crumbs a { color: var(--navy-ink); opacity: .85; }
.agency-head { padding-block: 10px 26px; }
.agency-head h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 5.5vw, 3.2rem); line-height: 1.02; margin: 4px 0 12px; text-wrap: balance; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .95rem; }
.facts span { opacity: .9; }
.facts a { color: var(--navy-ink); }
.layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.toc { flex: 1 1 220px; max-width: 260px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.toc a { text-decoration: none; padding: 7px 10px; border-radius: 6px; font-weight: 600; font-size: .95rem; display: flex; justify-content: space-between; gap: 8px; }
.toc a:hover { background: var(--surface-2); }
.toc a span { color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.sheet { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: .95rem; color: var(--ink-2); }
.notice strong { color: var(--ink); }
section.qa { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; scroll-margin-top: 16px; }
section.qa h2 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: 1.35rem; margin: 0; padding: 12px 16px; background: var(--surface-2); }
dl { margin: 0; }
.row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 20px; padding: 12px 16px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
dt { font-weight: 600; }
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
dd.none { color: var(--ink-2); font-style: italic; white-space: normal; }
.add { font: inherit; font-size: .88rem; font-style: normal; font-weight: 600; color: var(--red); background: none; border: 0; padding: 0; margin-left: 6px; cursor: pointer; text-decoration: underline; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.rating i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--red); display: inline-block; }
.rating i.on { background: var(--red); }
.rating b { margin-left: 6px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } .toc { position: static; max-width: none; flex-direction: row; flex-wrap: wrap; } .toc a span { display: none; } }

/* Form */
form.submit { display: grid; gap: 14px; padding: 16px; }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-weight: 600; }
.field small { color: var(--ink-2); }
select, textarea, input[type="text"], input[type="email"] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); width: 100%; }
textarea { min-height: 120px; resize: vertical; }
fieldset { border: 0; margin: 0; padding: 0; }
.radios { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.radios label { font-weight: 500; display: flex; gap: 6px; align-items: center; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.btn { font: inherit; font-weight: 700; font-size: 1rem; padding: 12px 18px; border-radius: 8px; border: 0; background: var(--red); color: var(--red-ink); cursor: pointer; justify-self: start; min-height: 44px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.status { margin: 0; font-weight: 600; }
.status.ok { color: var(--ok); }
.status.err { color: var(--red); }
.hp { position: absolute; left: -9999px; }

/* Prose pages */
.prose { max-width: 70ch; }
.prose h2 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 1.5rem; margin: 28px 0 8px; }
.prose ol, .prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }

footer { border-top: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; padding-block: 22px 40px; }
footer p { margin: 0 0 6px; max-width: 80ch; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Contact section and directory */
.src { margin: 0; padding: 10px 16px 14px; font-size: .85rem; color: var(--ink-2); border-top: 1px solid var(--line); }
.prose + .src, .wrap > .src { border-top: 0; padding: 18px 0 0; max-width: 80ch; }
#contact dd a, .cdl dd a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 2px; }
a.chip { display: inline-flex; align-items: center; text-decoration: none; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.ccard h2 { font-size: 1.05rem; margin: 0 0 6px; line-height: 1.25; }
.ccard h2 a { text-decoration: none; }
.ccard h2 a:hover { text-decoration: underline; }
.ccard .meta { margin: 0 0 10px; }
.cdl { display: grid; gap: 8px; font-size: .92rem; }
.cdl dt { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.cdl dd { white-space: normal; }
/* Employee satisfaction survey */
.sv-res { padding: 16px 16px 0; display: grid; gap: 10px; }
.sv-res p { margin: 0; }
.sv-n { font-weight: 700; }
.sv-note { color: var(--ink-2); }
.sv-rec { font-weight: 600; }
.sv-bars { margin: 0; display: grid; gap: 8px; }
.sv-bar { display: grid; grid-template-columns: minmax(0, 15rem) 1fr; gap: 4px 14px; align-items: center; }
.sv-bar dt { font-weight: 600; }
.sv-bar dd { margin: 0; display: flex; gap: 10px; align-items: center; }
.sv-bar b { font-variant-numeric: tabular-nums; min-width: 2.2em; }
.sv-track { flex: 1; height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.sv-fill { display: block; height: 100%; background: var(--navy); }
:root[data-theme="dark"] .sv-fill { background: var(--ok); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sv-fill { background: var(--ok); } }
.sv-form { border-top: 1px solid var(--line); margin-top: 16px; }
.sv-form h3 { margin: 0; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: 1.15rem; }
.sv-form p { margin: 0; }
.sv-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.scale { display: flex; gap: 6px; }
.scale label { position: relative; }
.scale input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.scale span { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 700; }
.scale input:checked + span { background: var(--navy); color: var(--navy-ink); border-color: var(--navy); }
.scale input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
@media (max-width: 640px) { .sv-bar { grid-template-columns: 1fr; } }
/* Admin review page */
.admin { display: grid; gap: 18px; }
.ad-pad { padding: 16px; display: grid; gap: 12px; }
.ad-pad p { margin: 0; }
.ad-list { gap: 14px; }
.ad-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 8px; background: var(--surface); }
.ad-card h3 { margin: 0; font-size: 1.05rem; text-transform: capitalize; }
.ad-card p { margin: 0; white-space: pre-wrap; }
.ad-q { font-weight: 600; }
.ad-card textarea { font: inherit; min-height: 90px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.ad-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ad-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0; }
.ad-uid { font-size: 1rem; word-break: break-all; user-select: all; padding: 6px 8px; background: var(--surface-2); border-radius: 6px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
/* Home page */
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.btn.alt { background: transparent; color: inherit; border: 1px solid currentColor; }
.home { display: grid; gap: 32px; padding-block: 28px; }
.home h2 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 1.6rem; margin: 0 0 14px; }
.pillars { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pillar { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; scroll-margin-top: 16px; }
.pillar h3 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; font-size: 1.25rem; margin: 0; }
.pillar p { margin: 0; }
.pillar-next { color: var(--ink-2); font-size: .95rem; }
.pillar-links { margin-top: auto; padding-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-weight: 600; }
#employment { grid-column: 1 / -1; border-top: 4px solid var(--red); }
#employment p { max-width: 70ch; }
.home-help { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.home-help p { margin: 0 0 10px; max-width: 70ch; }
.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; max-width: 70ch; }
.home-note { margin: 0; color: var(--ink-2); max-width: 70ch; }
/* Star rating: every star up to the chosen one fills in */
.scale.stars { gap: 2px; }
.stars span { border: 0; background: transparent; font-size: 2rem; line-height: 1; color: var(--line); }
.stars label:hover span, .stars label:has(~ label:hover) span, .stars label:has(input:checked) span, .stars label:has(~ label input:checked) span { color: #E8A200; background: transparent; }
.stars input:checked + span { background: transparent; color: #E8A200; border: 0; }
/* Write-in answers can hold several approved entries, one after another */
dd[data-q="perks"], dd[data-q="negatives"] { white-space: pre-line; }
/* Medic questionnaire */
#f-questions { display: grid; gap: 10px; }
.qq-group { border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; }
.qq-group summary { cursor: pointer; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 1.1rem; padding: 12px 0; min-height: 44px; box-sizing: border-box; }
.qq-group[open] { padding-bottom: 14px; }
.qq { margin-top: 14px; }
.qq-group summary + .qq { margin-top: 2px; }
.qq textarea, .qq select { font: inherit; width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); min-height: 44px; }
.qq textarea[disabled], .qq select[disabled] { opacity: .5; }
.field .qq-skip { display: flex; gap: 6px; align-items: center; font-weight: 500; font-size: .92rem; color: var(--ink-2); min-height: 28px; }
form.submit > p { margin: 0; }
