/*
 * Valley Advocates Inc. — site styles.
 * Brand: brand/BRAND.md (palette from brand/source/09_Brand_Color_Palette.json).
 * Light theme only: the approved logo artwork is made for white / light backgrounds.
 * Target: WCAG 2.2 AA. Every text color below is checked against its background in brand/BRAND.md.
 * Component and class reference: docs/dev/ui.md and docs/dev/forms.md.
 *
 * The CSP (style-src 'self') blocks inline style="" attributes, so every style lives here.
 * NRV Green (#4B962E) and River Sky Blue (#229ED3) are decorative only: never use them for text.
 */

@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/montserrat-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/montserrat-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/source-sans-3-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  /* Brand palette */
  --deep-river-blue: #064D83;
  --nrv-green: #4B962E;      /* decorative only (3.7:1) */
  --river-sky-blue: #229ED3; /* decorative only (3.0:1) */
  --forest-green: #236B35;   /* text OK: 6.5:1 on white, 6.0:1 on soft background */
  --soft-background: #F3F7F5;
  --white: #FFFFFF;
  /* Roles */
  --bg: var(--soft-background);
  --surface: var(--white);
  --text: #16283A;          /* near-navy body text, 13.9:1 on soft background */
  --muted: #4A5B68;         /* 7.0:1 on white, 6.5:1 on soft background */
  --border: #D3DDD8;
  --line: #D3DDD8;
  --control: #7A8B96;       /* input borders: 3.5:1 on white (WCAG 1.4.11) */
  --brand: var(--deep-river-blue);  /* links, primary buttons: 8.8:1 on white */
  --brand-ink: var(--white);
  --accent: var(--forest-green);    /* secondary buttons: 6.5:1 on white */
  --focus: var(--deep-river-blue);
  --ok-bg: #E6F2E1; --ok-ink: #1C5629;
  --err-bg: #FBEAEA; --err-ink: #8A1C1C;
  --warn-bg: #FFF4D6; --warn-ink: #6A4A00;
  /* Tints (backgrounds only) */
  --tint-green: #EAF3E6;   /* forest green text on it: 5.7:1 */
  --tint-blue: #E8F1F8;    /* deep blue text on it: 7.7:1 */
  --tint-sky: #E7F5FB;     /* deep blue text on it: 7.9:1 */
  --tint-head: #EEF4F1;    /* table heads: deep blue 7.9:1, muted 6.3:1 */
  --info-bg: var(--tint-sky); --info-ink: var(--deep-river-blue);
  /* Spacing (rem = 18px) */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem;  --space-7: 3rem;   --space-8: 4.5rem;
  /* Type scale: minor third (1.2), fluid at the top */
  --step--1: .875rem;                                   /* meta, badges, table heads */
  --step-0: 1rem;                                       /* 18px body */
  --step-1: 1.2rem;                                     /* h3, card titles */
  --step-2: 1.44rem;                                    /* h2 */
  --step-3: clamp(1.6rem, 1.25rem + 1.4vw, 2.07rem);    /* h1 */
  --step-4: clamp(1.9rem, 1.3rem + 2.4vw, 2.75rem);     /* home hero */
  --measure: 68ch;
  /* Shape and elevation */
  --radius-sm: 8px; --radius: 12px; --radius-lg: 20px; --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(6, 77, 131, .06), 0 2px 8px rgba(6, 77, 131, .05);
  --shadow-2: 0 2px 4px rgba(6, 77, 131, .08), 0 12px 28px rgba(6, 77, 131, .12);
  --max: 46rem;
  --font-body: "Source Sans 3", Arial, "Helvetica Neue", sans-serif;
  --font-head: "Montserrat", "Aptos Display", Arial, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { font-size: 112.5%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 var(--font-body);
  display: flex; flex-direction: column; min-height: 100vh; overflow-x: clip;
  overflow-wrap: break-word; } /* footer reaches the bottom; full-bleed bands never scroll sideways; long emails and codes wrap (WCAG 1.4.10, 1.4.12) */
