/* =============================================================================
   CivicStake — "Ledger" design system (editorial / documentary)
   Deep-navy canvas, brand teal as the one interactive accent, brand yellow as a
   sparing highlight. Newsreader (serif headlines) over Public Sans (UI/body);
   the wordmark is set in Montserrat to match the logo. All fonts are self-hosted. Pico 2 is the base; this
   file owns the token layer, base elements, layout rhythm and shared
   components. Page-specific styles live in editorial.css, data.css and
   forms.css; motion in motion.css.

   Layers (in order):
     1. primitives   raw palette — never used directly in components
     2. semantic     --color-*, --space-*, --text-*, --radius-*, --shadow-*,
                     --z-*, --dur-* / --ease-*  (use these)
     3. Pico mapping Pico variables pointed at the semantic layer
     4. base → layout → header → components → footer → utilities
   ========================================================================== */

/* ---- 0. fonts (self-hosted, OFL — licences in css/fonts/) ---------------- */
@font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/newsreader-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/newsreader-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Public Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/public-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Public Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/public-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {  /* variable glyph subset: wordmark + tagline only */
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/montserrat-wordmark.woff2") format("woff2");
}

/* ---- 1. primitives ------------------------------------------------------ */
:root {
    /* navy (dark → light) */
    --navy-1000: #070c14;
    --navy-950:  #0a111c;
    --navy-900:  #0f1826;
    --navy-850:  #142032;
    --navy-800:  #1b2a40;
    --navy-700:  #24364f;
    --navy-600:  #30445f;
    /* slate ink */
    --slate-500: #7f8ea2;
    --slate-400: #9aa8ba;
    --slate-200: #cdd6e1;
    --slate-100: #e8edf3;
    /* brand teal (logo #13897d; lightened for text on navy) */
    --teal-300:  #4fd1c0;
    --teal-400:  #2bb3a3;
    --teal-600:  #107d71;
    --teal-700:  #0e7469;
    --teal-950:  #03211d;
    /* brand yellow */
    --yellow-400: #f5c518;
    --yellow-950: #1a1400;
    /* support hues (semantic states only, kept apart from teal/yellow) */
    --green-400:  #7bc96f;
    --orange-400: #f29a4a;
    --red-400:    #f08a80;
    --blue-800:   #1d3557;
    --blue-100:   #d6e4f5;

    --navy-a04: rgba(148, 178, 214, 0.05);
    --navy-a12: rgba(148, 178, 214, 0.12);
    --navy-a22: rgba(148, 178, 214, 0.22);
}

