/* ==========================================================================
   OmiCairn showcase — design system
   Editorial, quiet, data-forward. System fonts only; no external requests.
   Sections:
     1. Tokens (light, dark)      7. Header, nav, disclaimer, footer
     2. Reset & base              8. Components
     3. Typography                9. Data: stat, funnel, stacked bar, legend, table
     4. Layout                   10. Cards
     5. Utilities                11. Long-form report pages
     6. Buttons, links, forms    12. Style guide helpers, print, reduced motion
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  color-scheme: light;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, "Bitstream Charter", "Source Serif Pro", Georgia, ui-serif, serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f7f5f0;
  --bg-elev: #ffffff;
  --bg-sunken: #efece5;
  --bg-tint: #f2efe8;
  --ink: #1b1e23;
  --ink-2: #464b54;
  --ink-3: #636973;
  --rule: #e2ded5;
  --rule-strong: #cbc5b9;
  /* Accent: the logo's deep green (#52796F), darkened for AA text contrast. Kept muted so it
     stays distinct from the saturated teal of --oc-supported. */
  --accent: #3b665c;
  --accent-ink: #2a4b43;
  --accent-soft: #e4ece8;
  --accent-line: #b3c8c0;
  --accent-on: #ffffff;
  --focus: #3b665c;
  --shadow-1: 0 1px 2px rgba(27, 30, 35, .05), 0 1px 1px rgba(27, 30, 35, .03);
  --shadow-2: 0 8px 24px -12px rgba(27, 30, 35, .22), 0 2px 6px -2px rgba(27, 30, 35, .08);
  --caution: #a45d00;
  --caution-soft: #fbf1df;
  --caution-line: #e7c78f;
  --figure-bg: #ffffff;
  --brand-ink: #2F3E46;
  --brand-base: #2F3E46;
  --seg-ink: #ffffff;

  /* Outcome tokens: fills for charts and swatches */
  --oc-supported: #0f766e;
  --oc-partial: #6cc4b8;
  --oc-not-supported: #4b5565;
  --oc-inconclusive: #e0a23a;
  --oc-not-testable: #a9aeb6;
  --oc-not-testable-line: #7d838c;
  --oc-not-run: transparent;
  --oc-not-run-line: #a3a8b1;
  /* Outcome badge (text on tint) — all ≥ 4.5:1 */
  --oc-supported-bg: #d8efeb;  --oc-supported-ink: #0b544e;
  --oc-partial-bg: #e5f5f2;    --oc-partial-ink: #1c6158;
  --oc-not-supported-bg: #e4e7ec; --oc-not-supported-ink: #2d3644;
  --oc-inconclusive-bg: #fbedd2; --oc-inconclusive-ink: #6e4300;
  --oc-not-testable-bg: #eceef1; --oc-not-testable-ink: #444a53;
  --oc-not-run-bg: transparent; --oc-not-run-ink: #555b64;
  --hatch-a: #c9cdd3;
  --hatch-b: #8f959e;

  --radius-s: 4px;
  --radius: 8px;
  --radius-l: 14px;
  --measure: 72ch;
  --wide: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --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; --space-9: 6rem;
}

