:root {
  color-scheme: light;
  --bg: #f7f5f1;
  --surface: #ffffff;
  --surface-2: #f1eee8;
  --line: #e2ddd4;
  --ink: #1f232b;
  --ink-2: #555b66;
  --ink-3: #7b818c;
  --brand: #c8102e;
  --charcoal: #2e3440;
  --teal: #2f6f5e;
  --sand: #8a6d3b;
  --series-1: #257de0;
  --series-2: #f47230;
  --series-3: #00b894;
  --good: #1e7b34;
  --warn: #9a6200;
  --bad: #b3261e;
  --good-bg: #e7f4ea;
  --warn-bg: #fdf3dc;
  --bad-bg: #fbe9e7;
  --info-bg: #e8f1fc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 31, .06), 0 2px 8px rgba(20, 24, 31, .04);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #15171c; --surface: #1d2027; --surface-2: #252932; --line: #343945;
    --ink: #eceef2; --ink-2: #b4bac5; --ink-3: #8a909c;
    --brand: #ff5a6e; --charcoal: #d8dce4;
    --series-1: #338ced; --series-2: #e76624; --series-3: #00a888;
    --good: #5cc679; --warn: #e5b34d; --bad: #ff7a70;
    --good-bg: #1d3325; --warn-bg: #3a2f17; --bad-bg: #3d2120; --info-bg: #1c2a3d;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--series-1); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 2.3rem; margin: .2em 0 .3em; }
h2 { font-size: 1.75rem; margin: 0 0 .4em; }
h3 { font-size: 1.2rem; margin: 1.6em 0 .5em; }
p { margin: .5em 0 1em; }
small, .muted { color: var(--ink-3); }
code { font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }

/* ---------------- top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brandmark { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brandmark .dot { width: 26px; height: 26px; border-radius: 7px; background: var(--charcoal); display: grid; place-items: center; color: var(--bg); font: 700 13px var(--sans); }
.brandmark .sub { font: 500 .8rem var(--sans); color: var(--ink-3); }
.topbar .spacer { flex: 1; }
.topbar nav { display: flex; gap: 4px; align-items: center; }
.topbar nav a, .topbar nav button { font: 500 .9rem var(--sans); color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; }
.topbar nav a:hover, .topbar nav button:hover { background: var(--surface-2); color: var(--ink); }
.topbar .who { font-size: .85rem; color: var(--ink-3); }
.badge { display: inline-block; font: 600 .72rem var(--sans); letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.badge.conf { background: var(--bad-bg); color: var(--bad); }

/* ---------------- layout */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; }
.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; font-size: .9rem; }
.toc .lvl { font: 600 .7rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 18px 0 6px 10px; }
.toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; }
.toc a:hover { background: var(--surface-2); color: var(--ink); }
.toc a.active { color: var(--ink); font-weight: 600; border-left-color: var(--brand); background: var(--surface); }
main { min-width: 0; }
section.page { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 36px 40px; margin-bottom: 28px; box-shadow: var(--shadow); }
.eyebrow { font: 600 .75rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 70ch; }
.prose { max-width: 75ch; }
.prose li { margin: .25em 0; }

/* ---------------- tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 22px 0; }
.tile { background: var(--surface-2); border-radius: var(--radius); padding: 16px 18px; }
.tile .k { font-size: .8rem; color: var(--ink-3); font-weight: 500; }
.tile .v { font: 600 1.75rem/1.15 var(--serif); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile .d { font-size: .82rem; color: var(--ink-2); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--surface); }
.card h4 { margin: 0 0 6px; font: 600 1rem var(--sans); }
.card p, .card ul { margin: .3em 0; font-size: .93rem; color: var(--ink-2); }
.card ul { padding-left: 1.1em; }
.card .tag { float: right; }

.callout { border-radius: var(--radius); padding: 14px 18px; margin: 18px 0; font-size: .95rem; border-left: 4px solid; }
.callout.info { background: var(--info-bg); border-color: var(--series-1); }
.callout.warn { background: var(--warn-bg); border-color: var(--warn); }
.callout.good { background: var(--good-bg); border-color: var(--good); }
.callout.bad { background: var(--bad-bg); border-color: var(--bad); }
.callout strong:first-child { display: block; margin-bottom: 2px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font: 600 .75rem var(--sans); padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--series-1); }
.pill.neutral { background: var(--surface-2); color: var(--ink-2); }

/* ---------------- tables */
.tablewrap { overflow-x: auto; margin: 14px 0 20px; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 600; background: var(--surface-2); }
table.wide-last td:last-child { min-width: 220px; }
table.wide-last td:first-child { white-space: nowrap; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.bar-cell .b { height: 10px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }

/* ---------------- charts */
.chart { position: relative; margin: 10px 0 6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text, .chart .lbl { fill: var(--ink-3); font: 12px var(--sans); }
.chart .val { fill: var(--ink-2); font: 600 12px var(--sans); }
.chart .band-label { fill: var(--ink-2); font: 600 11px var(--sans); }
.chart rect.hit { fill: transparent; cursor: default; }
.chart .mark { transition: opacity .12s; }
.chart.hovering .mark:not(.on) { opacity: .45; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .85rem; color: var(--ink-2); margin: 6px 0 2px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .82rem; padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .1s; z-index: 5; }
.tip.show { opacity: 1; }
.chart-title { font: 600 .95rem var(--sans); margin: 18px 0 0; }
.chart-sub { font-size: .82rem; color: var(--ink-3); margin: 0; }
details.table-view { margin: 4px 0 18px; font-size: .85rem; }
details.table-view summary { cursor: pointer; color: var(--ink-3); }

/* ---------------- phase timeline */
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.phase { border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); position: relative; }
.phase .num { font: 600 .72rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.phase h4 { margin: 2px 0 2px; font: 600 1.05rem var(--serif); }
.phase .dates { font-size: .82rem; color: var(--ink-3); margin-bottom: 10px; }
.phase dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 0; font-size: .88rem; }
.phase dt { color: var(--ink-2); }
.phase dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.phase .verdict { margin-top: 12px; font-size: .88rem; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 10px; }

/* ---------------- engine diagram */
.engine { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 18px 0; }
.engine .row { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: stretch; }
.engine .row > .lab { font: 600 .78rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; }
.engine .boxes { display: flex; flex-wrap: wrap; gap: 8px; }
.engine .box { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 7px 11px; font-size: .86rem; }
.engine .box b { display: block; font-size: .88rem; }
.engine .box.human { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.engine .box.kb { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, var(--surface)); }
.level { display: inline-block; width: 22px; height: 22px; border-radius: 6px; text-align: center; font: 700 .75rem/22px var(--sans); color: #fff; }
.level.l1 { background: #8a909c; } .level.l2 { background: #257de0; } .level.l3 { background: #2f6f5e; } .level.l4 { background: #6a4ce2; }

/* ---------------- forms (login, account, admin) */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.panel { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 34px; box-shadow: var(--shadow); }
.panel.wide { max-width: 980px; }
.panel h1 { font-size: 1.6rem; margin-top: 0; }
label { display: block; font: 600 .85rem var(--sans); margin: 14px 0 6px; color: var(--ink-2); }
input, select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--series-1); outline-offset: 1px; border-color: transparent; }
button.btn { font: 600 .92rem var(--sans); padding: 10px 16px; border-radius: 8px; border: 1px solid var(--charcoal); background: var(--charcoal); color: var(--bg); cursor: pointer; }
button.btn.full { width: 100%; margin-top: 20px; }
button.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.btn.sm { padding: 5px 10px; font-size: .8rem; }
button.btn:disabled { opacity: .5; cursor: wait; }
.msg { margin-top: 14px; font-size: .9rem; min-height: 1.2em; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--good); }
.form-row { display: grid; grid-template-columns: 1fr 1fr 120px auto auto; gap: 10px; align-items: end; }
.form-row label { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 12px 14px; align-items: start; }
.form-grid > div > label:first-child { margin-top: 0; }
.form-grid .form-go { grid-column: 3; justify-self: end; }
.inv { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.secret { font: 600 1.05rem ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; user-select: all; word-break: break-all; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- responsive */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; display: none; }
  section.page { padding: 24px 20px; }
  .grid2, .grid3, .phases { grid-template-columns: 1fr; }
  .engine .row { grid-template-columns: 1fr; }
  .form-row, .form-grid { grid-template-columns: 1fr; }
  .form-grid .form-go { grid-column: auto; justify-self: stretch; }
  .topbar .who { display: none; }
}
@media print {
  .topbar, .toc { display: none; }
  .layout { display: block; padding: 0; }
  section.page { break-inside: avoid-page; box-shadow: none; border: 0; }
}