/* ---- 2. semantic tokens ------------------------------------------------- */
:root {
    /* color: surfaces (elevation = lighter surface, not shadow) */
    --color-bg:            var(--navy-950);   /* page canvas */
    --color-bg-sunken:     var(--navy-1000);  /* footer */
    --color-surface-1:     var(--navy-900);   /* cards, tinted bands */
    --color-surface-2:     var(--navy-850);   /* card headers, raised */
    --color-surface-3:     var(--navy-800);   /* hover / pressed */
    /* color: ink (contrast on bg / surface-2) */
    --color-text:          var(--slate-100);  /* 16 / 13.9 */
    --color-text-prose:    var(--slate-200);  /* 12.9 / 11.2  long-form body */
    --color-text-muted:    var(--slate-400);  /* 7.8 / 6.8 */
    --color-text-faint:    var(--slate-500);  /* 5.7 / 4.9  captions, meta */
    /* color: lines */
    --color-border:        var(--navy-a12);
    --color-border-strong: var(--navy-a22);
    --color-border-solid:  var(--navy-700);   /* form controls */
    --color-border-hover:  var(--navy-600);
    /* color: accent = brand teal (links, primary actions, active nav, focus) */
    --color-accent:          var(--teal-400);  /* text/links, 7.3:1 */
    --color-accent-hover:    var(--teal-300);
    --color-accent-fill:     var(--teal-600);  /* button fill; white text 5.0:1 */
    --color-accent-fill-hover: var(--teal-700);
    --color-on-accent:       #ffffff;
    --color-accent-ink:      var(--teal-950);  /* text on a LIGHT teal (--color-accent) fill, 6.5:1 */
    --color-accent-soft:     color-mix(in srgb, var(--teal-400) 14%, transparent);
    --color-accent-line:     color-mix(in srgb, var(--teal-400) 45%, transparent);
    --color-focus:           var(--teal-300);
    --color-selection:       color-mix(in srgb, var(--teal-400) 35%, transparent);
    /* color: highlight = brand yellow — kickers, key figures, small markers only */
    --color-highlight:       var(--yellow-400); /* 11.6:1 */
    --color-highlight-ink:   var(--yellow-950);
    /* color: states */
    --color-success:       var(--green-400);
    --color-success-soft:  color-mix(in srgb, var(--green-400) 14%, transparent);
    --color-warn:          var(--orange-400);
    --color-warn-soft:     color-mix(in srgb, var(--orange-400) 14%, transparent);
    --color-danger:        var(--red-400);
    --color-danger-soft:   color-mix(in srgb, var(--red-400) 14%, transparent);
    --color-info-bg:       var(--blue-800);   /* sector badges, 9.6:1 */

    /* data palette — the ONLY place series colours live (chartlib + globe read these).
       Colour-blind checked (worst simulated ΔE 16) and kept clear of brand teal/yellow. */
    --series-1: #5b8be0;   /* Education */
    --series-2: #d9773f;   /* Healthcare */
    --series-3: #c678b5;
    --series-4: #8fbf6a;
    --chart-grid: #22324a;
    --color-info-text:     var(--blue-100);

    /* type */
    --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --font-brand: "Montserrat", "Public Sans", sans-serif;   /* wordmark + tagline only */
    --font-sans:  "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                  Helvetica, Arial, sans-serif;
    --text-xs:   0.75rem;                                      /* 12  micro labels, badges */
    --text-sm:   0.875rem;                                     /* 14  meta, nav, tables */
    --text-base: 1rem;                                         /* 16–17 body */
    --text-md:   clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);    /* lede */
    --text-lg:   clamp(1.1875rem, 1.05rem + 0.55vw, 1.375rem); /* h3, card titles */
    --text-xl:   clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);      /* h2 */
    --text-2xl:  clamp(1.875rem, 1.4rem + 2vw, 2.75rem);       /* h1 */
    --text-3xl:  clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);      /* hero display */
    --leading-tight:   1.1;
    --leading-snug:    1.25;
    --leading-normal:  1.55;
    --leading-relaxed: 1.7;
    --tracking-caps:   0.06em;   /* every uppercase data label */

    /* spacing: 4px base */
    --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
    --sp-5: 1.25rem;  --sp-6: 1.5rem;   --sp-8: 2rem;     --sp-10: 2.5rem;
    --sp-12: 3rem;    --sp-16: 4rem;    --sp-20: 5rem;    --sp-24: 6rem;
    /* section rhythm (fluid) */
    --space-page-top:   clamp(1.5rem, 0.75rem + 3vw, 3rem);   /* main → first block */
    --space-section:    clamp(3rem, 1.75rem + 4.5vw, 5rem);   /* .band padding-block */
    --space-section-sm: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); /* footer, compact bands */
    --space-stack:      var(--sp-8);                          /* section head → content */

    /* layout */
    --gutter:         clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
    --measure:        40rem;   /* prose */
    --measure-wide:   68rem;   /* section content */
    --container-max:  calc(var(--measure-wide) + 2 * var(--gutter)); /* header/footer edges align with .wrap */
    --masthead-h:     4rem;
    --target:         2.75rem; /* 44px minimum touch target */
    /* height of a Pico text input/select (same formula Pico uses), for buttons that sit beside them */
    --control-h: calc(1rem * var(--pico-line-height) + 2 * var(--pico-form-element-spacing-vertical) + 2 * var(--pico-border-width));
    --stat-value-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem);

    /* radii — 0 is a deliberate "ledger edge" (stat cards, figures) */
    --radius-0: 0;
    --radius-sm: 4px;   /* controls, badges */
    --radius-md: 6px;   /* cards */
    --radius-lg: 6px;   /* overlays — radii are capped at 6px (credibility rule) */
    --radius-full: 999px;

    /* elevation (dark UI: pair with a lighter surface) */
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-3: 0 6px 16px rgba(0, 0, 0, 0.4);  /* floating overlays only; prefer borders */

    /* z-index */
    --z-raised: 10;
    --z-panel: 40;
    --z-sticky: 50;
    --z-overlay: 80;
    --z-skip: 100;

    /* motion */
    --dur-fast: 120ms;
    --dur-base: 200ms;
    --dur-slow: 300ms;   /* entrances — nothing longer (credibility rule) */
    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}
/* aliases for the names used in UX_SPEC.md — identical values; prefer the canonical names above */
:root {
    --ink: var(--color-bg);
    --surface: var(--color-surface-1);
    --surface-2: var(--color-surface-2);
    --line: var(--color-border);
    --line-strong: var(--color-border-strong);
    --text: var(--color-text);
    --text-muted: var(--color-text-muted);
    --text-faint: var(--color-text-faint);
    --accent: var(--color-accent);
    --accent-hover: var(--color-accent-hover);
    --accent-ink: var(--color-accent-ink);
    --accent-soft: var(--color-accent-soft);
    --highlight: var(--color-highlight);
    --ok: var(--color-success);
    --warn: var(--color-warn);
    --bad: var(--color-danger);
    --header-h: var(--masthead-h);
    --fs-xs: var(--text-xs);
    --fs-sm: var(--text-sm);
    --fs-base: var(--text-base);
    --fs-lg: var(--text-md);
    --fs-h3: var(--text-lg);
    --fs-h2: var(--text-xl);
    --fs-h1: var(--text-2xl);
    --dur-1: var(--dur-fast);
    --dur-2: var(--dur-base);
    --dur-3: var(--dur-slow);
}

@media (max-width: 767px) {
    :root { --masthead-h: 3.5rem; }
}
@media (pointer: fine) {
    :root { --target: 2rem; } /* mouse users: denser lists; buttons keep their own height */
}

/* ---- 3. Pico mapping (forced dark theme on every page) ------------------ */
:root { --pico-font-size: 100%; }
@media (min-width: 1024px) { :root { --pico-font-size: 106.25%; } } /* 17px body on desktop */