/* Dark tokens: applied by system preference unless the user chose light, or explicitly. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121417; --bg-elev: #1a1d22; --bg-sunken: #0e1013; --bg-tint: #171a1e;
    --ink: #e9e7e2; --ink-2: #b9bcc2; --ink-3: #9a9fa7;
    --rule: #2a2e35; --rule-strong: #3b4049;
    --accent: #9cc3b0; --accent-ink: #c2dccf; --accent-soft: #1c2a26; --accent-line: #3d5a51; --accent-on: #0e1013;
    --focus: #9cc3b0;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 10px 28px -12px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .5);
    --caution: #f0b860; --caution-soft: #2a2114; --caution-line: #6b5126;
    --figure-bg: #f4f2ee;
    --brand-ink: #CAD2C5; --brand-base: #CAD2C5; --seg-ink: #0e1013;
    --oc-supported: #2bb3a2; --oc-partial: #86d8cb; --oc-not-supported: #8c97a8;
    --oc-inconclusive: #f0b44c; --oc-not-testable: #5d636c; --oc-not-testable-line: #8b919a;
    --oc-not-run-line: #6a707a;
    --oc-supported-bg: #12322f;  --oc-supported-ink: #8fe3d6;
    --oc-partial-bg: #173430;    --oc-partial-ink: #b2ece2;
    --oc-not-supported-bg: #262b33; --oc-not-supported-ink: #c9d0db;
    --oc-inconclusive-bg: #33280f; --oc-inconclusive-ink: #f6cd84;
    --oc-not-testable-bg: #22262c; --oc-not-testable-ink: #c3c7cd;
    --oc-not-run-ink: #b3b8c0;
    --hatch-a: #3a3f47; --hatch-b: #6f757e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121417; --bg-elev: #1a1d22; --bg-sunken: #0e1013; --bg-tint: #171a1e;
  --ink: #e9e7e2; --ink-2: #b9bcc2; --ink-3: #9a9fa7;
  --rule: #2a2e35; --rule-strong: #3b4049;
  --accent: #9cc3b0; --accent-ink: #c2dccf; --accent-soft: #1c2a26; --accent-line: #3d5a51; --accent-on: #0e1013;
  --focus: #9cc3b0;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 28px -12px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .5);
  --caution: #f0b860; --caution-soft: #2a2114; --caution-line: #6b5126;
  --figure-bg: #f4f2ee;
  --brand-ink: #CAD2C5; --brand-base: #CAD2C5; --seg-ink: #0e1013;
  --oc-supported: #2bb3a2; --oc-partial: #86d8cb; --oc-not-supported: #8c97a8;
  --oc-inconclusive: #f0b44c; --oc-not-testable: #5d636c; --oc-not-testable-line: #8b919a;
  --oc-not-run-line: #6a707a;
  --oc-supported-bg: #12322f;  --oc-supported-ink: #8fe3d6;
  --oc-partial-bg: #173430;    --oc-partial-ink: #b2ece2;
  --oc-not-supported-bg: #262b33; --oc-not-supported-ink: #c9d0db;
  --oc-inconclusive-bg: #33280f; --oc-inconclusive-ink: #f6cd84;
  --oc-not-testable-bg: #22262c; --oc-not-testable-ink: #c3c7cd;
  --oc-not-run-ink: #b3b8c0;
  --hatch-a: #3a3f47; --hatch-b: #6f757e;
}

/* 2. Reset & base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-main { flex: 1 0 auto; outline: none; }
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
svg { display: block; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.hatch-bg { fill: var(--hatch-a); }
.hatch-line { fill: var(--hatch-b); }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--space-7) 0; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }

/* 3. Typography ------------------------------------------------------------ */
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 var(--space-4); text-wrap: balance; }
h1, h2, .serif { font-family: var(--font-serif); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.05rem); margin-top: var(--space-7); }
h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -.005em; margin-top: var(--space-6); }
h4 { font-size: 1rem; font-weight: 650; margin-top: var(--space-5); }
h2:first-child, h3:first-child, h4:first-child { margin-top: 0; }
p, ul, ol, dl, blockquote, pre, table, figure { margin: 0 0 var(--space-4); }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: .3em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: var(--accent-line); }
a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
strong, b { font-weight: 650; }
small, .small { font-size: .875rem; }
code, kbd, samp, pre, .mono { font-family: var(--font-mono); font-size: .875em; }
code { background: var(--bg-sunken); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: .05em .35em; }
pre { background: var(--bg-sunken); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-4); overflow-x: auto; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; font-size: .8125rem; }
blockquote { margin-left: 0; padding-left: var(--space-4); border-left: 3px solid var(--rule-strong); color: var(--ink-2); }
.num, .tabular, td, .stat__value, .funnel__value { font-variant-numeric: tabular-nums; }

