/* Ai4Qi clinical audit library
   Identity: navy and gold, a refined serif for headings, quiet surfaces.
   Logo: two i-stems whose dots rise, cycle 1 (grey) to re-audit (gold). */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #0b1f3a;
  --muted: #5a6478;
  --border: #e3e6ec;
  --border-strong: #c5cbd6;
  --primary: #0b1f3a;
  --primary-hover: #1b3358;
  --on-primary: #ffffff;
  --primary-tint: #eef1f6;
  --gold: #87652a;                 /* 5:1 on the page background (WCAG AA text) */
  --gold-soft: #f6efe1;
  --ink: #0b1f3a;
  --on-ink: #f3f5f9;
  --on-ink-muted: #a9b2c3;
  --mint: #c9a45c;
  --link: #0b1f3a;
  --link-visited: #3c3a6e;
  --focus: #87652a;
  --control-border: #7c8595;       /* 3.7:1 against white (WCAG 1.4.11) */
  --focus-text: #0b1f3a;
  --ok-bg: #edf5f0;
  --ok-text: #1f6a47;
  --warn-bg: #fbf4e6;
  --warn-text: #7a5514;
  --warn-border: #dfc18b;
  --info-bg: #eef1f6;
  --info-text: #1b3358;
  --neutral-bg: #f1f3f6;
  --neutral-text: #3f4a5e;
  --bar: #0b1f3a;
  --bar-2: #c9a45c;
  --bar-2-text: #0b1f3a;
  --shadow: 0 1px 2px rgba(11, 31, 58, .04), 0 10px 30px -18px rgba(11, 31, 58, .18);
  --radius: 10px;
  --font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1424; --surface: #0f1b30; --surface-2: #15233c; --text: #edf0f5; --muted: #9aa4b6;
    --border: #22324e; --border-strong: #3a4c6d; --primary: #d6b772; --primary-hover: #e3c98f; --on-primary: #0b1f3a;
    --primary-tint: #1a2944; --gold: #d6b772; --focus: #d6b772; --control-border: #6f82a3; --focus: #d6b772; --control-border: #6f82a3; --gold-soft: #2a2718; --ink: #060d1a; --mint: #d6b772;
    --link: #e3e8f1; --link-visited: #c9c4ee; --ok-bg: #12301f; --ok-text: #9fd6b5; --warn-bg: #33280f; --warn-text: #ecd29a;
    --warn-border: #8a6a2b; --info-bg: #1a2944; --info-text: #c7d2e6; --neutral-bg: #182640; --neutral-text: #c5ccda;
    --bar: #9fb0cc; --bar-2: #d6b772; --bar-2-text: #0b1f3a; --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1424; --surface: #0f1b30; --surface-2: #15233c; --text: #edf0f5; --muted: #9aa4b6;
  --border: #22324e; --border-strong: #3a4c6d; --primary: #d6b772; --primary-hover: #e3c98f; --on-primary: #0b1f3a;
  --primary-tint: #1a2944; --gold: #d6b772; --focus: #d6b772; --control-border: #6f82a3; --gold-soft: #2a2718; --ink: #060d1a; --mint: #d6b772;
  --link: #e3e8f1; --link-visited: #c9c4ee; --ok-bg: #12301f; --ok-text: #9fd6b5; --warn-bg: #33280f; --warn-text: #ecd29a;
  --warn-border: #8a6a2b; --info-bg: #1a2944; --info-text: #c7d2e6; --neutral-bg: #182640; --neutral-text: #c5ccda;
  --bar: #9fb0cc; --bar-2: #d6b772; --bar-2-text: #0b1f3a; --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.18; margin: 0 0 .5em; text-wrap: balance; letter-spacing: -.005em; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
ul, ol { padding-left: 1.3em; margin: 0 0 .8em; }
li { margin-bottom: .35em; }
.kicker, .eyebrow-label { font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding-inline: 24px; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--focus); color: var(--focus-text); padding: 8px 12px; z-index: 30; font-weight: 600; }
.skip-link:focus { top: 8px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 28px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { display: inline-flex; }
.brand-mark svg { width: 34px; height: 34px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong { font-family: var(--display); font-size: 1.55rem; font-weight: 600; letter-spacing: -.01em; }
.brand-text strong b { font-weight: 600; color: inherit; }
.brand-sub { font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: center; }
.site-nav a { position: relative; color: var(--muted); text-decoration: none; padding: 6px 0; font-size: .96rem; font-weight: 600; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold); }
.install-btn { font: inherit; font-size: .88rem; font-weight: 600; color: var(--text); background: transparent; border: 1px solid var(--border-strong); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.install-btn:hover { background: var(--surface-2); }

main.wrap { padding-block: 40px 72px; min-height: 60vh; }
main:focus { outline: none; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .9rem; }
.footer-inner { padding-block: 28px 36px; display: grid; gap: 4px; }
.footer-inner p { max-width: 78ch; }
.offline-note { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .84rem; }
.offline-note[hidden] { display: none; }

.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 40px 0; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Home */
.hero { max-width: 760px; padding-block: 24px 12px; }
.hero h1 { font-size: clamp(2.3rem, 1.5rem + 3.2vw, 3.6rem); line-height: 1.06; font-weight: 500; letter-spacing: -.015em; margin-bottom: .4em; }
.hero .lede { color: var(--muted); font-size: 1.16rem; max-width: 60ch; margin-bottom: 8px; }
.examples { margin-top: 16px; font-size: .95rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.examples > span:first-child { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-right: 4px; }
.examples .sep { color: var(--border-strong); }
.examples a { color: var(--text); }
.hero-alt { margin-top: 12px; font-size: .95rem; color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 40px 0 48px; padding: 22px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.facts div { padding-inline: 20px; border-left: 1px solid var(--border); }
.facts div:first-child { border-left: 0; padding-left: 0; }
.facts dt { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-family: var(--display); font-size: 2.1rem; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }

.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 56px; }
.index-list { list-style: none; padding: 0; margin: 0; }
.index-list li { margin: 0; }
.index-list a { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.index-list a:hover .il-name { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.il-name { flex: 0 1 auto; }
.il-dots { flex: 1 1 auto; border-bottom: 1px dotted var(--border-strong); transform: translateY(-4px); min-width: 16px; }
.il-n { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .92rem; }

.search-form { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.search-form label { width: 100%; font-weight: 600; font-size: .95rem; }
.search-form input[type="search"] { flex: 1 1 280px; min-width: 0; font: inherit; font-size: 1.08rem; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.search-form input[type="search"]:focus { border-color: var(--text); outline: 2px solid var(--focus); outline-offset: 1px; }
.hero .search-form label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; letter-spacing: .01em; padding: 12px 22px; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary); cursor: pointer; text-decoration: none; line-height: 1.2; transition: background-color .15s; }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); border-color: var(--text); }
.btn svg { flex: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 28px; padding: 0; list-style: none; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 0; }
.stat b { display: block; font-family: var(--display); font-size: 1.6rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .9rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--text); }
.section-head h2 { margin: 0; font-size: 1.45rem; }
.section-head a { font-size: .92rem; font-weight: 600; }
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 32px; list-style: none; padding: 0; margin: 0; }
.chip-grid li { margin: 0; }
.chip-link { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.chip-link:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.chip-link .count { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* Badges: quiet labels, not candy */
.badges { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 10px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: transparent; color: var(--muted); border: 1px solid var(--border-strong); line-height: 1.6; max-width: 100%; }
.badge-ok { color: var(--ok-text); border-color: color-mix(in srgb, var(--ok-text) 40%, transparent); }
.badge-ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-warn { color: var(--warn-text); border-color: var(--warn-border); background: var(--warn-bg); }
.badge-info { color: var(--info-text); }
.badge-primary { color: var(--text); border-color: var(--border-strong); }

/* Search results */
.results-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.filters { position: sticky; top: 96px; padding: 0; }
.filters h2 { font-size: 1.05rem; margin-bottom: 12px; }
.filters label { display: block; font-size: .94rem; }
.filters select { width: 100%; font: inherit; padding: 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); margin: 4px 0 12px; }
.check { display: flex !important; align-items: flex-start; gap: 8px; margin: 8px 0; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 4px 0 0; accent-color: var(--primary); flex: none; }
.filters .hint { font-size: .84rem; color: var(--muted); margin: 10px 0 0; }
.results-title { margin: 28px 0 8px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--text); }
.results-title h2 { margin: 0; }
.results-title .count { color: var(--muted); font-size: .9rem; }
.result-list { list-style: none; padding: 0; margin: 0; }
.result { min-width: 0; overflow-wrap: anywhere; padding: 18px 0; margin: 0; border-bottom: 1px solid var(--border); }
.result h3 { font-size: 1.18rem; margin: 0 0 6px; line-height: 1.3; }
.result h3 a { text-decoration: none; color: var(--text); }
.result h3 a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.result .meta { color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.result .snippet { font-size: .98rem; margin: 0; color: var(--neutral-text); max-width: 75ch; }
.result .badges { margin: 10px 0 0; }
.result-proposed { }
.empty { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; color: var(--muted); background: var(--surface); }
.more { margin-top: 16px; }
.id-tag { font-family: var(--mono); font-size: .78rem; color: var(--muted); }

/* Detail pages */
.breadcrumb { font-size: .9rem; margin-bottom: 20px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.doc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: clamp(22px, 4vw, 56px); box-shadow: var(--shadow); }
.doc-head { border-bottom: 1px solid var(--border); padding-bottom: 24px; margin-bottom: 8px; }
.doc-head h1 { max-width: 30ch; font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem); }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.doc section { padding: 28px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 8px; }
.doc section > * { grid-column: 2; }
.doc section > h2 { grid-column: 1 / -1; font-size: 1.45rem; display: flex; align-items: baseline; gap: 18px; margin-bottom: 12px; }
.doc section:last-child { border-bottom: 0; padding-bottom: 0; }
.doc section > h2 .num { display: inline-block; width: 38px; font-family: var(--display); font-size: 1.45rem; font-weight: 400; color: var(--gold); flex: none; font-variant-numeric: lining-nums; }
.doc .prose { max-width: 70ch; }
.sub { margin: 20px 0 0; }
.sub > h3 { font-family: var(--font); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 6px; }
.sub:first-of-type { margin-top: 4px; }
blockquote.standard { margin: 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--gold); font-family: var(--display); font-size: 1.28rem; line-height: 1.45; font-style: italic; }
blockquote.standard p:last-child { margin-bottom: 0; }
.standard-source { font-size: .9rem; color: var(--muted); margin: 10px 0 0 24px; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.kv dt { font-weight: 600; color: var(--muted); font-size: .92rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.target { display: inline-block; font-family: var(--display); font-size: 2.2rem; font-weight: 500; color: var(--gold); margin-right: 10px; font-variant-numeric: lining-nums tabular-nums; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; margin: 6px 0 12px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface-2); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td code { font-family: var(--mono); font-size: .82rem; color: var(--text); }
.target-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
td.opts { color: var(--muted); }

.timeline { margin: 8px 0 4px; }
.tl-scale, .tl-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: center; }
.tl-track { display: grid; gap: 2px; position: relative; }
.tl-scale .tl-track span { font-size: .7rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.tl-row { padding: 4px 0; }
.tl-label { font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; line-height: 1.2; }
.tl-row .tl-track { background: repeating-linear-gradient(90deg, var(--surface-2) 0 calc(100% / var(--weeks) - 2px), transparent calc(100% / var(--weeks) - 2px) calc(100% / var(--weeks))); border-radius: 4px; min-height: 26px; }
.tl-bar { background: var(--bar); color: var(--on-primary); border-radius: 4px; font-size: .72rem; font-weight: 600; display: flex; align-items: center; justify-content: center; min-height: 26px; white-space: nowrap; overflow: hidden; padding: 0 4px; }
.tl-bar.alt { background: var(--bar-2); color: var(--bar-2-text); }

.pit-list, .pearl-list, .ev-list { list-style: none; padding: 0; display: grid; gap: 0; }
.pit-list li, .pearl-list li, .ev-list li { padding: 12px 0 12px 18px; margin: 0; border-bottom: 1px solid var(--border); position: relative; max-width: 80ch; }
.pit-list li::before, .pearl-list li::before, .ev-list li::before { content: ""; position: absolute; left: 0; top: 22px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.pit-list .risk { font-weight: 600; }
.pit-list .arrow { color: var(--gold); font-weight: 700; margin: 0 6px; }
.status-box { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }

.flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; margin: 6px 0; }
.flow-step { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; min-width: 0; overflow-wrap: anywhere; }
.flow-step h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-hover); margin-bottom: 4px; }
.flow-step .meta { font-size: .84rem; color: var(--muted); margin-bottom: 6px; }
.flow-step p:last-child { margin-bottom: 0; }
.flow-arrow { display: grid; place-items: center; color: var(--primary); font-size: 1.4rem; font-weight: 700; }

.abstract { max-width: 75ch; font-size: .95rem; }
.licence-note { font-size: .84rem; color: var(--muted); }
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
figure { margin: 0; border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--surface); }
figure img { display: block; margin: 0 auto 8px; border-radius: 4px; background: #fff; }
figcaption { font-size: .88rem; }
figcaption .credit { display: block; color: var(--muted); font-size: .78rem; margin-top: 6px; }
.citation { font-size: .93rem; overflow-wrap: anywhere; }
.links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .93rem; }

.card-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: clamp(16px, 3vw, 28px); margin-bottom: 16px; box-shadow: var(--shadow); }
.card-panel.draft { border-top: 4px solid var(--warn-border); }
.card-panel.seed { border-top: 4px solid var(--primary); }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.card-grid .sub { margin: 0; }
.draft-banner { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; font-size: .92rem; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0 16px; }
.toolbar input { font: inherit; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); flex: 1 1 260px; min-width: 0; }
.std-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.std { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0; }
.std h3 { font-size: 1rem; }
.std .used { margin-top: 10px; font-size: .88rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.used a { font-family: var(--mono); font-size: .82rem; padding: 1px 7px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; }
.used a:hover { border-color: var(--primary); }
.area-group { margin-bottom: 24px; }
.page-intro { color: var(--muted); max-width: 70ch; }
.muted { color: var(--muted); }

@media (max-width: 860px) {
  .home-cols { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .facts div:nth-child(3) { border-left: 0; padding-left: 0; }
  .results-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .filters { position: static; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-arrow { transform: rotate(90deg); height: 20px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  table.tpl, table.tpl tbody, table.tpl tr, table.tpl td { display: block; width: 100%; }
  table.tpl thead { display: none; }
  table.tpl tr { padding: 8px 10px; border-bottom: 1px solid var(--border); }
  table.tpl tbody tr:last-child { border-bottom: 0; }
  table.tpl td { border: 0; padding: 2px 0; display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; }
  table.tpl td::before { content: attr(data-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 2px; }
  table.tpl td.empty-cell { display: none; }
  table.tpl td code { font-weight: 600; }
  .tl-scale, .tl-row { grid-template-columns: 78px minmax(0, 1fr); gap: 6px; }
  .tl-label { font-size: .78rem; }
  .tl-bar { font-size: 0; }
  .tl-scale .tl-track span:nth-child(even) { visibility: hidden; }
  .site-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .site-nav a { white-space: nowrap; }
  .brand-sub { display: none; }
  .doc section { grid-template-columns: minmax(0, 1fr); }
  .doc section > * { grid-column: 1; }
  .doc section > h2 .num { width: 34px; }
  .site-nav a { padding: 6px 8px; font-size: .9rem; }
  .search-form .btn { width: 100%; }
}

/* Print: a proposed audit prints as a clean protocol */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --text: #000; --muted: #333; --border: #bbb; --primary: #000; --primary-hover: #000; --primary-tint: #f3f3f3; --link: #000; --on-primary: #fff; --bar: #555; --bar-2: #bbb; color-scheme: light; }
  @page { margin: 14mm 14mm 16mm; }
  html { font-size: 9pt; }
  body { font-size: 9pt; line-height: 1.35; background: #fff; }
  .doc .prose, .abstract { max-width: none; }
  .target { font-size: 12pt; }
  .sub > h3 { margin-bottom: 1px; font-size: 7.5pt; }
  p { margin-bottom: .4em; }
  .doc-head { padding-bottom: 6px; }
  .site-header, .site-footer, .skip-link, .breadcrumb, .doc-actions, .no-print, .more, .filters { display: none !important; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .doc, .card-panel { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .doc section { padding: 5px 0; break-inside: auto; }
  ul { margin-bottom: .3em; }
  .doc section > h2 { font-size: 11.5pt; margin-bottom: 4px; break-after: avoid; }
  .doc section > h2 .num { background: #000; color: #fff; width: 18px; height: 18px; font-size: 8pt; }
  h1 { font-size: 16pt; max-width: none !important; }
  .sub { margin-top: 5px; }
  .sub > h3 { break-after: avoid; }
  .table-wrap { overflow: visible; border: 1px solid #999; }
  table { font-size: 8.5pt; }
  th, td { padding: 2px 5px; line-height: 1.25; }
  tr { break-inside: avoid; }
  thead { display: table-header-group; }
  blockquote.standard { background: none; border-left: 3px solid #000; padding: 4px 10px; }
  .pit-list li, .pearl-list li, .ev-list li { border: 0; border-left: 2px solid #999; border-radius: 0; padding: 1px 8px; margin-bottom: 2px; }
  .tl-row .tl-track { background: none; border: 1px solid #ccc; }
  .tl-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 7pt !important; min-height: 16px; }
  .tl-row { padding: 1px 0; }
  .badge { border: 1px solid #555; background: none !important; color: #000 !important; box-shadow: none; }
  a { text-decoration: none; }
  .print-url::after { content: " (" attr(href) ")"; font-size: 8pt; overflow-wrap: anywhere; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
h1[tabindex="-1"]:focus { outline: none; }

/* feedback */
.fb { margin-top: 2rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.fb-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.fb-q { font-weight: 600; margin-right: .4rem; }
.fb-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); cursor: pointer; }
.fb-btn:hover { color: var(--primary); border-color: var(--primary); }
.fb-btn.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.fb-more { margin-top: .9rem; }
.fb-sub { display: block; font-size: .92rem; color: var(--muted); margin: .2rem 0 .5rem; }
.fb-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.fb-chip { padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .92rem; cursor: pointer; }
.fb-chip.is-on { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.fb-comment { width: 100%; box-sizing: border-box; font: inherit; padding: .5rem .6rem; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); margin-bottom: .7rem; }
.fb-thanks { margin: .7rem 0 0; color: var(--ok-text); font-weight: 600; }
.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; }
.fb-count { font-size: .88rem; color: var(--muted); margin-left: .2rem; }
.fb-count[hidden] { display: none; }

/* account and admin (shown only when the optional backend is configured) */
.doc.narrow { max-width: 640px; }
.stack-form { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 16px 0 8px; max-width: 460px; }
.stack-form label { font-weight: 600; margin-top: 8px; }
.stack-form input, .stack-form select { width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.stack-form input:focus, .stack-form select:focus { border-color: var(--primary); outline: 3px solid var(--focus); outline-offset: 0; }
.stack-form input[aria-invalid="true"] { border-color: var(--warn-border); }
.stack-form .btn { margin-top: 12px; }
.stack-form .btn:disabled, .btn:disabled { opacity: .6; cursor: default; }
.form-status { min-height: 1.4em; margin: 4px 0 0; font-size: .92rem; color: var(--ok-text); }
.form-status:empty { min-height: 0; }
.form-status.is-error { color: var(--warn-text); }
.notice { border-radius: 8px; padding: 12px 14px; margin: 12px 0; border: 1px solid var(--border); }
.notice p:last-of-type { margin-bottom: .6em; }
.notice-ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.notice-ok .btn-secondary { color: var(--ok-text); border-color: currentColor; }
.notice-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.notice:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.small-print { font-size: .86rem; margin-top: 16px; }
.account-section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 20px; }
.account-section h2 { font-size: 1.1rem; }
.account-actions { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 20px; }
.adm-table .num-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-table td:first-child { min-width: 200px; }
.adm-q { display: block; color: var(--text); font-size: .86rem; margin-top: 2px; }
.adm-h2 { margin-top: 28px; }
.adm-comments { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.adm-comments li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0; overflow-wrap: anywhere; }
.adm-comments .meta { color: var(--muted); font-size: .86rem; margin: 0 0 4px; }
.adm-comment { margin: 6px 0 0; white-space: pre-wrap; }

/* "My audits" tracker (optional backend) */
.track { margin-top: 14px; }
.track-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.track-note, .track-head { margin: 0 0 8px; font-size: .95rem; }
.track-status { min-height: 1.3em; margin: 6px 0 0; font-size: .92rem; color: var(--ok-text); }
.track-status:empty { min-height: 0; margin: 0; }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; counter-reset: none; }
.steps li { margin: 0; }
.step { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .9rem; padding: 6px 10px 6px 6px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; min-height: 36px; }
.step:hover { background: var(--surface-2); }
.step .step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: .8rem; font-weight: 700; }
.step.is-done { border-color: var(--ok-text); }
.step.is-done .step-n { background: var(--ok-text); color: var(--surface); }
.step[aria-pressed="true"] { background: var(--primary-tint); font-weight: 600; }
.step:disabled { opacity: .6; cursor: default; }
.my-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.my-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 0; overflow-wrap: anywhere; }
.my-title { margin: 0 0 4px; font-weight: 600; }
.my-item .meta { margin: 0 0 10px; font-size: .88rem; }
.link-btn { background: none; border: 0; padding: 4px 0; margin-top: 8px; font: inherit; font-size: .9rem; color: var(--link); text-decoration: underline; cursor: pointer; }

/* admin usage statistics */
.range-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin: 12px 0 20px; }
.range-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.range-form input { font: inherit; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); color-scheme: light dark; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 8px; }
.mini-chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 8px; margin: 0; min-width: 0; }
.mini-chart figcaption { font-size: .88rem; margin-bottom: 6px; }
.mini-chart figcaption strong { display: block; font-size: .95rem; }
.adm-table td.wk { white-space: nowrap; }
.adm-table td.wk .muted { display: block; font-size: .84rem; }
.mini-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.mini-chart .bar { fill: var(--primary); }
.mini-chart .hit { fill: transparent; }
.mini-chart g:hover .bar { fill: var(--primary-hover); }
.mini-chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.mini-chart text { fill: var(--muted); font-size: 11px; }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 20px; }
.bd h3 { font-size: 1rem; margin: 8px 0 4px; }
.copy-status{font-size:.9rem;color:var(--ok-text);align-self:center}.copy-fallback{width:100%;margin-top:.5rem;font:inherit;font-size:.85rem}

/* ---------- build an audit ---------- */
.hero-alt { margin-top: 10px; font-size: .92rem; color: var(--muted); }
.build-cta { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; background: var(--primary-tint); border: 1px solid var(--primary); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 22px; }
.build-cta h2 { font-size: 1.1rem; margin: 0 0 4px; text-wrap: balance; }
.build-cta p { margin: 0; color: var(--muted); font-size: .92rem; max-width: 60ch; }
.build-status { display: flex; gap: 10px; align-items: center; margin: 14px 0 6px; font-weight: 600; }
.build-steps { list-style: none; padding: 0; margin: 8px 0 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; color: var(--muted); }
.build-steps li { display: inline-flex; align-items: center; gap: 6px; }
.build-steps .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border-strong); }
.build-steps .is-done { color: var(--text); }
.build-steps .is-done .dot { background: var(--primary); border-color: var(--primary); }
.best-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 600; margin: 10px 0 2px; }
.alt-line { margin: 6px 0 12px; max-width: 70ch; }
.similar-box { border: 1px solid var(--warn-border); background: var(--warn-bg); color: var(--warn-text); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 22px; }
.similar-box h2 { font-size: 1rem; margin: 0 0 6px; }
.similar-box p { margin: 4px 0; }
.similar-box a { color: inherit; font-weight: 600; }
.similar-box .muted { color: inherit; opacity: .85; }
.more-link { margin-top: 10px; }

/* ---------- choosing and running an audit ---------- */
.variants { margin-top: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.v-more summary { cursor: pointer; font-size: .9rem; color: var(--muted); }
.v-more summary:hover { color: var(--text); }
.v-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; width: 100%; }
.v-list li { margin: 0; }
.v-list a { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--text); padding: 6px 8px; border-radius: 6px; }
.v-list a:hover { background: var(--surface-2); }
.v-list a[aria-current="page"] { background: var(--surface-2); font-weight: 600; }
.v-n { flex: none; font-family: var(--display); color: var(--gold); min-width: 14px; }

.page-head { margin-bottom: 18px; }
.run-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.run-card { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; display: grid; gap: 8px; align-content: start; }
.run-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.rc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run-card h2 { font-size: 1.2rem; margin: 0; line-height: 1.3; }
.run-card h2 a { color: var(--text); text-decoration: none; }
.run-card h2 a:hover { color: var(--primary); text-decoration: underline; }
.run-card .meta { margin: 0; color: var(--muted); font-size: .9rem; }
.run-card .sp-bars, .run .sp-bars { display: grid; gap: 8px; margin: 4px 0; }
.sp-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) 48px; gap: 12px; align-items: center; font-size: .88rem; color: var(--muted); }
.sp-track { position: relative; height: 12px; background: var(--line-soft, #eceff4); border-radius: 6px; }
.sp-fill { height: 100%; border-radius: 6px; background: #a9b3c4; }
.sp-row.after .sp-fill { background: var(--primary); }
.sp-target { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed var(--gold); z-index: 1; }
.sp-row b { font-family: var(--display); font-size: 1.1rem; color: var(--ink, #0b1f3a); text-align: right; font-variant-numeric: tabular-nums; }
.run .sp-bars { max-width: 640px; gap: 12px; }
.rc-next { margin: 4px 0 0; font-size: .92rem; padding-top: 10px; border-top: 1px solid var(--border); }
.rc-next.is-late, .next-card.is-late .nc-label { color: var(--warn-text); }
.restore { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.run-steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; counter-reset: none; }
.run-steps li { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 10px 10px 10px 8px; border-radius: 10px; background: var(--surface-2); font-size: .86rem; }
.rs-dot { grid-row: span 2; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--border-strong); font-weight: 700; font-size: .8rem; color: var(--muted); }
.rs-t { font-weight: 600; line-height: 1.2; }
.rs-d { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.run-steps .is-done .rs-dot { background: var(--ok-text); border-color: var(--ok-text); color: var(--surface); }
.run-steps .is-now { background: var(--primary-tint); box-shadow: inset 0 0 0 1.5px var(--primary); }
.run-steps .is-now .rs-dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.next-card { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 20px; border-radius: 10px; background: var(--ink); color: var(--on-ink); }
.nc-label { margin: 0 0 2px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mint); }
.next-card.is-late .nc-label { color: #ffd166; }
.nc-text { margin: 0; font-family: var(--display); font-size: 1.3rem; font-weight: 500; }
.nc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.next-card .btn { background: #c9a45c; border-color: #c9a45c; color: #0b1f3a; }
.next-card .btn-secondary { background: transparent; color: var(--on-ink); border-color: rgba(255, 255, 255, .3); }
.next-card .btn-secondary:hover { background: rgba(255, 255, 255, .08); }
.privacy-note { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: .9rem; color: var(--ok-text); }

.det-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; margin: 0 0 12px; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.rec-f { display: grid; gap: 4px; align-content: start; min-width: 0; }
.rec-f label { font-weight: 600; font-size: .9rem; }
.rec-f label .muted { font-weight: 400; font-size: .8rem; display: block; }
.rec-f input, .rec-f select, .rec-f textarea { width: 100%; min-width: 0; font: inherit; font-size: .98rem; padding: 9px 11px; border: 1.5px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
.rec-f input:focus, .rec-f select:focus, .rec-f textarea:focus { border-color: var(--primary); outline: 3px solid var(--focus); outline-offset: 0; }
.rec-wide { grid-column: 1 / -1; }
.rec-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.det-form .muted { grid-column: 1 / -1; margin: 0; font-size: .9rem; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { font: inherit; font-weight: 700; background: none; border: 0; padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
.tabs .count { font-family: var(--mono); font-size: .78rem; background: var(--surface-2); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.cycle-panel { display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.kpi span { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi b { font-family: var(--display); font-size: 1.9rem; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
.kpi b small { font-size: .95rem; color: var(--muted); font-weight: 600; }
.kpi > small { color: var(--muted); font-size: .86rem; }
.mini-track { height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.mini-track i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.rec-box { border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; background: var(--surface); }
.rec-box[open] { padding-bottom: 16px; }
.rec-box summary { cursor: pointer; font-weight: 700; padding: 12px 0; color: var(--primary); }
.rec-box summary:hover { color: var(--primary-hover); }
.rec-box .muted { font-size: .9rem; }
.file-pick { display: inline-flex; position: relative; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-pick input:focus-visible + .btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.import-preview { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--ok-bg); color: var(--text); }
.import-preview ul { margin: 8px 0 12px; font-size: .92rem; }
.rows-t { font-size: .86rem; }
.rows-t td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.num-col { font-family: var(--mono); color: var(--muted); }
.bd-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.bd-bars li { margin: 0; display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: .9rem; }
.bd-bars i { display: block; height: 12px; border-radius: 6px; background: var(--primary); min-width: 2px; }
.bd-bars b { font-variant-numeric: tabular-nums; text-align: right; }
.bd-bars.is-two li { grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 64px; }
.bd-pair { display: grid; gap: 3px; }
.bd-pair i { height: 8px; }
.bd-pair i.before, .bd-key .k-before::before { background: #a9b3c4; }
.bd-key { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); margin: 0 0 8px; }
.bd-key span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--primary); }
.out-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.out-btn { font: inherit; text-align: left; display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, background-color .15s; }
.out-btn:hover { border-color: var(--primary); background: var(--primary-tint); }
.out-btn b { font-family: var(--display); font-size: 1.12rem; font-weight: 500; }
.out-btn span { font-size: .86rem; color: var(--muted); }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); display: block !important; }
.danger-zone .link-btn { color: var(--warn-text); }
@media (max-width: 860px) {
  .run-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .run-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-list { grid-template-columns: minmax(0, 1fr); }
  .bd-bars li { grid-template-columns: minmax(0, 1fr) 36px; }
  .bd-bars i { grid-column: 1 / -1; grid-row: 2; }
  .bd-bars.is-two li { grid-template-columns: minmax(0, 1fr) 64px; }
  .bd-pair { grid-column: 1 / -1; grid-row: 2; }
  .bd-pair i { grid-row: auto; }
}
.ft-warn { font-size: .78rem; color: var(--warn-text); }
.opt-set { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin: 0; display: grid; gap: 2px; }
.opt-set legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.export-warn { margin: 12px 0 0; font-size: .9rem; color: var(--warn-text); background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; }
.vault .stack-form .check { font-weight: 400; margin-top: 12px; }
.privacy-note .link-btn { margin: 0 0 0 6px; padding: 0; }
.rec-box.nested { margin-top: 10px; }
.paste-any { margin-bottom: 16px; }
.rec-box code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.consent { border: 0; padding: 0; margin: 10px 0 4px; display: grid; gap: 4px; }
.consent legend { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 4px; }
.stack-form .consent .check { font-weight: 400; margin: 2px 0; }
.brand-mark svg { border-radius: 8px; box-shadow: 0 0 0 1px var(--border-strong); }

/* Account menu (right of the header): initials when signed in, a person icon otherwise */
.header-inner { flex-wrap: nowrap; }
.site-nav { margin-left: auto; }
.acct { position: relative; flex: none; }
.acct-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: var(--text); }
.acct-btn.is-current { box-shadow: 0 0 0 2px var(--gold); border-color: var(--gold); }
.acct-avatar { display: inline-grid; place-items: center; font-family: var(--display); font-size: .98rem; font-weight: 600; letter-spacing: .02em; }
.acct-avatar.has-initials { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--on-primary); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 40; display: grid; }
.acct-menu[hidden] { display: none; }
.acct-menu a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.acct-menu a:hover, .acct-menu a:focus-visible { background: var(--surface-2); }
.acct-menu a[aria-current="page"] { color: var(--gold); }
.acct-who { margin: 0; padding: 8px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .header-inner { flex-wrap: wrap; }
  .acct { position: absolute; right: 20px; top: 12px; }
  .site-header .wrap { position: relative; }
}
.acct-menu a[hidden], [hidden] { display: none !important; }

/* demo mode */
.demo-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: center; margin: 0 0 20px; padding: 10px 16px; border: 1px solid var(--gold); border-radius: 8px; background: color-mix(in srgb, var(--gold) 10%, var(--surface, #fff)); font-size: .88rem; color: var(--text); }
.demo-bar a, .demo-bar .link-btn { color: var(--text); }
.btn.demo-btn { background: #fbf4e4; border: 1.5px dashed var(--gold); color: #0b1f3a; }
.btn.demo-btn:hover { background: #f5e8c8; border-color: var(--gold); color: #0b1f3a; }
.btn.demo-btn::before { content: "▶"; font-size: .7em; margin-right: 8px; color: var(--gold); }
.badge-demo { color: #7a5a1c; border-color: var(--gold); }
.nc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.acct-menu .acct-demo { border-top: 1px solid var(--border, #e3e6ec); margin-top: 4px; padding-top: 10px; color: var(--muted); font-size: .85rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: .86rem; }
.footer-links a { color: inherit; }
.legal h1 { margin-bottom: 18px; } .legal h2 { margin-top: 32px; font-size: 1.25rem; } .legal h3 { margin-top: 22px; font-size: 1.05rem; }
.legal table { width: 100%; border-collapse: collapse; font-size: .9rem; display: block; overflow-x: auto; }
.legal th, .legal td { border-bottom: 1px solid var(--border, #e3e6ec); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal p, .legal li { line-height: 1.6; max-width: 70ch; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { border-color: var(--control-border) !important; }
.nice-attr { font-size: .78rem; line-height: 1.5; color: var(--muted); margin: 8px 0 0; max-width: 70ch; }
.nice-attr a { color: inherit; }
.ai-note { margin: 0 0 22px; padding: 12px 16px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 8px 8px 0; font-size: .92rem; }
.ai-note p { margin: 0; max-width: 72ch; }