[data-theme="dark"] {
    --pico-background-color: var(--color-bg);
    --pico-color: var(--color-text);
    --pico-text-selection-color: var(--color-selection);
    --pico-muted-color: var(--color-text-muted);
    --pico-muted-border-color: var(--color-border);
    --pico-h1-color: var(--color-text);
    --pico-h2-color: var(--color-text);
    --pico-h3-color: var(--color-text);
    --pico-h4-color: var(--color-text);
    --pico-h5-color: var(--color-text-muted);
    --pico-h6-color: var(--color-text-muted);
    --pico-font-family: var(--font-sans);
    --pico-font-family-sans-serif: var(--font-sans);
    --pico-line-height: var(--leading-normal);
    --pico-border-radius: var(--radius-sm);
    --pico-transition: var(--dur-fast) ease;
    --pico-spacing: var(--sp-4);
    --pico-block-spacing-vertical: var(--sp-6);
    --pico-block-spacing-horizontal: var(--sp-6);
    --pico-text-underline-offset: 0.2em;

    --pico-primary: var(--color-accent);
    --pico-primary-background: var(--color-accent-fill);
    --pico-primary-border: var(--color-accent-fill);
    --pico-primary-underline: var(--color-accent-line);
    --pico-primary-hover: var(--color-accent-hover);
    --pico-primary-hover-background: var(--color-accent-fill-hover);
    --pico-primary-hover-border: var(--color-accent);
    --pico-primary-hover-underline: var(--color-accent-hover);
    --pico-primary-focus: transparent; /* focus is drawn by the outline ring below */
    --pico-primary-inverse: var(--color-on-accent);

    --pico-secondary: var(--color-text-muted);
    --pico-secondary-background: var(--color-surface-3);
    --pico-secondary-border: var(--color-border-strong);
    --pico-secondary-underline: var(--color-border-strong);
    --pico-secondary-hover: var(--color-text);
    --pico-secondary-hover-background: var(--color-border-solid);
    --pico-secondary-hover-border: var(--color-border-hover);
    --pico-secondary-focus: transparent;
    --pico-secondary-inverse: var(--color-text);
    --pico-contrast-focus: transparent;

    --pico-card-background-color: var(--color-surface-1);
    --pico-card-sectioning-background-color: var(--color-surface-2);
    --pico-card-border-color: var(--color-border);
    --pico-card-box-shadow: none;
    --pico-dropdown-background-color: var(--color-surface-2);
    --pico-dropdown-border-color: var(--color-border-strong);
    --pico-dropdown-hover-background-color: var(--color-surface-3);

    --pico-table-border-color: var(--color-border);
    --pico-table-row-stripped-background-color: var(--navy-a04);
    --pico-ins-color: var(--color-success);
    --pico-del-color: var(--color-danger);
    --pico-mark-background-color: var(--color-accent-soft);
    --pico-mark-color: var(--color-text);
    --pico-code-background-color: var(--color-surface-2);
    --pico-code-color: var(--color-text-prose);
    --pico-accordion-border-color: var(--color-border);
    --pico-accordion-active-summary-color: var(--color-accent-hover);
    --pico-accordion-open-summary-color: var(--color-text);

    --pico-form-element-background-color: var(--color-surface-1);
    --pico-form-element-selected-background-color: var(--color-surface-3);
    --pico-form-element-border-color: var(--color-border-solid);
    --pico-form-element-color: var(--color-text);
    --pico-form-element-placeholder-color: var(--color-text-faint);
    --pico-form-element-active-background-color: var(--color-surface-2);
    --pico-form-element-active-border-color: var(--color-accent);
    --pico-form-element-focus-color: var(--color-accent-line);
    --pico-form-element-invalid-border-color: var(--color-danger);
    --pico-form-element-invalid-active-border-color: var(--color-danger);
    --pico-form-element-invalid-focus-color: var(--color-danger-soft);
    --pico-form-element-valid-border-color: var(--color-success);
    --pico-form-element-valid-active-border-color: var(--color-success);
    --pico-form-element-valid-focus-color: var(--color-success-soft);
    --pico-switch-checked-background-color: var(--color-accent-fill);
    --pico-range-thumb-active-color: var(--color-accent);
    --pico-progress-color: var(--color-accent);
}

/* ---- 4. base ------------------------------------------------------------ */
html {
    scrollbar-color: var(--color-border-hover) var(--color-bg);
    scroll-padding-top: calc(var(--masthead-h) + var(--sp-4)); /* anchors clear the sticky header */
}
body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern", "liga";
}
::selection { background: var(--color-selection); color: var(--color-text); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--color-border-solid);
    border: 3px solid var(--color-bg);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-border-hover); }

/* typography */
h1, h2, h3, .display {
    font-family: var(--font-serif);
    font-weight: 600;
    font-optical-sizing: auto;
    letter-spacing: -0.012em;
    line-height: var(--leading-snug);
    text-wrap: balance;
}
h1 { font-size: var(--text-2xl); line-height: var(--leading-tight); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4, h5, h6 { font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }
h4 { font-size: var(--text-base); }
h5, h6 { font-size: var(--text-sm); }

p { line-height: var(--leading-relaxed); text-wrap: pretty; }
small { font-size: var(--text-sm); }
strong, b { font-weight: 650; }

/* links: underline is quiet until hover */
:where(a:not([role="button"])) {
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    text-decoration-color: var(--color-accent-line);
}
:where(a:not([role="button"])):hover { text-decoration-color: currentColor; }

.eyebrow, .kicker {
    display: block;
    margin: 0 0 var(--sp-3);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: var(--leading-snug);
    letter-spacing: 0.01em;
    color: var(--color-highlight);
}

.lede {
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    color: var(--color-text-muted);
    max-width: var(--measure);
}

.prose { max-width: var(--measure); }
.prose p, .prose li { color: var(--color-text-prose); }
.prose p { margin-bottom: var(--sp-6); }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: var(--sp-5); margin-bottom: var(--sp-6); }
.prose li { margin-bottom: var(--sp-3); line-height: var(--leading-relaxed); }
.prose li::marker { color: var(--color-accent); }