.kicker {
  font-family: var(--font-sans); font-size: .75rem; font-weight: 650; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 var(--space-3);
}
.lede { font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3rem); line-height: 1.55; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-3); }
.eyebrow-rule { display: flex; align-items: center; gap: var(--space-3); }
.eyebrow-rule::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* 4. Layout ---------------------------------------------------------------- */
.container { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.prose { max-width: var(--measure); }
.prose > * + h2 { margin-top: var(--space-7); }
.prose > * + h3 { margin-top: var(--space-6); }
.section { padding-block: var(--space-8); }
.section--tight { padding-block: var(--space-6); }
.section--alt { background: var(--bg-tint); border-block: 1px solid var(--rule); }
.section__head { max-width: var(--measure); margin-bottom: var(--space-6); }
.section__head h2 { margin-top: 0; }
.page-head { padding-block: var(--space-7) var(--space-6); border-bottom: 1px solid var(--rule); }
.page-head h1 { margin-bottom: var(--space-3); }
.page-head .lede { margin-bottom: 0; }
.breadcrumb + .page-head { padding-top: var(--space-5); }

/* auto-fit (not auto-fill): a short row stretches instead of leaving empty tracks */
.grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 260px)), 1fr)); }
.grid--cases { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .grid--cases { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid--2 { --grid-min: 380px; }
.grid--3 { --grid-min: 280px; }
.grid--4 { --grid-min: 210px; }
.split { display: grid; gap: var(--space-7); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } .split--even { grid-template-columns: 1fr 1fr; } }
.stack > * + * { margin-top: var(--space-4); }
.stack--lg > * + * { margin-top: var(--space-6); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* 5. 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; }
.skip-link { position: absolute; left: var(--space-3); top: -100px; z-index: 100; background: var(--bg-elev); color: var(--accent); padding: var(--space-2) var(--space-4); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.skip-link:focus { top: var(--space-3); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-6 { margin-top: var(--space-6) !important; } .mb-6 { margin-bottom: var(--space-6) !important; }
.nowrap { white-space: nowrap; }

/* 6. Buttons, links, forms ------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; gap: .5em; min-height: 2.5rem; padding: .5rem 1rem;
  border-radius: var(--radius); border: 1px solid var(--rule-strong); background: var(--bg-elev);
  color: var(--ink); font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.button:hover { border-color: var(--ink-3); color: var(--ink); background: var(--bg-elev); }
.button--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }
.button--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--accent-on); }
.button--ghost { background: transparent; border-color: transparent; color: var(--accent); }
.button--ghost:hover { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.button--small { min-height: 2rem; padding: .3rem .7rem; font-size: .8125rem; }
.button .icon { width: 1.05em; height: 1.05em; }
.link-arrow { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-arrow::after { content: " \2192"; display: inline-block; transition: transform .15s; }
.link-arrow:hover::after { transform: translateX(3px); }
.link-external::after { content: " \2197"; font-size: .85em; }

.input, .select {
  font: inherit; font-size: .9375rem; color: var(--ink); background: var(--bg-elev);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); min-height: 2.5rem; padding: .45rem .75rem;
  max-width: 100%;
}
.input::placeholder { color: var(--ink-3); }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.input--search { padding-left: 2.25rem; background-image: none; }
.search { position: relative; display: block; flex: 1 1 260px; min-width: 0; }
.search .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--ink-3); pointer-events: none; }
.search .input { width: 100%; }
.select { padding-right: 2rem; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.label { display: block; font-size: .8125rem; font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }

.icon { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* 7. Header, nav, disclaimer, footer -------------------------------------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--rule); position: relative; z-index: 20; }
.site-header__inner { display: flex; align-items: center; gap: var(--space-4); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.01em; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 22px; height: 29px; flex: none; }
.brand__base { fill: var(--brand-base); }
.brand__name { font-family: Arial, Helvetica, var(--font-sans); font-size: 1.32rem; font-weight: 400; letter-spacing: -.02em; color: var(--brand-ink); }
.brand__name b { font-weight: 700; }
.site-nav__list { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.site-nav__list li + li { margin-top: 0; }
.site-nav__link { display: block; padding: .45rem .75rem; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; font-size: .9375rem; font-weight: 550; }
.site-nav__link:hover { color: var(--ink); background: var(--bg-sunken); }
.site-nav__link[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--radius) var(--radius) 0 0; }
.theme-toggle, .nav-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2); cursor: pointer; padding: 0;
}
.theme-toggle:hover, .nav-toggle:hover { color: var(--ink); border-color: var(--rule-strong); }
.theme-toggle .icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon--moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon--sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon--moon { display: block; }
}
.nav-toggle { display: none; }
html:not(.js) .theme-toggle { display: none; }   /* the toggle needs site.js */
@media (max-width: 860px) {
  .js .nav-toggle { display: inline-grid; order: 3; }
  .theme-toggle { order: 2; }
  .js .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-elev); border-bottom: 1px solid var(--rule); box-shadow: var(--shadow-2); padding: var(--space-3) var(--gutter) var(--space-4); }
  .js .site-nav.is-open { display: block; }
  .js .site-nav__list { flex-direction: column; }
  .js .site-nav__link { padding: .75rem .5rem; font-size: 1.0625rem; }
  .js .site-nav__link[aria-current] { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0; padding-left: .9rem; }
  .site-header__inner { flex-wrap: wrap; }
  html:not(.js) .site-nav { order: 4; width: 100%; overflow-x: auto; }
}

.disclaimer { background: var(--bg-tint); border-bottom: 1px solid var(--rule); color: var(--ink-2); font-size: .8125rem; line-height: 1.45; }
.disclaimer__inner { display: flex; align-items: flex-start; gap: .5rem; padding-block: .55rem; }
.disclaimer__inner p { margin: 0; }
.disclaimer .icon { width: 1rem; height: 1rem; margin-top: .1rem; color: var(--ink-3); }
.disclaimer a { color: var(--ink-2); text-decoration-color: var(--rule-strong); }
.disclaimer a:hover { color: var(--ink); }

.breadcrumb { font-size: .8125rem; color: var(--ink-3); padding-top: var(--space-5); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem .4rem; }
.breadcrumb li { margin: 0; display: inline-flex; gap: .4rem; min-width: 0; }
.breadcrumb li + li::before { content: "/"; color: var(--rule-strong); }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--ink-3); overflow-wrap: anywhere; }

