/* Explainer pages (How it works, Tests & validation) — shares tokens with styles.css */
body.doc { background: var(--bg); }
.doc-top { background: var(--surface); border-bottom: 3px solid var(--red); position: sticky; top: 0; z-index: 5; }
.doc-top .inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.doc-top nav { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-top nav a { text-decoration: none; color: var(--text); font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.doc-top nav a.active, .doc-top nav a:hover { background: var(--charcoal); color: #fff; }
.doc-top nav a.cta { background: var(--red); color: #fff; }
.doc-hero { background: radial-gradient(120% 120% at 0% 0%, #ff2a2a 0%, var(--red) 45%, #a80000 100%); color: #fff; }
.doc-hero .inner { max-width: 1120px; margin: 0 auto; padding: 44px 16px 40px; }
.doc-hero h1 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 10px; letter-spacing: -.03em; line-height: 1.1; }
.doc-hero p { font-size: 17px; max-width: 760px; opacity: .93; margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 26px; }
.kpi { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 14px; padding: 12px 14px; }
.kpi b { display: block; font-size: 26px; letter-spacing: -.02em; }
.kpi span { font-size: 13px; opacity: .9; }
main.doc-main { max-width: 1120px; margin: 0 auto; padding: 28px 16px 60px; }
.doc-main section { margin: 0 0 40px; }
.doc-main h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.doc-main h2::before { content: ""; width: 8px; height: 26px; border-radius: 4px; background: var(--red); }
.doc-main h3 { margin: 18px 0 6px; font-size: 17px; }
.lead { color: var(--muted); margin: 0 0 16px; max-width: 820px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card { background: var(--surface); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); }
.card h4 { margin: 0 0 6px; font-size: 16px; }
.card p, .card li { font-size: 14px; }
.card ul { margin: 6px 0 0; padding-inline-start: 18px; }
.card .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-size: 20px; margin-bottom: 8px; }
.figure { background: #fff; border-radius: 16px; padding: 10px; box-shadow: var(--shadow); overflow-x: auto; }
.figure img { display: block; width: 100%; min-width: 760px; height: auto; }
.caption { font-size: 13px; color: var(--muted); margin: 8px 4px 0; }
table.t { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
table.t th, table.t td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t th { background: var(--charcoal); color: #fff; font-size: 13px; }
table.t tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; counter-reset: s; }
.flow div { background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); position: relative; font-size: 14px; }
.flow div::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 13px; margin-bottom: 6px; }
.chart { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 70px; align-items: center; gap: 10px; font-size: 14px; }
.hbar .track { height: 18px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar .fill { display: block; height: 100%; background: var(--grey-300); border-radius: 6px; }
.hbar.ours .fill { background: var(--red); }
.hbar .v { font-weight: 800; text-align: end; font-variant-numeric: tabular-nums; }
.pill-ok, .pill-bad { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 10px; color: #fff; }
.pill-ok { background: var(--ok); } .pill-bad { background: var(--err); }
details.scn { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); margin: 10px 0; }
details.scn summary { cursor: pointer; padding: 12px 16px; display: flex; gap: 10px; align-items: center; font-weight: 700; list-style: none; }
details.scn summary::-webkit-details-marker { display: none; }
details.scn .body { padding: 0 16px 14px; }
.turn { border-inline-start: 3px solid var(--border); padding: 6px 12px; margin: 10px 0; }
.turn .u { font-weight: 700; } .turn .a { color: var(--muted); font-size: 14px; margin: 4px 0; white-space: pre-wrap; }
.turn .tl { font-size: 12px; font-family: ui-monospace, Menlo, monospace; color: var(--grey-700); }
.chk { font-size: 13px; } .chk.ok { color: var(--ok); } .chk.bad { color: var(--err); font-weight: 700; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.gallery img { width: 100%; display: block; border-bottom: 1px solid var(--border); cursor: zoom-in; }
.gallery figcaption { padding: 10px 12px; font-size: 13px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 50; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }
