/* ===========================================================================
   The Lyme Accountability Project

   Dark is the default theme (it is the brand); light is provided under both the
   OS preference and an explicit [data-theme] stamp, with the stamp winning both
   ways. Series colors are the validated categorical palette - do not substitute
   hues here without re-running the palette validator, the slot ORDER is the
   colorblind-safety mechanism, not decoration.
   =========================================================================== */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg:            #0f1419;
  --surface-1:     #161d24;
  --surface-2:     #1d262f;
  --surface-3:     #26323d;
  --border:        #2c3946;
  --border-strong: #3d4e5e;

  /* ink */
  --text:          #eef2f5;
  --text-2:        #a9b8c4;
  --text-3:        #7d8f9d;

  /* brand + status */
  --accent:        #2f9c63;
  --accent-hover:  #3ab473;
  --accent-ink:    #04140b;
  --amber:         #d99413;
  --amber-soft:    #2a2415;
  --alarm:         #e05c5c;
  --alarm-soft:    #2a1a1c;

  /* categorical series - dark steps */
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;

  /* chart furniture */
  --grid:      #26323d;
  --baseline:  #3d4e5e;
  --ann-band:  rgba(217, 148, 19, .10);
  --ann-line:  #d99413;

  --radius:    10px;
  --radius-sm: 6px;
  --wrap:      1180px;
  --measure:   68ch;

  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root:where(:not([data-theme="dark"])) {
    color-scheme: light;
    --bg:            #fcfcfb;
    --surface-1:     #ffffff;
    --surface-2:     #f4f5f3;
    --surface-3:     #e9ebe8;
    --border:        #dcdedb;
    --border-strong: #b9bdb8;
    --text:          #12171c;
    --text-2:        #4b5560;
    --text-3:        #6d7883;
    --accent:        #1f6f43;
    --accent-hover:  #185c37;
    --accent-ink:    #ffffff;
    --amber:         #9a6708;
    --amber-soft:    #fdf4e3;
    --alarm:         #b3312f;
    --alarm-soft:    #fdeceb;
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;
    --series-4: #eda100;
    --series-5: #e87ba4;
    --series-6: #008300;
    --grid:      #e9ebe8;
    --baseline:  #b9bdb8;
    --ann-band:  rgba(154, 103, 8, .08);
    --ann-line:  #9a6708;
    --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px -16px rgb(0 0 0 / .22);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:            #fcfcfb;
  --surface-1:     #ffffff;
  --surface-2:     #f4f5f3;
  --surface-3:     #e9ebe8;
  --border:        #dcdedb;
  --border-strong: #b9bdb8;
  --text:          #12171c;
  --text-2:        #4b5560;
  --text-3:        #6d7883;
  --accent:        #1f6f43;
  --accent-hover:  #185c37;
  --accent-ink:    #ffffff;
  --amber:         #9a6708;
  --amber-soft:    #fdf4e3;
  --alarm:         #b3312f;
  --alarm-soft:    #fdeceb;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --grid:      #e9ebe8;
  --baseline:  #b9bdb8;
  --ann-band:  rgba(154, 103, 8, .08);
  --ann-line:  #9a6708;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px -16px rgb(0 0 0 / .22);
}

/* --------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.wrap.narrow { max-width: 640px; }
.measure { max-width: var(--measure); }
.measure-center { max-width: var(--measure); margin-inline: auto; }
.center { text-align: center; }
.center-actions { justify-content: center; }
.muted { color: var(--text-2); }
.small { font-size: .875rem; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .09em; font-size: .75rem;
  font-weight: 700; color: var(--text-3); margin-bottom: .75em;
}
.lede { font-size: 1.15rem; color: var(--text-2); }
.link-strong { font-weight: 600; text-decoration: none; }
.link-strong:hover { text-decoration: underline; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600;
  transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* ------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.02rem; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 50%, var(--alarm) 0 26%, transparent 27%),
              radial-gradient(circle at 50% 50%, var(--bg) 0 46%, transparent 47%),
              radial-gradient(circle at 50% 50%, var(--alarm) 0 68%, transparent 69%),
              var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.brand-text strong { font-weight: 800; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 11px; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none; font-size: .925rem; font-weight: 500;
}
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); font-weight: 600; }

.nav-toggle { display: none; }
.header-cta { flex: none; }

@media (max-width: 900px) {
  .header-cta { display: none; }
  .nav-toggle {
    display: grid; place-items: center; margin-left: auto;
    width: 40px; height: 40px; background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; color: var(--text);
  }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    content: ""; display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
  }
  .nav-toggle-bar { position: relative; }
  .nav-toggle-bar::before { position: absolute; top: -6px; }
  .nav-toggle-bar::after  { position: absolute; top: 6px; }
  .site-nav {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    background: var(--surface-1); border-bottom: 1px solid var(--border); padding: 8px 16px 14px;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding: 12px 8px; font-size: 1rem; }
}

/* ------------------------------------------------------------ sections */