.site-footer { margin-top: var(--space-8); background: var(--bg-sunken); border-top: 1px solid var(--rule); font-size: .875rem; color: var(--ink-2); }
.site-footer__grid { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); padding-block: var(--space-7) var(--space-6); }
@media (min-width: 820px) { .site-footer__grid { grid-template-columns: 1.3fr .7fr 1.6fr; } }
.site-footer__about p { max-width: 44ch; }
.site-footer__h { font-family: var(--font-sans); font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 var(--space-3); font-weight: 650; }
.site-footer__list { list-style: none; padding: 0; margin: 0; }
.site-footer__list li + li { margin-top: .45rem; }
.site-footer a { color: var(--ink); text-decoration-color: var(--rule-strong); }
.site-footer a:hover { color: var(--accent); }
.site-footer__legal { border-top: 1px solid var(--rule); padding-block: var(--space-4) var(--space-6); font-size: .8125rem; color: var(--ink-3); }
.site-footer__legal p { margin: 0; }
.site-footer__legal a { color: var(--ink-2); }
.brand--footer { margin-bottom: var(--space-3); }
.brand--footer .brand__mark { width: 18px; height: 24px; }
.brand--footer .brand__name { font-size: 1.1rem; }

/* 8. Components ------------------------------------------------------------ */
/* Hero */
.hero { padding-block: var(--space-8) var(--space-7); }
.hero__title { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.9rem); max-width: 18ch; margin-bottom: var(--space-5); }
.hero__lede { margin-bottom: var(--space-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* Outcome badge */
.badge {
  display: inline-flex; align-items: center; gap: .4em; padding: .12rem .55rem .12rem .45rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; vertical-align: middle;
}
.badge::before { content: ""; width: .6em; height: .6em; border-radius: 2px; flex: none; }
.badge__count { font-variant-numeric: tabular-nums; opacity: .85; font-weight: 700; }
.badge--supported { background: var(--oc-supported-bg); color: var(--oc-supported-ink); }
.badge--supported::before { background: var(--oc-supported); }
.badge--partial { background: var(--oc-partial-bg); color: var(--oc-partial-ink); }
.badge--partial::before { background: var(--oc-partial); }
.badge--not_supported { background: var(--oc-not-supported-bg); color: var(--oc-not-supported-ink); }
.badge--not_supported::before { background: var(--oc-not-supported); }
.badge--inconclusive { background: var(--oc-inconclusive-bg); color: var(--oc-inconclusive-ink); }
.badge--inconclusive::before { background: var(--oc-inconclusive); }
.badge--not_testable { background: var(--oc-not-testable-bg); color: var(--oc-not-testable-ink); }
.badge--not_testable::before { background: repeating-linear-gradient(135deg, var(--hatch-a) 0 2px, var(--hatch-b) 2px 3.5px); }
.badge--not_run { background: var(--oc-not-run-bg); color: var(--oc-not-run-ink); border: 1px dashed var(--oc-not-run-line); }
.badge--not_run::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--oc-not-run-line); }