.num, td.num, th.num {
    font-variant-numeric: tabular-nums lining-nums;
    text-align: right;
}

/* Pico lays every <nav> out as a space-between bar with negative list margins and
   padded <li>s. Reset that so any nav (breadcrumbs, tabs, link rows) starts flush left. */
nav { justify-content: flex-start; }
nav ol:first-of-type, nav ul:first-of-type, nav ol:last-of-type, nav ul:last-of-type { margin-inline: 0; }
nav li { padding: 0; }

/* ---- focus (a11y) ------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
summary:focus-visible, [tabindex]:focus-visible, .sector-chip:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    box-shadow: none;
}
/* form fields show Pico's teal border + soft ring instead of an outline */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

.skip-link {
    position: absolute; left: var(--sp-2); top: var(--sp-2);
    z-index: var(--z-skip);
    transform: translateY(-200%);
    background: var(--color-accent-fill); color: var(--color-on-accent);
    padding: var(--sp-3) var(--sp-4);
    font-weight: 700; text-decoration: none;
    border-radius: var(--radius-sm);
}
.skip-link:focus { transform: none; }

/* ---- layout ------------------------------------------------------------- */
.container {
    max-width: var(--container-max);
    padding-inline: var(--gutter);
}

body > main {
    flex: 1 0 auto;
    padding-block: var(--space-page-top) var(--space-section);
}
/* a page that ends on a band lets the band's own padding meet the footer */
body > main:has(> .band:last-child) { padding-bottom: 0; }
main > section { margin-bottom: 0; }

.wrap { max-width: var(--measure-wide); margin-inline: auto; }
.wrap-prose { max-width: var(--measure); margin-inline: auto; }

/* Bands: the vertical rhythm unit. Adjacent plain bands share a hairline;
   .band-tint paints a full-bleed surface without causing horizontal scroll. */
.band {
    padding-block: var(--space-section);
    border-top: 1px solid var(--color-border);
}
.band:first-child, .band-tint, .band--tint, .band-tint + .band, .band--tint + .band { border-top: 0; }
.band-tint, .band--tint {
    background: var(--color-surface-1);
    box-shadow: 0 0 0 100vmax var(--color-surface-1);
    clip-path: inset(0 -100vmax);
}
.band-sm { padding-block: var(--space-section-sm); }

.section-head { margin-bottom: var(--space-stack); }
.section-head h1, .section-head h2 { margin: 0; }
.section-head p:not(.eyebrow, .kicker) {
    color: var(--color-text-muted);
    margin: var(--sp-3) 0 0;
    max-width: var(--measure);
}
.section-head .eyebrow { margin-bottom: var(--sp-3); }

/* page header: kicker (or breadcrumb) → h1 → dek → actions; first block on non-hero pages */
.page-head {
    max-width: var(--measure-wide);
    margin-inline: auto;
    padding-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}
.page-head h1 { margin: 0; }
.page-head .page-dek {
    margin: var(--sp-3) 0 0;
    max-width: var(--measure);
    font-size: var(--text-md);
    line-height: var(--leading-normal);
    color: var(--color-text-muted);
}
.page-head .page-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
/* breadcrumb kicker on data pages: navigation, so muted + teal links, not yellow */
nav.kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: var(--sp-2);
    color: var(--color-text-muted);
}
nav.kicker a { display: inline-flex; align-items: center; min-height: 1.5rem; color: var(--color-accent); }

/* ---- masthead ----------------------------------------------------------- */
body > header.masthead {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    padding-block: 0;
    margin: 0;
    background: color-mix(in srgb, var(--color-bg) 80%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur-base) ease, background-color var(--dur-base) ease;
}
html:not(.js) body > header.masthead,
body > header.masthead.is-scrolled,
body > header.masthead[data-open] {
    border-bottom-color: var(--color-border);
    background: color-mix(in srgb, var(--color-bg) 92%, transparent);
}
.masthead-row {
    display: flex;
    align-items: center;
    gap: var(--sp-4) var(--sp-8);
    min-height: var(--masthead-h);
}
/* brand lockup: logo mark + live-text wordmark ("Civic" regular, "Stake" bold) */
.wordmark {
    font-family: var(--font-brand);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--color-text);
}
.wordmark b { font-weight: 700; }
.masthead .brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: var(--target);
    font-size: 1.25rem;
    text-decoration: none;
    flex-shrink: 0;
}
.masthead .brand-mark { height: 2rem; width: auto; flex-shrink: 0; }