.section { padding: clamp(40px, 6vw, 72px) 0; }
.section--alt { background: var(--surface-1); border-block: 1px solid var(--border); }
.section--tracker { padding-top: 8px; }
.section--counter { padding-block: 0 8px; }
.section--cta { background: var(--surface-1); border-top: 1px solid var(--border); }

.hero { padding: clamp(36px, 6vw, 68px) 0 28px; }
.hero h1 { max-width: 20ch; text-wrap: balance; }
.hero .lede { max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.page-head { padding: clamp(32px, 5vw, 56px) 0 8px; }
.page-head h1 { text-wrap: balance; }
.page-head.center { text-align: center; padding-bottom: 48px; }

.grid-2 { display: grid; gap: clamp(24px, 4vw, 48px); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: .4em; }

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 7px 13px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.toggle-group { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-sm); }
.toggle-btn {
  padding: 7px 14px; border: 0; border-radius: 4px; background: transparent;
  color: var(--text-2); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
}
.toggle-btn:hover { color: var(--text); }
.toggle-btn.is-active { background: var(--surface-1); color: var(--text); box-shadow: var(--shadow); }
.metric-toggle { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-sm); }

/* ---------------------------------------------------------- stat tiles */

.stats {
  display: grid; gap: 14px; margin-bottom: 34px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.stat {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-value { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .875rem; color: var(--text-2); line-height: 1.35; }
.stat-note { margin-top: auto; padding-top: 10px; font-size: .78rem; color: var(--text-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat--alarm { border-color: color-mix(in srgb, var(--alarm) 40%, var(--border)); background: var(--alarm-soft); }
.stat--alarm .stat-value { color: var(--alarm); }
.stat--live .stat-value { color: var(--accent); }
.spark { width: 84px; height: 24px; flex: none; }
.spark-line { fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------- charts */

.chart-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.chart-head h2 { margin-bottom: .15em; }
.chart { margin: 0 0 20px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }

.c-grid     { stroke: var(--grid); stroke-width: 1; }
.c-baseline { stroke: var(--baseline); stroke-width: 1.5; }
.c-axis     { fill: var(--text-3); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.c-line     { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-area     { fill: var(--series-1); opacity: .13; }
.c-dot      { fill: var(--series-1); stroke: var(--bg); stroke-width: 2; }
.c-endlabel { fill: var(--text); font-size: 15px; font-weight: 700; font-family: var(--font); font-variant-numeric: tabular-nums; }

.c-ann-band { fill: var(--ann-band); }
.c-ann-line { stroke: var(--ann-line); stroke-width: 1.5; stroke-dasharray: 4 3; }
.c-ann-chip { fill: var(--surface-2); stroke: var(--border); }
.c-ann-text { fill: var(--amber); font-size: 11.5px; font-weight: 600; font-family: var(--font); }
.c-ann-text--muted { fill: var(--text-3); font-weight: 500; }

/* 2px surface gap between stacked bands so adjacent fills never touch */
.c-band { stroke: var(--bg); stroke-width: 2; stroke-linejoin: round; }
.c-s1 { fill: var(--series-1); } .c-s2 { fill: var(--series-2); } .c-s3 { fill: var(--series-3); }
.c-s4 { fill: var(--series-4); } .c-s5 { fill: var(--series-5); } .c-s6 { fill: var(--series-6); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 8px 0 0; padding: 0; font-size: .85rem; color: var(--text-2); }
.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend-swatch.c-s1 { background: var(--series-1); } .legend-swatch.c-s2 { background: var(--series-2); }
.legend-swatch.c-s3 { background: var(--series-3); } .legend-swatch.c-s4 { background: var(--series-4); }
.legend-swatch.c-s5 { background: var(--series-5); } .legend-swatch.c-s6 { background: var(--series-6); }

/* hover layer, added by tracker.js */
.c-cross { stroke: var(--border-strong); stroke-width: 1; }
.c-hit   { fill: transparent; cursor: crosshair; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 20;
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 11px; box-shadow: var(--shadow);
  font-size: .82rem; line-height: 1.45; white-space: nowrap; transform: translate(-50%, -100%);
}
.chart-tip-year { font-weight: 700; display: block; }
.chart-tip-note { color: var(--amber); display: block; margin-top: 3px; max-width: 220px; white-space: normal; }
.chart-stack { position: relative; }

.annotations { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin: 6px 0 26px; }
.annotation { border-left: 3px solid var(--amber); background: var(--amber-soft); padding: 13px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.annotation h3 { font-size: .95rem; margin-bottom: .35em; }
.annotation p { font-size: .875rem; color: var(--text-2); margin: 0; }
.annotation-years { font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- tables */

.table-view { margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-1); }
.table-view > summary { padding: 13px 18px; cursor: pointer; font-weight: 600; font-size: .925rem; list-style-position: inside; }
.table-view > summary:hover { color: var(--accent); }
.table-view[open] > summary { border-bottom: 1px solid var(--border); }
.table-view .prose { padding: 4px 18px 16px; font-size: .925rem; }
.table-scroll { overflow-x: auto; max-height: 560px; overscroll-behavior: contain; }

.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.data-table caption { text-align: left; padding: 12px 16px; color: var(--text-3); font-size: .8rem; }
.data-table th, .data-table td { padding: 7px 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; font-weight: 600; color: var(--text-2); }
.data-table tbody th { text-align: left; font-weight: 600; position: sticky; left: 0; background: var(--surface-1); }
.data-table tbody tr:hover td, .data-table tbody tr:hover th { background: var(--surface-2); }
.data-table--sortable thead th { cursor: pointer; user-select: none; }
.data-table--sortable thead th[aria-sort="ascending"]::after  { content: " \\2191"; color: var(--accent); }
.data-table--sortable thead th[aria-sort="descending"]::after { content: " \\2193"; color: var(--accent); }
.fn { cursor: help; color: var(--amber); text-decoration: none; border: 0; }

/* -------------------------------------------------------------- callouts */

.callout { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; background: var(--surface-1); margin: 0 0 22px; }
.callout-head { font-size: 1.05rem; margin-bottom: .6em; }
.callout p:last-child { margin-bottom: 0; }
.callout--legal { border-left: 3px solid var(--amber); }
.callout--counter { border-left: 3px solid var(--series-1); background: color-mix(in srgb, var(--series-1) 7%, var(--surface-1)); }
.callout--medical { border-left: 3px solid var(--text-3); font-size: .9rem; }
.callout--care ul { margin: 0; padding-left: 1.15em; font-size: .9rem; }
.callout--care li { margin-bottom: .55em; }
.callout--crisis { border-left: 3px solid var(--alarm); background: var(--alarm-soft); font-size: .9rem; }
.callout-links { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }

/* -------------------------------------------------------------- timeline */

.tier { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; white-space: nowrap; cursor: help; }
.claim-documented { background: color-mix(in srgb, var(--series-3) 20%, transparent); color: var(--series-3); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--series-3) 45%, transparent); }
.claim-contested  { background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 45%, transparent); }
.claim-allegation { background: var(--alarm-soft); color: var(--alarm); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--alarm) 45%, transparent); }
.claim-documented::before, .claim-contested::before, .claim-allegation::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.claim-allegation::before { border-radius: 1px; transform: rotate(45deg); }
.claim-contested::before  { border-radius: 1px; }

.tier-key { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); padding: 18px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); }
.tier-key-item p { font-size: .85rem; color: var(--text-2); margin: 8px 0 0; }

.tl-filters { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-sm); margin-bottom: 26px; width: fit-content; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-item { position: relative; margin-bottom: 30px; }
.tl-item[hidden] { display: none; }
.tl-marker { position: absolute; left: -26px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); box-shadow: 0 0 0 3px var(--bg); }
.tl-item--documented .tl-marker { background: var(--series-3); }
.tl-item--contested  .tl-marker { background: var(--amber); }
.tl-item--allegation .tl-marker { background: var(--alarm); }
.tl-item--key .tl-body { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.tl-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tl-when { font-weight: 700; font-size: .85rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-title { font-size: 1.08rem; margin-bottom: .4em; text-wrap: balance; }
.tl-text { color: var(--text-2); max-width: var(--measure); }
.tl-text p:last-child { margin-bottom: 0; }
.tl-sources { margin-top: 10px; font-size: .85rem; }
.tl-sources summary { cursor: pointer; color: var(--text-3); font-weight: 600; }
.tl-sources summary:hover { color: var(--accent); }
.tl-sources ul { margin: 8px 0 0; padding-left: 1.1em; }
.tl-sources li { margin-bottom: .3em; }

.demands { list-style: none; counter-reset: d; margin: 0; padding: 0; display: grid; gap: 16px; }
.demand { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.demand h3 { margin-bottom: .35em; }
.demand p { margin: 0; color: var(--text-2); font-size: .935rem; }
.demand--numbered { display: flex; gap: 16px; align-items: flex-start; }
.demand-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.qlist { padding-left: 1.15em; color: var(--text-2); }
.qlist li { margin-bottom: .55em; }

/* ----------------------------------------------------------------- forms */

.form { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 3vw, 30px); box-shadow: var(--shadow); }
.card-head { margin-bottom: 0; font-size: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--narrow { max-width: 150px; }
.field--inline { flex-direction: row; align-items: center; gap: 8px; }
.field-label { font-size: .875rem; font-weight: 600; }
.field-label em { font-style: normal; font-weight: 500; color: var(--text-3); font-size: .8rem; margin-left: 4px; }
.field-label .opt { font-weight: 500; color: var(--text-3); font-size: .8rem; margin-left: 4px; }
.field-help { font-size: .8rem; color: var(--text-3); line-height: 1.45; }

input[type="text"], input[type="email"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: .95rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--alarm); }
textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
input[type="file"] { padding: 8px; font-size: .875rem; }

.consents { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.consents legend { padding: 0 6px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.45; cursor: pointer; }
.check input { margin-top: 3px; flex: none; width: 17px; height: 17px; accent-color: var(--accent); }
.check em { font-style: normal; color: var(--text-3); font-size: .8rem; }

/* Honeypot: off-screen, not display:none, so headless fillers still see it. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin: 0; font-size: .9rem; min-height: 1.4em; }
.form-status.is-error { color: var(--alarm); }
.form-status.is-ok { color: var(--accent); }
.form--inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: 12px; }

.grid-petition { display: grid; gap: clamp(26px, 4vw, 48px); grid-template-columns: 1fr; }
.grid-story { display: grid; gap: clamp(26px, 4vw, 42px); grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .grid-petition { grid-template-columns: 1fr minmax(380px, 440px); }
  .grid-story    { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
}

/* --------------------------------------------------------------- counter */

.counter-block { margin-top: 26px; max-width: 460px; }
.counter-value { font-size: clamp(2.4rem, 1.6rem + 3vw, 3.6rem); font-weight: 800; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.counter-label { font-size: .9rem; color: var(--text-2); margin-top: 4px; }
.counter-sub { display: block; color: var(--text-3); font-size: .82rem; }
.counter-bar { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.counter-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .6s ease; }
.counter-goal { margin-top: 6px; }

.wall { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 20px; }
.wall-item { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 15px; font-size: .9rem; }
.wall-name { font-weight: 700; }
.wall-meta { color: var(--text-3); font-size: .8rem; }
.wall-statement { color: var(--text-2); margin: 7px 0 0; font-size: .875rem; line-height: 1.5; }

/* ------------------------------------------------------------------ news */

.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.filters .field--inline input, .filters .field--inline select { min-width: 220px; }

.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.news-item { border-bottom: 1px solid var(--border); padding: 15px 0; display: grid; gap: 5px; }
.news-item:first-child { border-top: 1px solid var(--border); }
.news-title { font-size: 1.02rem; font-weight: 600; line-height: 1.35; margin: 0; }
.news-title a { color: var(--text); text-decoration: none; }
.news-title a:hover { color: var(--accent); text-decoration: underline; }
.news-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .8rem; color: var(--text-3); }
.news-source { font-weight: 600; color: var(--text-2); }
.news-cat { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.news-cat[data-cat="research"]     { color: var(--series-1); }
.news-cat[data-cat="policy"]       { color: var(--series-2); }
.news-cat[data-cat="surveillance"] { color: var(--series-3); }
.news-cat[data-cat="community"]    { color: var(--series-5); }
.news-cat[data-cat="legal"]        { color: var(--series-4); }
.news-summary { font-size: .9rem; color: var(--text-2); margin: 0; }
.news-loading, .empty-state { color: var(--text-3); font-size: .9rem; padding: 22px 0; }

/* ---------------------------------------------------------------- stories */

.story-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.story-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 9px; }
.story-card h3 { font-size: 1.05rem; margin: 0; text-wrap: balance; }
.story-meta { font-size: .8rem; color: var(--text-3); display: flex; gap: 9px; flex-wrap: wrap; }
.story-excerpt { font-size: .92rem; color: var(--text-2); margin: 0; }
.story-more { margin-top: auto; font-weight: 600; font-size: .875rem; text-decoration: none; }
.story-aside { display: flex; flex-direction: column; gap: 18px; }

/* ----------------------------------------------------------------- spread */

.post-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.post-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.post-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.post-card-head h3 { margin: 0; font-size: .95rem; }
.post-text { margin: 0; font-size: .92rem; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; border-left: 2px solid var(--border-strong); padding-left: 14px; }
.post-card-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.plain-list { list-style: none; padding: 0; margin: 0 0 1em; display: flex; flex-direction: column; gap: 7px; }
.draft-letter { white-space: pre-wrap; font-family: var(--mono); font-size: .8rem; line-height: 1.6; background: var(--surface-2); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; }
.rep-results { margin-top: 20px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rep-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }

/* ------------------------------------------------------------------ admin */

.admin-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 24px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab { padding: 10px 16px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-2); font: inherit; font-weight: 600; font-size: .925rem; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.badge { background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 1px 7px; font-size: .72rem; font-weight: 700; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.mod-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.mod-card--flagged { border-left: 3px solid var(--amber); }
.mod-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.mod-flag { background: var(--amber-soft); color: var(--amber); font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.mod-body { white-space: pre-wrap; font-size: .9rem; color: var(--text-2); max-height: 260px; overflow-y: auto; background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-sm); }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }

/* ----------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--border); background: var(--surface-1); padding: 44px 0 28px; margin-top: 40px; font-size: .9rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.footer-col a { color: var(--text-2); text-decoration: none; }
.footer-col a:hover { color: var(--accent); text-decoration: underline; }
.footer-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 12px; }
.footer-brand { margin-bottom: .35em; }
.footer-legal { padding-top: 22px; display: flex; flex-direction: column; gap: 9px; font-size: .84rem; color: var(--text-2); }
.footer-legal p { margin: 0; max-width: 76ch; }
.crisis { color: var(--text); }
.crisis a { font-weight: 700; }

.big-check { width: 62px; height: 62px; margin: 0 auto 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 2rem; font-weight: 700; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .field--narrow { max-width: none; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .field--inline input, .filters .field--inline select { min-width: 0; width: 100%; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

@media print {
  .site-header, .site-nav, .hero-actions, .tl-filters, .filters, .metric-toggle, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .table-view[open] { break-inside: avoid; }
}

/* Forced-colors: keep identity off color alone. */
@media (forced-colors: active) {
  .c-line, .c-band { forced-color-adjust: none; }
  .tier { border: 1px solid currentColor; }
}