/* Swatches & segment fills (shared by legends, stacked bars, CSS charts) */
.swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: -.08em; flex: none; }
.swatch--supported, .seg--supported { background: var(--oc-supported); }
.swatch--partial, .seg--partial { background: var(--oc-partial); }
.swatch--not_supported, .seg--not_supported { background: var(--oc-not-supported); }
.swatch--inconclusive, .seg--inconclusive { background: var(--oc-inconclusive); }
.swatch--not_testable, .seg--not_testable { background: repeating-linear-gradient(135deg, var(--hatch-a) 0 3px, var(--hatch-b) 3px 5px); }
.swatch--not_run, .seg--not_run { background: transparent; box-shadow: inset 0 0 0 1.5px var(--oc-not-run-line); }
/* SVG fills: <rect class="fill--supported"> ; hatched uses the global #oc-hatch pattern */
.fill--supported { fill: var(--oc-supported); }
.fill--partial { fill: var(--oc-partial); }
.fill--not_supported { fill: var(--oc-not-supported); }
.fill--inconclusive { fill: var(--oc-inconclusive); }
.fill--not_testable { fill: url(#oc-hatch); }
.fill--not_run { fill: transparent; stroke: var(--oc-not-run-line); stroke-width: 1.5; stroke-dasharray: 3 2; }
.fill--accent { fill: var(--accent); }
.fill--muted { fill: var(--rule-strong); }
.chart-text { fill: var(--ink-2); font: 12px var(--font-sans); }
.chart-text--strong { fill: var(--ink); font-weight: 650; }
.chart-rule { stroke: var(--rule); stroke-width: 1; }

/* Tag */
.tag { display: inline-block; padding: .05rem .45rem; border: 1px solid var(--rule-strong); border-radius: var(--radius-s); font-size: .72rem; font-weight: 650; letter-spacing: .04em; color: var(--ink-2); background: var(--bg-elev); line-height: 1.5; white-space: nowrap; }

/* Callout */
.callout { border: 1px solid var(--accent-line); border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: var(--space-4) var(--space-5); color: var(--ink); margin: 0 0 var(--space-5); }
.callout > :last-child { margin-bottom: 0; }
.callout__title { font-weight: 700; margin-bottom: var(--space-2); }
.callout--caution { border-color: var(--caution-line); border-left-color: var(--caution); background: var(--caution-soft); }
.callout--caution .callout__title { color: var(--caution); }
.callout--note .callout__title { color: var(--accent-ink); }

/* Figure */
.figure { margin: var(--space-6) 0; }
.figure img { width: 100%; background: var(--figure-bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(6px, 1.2vw, 14px); }
.figure figcaption { margin-top: var(--space-3); font-size: .875rem; line-height: 1.55; color: var(--ink-2); max-width: var(--measure); }
.figure__credit, .figure__note { display: block; margin-top: .4rem; }
.figure__credit { font-size: .8rem; color: var(--ink-3); }
.figure__note { font-size: .8125rem; color: var(--ink); background: var(--caution-soft); border-left: 3px solid var(--caution); padding: .4rem .65rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.figure--wide { max-width: none; }
.figure a.figure__zoom { display: block; }

/* Disclosure (details/summary) */
.disclosure { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-elev); }
.disclosure + .disclosure { margin-top: var(--space-2); }
.disclosure > summary { list-style: none; cursor: pointer; padding: var(--space-3) var(--space-4); display: flex; align-items: center; gap: var(--space-3); font-weight: 600; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: ""; margin-left: auto; width: .5rem; height: .5rem; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translateY(-2px); transition: transform .15s; flex: none; }
.disclosure[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.disclosure__body { padding: 0 var(--space-4) var(--space-4); color: var(--ink-2); font-size: .9375rem; }
.disclosure__body > :last-child { margin-bottom: 0; }

/* On-this-page jump links (pills): ul.jump > li > a */
.jump { display: flex; flex-wrap: wrap; gap: .4rem .5rem; list-style: none; padding: 0; margin: var(--space-5) 0 0; }
.jump li { margin: 0; }
.jump a { display: inline-block; padding: .3rem .7rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg-elev); color: var(--ink-2); font-size: .8125rem; font-weight: 600; text-decoration: none; }
.jump a:hover { border-color: var(--accent-line); color: var(--accent-ink); }

/* Horizontal scroller with edge shadows that show there is more to the side.
   Use for wide diagrams that must not shrink: <div class="scroll-x" tabindex="0" role="region" aria-label="..."> */
.scroll-x {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--bg-elev) 30%, transparent) left center / 24px 100% no-repeat local,
    linear-gradient(to left, var(--bg-elev) 30%, transparent) right center / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .18), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .18), transparent) right center / 12px 100% no-repeat scroll;
  background-color: var(--bg-elev);
}
.scroll-hint { display: none; font-size: .8125rem; color: var(--ink-3); margin: .4rem 0 0; }
@media (max-width: 480px) { .scroll-hint { display: block; } }

/* Steps ("how it works" strip) */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); counter-reset: step; }
.steps > li { margin: 0; position: relative; padding: var(--space-4) var(--space-4) var(--space-4); background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius); counter-increment: step; }
.steps > li::before { content: counter(step); display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .8125rem; margin-bottom: var(--space-3); font-variant-numeric: tabular-nums; }
.steps__title { font-weight: 700; margin-bottom: .3rem; }
.steps p { color: var(--ink-2); font-size: .9375rem; margin: 0; }

/* Definition list */
.deflist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0 0 var(--space-5); border-top: 1px solid var(--rule); }
.deflist > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: .2rem var(--space-5); padding: var(--space-3) 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 640px) { .deflist > div { grid-template-columns: 13rem minmax(0, 1fr); } }
.deflist dt { font-weight: 600; color: var(--ink-2); font-size: .9375rem; }
.deflist dd { margin: 0; }