/* ================= board (v2) */
.board { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px 34px; box-shadow: var(--shadow); }
.hero h1 { font-size: 2.1rem; margin: .15em 0 .35em; }
.hero .lede { margin: 0; }
.hero-facts { display: grid; gap: 10px; align-content: center; }
.hero-facts div { background: var(--surface-2); border-radius: var(--radius); padding: 10px 14px; }
.hero-facts span { display: block; font-size: .75rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.hero-facts strong { font-weight: 500; font-size: .93rem; }
.board-h { font: 600 1.15rem var(--sans); margin: 30px 0 12px; letter-spacing: 0; }
.board-h small { font-weight: 400; color: var(--ink-3); font-size: .85rem; margin-left: 8px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { all: unset; box-sizing: border-box; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.kpi:hover, .kpi:focus-visible { border-color: var(--ink-3); transform: translateY(-1px); }
.kpi:focus-visible { outline: 2px solid var(--series-1); }
.kpi .k { font-size: .78rem; color: var(--ink-3); font-weight: 500; }
.kpi .v { font: 600 1.6rem/1.15 var(--serif); font-variant-numeric: tabular-nums; }
.kpi .d { font-size: .78rem; color: var(--ink-2); }
.kpi.bad { border-top: 3px solid var(--bad); }
em.est { font-style: normal; font-size: .7rem; font-weight: 600; color: var(--warn); background: var(--warn-bg); padding: 0 5px; border-radius: 4px; }
.board-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); }
.panel-card.accent { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; font: 600 1.05rem var(--sans); }
button.more { all: unset; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--series-1); white-space: nowrap; }
button.more:hover { text-decoration: underline; }
button.more:focus-visible { outline: 2px solid var(--series-1); border-radius: 4px; }
.note { font-size: .85rem; color: var(--ink-2); margin: 10px 0 0; }
.funnel { display: grid; gap: 8px; }
.f-row { display: grid; grid-template-columns: 130px 1fr 120px; gap: 10px; align-items: center; font-size: .9rem; }
.f-bar { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.f-bar i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.f-bar i.all { background: var(--ink-3); opacity: .45; }
.f-v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.f-v small { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.f-gap { font-size: .8rem; color: var(--bad); font-weight: 600; padding-left: 140px; }
.big-line { margin: 0 0 10px; font-size: 1rem; color: var(--ink-2); }
.big-line strong { font: 600 1.6rem var(--serif); color: var(--ink); margin-right: 4px; }
.progress { height: 14px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--series-2); border-radius: 99px; }
.progress-legend { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink-2); margin: 6px 0 10px; }
ul.tight { margin: 0; padding-left: 1.1em; font-size: .9rem; }
ul.tight li { margin: 3px 0; }
.tablewrap.flat { margin: 0; }
.tablewrap.flat td, .tablewrap.flat th { padding: 7px 10px; }
.journey { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: .9rem; }
.journey li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; }
.journey small { color: var(--ink-3); }
.j-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--ink-3); }
.j-dot.b { background: var(--series-1); } .j-dot.o { background: var(--series-2); } .j-dot.g { background: var(--series-3); }
.mini-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-tiles div { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; }
.mini-tiles span { display: block; font-size: .75rem; color: var(--ink-3); }
.mini-tiles strong { font: 600 1.15rem var(--serif); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .9rem; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.steps b { width: 26px; height: 26px; border-radius: 50%; background: var(--charcoal); color: var(--bg); display: grid; place-items: center; font-size: .8rem; }
.steps small { color: var(--ink-3); }
.dive { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dive button { all: unset; box-sizing: border-box; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; transition: border-color .12s; }
.dive button:hover, .dive button:focus-visible { border-color: var(--series-1); }
.dive button:focus-visible { outline: 2px solid var(--series-1); }
.dive b { font-size: .95rem; }
.dive span { font-size: .8rem; color: var(--ink-3); }
.foot { font-size: .8rem; margin-top: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chips span { background: var(--surface-2); border-radius: 99px; padding: 3px 12px; font-size: .85rem; font-weight: 600; }

/* ================= shelf */
.scrim { position: fixed; inset: 0; background: rgba(15, 18, 24, .35); z-index: 40; }
.shelf { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--surface); z-index: 50; box-shadow: -8px 0 30px rgba(15, 18, 24, .18); transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; visibility: hidden; }
.shelf.open { transform: none; visibility: visible; }
.shelf-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; border-bottom: 1px solid var(--line); }
.shelf-head .eyebrow { margin: 0; color: var(--ink-3); }
.shelf-close { all: unset; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 1rem; color: var(--ink-2); }
.shelf-close:hover, .shelf-close:focus-visible { background: var(--surface-2); color: var(--ink); }
.shelf-body { overflow-y: auto; padding: 22px 32px 40px; flex: 1; }
.shelf-body h2 { margin-top: 0; }
.shelf-body h3 { font: 600 1rem var(--sans); margin: 1.4em 0 .4em; }
.shelf-body ul, .shelf-body ol { padding-left: 1.2em; }
.shelf-body li { margin: 4px 0; }
.shelf-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
body.shelf-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .shelf { transition: none; } }

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dive { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .board-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-row { grid-template-columns: 100px 1fr 80px; }
  .f-gap { padding-left: 0; }
  .shelf-body { padding: 18px; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 1.6rem; }
}