main { flex: 1 0 auto; }
body > main.wrap, .site-footer > .wrap { width: 100%; } /* auto side margins would otherwise shrink-wrap to wide content */
h1, h2, h3, .footer-name, .stat { font-family: var(--font-head); font-weight: 600; color: var(--deep-river-blue); letter-spacing: -0.01em; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: var(--step-3); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 var(--space-4); font-weight: 700; }
h2 { font-size: var(--step-2); line-height: 1.25; margin: var(--space-7) 0 var(--space-3); }
h3 { font-size: var(--step-1); line-height: 1.3; margin: var(--space-5) 0 var(--space-2); }
main p, main li, .lead { max-width: var(--measure); }
main ol > li::marker { color: var(--forest-green); font-family: var(--font-head); font-weight: 700; } /* 6.5:1 */
main ul > li::marker { color: var(--nrv-green); }                                                   /* decorative bullet */
a { color: var(--brand); text-underline-offset: 2px; overflow-wrap: anywhere; }
a:hover { color: var(--forest-green); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
[id] { scroll-margin-top: var(--space-4); }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 64rem; }
main.wrap { padding-top: var(--space-6); padding-bottom: var(--space-7); min-height: 0; } /* .wrap sets side padding only */
.lead { font-size: 1.15rem; line-height: 1.55; color: var(--muted); }
.muted { color: var(--muted); }
.eyebrow { font: 700 var(--step--1)/1.2 var(--font-head); color: var(--forest-green); letter-spacing: .04em; margin: 0 0 var(--space-2); }
code { overflow-wrap: anywhere; }

/* ---------- Utilities (use these instead of inline styles) ---------- */
.pre-line { white-space: pre-line; }                         /* keep line breaks people typed */
.break-all { overflow-wrap: anywhere; word-break: break-all; } /* long codes and fingerprints wrap on phones */
/* Honeypot spam trap: off-screen but not display:none (bots skip hidden fields). Keep aria-hidden and tabindex=-1 on it. */
.hp { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Header ---------- */
/* Always white so the logo sits on the background it was designed for. */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: relative; z-index: 15; }
.site-header::after { /* thin river-and-valley rule */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px;
  background: linear-gradient(90deg, var(--forest-green), var(--nrv-green) 35%, var(--river-sky-blue) 70%, var(--deep-river-blue));
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.25rem; padding-top: var(--space-3); padding-bottom: var(--space-3); max-width: 64rem; }
.brand { display: inline-flex; line-height: 0; padding: 6px 0; } /* clear space ~ the height of the people in the mark */
.brand img { height: 60px; width: auto; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; align-items: center; }
nav a { text-decoration: none; padding: .35rem 0; display: inline-block; min-height: 24px; font-weight: 600; }
nav a:hover { text-decoration: underline; }
nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--nrv-green); } /* non-text indicator, 3.7:1 */
nav .linklike { text-decoration: none; font-size: inherit; }
nav .linklike:hover { text-decoration: underline; }
.nav-mobile { display: none; }

/* Phones: logo plus a "Menu" disclosure (<details>, no JavaScript). The panel drops below the header. */
@media (max-width: 40rem) {
  .nav-desktop { display: none; }
  .nav-mobile { display: flex; align-items: center; gap: var(--space-2); }
  .header-inner { flex-wrap: nowrap; padding-top: var(--space-2); padding-bottom: var(--space-2); }
  .brand { min-width: 0; flex: 0 1 auto; }
  .brand img { height: auto; max-height: 48px; max-width: 100%; }
  .nav-mobile { flex: none; }
  .nav-mobile .button { white-space: nowrap; }
  .menu > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .35rem .8rem;
    border: 2px solid var(--control); border-radius: var(--radius-sm); font-weight: 600; color: var(--deep-river-blue); background: var(--white); white-space: nowrap;
  }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu > summary::before { /* three-line icon; the word "Menu" is the accessible name */
    content: ""; width: 1.1rem; height: 1.1rem; flex: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23064D83' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  .menu[open] > summary { background: var(--tint-blue); border-color: var(--deep-river-blue); }
  .menu[open] > summary::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23064D83' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  }
  .menu > nav { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--white); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-2); padding: var(--space-2) 16px var(--space-4); }
  .menu > nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .menu > nav li { border-bottom: 1px solid #E4EBE7; }
  .menu > nav li:last-child { border-bottom: 0; }
  .menu > nav a, .menu > nav .linklike { display: flex; align-items: center; min-height: 44px; width: 100%; padding: .4rem 0; font-size: 1rem; }
  .menu > nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--nrv-green); padding-left: .75rem; }
  .menu > nav form.inline { display: block; }
  .menu > nav a.button { justify-content: center; margin-top: var(--space-2); }
}