/* Citation block */
.cite-block { position: relative; }
.cite-block pre { white-space: pre-wrap; word-break: break-word; }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-5); align-items: flex-end; padding: var(--space-4) var(--space-5); background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius-l); box-shadow: var(--shadow-1); margin-bottom: var(--space-5); }
.filter-bar__row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; width: 100%; }
.filter-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.filter-group__label, .filter-group > legend { font-size: .75rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .4rem; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2rem; padding: .25rem .7rem; border-radius: 999px;
  border: 1px solid var(--rule-strong); background: var(--bg); color: var(--ink-2); font: inherit; font-size: .8125rem; font-weight: 550; cursor: pointer; line-height: 1.2;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .swatch { width: .65rem; height: .65rem; }
.chip__count { font-variant-numeric: tabular-nums; opacity: .7; }
.filter-bar__count { margin-left: auto; font-size: .875rem; color: var(--ink-2); white-space: nowrap; }
.filter-bar__count strong { color: var(--ink); }

/* 9. Data components --------------------------------------------------------*/
/* Stat tile */
.stat-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); margin: 0 0 var(--space-5); }
.stat { background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-4) var(--space-5); position: relative; min-width: 0; }
.stat > * { margin: 0; }
.stat__value { font-family: var(--font-serif); font-size: clamp(2rem, 1.6rem + 1.5vw, 2.75rem); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; color: var(--ink); }
.stat__label { margin-top: .4rem; font-size: .9375rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.stat__note { margin-top: .35rem; font-size: .8125rem; color: var(--ink-3); line-height: 1.45; }
.stat--accent .stat__value { color: var(--accent); }
.stat[class*="stat--"]:not(.stat--accent)::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; border-radius: var(--radius) 0 0 var(--radius); }
.stat--supported::before { background: var(--oc-supported); }
.stat--partial::before { background: var(--oc-partial); }
.stat--not_supported::before { background: var(--oc-not-supported); }
.stat--inconclusive::before { background: var(--oc-inconclusive); }
.stat--not_testable::before { background: repeating-linear-gradient(135deg, var(--hatch-a) 0 3px, var(--hatch-b) 3px 5px); }
.stat--not_run::before { background: var(--oc-not-run-line); }

/* Funnel */
.funnel { list-style: none; padding: 0; margin: 0 0 var(--space-5); display: grid; gap: .55rem; }
.funnel__row { display: grid; grid-template-columns: minmax(9rem, 16rem) minmax(0, 1fr) 3.5rem; gap: var(--space-4); align-items: center; margin: 0; }
.funnel__label { font-size: .9375rem; font-weight: 550; line-height: 1.3; }
.funnel__note { display: block; font-size: .78rem; font-weight: 400; color: var(--ink-3); }
.funnel__track { height: 1.6rem; background: var(--bg-sunken); border-radius: var(--radius-s); overflow: hidden; }
.funnel__bar { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); border-radius: var(--radius-s); opacity: .9; }
.funnel__row:nth-child(n+2) .funnel__bar { opacity: .78; }
.funnel__row:nth-child(n+4) .funnel__bar { opacity: .66; }
.funnel__row:nth-child(n+6) .funnel__bar { opacity: .56; }
.funnel__value { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; text-align: right; }
@media (max-width: 560px) {
  .funnel__row { grid-template-columns: minmax(0, 1fr) 3rem; gap: .25rem var(--space-3); }
  .funnel__label { grid-column: 1 / -1; }
  .funnel__track { height: 1.1rem; }
}

/* Funnel aside: a count that belongs next to the funnel but is not one of its steps */
.funnel-aside { display: flex; gap: var(--space-4); align-items: flex-start; padding: var(--space-4); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--bg-elev); margin: 0 0 var(--space-4); max-width: 46rem; }
.funnel-aside > * { margin: 0; }
.funnel-aside__n { font-family: var(--font-serif); font-size: 2.25rem; font-weight: 600; line-height: 1; color: var(--accent); flex: none; min-width: 2.5ch; }
.funnel-aside__text { font-size: .9375rem; color: var(--ink-2); }
.funnel-aside__text strong { color: var(--ink); }

/* Stacked bar */
.stackbar { display: flex; width: 100%; height: 1rem; border-radius: var(--radius-s); overflow: hidden; background: var(--bg-sunken); }
.stackbar--sm { height: .5rem; border-radius: 3px; }
.stackbar--lg { height: 2.25rem; }
.stackbar__seg { flex: 0 0 auto; width: var(--w); min-width: 3px; display: flex; align-items: center; justify-content: center; }
.stackbar--sm .stackbar__seg { min-width: 2px; }
.stackbar__val { font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--seg-ink); padding: 0 2px; overflow: hidden; }
.seg--partial .stackbar__val, .seg--inconclusive .stackbar__val { color: #1b1e23; }   /* light fills in both themes */
.seg--not_testable .stackbar__val { color: var(--ink); background: var(--bg-elev); padding: 0 .3rem; border-radius: 3px; }
.stackbar--lg .stackbar__seg { container-type: inline-size; }
@container (max-width: 40px) { .stackbar__val { font-size: .75rem; padding: 0 1px; } }
.seg--not_run .stackbar__val { color: var(--ink-2); }
.stackbar__seg + .stackbar__seg { border-left: 2px solid var(--bg); }
.stackbar--sm .stackbar__seg + .stackbar__seg { border-left-width: 1px; }
.stackbar--empty { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); }
.stackbar-row { display: grid; grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr) 3rem; gap: var(--space-4); align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.stackbar-row__label { font-weight: 600; font-size: .9375rem; }
.stackbar-row__total { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: .875rem; }
@media (max-width: 560px) { .stackbar-row { grid-template-columns: minmax(0, 1fr) 3rem; } .stackbar-row .stackbar { grid-column: 1 / -1; grid-row: 2; } }