.masthead-menu {
    display: flex;
    align-items: center;
    flex: 1;
    gap: var(--sp-6);
    min-width: 0;
}
.masthead-menu > nav { flex: 1; min-width: 0; }
.masthead nav ul.masthead-links {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1);
    margin: 0;
    padding: 0;
}
.masthead-links li { padding: 0; }
.masthead-links li::before { content: none; } /* Pico's zero-width-space float */
.masthead-links li a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin: 0;
    padding: 0 var(--sp-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.005em;
    color: var(--color-text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.masthead-links li a::after {
    content: "";
    position: absolute;
    left: var(--sp-3);
    right: var(--sp-3);
    bottom: 0.45rem;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-base) var(--ease-out);
}
.masthead-links li a:hover { color: var(--color-text); text-decoration: none; }
.masthead-links li a.active { color: var(--color-text); }
.masthead-links li a.active::after { transform: scaleX(1); }

.masthead-auth {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-shrink: 0;
}
.masthead-auth form { margin: 0; }

.user-menu { display: flex; align-items: center; gap: var(--sp-3); }
.user-avatar {
    width: 1.75rem; height: 1.75rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--color-border-strong);
}
.user-avatar-placeholder {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-surface-3); color: var(--color-text-muted);
}
.user-name {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-menu .link-button {
    display: inline-flex; align-items: center;
    min-height: 2.75rem;
    font-size: var(--text-sm);
}

/* hamburger: hidden on wide screens and when JS is off */
.nav-toggle { display: none; }

@media (max-width: 1099px) {
    .masthead-row { gap: var(--sp-4) var(--sp-5); }
    .user-name { display: none; } /* admins carry 7 links; keep the bar on one line */
}

@media (max-width: 899px) {
    /* no-JS fallback: brand + auth on the first row, links wrap underneath */
    html:not(.js) .masthead-row { flex-wrap: wrap; padding-block: var(--sp-2); }
    html:not(.js) .masthead-menu { order: 3; flex-basis: 100%; }
    html:not(.js) .masthead nav ul.masthead-links { flex-wrap: wrap; }

    .js .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--sp-2);
        margin: 0;
        width: auto;
        min-width: 2.75rem;
        height: 2.75rem;
        padding: 0 var(--sp-3);
        border: 1px solid var(--color-border-strong);
        border-radius: var(--radius-sm);
        background: transparent;
        color: var(--color-text);
        font-size: var(--text-sm);
        font-weight: 600;
    }
    .js .nav-toggle:hover { background: var(--color-surface-2); border-color: var(--color-border-hover); }
    .nav-toggle-bars,
    .nav-toggle-bars::before,
    .nav-toggle-bars::after {
        display: block;
        width: 1.125rem;
        height: 2px;
        border-radius: 1px;
        background: currentColor;
        transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast) ease;
    }
    .nav-toggle-bars { position: relative; }
    .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
    .nav-toggle-bars::before { top: -6px; }
    .nav-toggle-bars::after { top: 6px; }
    [data-open] .nav-toggle-bars { background: transparent; }
    [data-open] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
    [data-open] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

    .js .masthead-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100dvh - var(--masthead-h));
        overflow-y: auto;
        padding: var(--sp-2) var(--gutter) var(--sp-4);
        background: var(--color-surface-2);   /* raised: reads as a panel over the page */
        border-block: 1px solid var(--color-border-strong);
        box-shadow: var(--shadow-3);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-0.5rem);
        transition: opacity 140ms var(--ease-in),
                    transform 140ms var(--ease-in),
                    visibility 0s linear 140ms;
    }
    .js [data-open] .masthead-menu {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition: opacity var(--dur-base) var(--ease-out),
                    transform var(--dur-base) var(--ease-out),
                    visibility 0s;
    }
    .js .masthead nav ul.masthead-links { flex-direction: column; align-items: stretch; gap: 0; }
    .js .masthead-links li { border-bottom: 1px solid var(--color-border); }
    .js .masthead-links li:last-child { border-bottom: 0; }
    .js .masthead-links li a {
        display: flex;
        min-height: 3rem;
        padding: 0;   /* text aligns with the logo's left edge */
        font-size: var(--text-base);
    }
    .js .masthead-links li a::after {
        left: calc(var(--sp-3) * -1); right: auto; top: var(--sp-3); bottom: var(--sp-3);
        width: 2px; height: auto;
        transform: scaleY(0);
        transform-origin: top;
    }
    .js .masthead-links li a.active::after { transform: scaleY(1); }
}
@media (max-width: 479px) {
    .masthead-row { gap: var(--sp-3); }
    .js .nav-toggle { padding: 0; }
    .nav-toggle-label {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0 0 0 0); white-space: nowrap;
    }
    .masthead .brand { font-size: 1.125rem; }
    .masthead .brand-mark { height: 1.75rem; }
}

/* ---- buttons ------------------------------------------------------------ */
/* Primary (teal fill, white text): Pico button / a[role=button] / .cta
   Secondary (neutral fill): .secondary
   Ghost (outlined): .outline / .cta-ghost
   Small: .btn--sm (36px visual, 44px hit area)
   Class-based (any element): .btn (primary) · .btn--ghost · .btn--sm */
button, [role="button"], [type="submit"], [type="button"], [type="reset"] {
    --pico-font-weight: 600;
    min-height: 2.75rem;
    padding: 0 var(--sp-5);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    letter-spacing: 0.01em;
    line-height: 1.2;
    transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease,
                color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
a[role="button"] { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); }
button:active:not(:disabled), [role="button"]:active { transform: translateY(1px); }
button:disabled, [role="button"][aria-disabled="true"], button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}
.outline, [role="button"].outline, button.outline {
    --pico-background-color: transparent;
    --pico-color: var(--color-accent);
    --pico-border-color: var(--color-accent-line);
}
.outline:is(:hover, :active):not(:disabled) {
    --pico-background-color: var(--color-accent-soft);
    --pico-color: var(--color-accent-hover);
    --pico-border-color: var(--color-accent);
}
.secondary.outline {
    --pico-color: var(--color-text);
    --pico-border-color: var(--color-border-strong);
}
.secondary.outline:is(:hover, :active):not(:disabled) {
    --pico-background-color: var(--color-surface-2);
    --pico-color: var(--color-text);
    --pico-border-color: var(--color-border-hover);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    width: auto;
    min-height: 2.75rem;
    padding: 0 var(--sp-5);
    border: 1px solid var(--color-accent-fill);
    border-radius: var(--radius-sm);
    background: var(--color-accent-fill);
    color: var(--color-on-accent);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease,
                color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.btn:hover { background: var(--color-accent-fill-hover); border-color: var(--color-accent); color: var(--color-on-accent); }
.btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border-strong); }
.btn--ghost:hover { background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-text); }
.btn:active { transform: translateY(1px); }
.btn--sm {
    position: relative;
    min-height: 2.25rem;
    padding: 0 var(--sp-4);
    font-size: var(--text-sm);
}
.btn--sm::before { content: ""; position: absolute; inset: -0.25rem 0; } /* 44px hit area */
/* sits beside inputs/selects at exactly their height (filter rows) */
.btn--field, button.btn--field, [role="button"].btn--field {
    height: var(--control-h);
    min-height: var(--control-h);
    width: auto;
    margin-bottom: 0;
    padding: 0 var(--sp-6);
    align-self: end;
}

/* touch: every button reaches 44px; desktop sizes are unchanged */
@media (pointer: coarse) {
    button, [role="button"], [type="submit"], [type="button"], [type="reset"], .btn, .btn--sm, .link-button {
        min-height: 2.75rem;
    }
}

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

a.cta, a.cta-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 3rem;
    padding: 0 var(--sp-6);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    font-weight: 600;
    letter-spacing: 0.005em;
    text-decoration: none;
    transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease,
                color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
a.cta {
    background: var(--color-accent-fill);
    color: var(--color-on-accent);
    border: 1px solid var(--color-accent-fill);
}
a.cta:hover { background: var(--color-accent-fill-hover); border-color: var(--color-accent); color: var(--color-on-accent); }
a.cta-ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border-strong);
}
a.cta-ghost:hover { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-text); }
a.cta:active, a.cta-ghost:active { transform: translateY(1px); }

.link-button {
    all: unset;
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    cursor: pointer;
    color: var(--color-text-muted);
    text-decoration: underline;
    text-decoration-color: var(--color-border-strong);
    text-underline-offset: 0.2em;
    font-size: var(--text-sm);
}
.link-button:hover { color: var(--color-text); text-decoration-color: currentColor; }

/* ---- hero --------------------------------------------------------------- */
.hero { padding-block: clamp(var(--sp-4), 4vw, var(--sp-12)) var(--space-section); }
.hero h1 { font-size: var(--text-3xl); font-weight: 500; max-width: 18ch; margin-bottom: var(--sp-6); letter-spacing: -0.02em; }
.hero .lede { margin-bottom: var(--sp-8); }
.hero .provenance {
    margin-top: var(--sp-8);
    font-size: var(--text-sm);
    color: var(--color-text-faint);
    max-width: var(--measure);
    line-height: var(--leading-normal);
}

/* editorial pull-quote */
.pull {
    border-left: 3px solid var(--color-highlight);
    padding: var(--sp-2) 0 var(--sp-2) var(--sp-6);
    margin: 0;
    max-width: 48rem;
}
.pull p {
    font-family: var(--font-serif);
    font-size: clamp(1.375rem, 1.1rem + 1.1vw, 1.875rem);
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--color-text);
    margin: 0;
}
.pull cite {
    display: block;
    margin-top: var(--sp-4);
    font-family: var(--font-sans);
    font-style: normal;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}
.pull cite a { color: var(--color-text-muted); }

/* ---- editorial figures --------------------------------------------------- */
.figure { margin: 0; }
.figure-lede { max-width: var(--measure-wide); margin-inline: auto; }
.figure img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--color-border);
    border-top: 2px solid var(--color-accent);
    border-radius: var(--radius-0);
    background: var(--color-surface-2); /* placeholder while loading */
    filter: grayscale(0.6) brightness(0.82) contrast(1.05);
}
.figure figcaption {
    margin-top: var(--sp-3);
    font-size: var(--text-xs);
    line-height: var(--leading-normal);
    color: var(--color-text-faint);
    display: flex;
    justify-content: space-between;
    gap: var(--sp-2) var(--sp-6);
    flex-wrap: wrap;
}
.figure figcaption .credit { white-space: nowrap; }
.figure figcaption a { color: var(--color-text-faint); }
.figure figcaption a:hover { color: var(--color-text-muted); }