.panel-card, .board-grid > * { min-width: 0; }
table.compact td:first-child { white-space: nowrap; }
@media (max-width: 680px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .brandmark .sub { display: none; }
  .topbar nav a, .topbar nav button { padding: 6px 6px; font-size: .85rem; }
  table.compact th:last-child, table.compact td:last-child { display: none; }
  .progress-legend { flex-direction: column; gap: 2px; }
}

/* ================= v3: Nine Labs entry + visual components */
.nl-hero { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px 34px; box-shadow: var(--shadow); }
.nl-hero h1 { font-size: 2.2rem; margin: .1em 0 .3em; max-width: 26ch; line-height: 1.15; }
.nl-hero .lede { margin: 0 0 18px; }
.pvm { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pvm div { border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 16px; }
.pvm span { display: block; font: 600 .72rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.pvm strong { font: 500 1rem/1.4 var(--serif); }

.engine-map { display: grid; grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1.5fr); gap: 0; align-items: center; margin: 22px 0 6px; }
.em-core { background: var(--charcoal); color: var(--bg); border-radius: 14px; padding: 18px 20px; }
.em-core > b { font: 600 1.1rem var(--serif); display: block; margin-bottom: 8px; }
.em-core ul { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; font-size: .9rem; }
.em-core li { display: flex; align-items: center; gap: 9px; }
.em-core .more { color: color-mix(in srgb, var(--bg) 85%, var(--series-1)); }
.ic { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ic.h { background: var(--series-2); } .ic.a { background: var(--series-3); } .ic.k { background: var(--series-1); } .ic.r { background: var(--brand); }
.em-arrow { height: 2px; background: var(--ink-3); position: relative; margin: 0 6px; }
.em-arrow::after { content: ""; position: absolute; right: -2px; top: -5px; border: 6px solid transparent; border-left: 8px solid var(--ink-3); border-right: 0; }
.em-brands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.em-brand { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.em-brand b { font: 600 1.05rem var(--serif); }
.em-brand small { font-size: .8rem; }
.em-brand em { font-style: normal; font-size: .75rem; font-weight: 700; color: var(--brand); }
.em-brand .pill { align-self: flex-start; }
.em-brand.live { border: 2px solid var(--brand); }
.em-brand.ghost { border-style: dashed; background: transparent; }

.road { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; counter-reset: r; }
.road li { position: relative; padding: 14px 14px 0 0; border-top: 3px solid var(--line); font-size: .88rem; }
.road li::before { content: ""; position: absolute; top: -8px; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); }
.road li.now { border-top-color: var(--brand); }
.road li.now::before { border-color: var(--brand); background: var(--brand); }
.road b { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.road li.now b { color: var(--brand); }

.brand-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: end; margin: 36px 0 14px; }
.brand-head h2 { margin: 0; font-size: 1.7rem; }
.brand-head p { margin: 4px 0 0; }
.facts { display: grid; gap: 6px; font-size: .88rem; }
.facts span { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
.facts b { display: inline-block; min-width: 108px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }

.meters { display: grid; gap: 12px; margin-bottom: 14px; }
.meter { display: grid; grid-template-columns: 96px 1fr 120px; gap: 10px; align-items: center; font-size: .88rem; }
.m-bar { position: relative; height: 14px; background: var(--surface-2); border-radius: 99px; }
.m-bar i { display: block; height: 100%; border-radius: 99px; background: var(--series-1); }
.m-bar i.o { background: var(--series-2); }
.m-bar s { position: absolute; top: -4px; bottom: -4px; right: 0; width: 2px; background: var(--ink); }
.m-v { font-weight: 600; font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; }
.pva-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .88rem; }
.pva-mini li { display: grid; grid-template-columns: 1fr 70px 90px 56px; gap: 8px; align-items: center; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; }
.pva-mini b { font-variant-numeric: tabular-nums; text-align: right; }
.pva-mini small { text-align: right; }
.pva-mini .pill { justify-self: end; }

.gates { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gates li { position: relative; background: var(--surface-2); border-radius: 10px; padding: 12px 10px 10px; display: flex; flex-direction: column; gap: 2px; font-size: .85rem; }
.gates li:not(:last-child)::after { content: "›"; position: absolute; right: -8px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 1.2rem; z-index: 1; }
.gates b { width: 24px; height: 24px; border-radius: 50%; background: var(--charcoal); color: var(--bg); display: grid; place-items: center; font-size: .78rem; margin-bottom: 4px; }
.gates strong { font-size: .9rem; line-height: 1.25; }
.gates small { font-size: .78rem; }
.gates.big li { padding: 16px 14px; }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: .86rem; }
.yesno > div { border-radius: 10px; padding: 10px 12px; }
.yesno span { display: block; font: 700 .72rem var(--sans); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.yesno .yes { background: var(--good-bg); } .yesno .yes span { color: var(--good); }
.yesno .no { background: var(--bad-bg); } .yesno .no span { color: var(--bad); }
.yesno ul { margin: 4px 0 0; padding-left: 1.1em; }
.yesno.tall { margin-bottom: 8px; }
.chips.sm span { font-size: .78rem; font-weight: 500; }
.chips .c-warn { background: var(--warn-bg); color: var(--warn); }
.chips .c-mute { color: var(--ink-3); }

.watch { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .9rem; }
.watch li { display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: baseline; }
.watch i { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); }
.watch i.bad { background: var(--bad); } .watch i.warn { background: var(--warn); }

.scale { position: relative; margin: 46px 0 52px; }
.sc-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; }
.sc-bar span { display: block; height: 100%; }
.z-red { background: color-mix(in srgb, var(--bad) 70%, var(--surface)); }
.z-amber { background: color-mix(in srgb, var(--warn) 45%, var(--surface)); }
.z-green { background: color-mix(in srgb, var(--good) 55%, var(--surface)); }
.sc-mark { position: absolute; top: 18px; transform: translateX(-50%); font-size: .74rem; color: var(--ink-2); text-align: center; width: 120px; line-height: 1.25; }
.sc-mark::before { content: ""; position: absolute; left: 50%; top: -22px; width: 2px; height: 20px; background: var(--ink); }
.sc-mark b { display: block; font-size: .85rem; color: var(--ink); }
.sc-mark.up { top: auto; bottom: 20px; }
.sc-mark.up::before { top: auto; bottom: -24px; }
.sc-ends { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-3); position: absolute; width: 100%; top: -18px; pointer-events: none; }
.sc-ends span:first-child { visibility: hidden; }
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 14px; font-size: .92rem; }
.formula span { background: var(--surface-2); border-radius: 8px; padding: 5px 11px; font-weight: 600; }
.formula b { color: var(--ink-3); font-size: 1.1rem; }
.formula em { flex-basis: 100%; font-style: normal; font-size: .8rem; color: var(--ink-3); }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 10px; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile strong { font: 600 1.35rem/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.tile span { font-size: .82rem; color: var(--ink-2); }
.tile.bad { border-top: 3px solid var(--bad); } .tile.good { border-top: 3px solid var(--good); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks span { font-size: .84rem; padding: 4px 10px 4px 26px; border-radius: 99px; background: var(--surface-2); position: relative; }
.checks span::before { content: "✓"; position: absolute; left: 10px; color: var(--good); font-weight: 700; }
.rank { padding-left: 1.3em; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 8px 0 8px 16px; position: relative; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--series-1); }
.timeline b { font-size: .85rem; }

.pva { display: grid; gap: 6px; margin: 6px 0; }
.pva-row { display: grid; grid-template-columns: 130px 1fr 130px 70px; gap: 10px; align-items: center; font-size: .88rem; }
.pva-row .bars { display: grid; gap: 3px; }
.pva-row .bars i { display: block; height: 9px; border-radius: 0 4px 4px 0; min-width: 2px; }
.pva-row .bars i.p { background: var(--line); }
.pva-row .bars i.a { background: var(--series-1); }
.pva-row .bars i.a.est, .legend i.hatch { background: repeating-linear-gradient(45deg, var(--series-1) 0 4px, color-mix(in srgb, var(--series-1) 40%, var(--surface)) 4px 7px); }
.pva-row .v { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.pva-row .v small { font-weight: 400; }
.pva-row .pill { justify-self: end; }
.pva-row.total { border-top: 1px solid var(--line); padding-top: 6px; }
.auto { font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.auto.a3 { background: color-mix(in srgb, var(--series-3) 18%, var(--surface)); color: color-mix(in srgb, var(--series-3) 70%, var(--ink)); }
.auto.a2 { background: var(--info-bg); color: var(--series-1); }
.auto.a1 { background: color-mix(in srgb, var(--series-2) 16%, var(--surface)); color: color-mix(in srgb, var(--series-2) 65%, var(--ink)); }

@media (max-width: 1000px) {
  .engine-map { grid-template-columns: 1fr; }
  .em-arrow { width: 2px; height: 26px; margin: 4px auto; }
  .em-arrow::after { right: -5px; top: auto; bottom: -2px; border: 6px solid transparent; border-top: 8px solid var(--ink-3); border-bottom: 0; }
  .brand-head { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nl-hero { padding: 22px 18px; }
  .nl-hero h1 { font-size: 1.6rem; }
  .pvm, .em-brands, .grid3, .grid2 { grid-template-columns: 1fr; }
  .gates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gates li::after { display: none; }
  .yesno { grid-template-columns: 1fr; }
  .meter { grid-template-columns: 80px 1fr; }
  .meter .m-v { grid-column: 2; }
  .pva-mini li { grid-template-columns: 1fr auto auto; }
  .pva-mini small { display: none; }
  .pva-row { grid-template-columns: 1fr auto; }
  .pva-row .bars { grid-column: 1 / -1; grid-row: 2; }
  .pva-row .pill { display: none; }
  .road { font-size: .8rem; }
  .sc-mark { width: 84px; font-size: .68rem; }
}
.conf-strip { background: var(--bad-bg); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); border-radius: 10px; padding: 8px 14px; font-size: .85rem; margin-bottom: 16px; }
@media (max-width: 680px) { .topbar .badge.conf { display: inline-block; font-size: .62rem; } }
.panel.terms { max-width: 720px; margin-top: 10px; }
.terms-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .85rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; margin: 14px 0 6px; }
.clauses { padding-left: 1.3em; font-size: .93rem; color: var(--ink-2); }
.clauses li { margin: 8px 0; }
.clauses strong { color: var(--ink); }
label.tick { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--ink); margin-top: 16px; }
label.tick input { width: auto; margin-top: 4px; }
.terms-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.conf-strip a { color: inherit; text-decoration: underline; }
.home-hero h1 { max-width: none; }
.spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.space { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 18px 20px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.space:hover, .space:focus-visible { transform: translateY(-1px); border-color: var(--ink-3); border-left-color: var(--brand); }
.space b { font: 600 1.15rem var(--serif); }
.space span { font-size: .9rem; color: var(--ink-2); }
.space em { font-style: normal; font-weight: 600; font-size: .85rem; color: var(--series-1); margin-top: 4px; }
.space-picks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.space-picks label { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; color: var(--ink); }
.space-picks input { width: auto; }