/* ---------- Home hero: full-width white band, stacked logo (tablet and up), landscape band ---------- */
.hero {
  margin: calc(-1 * var(--space-6)) calc(50% - 50vw) 0; background: var(--white); position: relative;
  border-bottom: 3px solid var(--nrv-green);
}
.hero-grid {
  max-width: 64rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) 16px var(--space-4);
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.hero-logo img { width: 100%; height: auto; display: block; }
.hero h1 { font-size: var(--step-4); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 var(--space-4); }
.hero .lead { color: var(--text); }
.hero .actions { margin-top: var(--space-5); }
.hero .more { margin: var(--space-4) 0 0; font-size: .95rem; }
.hero-art { display: block; width: 100%; height: clamp(64px, 11vw, 150px); }
@media (max-width: 40rem) {
  .hero-grid { grid-template-columns: 1fr; padding-top: var(--space-5); }
  .hero-logo { display: none; } /* the header already shows the logo on phones */
}

/* ---------- Footer: hills crest, link column, legal line ---------- */
.site-footer { position: relative; background: var(--deep-river-blue); color: #E7F0F7; font-size: .95rem; margin-top: var(--space-8); padding: var(--space-6) 0 var(--space-4); }
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: clamp(40px, 6vw, 84px); pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='%234B962E' d='M0 72C160 26 330 18 520 58s300 70 470 30 330-78 450-46v78H0z'/%3E%3Cpath fill='%23236B35' d='M0 96c200-40 380-34 600-4s420 26 560-6 230-28 280-18v52H0z'/%3E%3Cpath fill='none' stroke='%23229ED3' stroke-width='7' stroke-linecap='round' d='M760 120c-30-14 10-26 60-30s70-18 40-30'/%3E%3Cpath fill='%23064D83' d='M0 112c320-16 760 10 1440-6v14H0z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
.site-footer a { color: var(--white); }
.site-footer a:hover { color: #CDEBC1; }
.site-footer :focus-visible { outline-color: var(--white); }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-4) var(--space-6); align-items: start; max-width: 64rem; }
.footer-mark { background: var(--white); border-radius: var(--radius); padding: 6px; flex: none; }
.footer-name { color: var(--white); margin: 0 0 .25rem; font-size: 1.05rem; }
.site-footer p { margin: .25rem 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.footer-links a { display: inline-block; padding: .2rem 0; min-height: 24px; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.site-footer .footer-legal { max-width: 64rem; margin: var(--space-5) auto 0; padding: var(--space-3) 16px 0; border-top: 1px solid rgba(255, 255, 255, .18); color: #C9DCEB; font-size: var(--step--1); } /* 6.2:1 */
@media (max-width: 40rem) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------- Cards and grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); margin: var(--space-4) 0; box-shadow: var(--shadow-1); }
.card > :first-child { margin-top: .25rem; }
.card h2, .card > h3:first-child { font-size: var(--step-1); margin-top: 0; }
.grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); margin-top: var(--space-5); }
.grid > .card { margin: 0; border-top: 4px solid var(--nrv-green); }
.grid > .card:nth-child(3n+1) { border-top-color: var(--nrv-green); }
.grid > .card:nth-child(3n+2) { border-top-color: var(--river-sky-blue); }
.grid > .card:nth-child(3n) { border-top-color: var(--deep-river-blue); }
/* Whole-card link ("stretched link"): a card whose <h2> holds a link is clickable anywhere. */
.card:has(h2 > a) { position: relative; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.card h2 > a { text-decoration: none; }
.card h2 > a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card:has(h2 > a):hover { box-shadow: var(--shadow-2); border-color: #B9C9C1; }
.card:has(h2 > a):hover h2 > a { text-decoration: underline; }
.card-cue { margin: 0; color: var(--deep-river-blue); font-weight: 600; }
a.card { color: inherit; text-decoration: none; transition: box-shadow .15s ease, border-color .15s ease; }
a.card:hover { border-color: var(--brand); box-shadow: var(--shadow-2); }
@media (prefers-reduced-motion: no-preference) { .card:has(h2 > a):hover, a.card:hover { transform: translateY(-2px); } }
.card-icon { width: 48px; height: 48px; margin-bottom: var(--space-3); display: block; }
.meta { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: var(--space-2) 0 var(--space-3); list-style: none; }
.meta li { font-size: var(--step--1); color: var(--muted); background: var(--tint-head); border-radius: var(--radius-pill); padding: .1rem .65rem; max-width: 100%; } /* 6.3:1 */
.next-shift { font-weight: 600; margin-bottom: 0; }
.next-shift::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .4em; vertical-align: -.12em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23236B35' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") center/contain no-repeat; }
.shift { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); padding: var(--space-4) var(--space-5); }
.shift p { margin: 0; }
.shift .actions { margin: 0; }
.spots { display: block; font-size: var(--step--1); color: var(--muted); }
.spots meter { width: 8rem; max-width: 100%; height: .5rem; vertical-align: middle; margin-left: .4rem; }
.empty { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-4) var(--space-5); border: 1px dashed #B9C9C1; border-radius: var(--radius); color: var(--muted); background: rgba(255, 255, 255, .6); max-width: var(--measure); }
.empty p { margin: 0; }

/* ---------- Buttons ---------- */
.button, button { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 2px solid var(--brand); border-radius: var(--radius-sm); padding: .6rem 1.15rem;
  font: inherit; font-weight: 600; line-height: 1.3; cursor: pointer; text-decoration: none; min-height: 44px; box-shadow: 0 1px 0 rgba(6, 77, 131, .18);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease; }
.button:hover, button:hover { background: #053E69; border-color: #053E69; color: var(--white); box-shadow: 0 2px 6px rgba(6, 77, 131, .22); }
/* Positive alternative (Host volunteers, Sign up a minor): Forest Green outline */
.button.secondary, button.secondary { background: var(--white); color: var(--accent); border-color: var(--accent); }
.button.secondary:hover, button.secondary:hover { background: var(--ok-bg); color: var(--ok-ink); }
/* Neutral or negative choice (Cancel, Decline, Not eligible): blue text, grey border */
.button.quiet, button.quiet { background: var(--white); color: var(--deep-river-blue); border-color: var(--control); }
.button.quiet:hover, button.quiet:hover { background: var(--tint-blue); color: var(--deep-river-blue); border-color: var(--deep-river-blue); }
/* Consequential but reversible (Close household, Suspend): red outline */
.button.caution, button.caution { background: var(--white); color: var(--err-ink); border-color: var(--err-ink); }
.button.caution:hover, button.caution:hover { background: var(--err-bg); color: var(--err-ink); }
.button.danger, button.danger { background: var(--err-ink); border-color: var(--err-ink); color: var(--white); }
.button.large, button.large { padding: .85rem 1.6rem; min-height: 52px; font-size: 1.15rem; }
details { margin: var(--space-3) 0; }
details > summary { cursor: pointer; font-weight: 600; color: var(--deep-river-blue); min-height: 44px; display: flex; align-items: center; gap: var(--space-2); }
details > summary:focus-visible { outline: 3px solid var(--deep-river-blue); outline-offset: 2px; }
.button.small, button.small { padding: .3rem .8rem; min-height: 36px; font-size: .95rem; }
.linklike, .linklike:hover { background: none; border: 0; color: var(--brand); padding: 0; min-height: 24px; font-weight: 600; text-decoration: underline; box-shadow: none; }
.linklike:hover { color: var(--forest-green); }
form.inline { display: inline; }
/* Buttons never stretch to the height of a neighbouring field block (they line up with its bottom). */
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); align-items: flex-end; }
.actions > .field { margin: 0; }
@media (max-width: 30rem) { .hero .actions > .button, .actions.stack > .button, .actions.stack > button { flex: 1 1 100%; text-align: center; } }

/* ---------- Forms (docs/dev/forms.md) ---------- */
.field { margin: 1rem 0; max-width: 36rem; }
.field:has(textarea) { max-width: 46rem; }
label { display: block; font-weight: 600; margin-bottom: .25rem; color: var(--text); }
.req { color: var(--err-ink); }
.hint { color: var(--muted); font-size: .92rem; margin: 0 0 .35rem; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=datetime-local], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--control); border-radius: var(--radius-sm); background: var(--white); color: var(--text); min-height: 44px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:not([type]) { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--control); border-radius: var(--radius-sm); min-height: 44px; }
input[type=date], input[type=datetime-local] { max-width: 18rem; }
input:hover, select:hover, textarea:hover { border-color: var(--deep-river-blue); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(34, 158, 211, .25); }
input[type=checkbox], input[type=radio] { accent-color: var(--forest-green); width: 1.3rem; height: 1.3rem; }
input[type=file] { font: inherit; color: var(--muted); max-width: 100%; min-height: 44px; }
input[type=file]::file-selector-button {
  font: 600 .95rem var(--font-body); color: var(--deep-river-blue); background: var(--white);
  border: 2px solid var(--control); border-radius: var(--radius-sm); padding: .35rem .9rem; margin-right: .75rem; cursor: pointer;
}
input[type=file]::file-selector-button:hover { border-color: var(--deep-river-blue); background: var(--tint-blue); }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .75rem 0; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: .2rem; flex: none; accent-color: var(--forest-green); }
.check label { font-weight: 400; margin: 0; }
.check > div > .hint, .check > div > .field-error { margin-top: .2rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-5) var(--space-4); background: var(--white); max-width: 36rem; min-width: 0; }
legend { font-weight: 600; font-family: var(--font-head); color: var(--deep-river-blue); padding: 0 .4rem; }
/* Errors: message text in error ink (9.3:1 on white), control border thickened */
.field-error { color: var(--err-ink); font-weight: 600; margin: .25rem 0 .35rem; }
.field-error::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .35em; vertical-align: -.15em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%238A1C1C'/%3E%3Cpath d='M12 6.5v7' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='17.3' r='1.5' fill='%23fff'/%3E%3C/svg%3E") center/contain no-repeat; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border: 2px solid var(--err-ink); }
.field.has-error { padding-left: var(--space-3); border-left: 4px solid var(--err-ink); }
.error-summary { background: var(--white); border: 3px solid var(--err-ink); border-radius: var(--radius); padding: var(--space-3) var(--space-5); margin: var(--space-4) 0 var(--space-5); max-width: var(--measure); }
.error-summary :is(h2, h3, h4, h5) { color: var(--err-ink); font-size: var(--step-1); margin: 0 0 var(--space-2); }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary li::marker { color: var(--err-ink); }
.error-summary a { color: var(--err-ink); font-weight: 600; }
.error-summary:focus-visible { outline-offset: 3px; }
.sign-block { background: var(--white); border: 1px solid var(--line); border-top: 5px solid var(--forest-green);
  border-radius: var(--radius); box-shadow: var(--shadow-1); padding: var(--space-4) var(--space-5) var(--space-5); margin: var(--space-5) 0 0; max-width: none; }