/* Legend */
.legend { list-style: none; padding: 0; margin: var(--space-3) 0 var(--space-4); display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; font-size: .8125rem; color: var(--ink-2); }
.legend__item { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.legend__count { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Data table */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-elev); margin: 0 0 var(--space-5); }
.table-wrap:focus-visible { outline-offset: 2px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 0; }
.data-table caption { caption-side: top; text-align: left; padding: var(--space-3) var(--space-4); font-size: .875rem; color: var(--ink-2); border-bottom: 1px solid var(--rule); }
.data-table th, .data-table td { padding: .6rem var(--space-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.data-table thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-tint); font-size: .75rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:hover > * { background: var(--bg-tint); }
.data-table .num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tfoot td, .data-table tfoot th { font-weight: 700; border-top: 1px solid var(--rule-strong); border-bottom: 0; }
.data-table--compact th, .data-table--compact td { padding: .4rem .7rem; }
.data-table .row-detail > td { background: var(--bg-tint); color: var(--ink-2); font-size: .875rem; }
.row-toggle { font: inherit; font-size: .8125rem; color: var(--accent); background: none; border: 0; padding: .2rem 0; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.row-toggle::before { content: ""; width: .4rem; height: .4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.row-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }

/* 10. Cards ---------------------------------------------------------------- */
.card { background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius-l); padding: var(--space-5); box-shadow: var(--shadow-1); }
.card > :last-child { margin-bottom: 0; }
.card__title { font-size: 1.125rem; margin: 0 0 var(--space-2); }

.run-card { display: flex; flex-direction: column; background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-1); transition: box-shadow .2s, transform .2s, border-color .2s; min-width: 0; }
.run-card:hover { box-shadow: var(--shadow-2); border-color: var(--rule-strong); transform: translateY(-2px); }
.run-card__link { display: flex; flex-direction: column; color: inherit; text-decoration: none; flex: 1; }
.run-card__link:hover { color: inherit; }
.run-card__link:hover .run-card__title { color: var(--accent); }
.run-card__thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; background: #fff; border-bottom: 1px solid var(--rule); padding: 0; }
:root[data-theme="dark"] img.run-card__thumb { filter: brightness(.88); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) img.run-card__thumb { filter: brightness(.88); } }
.run-card__thumb--none { display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--bg-tint) 0 8px, var(--bg-sunken) 8px 16px); color: var(--ink-3); font-size: .8125rem; font-weight: 600; letter-spacing: .04em; }
.run-card__thumb--none span { background: var(--bg-elev); padding: .25rem .6rem; border-radius: 999px; border: 1px solid var(--rule); }
.run-card__body { padding: var(--space-4) var(--space-4) var(--space-2); }
.run-card__id { font-size: .75rem; color: var(--ink-3); margin: 0 0 .35rem; overflow-wrap: anywhere; }
.run-card__title { font-family: var(--font-sans); font-size: 1rem; font-weight: 650; line-height: 1.35; margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.run-card__foot { padding: var(--space-2) var(--space-4) var(--space-4); display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--ink-2); }
.run-card__foot .stackbar { flex-basis: 100%; margin-top: .25rem; }
.run-card__summary { font-variant-numeric: tabular-nums; }
/* Phones: a report thumbnail is unreadable at this size; show a compact row instead. */
@media (max-width: 600px) {
  .run-card__link { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
  .run-card__thumb { width: 64px; aspect-ratio: 3 / 4; height: auto; margin: var(--space-4) 0 0 var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius-s); }
  .run-card__thumb--none { display: none; }
  .run-card__link:has(.run-card__thumb--none) { grid-template-columns: minmax(0, 1fr); }
  .run-card__body { padding-bottom: var(--space-1); }
  .run-card__title { -webkit-line-clamp: 3; }
}