/* feature rows: copy beside a treated image; .feature--reverse flips it */
.feature {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-8);
    max-width: var(--measure-wide);
    margin-inline: auto;
    align-items: center;
}
.feature-body { max-width: 38rem; }
.feature-media .figure { height: 100%; display: flex; flex-direction: column; }
.feature-media .figure img {
    flex: 1 1 auto;
    height: 100%;
    min-height: 300px;
    aspect-ratio: auto;
}
@media (min-width: 840px) {
    .feature {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        gap: var(--sp-12);
        align-items: stretch;
    }
    .feature--reverse .feature-media { order: -1; }
}

/* ---- cards -------------------------------------------------------------- */
article {
    margin-bottom: var(--sp-6);
    background: var(--color-surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: none;
}
article > header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-1) var(--sp-3);
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
article > header strong { font-size: var(--text-base); font-weight: 650; }
article > header small { color: var(--color-text-muted); }
article > footer { border-top: 1px solid var(--color-border); }
@media (max-width: 575px) {
    [data-theme="dark"] { --pico-block-spacing-horizontal: var(--sp-4); }
}

/* stat card: square "ledger edge" + 2px yellow top rule */
/* headline numbers — ONE style sitewide: label above, serif figure, 2×2 on phones */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
}
@media (min-width: 600px) {
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--sp-4); }
}
.stat, article.stat {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin: 0;
    padding: var(--sp-5) var(--sp-4);
    background: var(--color-surface-1);
    border: 1px solid var(--color-border);
    border-top: 2px solid var(--color-highlight);
    border-radius: var(--radius-0);
    box-shadow: none;
    min-width: 0;
}
.stat-label, .stat > small {
    display: block;
    order: -1;   /* label always sits above the value */
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-caps);
    font-weight: 600;
    line-height: var(--leading-snug);
}
.stat-value, .stat > strong {
    display: block;
    margin: 0;
    font-family: var(--font-serif);
    font-size: var(--stat-value-size);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.015em;
    color: var(--color-text);
    font-variant-numeric: tabular-nums lining-nums;
    overflow-wrap: anywhere;
}
.stat-value a { color: inherit; text-decoration-color: var(--color-accent-line); }
.stat-value a:hover { color: var(--color-accent-hover); }
.stat-note { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: var(--sp-4);
}
.action-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-6);
    background: var(--color-surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.band-tint .action-card, .band--tint .action-card { background: var(--color-bg); }
.action-card:hover { border-color: var(--color-border-strong); }
.action-card h3 { margin: 0; }
.action-card p { margin: 0; color: var(--color-text-muted); font-size: var(--text-base); flex: 1; }
.action-card a {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    font-weight: 600;
    text-decoration: none;
}
.action-card a:hover { text-decoration: underline; }

/* ---- tables ------------------------------------------------------------- */
table {
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums lining-nums;
    margin-bottom: 0;
}
th, td {
    padding: var(--sp-3) var(--sp-4);
    background-color: transparent;
    border-bottom: 1px solid var(--color-border);
    vertical-align: baseline;
}
thead th {
    background: var(--color-surface-1);
    border-bottom: 2px solid var(--color-border-strong);
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-caps);
    color: var(--color-text-muted);
    font-weight: 600;
    white-space: nowrap;
}
tbody tr { transition: background-color var(--dur-fast) ease; }
tbody tr:nth-child(even) { background-color: var(--pico-table-row-stripped-background-color); }
tbody tr:hover { background-color: color-mix(in srgb, var(--color-text) 6%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
article:has(> table), #deal-results, .table-wrap { overflow-x: auto; }
.table-wrap { max-width: 100%; }
.table-wrap--tall { max-height: 70vh; overflow-y: auto; }
.table-wrap--tall thead th { position: sticky; top: 0; z-index: 1; }
th a { text-decoration: none; color: var(--color-text-muted); }
th a:hover { color: var(--color-text); }

/* ---- badges ------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    background: var(--color-info-bg);
    color: var(--color-info-text);
    white-space: nowrap;
}
.badge--neutral { background: var(--color-surface-3); color: var(--color-text-muted); }
.badge--accent  { background: var(--color-accent-soft); color: var(--color-accent-hover); }
.badge--highlight { background: color-mix(in srgb, var(--color-highlight) 14%, transparent); color: var(--color-highlight); }
.badge--success { background: var(--color-success-soft); color: var(--color-success); }
.badge--warn    { background: var(--color-warn-soft); color: var(--color-warn); }
.badge--danger  { background: var(--color-danger-soft); color: var(--color-danger); }

/* ---- forms -------------------------------------------------------------- */
input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]), select, textarea {
    border-radius: var(--radius-sm);
}
input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]), select {
    min-height: 2.75rem;
}
label { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
input:not([type="checkbox"], [type="radio"]):hover:not(:focus, :disabled),
select:hover:not(:focus, :disabled), textarea:hover:not(:focus, :disabled) {
    border-color: var(--color-border-hover);
}
[type="checkbox"], [type="radio"] { accent-color: var(--color-accent); }

.form-card { max-width: 44rem; }
.form-card label { margin-top: var(--sp-3); }
.form-error { display: block; color: var(--color-danger); font-size: var(--text-sm); }

.banner {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-sm);
    border: 1px solid;
    border-left-width: 3px;
    margin-bottom: var(--sp-4);
    font-size: var(--text-sm);
}
.banner.success { background: var(--color-success-soft); border-color: var(--color-success); }
.banner.error   { background: var(--color-danger-soft); border-color: var(--color-danger); }
.banner.warn    { background: var(--color-warn-soft); border-color: var(--color-warn); }