.sign-block legend { font-size: var(--step-1); padding: 0; float: left; width: 100%; margin-bottom: var(--space-2); }
.sign-block legend + * { clear: both; }
.sign-block .field { margin-bottom: var(--space-2); }
.sign-block input[name=typed_name] { font-family: var(--font-head); font-size: 1.25rem; color: var(--deep-river-blue);
  border-width: 0 0 2px; border-color: var(--deep-river-blue); border-radius: 0; background: #FBFDFC; padding-left: .25rem; }

/* ---------- Notices and badges ---------- */
.notice { display: flex; gap: var(--space-3); align-items: flex-start; border: 1px solid; border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin: 1rem 0; max-width: var(--measure); }
.notice::before { content: ""; flex: none; width: 1.3rem; height: 1.3rem; margin-top: .15rem; background: center/contain no-repeat; }
.notice > p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: #A9CF98; }
.notice.ok::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23236B35'/%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.notice.info { background: var(--info-bg); color: var(--info-ink); border-color: #9ED3EC; } /* 7.9:1 */
.notice.info::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23064D83'/%3E%3Cpath d='M12 11v6' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='7.5' r='1.5' fill='%23fff'/%3E%3C/svg%3E"); }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: #E3C55E; }
.notice.warn::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L1 21h22z' fill='%236A4A00'/%3E%3Cpath d='M12 9v5' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='17.3' r='1.4' fill='%23fff'/%3E%3C/svg%3E"); }
.notice.error { background: var(--err-bg); color: var(--err-ink); border-color: #E2A3A3; }
.notice.error::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%238A1C1C'/%3E%3Cpath d='M8 8l8 8M16 8l-8 8' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.notice:focus-visible { outline-offset: 3px; }
/* Badges: sentence case (the words come from statusLabel), color is never the only cue */
.badge { display: inline-flex; align-items: center; gap: .4em; font-size: .8rem; font-weight: 600; padding: .12rem .6rem .12rem .5rem; line-height: 1.35; border-radius: var(--radius-pill);
  background: #E5ECF1; color: var(--text); vertical-align: middle; }
.badge::before { content: ""; width: .45em; height: .45em; border-radius: 50%; background: currentColor; }
h1 .badge, h2 .badge { vertical-align: .2em; }
.badge-approved, .badge-published, .badge-staff_verified, .badge-adjusted, .badge-eligible, .badge-proceed, .badge-completed, .badge-signed, .badge-active, .badge-confirmed, .badge-pass, .badge-sent, .badge-resolved { background: var(--ok-bg); color: var(--ok-ink); }
.badge-rejected, .badge-suspended, .badge-declined, .badge-escalated, .badge-disputed, .badge-ineligible, .badge-revoked, .badge-decline, .badge-fail, .badge-failed { background: var(--err-bg); color: var(--err-ink); }
.badge-cancelled, .badge-closed { background: #E5ECF1; color: var(--muted); }
.badge-pending, .badge-submitted, .badge-applied, .badge-draft, .badge-scheduled, .badge-requested, .badge-open { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- Agreements and long text ---------- */
/* Default (.prose.full): in page flow, no inner scroll box (WCAG 1.4.10). Headings carry #section-N ids. */
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5) var(--space-6); line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: var(--step-2); margin-top: var(--space-6); }
.prose h3 { font-size: var(--step-1); margin-top: var(--space-5); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-5) 0; }
.prose blockquote { border-left: 4px solid var(--border); margin: 1rem 0; padding: 0 1rem; color: var(--muted); }
.prose h2:target, .prose h3:target { background: var(--tint-blue); border-radius: 4px; }
/* Optional fixed-height variant (Markdown scroll): keyboard-scrollable region with scroll shadows. */
.prose.scroll { max-height: min(34rem, 65vh); overflow-y: auto; border-color: var(--control);
  background:
    linear-gradient(var(--white) 30%, rgba(255,255,255,0)) top / 100% 48px no-repeat local,
    linear-gradient(rgba(255,255,255,0), var(--white) 70%) bottom / 100% 48px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(6,77,131,.22), transparent) top / 100% 14px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(6,77,131,.22), transparent) bottom / 100% 14px no-repeat scroll,
    var(--white); }
.prose.risk { border-top: 5px solid #C99A00; }
.risk-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-3); }
@media (max-width: 40rem) { .prose { padding: var(--space-4); } }
/* "In plain words" summary card, shown before the full text */
.plain-summary { background: var(--tint-green); border: 1px solid #A9CF98; border-radius: var(--radius); padding: var(--space-4) var(--space-5); margin: var(--space-4) 0 var(--space-5); }
.plain-summary h2 { margin: 0 0 var(--space-2); font-size: var(--step-1); }
.plain-summary ul { margin: 0 0 var(--space-3); padding-left: 1.25rem; }
.plain-summary li { margin: .3rem 0; }
.plain-summary ul > li::marker { color: var(--forest-green); }
.plain-summary .hint { margin: 0; color: var(--text); }
.full-text-heading { font-size: var(--step-1); margin: var(--space-5) 0 var(--space-3); }

/* ---------- Tables ---------- */
/* .table-wrap (TableWrap component): a focusable, labelled scroll region for wide tables. */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); margin: var(--space-4) 0; }
.table-wrap table { margin: 0; background: transparent; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .95rem; background: var(--white); }
th, td { border-bottom: 1px solid var(--border); padding: .7rem .9rem; text-align: left; vertical-align: top; }
th { font-weight: 600; color: var(--deep-river-blue); background: var(--tint-head); font-size: var(--step--1); letter-spacing: .01em; padding: .6rem .9rem; white-space: nowrap; } /* 7.9:1 */
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #F7FAF8; }
/* Simple tables as stacked cards on phones: <table class="table-cards"> with <td data-label="Column">. */
@media (max-width: 40rem) {
  table.table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: 100%; }
  table.table-cards tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  table.table-cards tbody tr:last-child { border-bottom: 0; }
  table.table-cards td { border: 0; padding: .2rem 0; }
  table.table-cards td[data-label]::before { content: attr(data-label); display: block; font-size: var(--step--1); font-weight: 600; color: var(--muted); }
  table.table-cards tbody tr:hover td { background: none; }
  .table-wrap:has(> table.table-cards) { overflow-x: visible; }
}
.stat { font-size: 1.6rem; }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .25rem 1rem; }
dl.kv dt { font-weight: 600; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Dashboards (coordinator, account): stat tiles, pill links, checklist, stepper ---------- */
.stats { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: var(--space-5) 0; }
.stat-card { display: block; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--line); border-radius: var(--radius);
  padding: var(--space-4) var(--space-5); color: var(--text); text-decoration: none; box-shadow: var(--shadow-1); }