.case-card { display: grid; grid-template-rows: auto 1fr; background: var(--bg-elev); border: 1px solid var(--rule); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-1); color: inherit; text-decoration: none; transition: box-shadow .2s, transform .2s, border-color .2s; }
.case-card:hover { color: inherit; box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--rule-strong); }
.case-card__media { aspect-ratio: 16 / 9; background: var(--figure-bg); border-bottom: 1px solid var(--rule); overflow: hidden; }
.case-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.case-card__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }
.case-card__body > * { margin: 0; }
.case-card__title { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; line-height: 1.25; }
.case-card:hover .case-card__title { color: var(--accent); }
.case-card__text { color: var(--ink-2); font-size: .9375rem; }
.case-card__meta { margin-top: auto !important; padding-top: var(--space-3); font-size: .8125rem; color: var(--ink-3); }

/* 11. Long-form report pages ---------------------------------------------- */
.doc { display: grid; gap: var(--space-7); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1080px) {
  .doc--toc { grid-template-columns: minmax(0, var(--measure)) 15rem; justify-content: space-between; }
  .doc--toc-wide { grid-template-columns: minmax(0, 1fr) 13rem; }
}
.toc { font-size: .875rem; }
.toc__inner { position: sticky; top: var(--space-5); border-left: 1px solid var(--rule); padding-left: var(--space-4); }
.toc__title { font-size: .75rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--space-2); }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: .25rem 0; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--accent); }
@media (max-width: 1079px) { .toc { order: -1; } .toc__inner { position: static; border-left: 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-elev); } .toc ol { columns: 2 12rem; } }

.report-body { font-size: 1.0625rem; overflow-wrap: break-word; }
.report-body h2 { font-size: 1.6rem; padding-top: var(--space-2); }
.report-body h3 { font-size: 1.125rem; }
.report-body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: .875rem; max-width: 100%; }
.report-body th, .report-body td { border: 1px solid var(--rule); padding: .4rem .6rem; text-align: left; vertical-align: top; }
.report-body th { background: var(--bg-tint); }
.report-body hr { margin: var(--space-6) 0; }
.report-body sup { line-height: 0; }
.report-body ol li, .report-body ul li { overflow-wrap: anywhere; }
.report-body .figure img { max-height: none; }
.report-head__id { font-family: var(--font-mono); font-size: clamp(1.6rem, 1.1rem + 2vw, 2.5rem); font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.report-head__label { font-size: .75rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: var(--space-4) 0 var(--space-2); }
.report-head .callout { margin: var(--space-5) 0 0; max-width: var(--measure); }
.report-head__title { font-family: var(--font-serif); font-size: clamp(1.15rem, 1.05rem + .5vw, 1.4rem); line-height: 1.35; color: var(--ink-2); max-width: var(--measure); margin: 0; }
.report-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; font-size: .875rem; color: var(--ink-2); margin-bottom: var(--space-5); }

/* 12. Style guide helpers -------------------------------------------------- */
.sg-section { padding-block: var(--space-7); border-top: 1px solid var(--rule); }
.sg-section:first-of-type { border-top: 0; }
.sg-demo { background: var(--bg); border: 1px dashed var(--rule-strong); border-radius: var(--radius); padding: var(--space-5); margin-bottom: var(--space-3); }
.sg-demo > :last-child { margin-bottom: 0; }
.sg-code { margin-bottom: var(--space-5); }
.sg-code summary { cursor: pointer; font-size: .8125rem; font-weight: 600; color: var(--ink-2); padding: .25rem 0; }
.sg-code pre { margin-top: var(--space-2); font-size: .8rem; max-height: 22rem; }
.sg-swatches { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); }
.sg-swatch { border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); font-size: .78rem; }
.sg-swatch__chip { height: 56px; }
.sg-swatch__meta { padding: .5rem .65rem; }
.sg-swatch__meta code { font-size: .72rem; background: none; border: 0; padding: 0; color: var(--ink-3); }
.sg-type > * { margin-bottom: var(--space-3); }

/* Print -------------------------------------------------------------------- */
@media print {
  :root { --bg: #fff; --bg-elev: #fff; --bg-tint: #fff; --bg-sunken: #fff; --ink: #000; --ink-2: #222; --ink-3: #444; --rule: #bbb; }
  body { font-size: 11pt; display: block; }
  .site-header, .nav-toggle, .theme-toggle, .skip-link, .site-footer__grid, .filter-bar, .toc, .hero__actions, .sg-code { display: none !important; }
  .disclaimer { border: 1px solid #999; margin-bottom: 1rem; }
  .site-footer { margin-top: 2rem; background: none; }
  a { color: #000; text-decoration: underline; }
  .prose a[href^="http"]::after, .report-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; }
  .run-card, .case-card, .card, .stat, .figure, .callout, tr { break-inside: avoid; box-shadow: none !important; }
  .section { padding-block: 1.2rem; }
  .stackbar__seg, .swatch, .badge::before, .funnel__bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .run-card:hover, .case-card:hover { transform: none; }
}