.password-field { position: relative; margin-bottom: var(--pico-spacing); }
.password-field input { padding-right: 4.5rem; margin-bottom: 0; }
.toggle-password {
    position: absolute;
    right: var(--sp-1);
    top: 0;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    width: auto;
    margin: 0;
    padding: 0 var(--sp-3);
    background: none;
    border: none;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
}
.toggle-password:hover { color: var(--color-text); background: none; }

.results-bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-4);
    padding-bottom: var(--sp-2);
    color: var(--color-text-muted);
    flex-wrap: wrap;
}
.chart-box { position: relative; height: 320px; }
.chart-data { margin: var(--sp-3) 0 0; }
.chart-data > summary {
    padding-block: var(--sp-3);   /* 44px hit area, same visual weight */
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}
.chart-data > summary:hover { color: var(--color-text); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); }

/* ---- shared cross-page components -------------------------------------- */
/* text link with a trailing arrow: <a class="link-arrow">Label <svg aria-hidden="true">…</svg></a> */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: var(--target);
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
}
.link-arrow:hover { color: var(--color-accent-hover); text-decoration: underline; }
.link-arrow svg {
    width: 1em; height: 1em; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 2;
    transition: transform var(--dur-fast) ease;
}
.link-arrow:hover svg { transform: translateX(3px); }

/* note box inside prose or forms */
.callout {
    padding: var(--sp-4) var(--sp-5);
    background: var(--color-surface-1);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    color: var(--color-text-prose);
}
.callout > :last-child { margin-bottom: 0; }

/* empty state: title + one sentence of direction + one action */
.empty-state {
    display: grid;
    justify-items: start;
    gap: var(--sp-2);
    padding: var(--sp-8) var(--sp-4);
    color: var(--color-text-muted);
}
.empty-state > :first-child { margin: 0; font-size: var(--text-base); font-weight: 600; color: var(--color-text); }
.empty-state p { margin: 0; max-width: var(--measure); color: var(--color-text-muted); }

/* status with a colored dot; the text label is always present */
.status-dot {
    --dot: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    white-space: nowrap;
}
.status-dot::before {
    content: "";
    width: 0.5rem; height: 0.5rem;
    border-radius: 50%;
    background: var(--dot);
    flex-shrink: 0;
}
.status-dot--completed, .status-dot--approved, .status-dot--success { --dot: var(--color-success); }
.status-dot--announced { --dot: var(--color-accent); }
.status-dot--pending, .status-dot--running { --dot: var(--color-warn); }
.status-dot--terminated, .status-dot--rejected, .status-dot--failed { --dot: var(--color-danger); }

/* form field group: label → control → hint → error */
.field { display: grid; gap: var(--sp-1); align-content: start; }
.field > label { margin: 0; }
.field > input, .field > select, .field > textarea { margin-bottom: 0; }
.field-hint { display: block; font-size: var(--text-sm); color: var(--color-text-faint); }

/* ---- footer ------------------------------------------------------------- */
body > footer.site-footer {
    margin-top: 0;
    padding-block: var(--space-section-sm) 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-sunken);
    font-size: var(--text-sm);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-10) var(--sp-8);
}
.footer-about { grid-column: 1 / -1; }
@media (min-width: 960px) {
    .footer-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 2fr) minmax(0, 2fr); gap: var(--sp-12); }
    .footer-about { grid-column: auto; }
}
.footer-about { max-width: 30rem; }
.footer-about .footer-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    margin: 0;
    font-size: 1.375rem;
}
.footer-brand img { height: 2.25rem; width: auto; }
.footer-about p.tagline {
    margin: var(--sp-2) 0 var(--sp-5);
    font-family: var(--font-brand);
    font-size: var(--text-xs);
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.footer-about p {
    margin: 0;
    max-width: 60ch;
    text-wrap: pretty;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}
.site-footer .footer-heading {
    margin: 0 0 var(--sp-3);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: var(--leading-snug);
    color: var(--color-text);
}
.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    align-items: start;
    gap: 0;
}
.site-footer li { margin: 0; padding: 0; list-style: none; }
.site-footer ul a {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--text-sm);
}
.site-footer ul a:hover { color: var(--color-text); text-decoration: underline; text-decoration-color: var(--color-accent-line); }

.social-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-6); }
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.social-links a:hover { color: var(--color-accent-hover); border-color: var(--color-accent-line); background: var(--color-accent-soft); }
.social-links svg { width: 1.125rem; height: 1.125rem; fill: currentColor; }

.footer-legal {
    display: grid;
    gap: var(--sp-3);
    margin-top: var(--space-section-sm);
    padding-block: var(--sp-6) var(--sp-8);
    border-top: 1px solid var(--color-border);
}
.footer-legal p {
    margin: 0;
    max-width: 52rem;
    font-size: var(--text-xs);
    line-height: var(--leading-normal);
    color: var(--color-text-faint);
}
.footer-legal .copyright { color: var(--color-text-muted); }

/* ---- utilities ---------------------------------------------------------- */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-accent { color: var(--color-accent); }
.measure { max-width: var(--measure); }
.stack > * + * { margin-top: var(--sp-4); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