a.stat-card:hover { border-color: var(--deep-river-blue); color: var(--text); }
.stat-card .stat { font-size: var(--step-3); line-height: 1.1; margin: 0 0 .2rem; }
.stat-card.attention { border-top-color: #C99A00; }
.stat-card .flag { display: inline-block; font-size: var(--step--1); font-weight: 600; color: var(--warn-ink); background: var(--warn-bg); border-radius: var(--radius-pill); padding: 0 .55rem; margin-top: .35rem; } /* 7.4:1 */
.stat-card.clear .stat { color: var(--muted); }
.stat-card.total { border-top-color: var(--nrv-green); }
@media (max-width: 30rem) { .stats { grid-template-columns: 1fr 1fr; gap: var(--space-3); } .stat-card { padding: var(--space-3) var(--space-4); } }
/* Pill links: <nav class="subnav" aria-label="…"><ul><li><a aria-current="page">…</a></li></ul></nav> */
.subnav ul { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0 0 var(--space-5); }
.subnav li { max-width: none; }
.subnav a { display: inline-flex; align-items: center; min-height: 40px; padding: .3rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--white); text-decoration: none; font-weight: 600; font-size: .95rem; }
.subnav a:hover { border-color: var(--deep-river-blue); background: var(--tint-blue); color: var(--deep-river-blue); }
.subnav a[aria-current="page"] { border-color: var(--deep-river-blue); background: var(--tint-blue); box-shadow: inset 0 -3px 0 var(--nrv-green); }
.subnav .count { margin-left: .4rem; font-size: .8rem; background: var(--tint-head); border-radius: var(--radius-pill); padding: 0 .45rem; color: var(--muted); }
/* Checklist: <ol class="checklist"><li class="done|todo"><span class="visually-hidden">Done: </span>…</li></ol> */
.checklist { list-style: none; padding: 0; margin: var(--space-3) 0; }
.checklist li { position: relative; padding: .45rem 0 .45rem 2.1rem; border-bottom: 1px solid #E4EBE7; }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .55rem; width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 2px solid var(--control); background: var(--white); }
.checklist li.done::before { border-color: var(--forest-green);
  background: var(--forest-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat; }
.checklist li.todo { font-weight: 600; }
/* Workflow stepper: <section class="step done|current|ready|locked"><span class="step-n" aria-hidden="true">1</span><h2>…</h2>…</section> */
.summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4) var(--space-6); }
.summary dl.kv { margin: 0; }
.summary .actions { margin: 0; align-self: flex-start; }
.step { position: relative; padding-left: 3rem; margin-top: var(--space-6); }
.step::before { content: ""; position: absolute; left: 1rem; top: 2.4rem; bottom: -2rem; width: 2px; background: var(--line); }
.step:last-of-type::before { display: none; }
.step > h2 { margin-top: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.step-n { position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center;
  font: 700 1rem var(--font-head); background: var(--deep-river-blue); color: var(--white); }
.step.done .step-n { background: var(--forest-green); }
.step.locked .step-n { background: #E5ECF1; color: var(--muted); } /* 5.9:1 */
.step.locked > h2, .step.locked > p { color: var(--muted); }

/* Numbered "what happens next" lists (public pages, resident thank-you, household stepper). */
ol.steps { list-style: none; counter-reset: step; padding-left: 0; margin: var(--space-4) 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 3rem; margin-bottom: var(--space-4); min-height: 2.1rem; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  display: grid; place-items: center; font: 700 1rem var(--font-head); background: var(--deep-river-blue); color: var(--white); }
#next-step { border-left-width: 6px; }
.step details { margin-top: var(--space-3); border: 1px solid var(--line); border-radius: 8px; padding: var(--space-2) var(--space-3); background: var(--white); }
.step details > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.step details[open] > summary { margin-bottom: var(--space-2); }

/* Cookie consent banner (src/views/layout.tsx). Not a modal: it never takes or traps focus.
   Larger screens: fixed to the bottom; the page reserves its height (--consent-h, measured by
   analytics.js through the CSSOM, which the CSP allows; the fallbacks cover no-JS) so it can't hide
   the end of the page, and scroll padding keeps focused elements clear of it (WCAG 2.4.11).
   Narrow or short screens: normal document flow above the footer, covering nothing (WCAG 1.4.10).
   Text is body ink on white; the brand greens and sky blue are never used for text. */
html.has-consent-banner { --consent-fallback: 6.5rem; scroll-padding-bottom: calc(var(--consent-h, var(--consent-fallback)) + 1rem); }
html.has-consent-banner body { padding-bottom: var(--consent-h, var(--consent-fallback)); }
.consent-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--white); color: var(--text);
  border-top: 4px solid var(--deep-river-blue); box-shadow: 0 -4px 18px rgba(6, 77, 131, .14); }
.consent-inner { max-width: 64rem; margin: 0 auto; padding: .75rem 16px; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem; }
.consent-inner p { margin: 0; flex: 1 1 18rem; min-width: 0; overflow-wrap: anywhere; }
/* Both choices: same size, same style, same weight. Side by side when they fit. */
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; flex: 0 1 20rem; }
.consent-actions button { min-height: 44px; margin: 0; padding: .45rem .75rem; font-size: .95rem; line-height: 1.3; }
.card .consent-actions { max-width: 22rem; margin: .5rem 0 1rem; }
@media (max-width: 46rem) { html.has-consent-banner { --consent-fallback: 8.5rem; } .consent-actions { flex-basis: 100%; } }
@media (max-width: 30rem), (max-height: 500px) {
  html.has-consent-banner { scroll-padding-bottom: 0; }
  html.has-consent-banner body { padding-bottom: 0; }
  .consent-banner { position: static; box-shadow: none; border-bottom: 1px solid var(--border); }
  .consent-banner + .site-footer { margin-top: 0; }
}
@media (max-width: 20rem) { .consent-actions { grid-template-columns: 1fr; } }
/* The footer crest sits above the footer; in flow, the banner sits right before it, so leave room. */
@media (max-width: 30rem), (max-height: 500px) { .consent-banner + .site-footer { margin-top: clamp(40px, 6vw, 84px); } }

/* ---------- Printable timesheets (letterhead on screen and paper) ---------- */
.sheet { background: #fff; color: #111; max-width: 8.5in; margin: var(--space-4) auto; padding: clamp(1rem, 6vw, .75in) clamp(1rem, 5vw, .7in); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-2); font-size: .95rem; }
.sheet-logo { display: block; height: auto; max-height: 64px; width: auto; max-width: 100%; margin: 0 0 .75rem; }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; padding-bottom: .6rem; border-bottom: 3px solid var(--deep-river-blue); position: relative; margin-bottom: 1.25rem; }
.sheet-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; border-bottom: 2px solid var(--nrv-green); }
.sheet-head .sheet-logo { margin: 0; }
.sheet-docmeta { text-align: right; font-size: .85rem; color: var(--muted); line-height: 1.4; }
.sheet h1 { font-size: 1.35rem; margin: 0 0 .25rem; }
.sheet-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: start; margin: 1rem 0; }
.sheet-total { border: 2px solid var(--deep-river-blue); border-radius: 8px; padding: .5rem 1rem; text-align: center; min-width: 9rem; }
.sheet-total strong { display: block; font: 700 1.9rem/1.1 var(--font-head); color: var(--deep-river-blue); }
.sheet-total span { font-size: .8rem; color: var(--muted); }
.sheet .table-wrap { box-shadow: none; border-radius: 0; border: 0; }
.sheet th { background: none; border-bottom: 2px solid var(--deep-river-blue); }
.sheet tbody tr:hover td { background: none; }
.sheet-verify { border: 1px dashed var(--control); border-radius: 8px; padding: .75rem 1rem; margin-top: 1.25rem; break-inside: avoid; display: flex; gap: 1rem; align-items: center; }
.sheet-verify .qr { flex: none; width: 8.25rem; height: auto; }
@media (max-width: 30rem) { .sheet-verify { flex-direction: column; align-items: flex-start; } }
.sheet-verify code, .sheet code { font-size: .78rem; overflow-wrap: anywhere; word-break: break-all; }
@media (max-width: 30rem) { .sheet-summary { grid-template-columns: 1fr; } .sheet-docmeta { text-align: left; } }
@page { size: letter; margin: .6in .65in .7in; }

@media print {
  html { font-size: 10.5pt; } /* rem sizes follow the 10.5pt print base */
  body { background: #fff; font-size: 1rem; line-height: 1.45; display: block; }
  .site-header, .site-footer, .no-print, .skip, .consent-banner { display: none !important; }
  html.has-consent-banner body { padding-bottom: 0; }
  main.wrap { padding: 0; }
  .sheet { max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; font-size: 1rem; }
  .sheet table { font-size: .92rem; }
  .sheet tr { break-inside: avoid; }
  .sheet thead { display: table-header-group; }
  .sheet a { color: inherit; text-decoration: none; }
  .site-footer::before { display: none; }
  .table-wrap { overflow: visible; box-shadow: none; }
  .prose { border: 0; padding: 0; }
}
@media (max-width: 30rem) {
  dl.kv { grid-template-columns: minmax(0, 1fr); }
  dl.kv dd { margin-bottom: .4rem; }
}
