/* ============================================================
   OmniCore docs — design tokens
   Edit colors / type here. Two themes via [data-theme].
   ============================================================ */
:root {
    --paper:        #f5f2ea;
    --surface:      #fffdf8;
    --surface-2:    #faf7ef;
    --ink:          #211f1b;
    --ink-soft:     #423e37;
    --muted:        #6f6a5f;
    --faint:        #938d80;
    --border:       #e4ddcf;
    --border-soft:  #eee8db;
    --accent:       #4b53a8;
    --accent-ink:   #3c4290;
    --accent-soft:  #ebecf7;
    --accent-line:  #c9cbec;
    --code-bg:      #f1ede3;
    --code-ink:     #2c2a24;
    --chip-bg:      #f1ede3;  --chip-line: #eee8db;  /* inline <code> chip (light = as before) */
    --good:         #2f7d5e;  --good-bg:  #e4efe9;  --good-line: #b4d6c6;
    --warn:         #9a6f24;  --warn-bg:  #f6eeda;  --warn-line: #e3d2a3;
    --bad:          #a8493d;  --bad-bg:   #f6e6e2;  --bad-line:  #e6c2b8;
    --tok-c:        #948c7b;
    --tok-s:        #4f8064;
    --tok-k:        #6a59a8;
    --tok-n:        #9a6f24;
    --shadow:       0 1px 2px rgba(40,35,25,.05), 0 8px 28px rgba(40,35,25,.06);
    --shadow-soft:  0 1px 0 rgba(40,35,25,.04);
    --sidebar-w:    282px;
    --rail-w:       232px;
}
[data-theme="dark"] {
    --paper:        #121319;
    --surface:      #191b22;
    --surface-2:    #1e212a;
    --ink:          #e7e9f0;
    --ink-soft:     #c6cad6;
    --muted:        #969cab;
    --faint:        #6a7081;
    --border:       #2b2e39;
    --border-soft:  #23262f;
    --accent:       #9da6f0;
    --accent-ink:   #b6bcf6;
    --accent-soft:  #21243c;
    --accent-line:  #383c5c;
    --code-bg:      #171922;
    --code-ink:     #d4d8e4;
    --chip-bg:      #272c37;  --chip-line: #3a4152;  /* inline <code> chip — lighter than the surface so the box reads */
    --good:         #84c08c;  --good-bg:  #16241b;  --good-line: #2c4733;
    --warn:         #d8b36a;  --warn-bg:  #261f12;  --warn-line: #463a1f;
    --bad:          #df9384;  --bad-bg:   #281a17;  --bad-line:  #482c26;
    --tok-c:        #6b7184;
    --tok-s:        #9ccf9b;
    --tok-k:        #aab0f0;
    --tok-n:        #d8b36a;
    --shadow:       0 1px 2px rgba(0,0,0,.3), 0 8px 30px rgba(0,0,0,.35);
    --shadow-soft:  0 1px 0 rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16.5px;
    line-height: 1.68;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); }

/* ---------- App grid ---------- */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--surface-2);
    border-right: 1px solid var(--border);
    z-index: 40;
}
.brand {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 11px;
    padding: 22px 24px 16px;
}
.brand .mark {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: grid; place-items: center;
    font-family: "Newsreader", Georgia, serif;
    font-weight: 600; font-size: 19px;
    flex: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.brand .name { font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: 20px; line-height: 30px; letter-spacing: -.01em; white-space: nowrap; }
.brand .name span { color: var(--faint); font-weight: 400; }
.search-wrap { padding: 0 18px 14px; }
.search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px 11px;
    transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box svg { width: 15px; height: 15px; color: var(--faint); flex: none; }
.search-box input {
    border: none; background: none; outline: none;
    font: inherit; font-size: 14px; color: var(--ink);
    width: 100%;
}
.search-box input::placeholder { color: var(--faint); }
.search-box kbd {
    font-family: "JetBrains Mono", monospace; font-size: 11px;
    color: var(--faint); border: 1px solid var(--border);
    border-radius: 5px; padding: 1px 5px; background: var(--surface-2);
}
nav.nav {
    flex: 1; overflow-y: auto;
    padding: 6px 12px 28px;
    scrollbar-width: thin;
}
.nav-group { margin-top: 16px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group-title {
    font-size: 11px; font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--faint);
    padding: 6px 12px 5px;
}
.nav-link {
    display: block;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 14.5px;
    padding: 6px 12px;
    border-radius: 7px;
    line-height: 1.35;
    transition: background .12s, color .12s;
}
.nav-link code { font-size: 12.5px; background: none; padding: 0; color: inherit; }
.nav-link:hover { background: var(--surface); color: var(--ink); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-empty { padding: 14px 14px; color: var(--faint); font-size: 13.5px; font-style: italic; }
.sidebar-footer {
    flex: none;
    padding: 13px 22px 16px;
    border-top: 1px solid var(--border-soft);
    font-size: 12px; line-height: 1.6;
    color: var(--faint);
}
.sidebar-footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); transition: color .12s; }
.sidebar-footer a:hover { color: var(--accent-ink); border-color: var(--accent-line); }

/* ---------- Content column ---------- */
.content-col {
    height: 100vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 14px;
    padding: 13px 32px;
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border-soft);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.breadcrumb .crumb-group { color: var(--faint); }
.breadcrumb .sep { color: var(--accent-line); }
.breadcrumb .crumb-page { color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.icon-btn {
    width: 36px; height: 36px; flex: none;
    display: grid; place-items: center;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 9px;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .moon { display: none; }
[data-theme="dark"] .icon-btn .moon { display: block; }
[data-theme="dark"] .icon-btn .sun { display: none; }
.hamburger { display: none; }
.repo-link {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13.5px; color: var(--ink-soft); text-decoration: none;
    border: 1px solid var(--border); background: var(--surface);
    border-radius: 9px; padding: 7px 12px; transition: background .12s;
}
.repo-link:hover { background: var(--surface-2); }
.repo-link svg { width: 15px; height: 15px; }

.content-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) var(--rail-w);
    gap: 44px;
    max-width: 1480px;
    margin: 0 auto;
    padding: 40px 48px 120px;
}
.article { min-width: 0; }

/* ---------- Section paging ---------- */
.doc-section { display: none; animation: fade .28s ease; }
.doc-section.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.eyebrow {
    font-size: 12px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 10px;
}

/* ---------- Hero (overview only) ---------- */
.hero { padding: 8px 0 30px; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
.hero-kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero-title { font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: 60px; line-height: 1; letter-spacing: -.02em; margin: 0 0 12px; }
.hero-tag { font-family: "Newsreader", Georgia, serif; font-size: 23px; font-style: italic; color: var(--muted); margin: 0 0 22px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 9px; }
.badge {
    font-family: "JetBrains Mono", monospace; font-size: 12px;
    color: var(--accent-ink); background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: 7px; padding: 5px 10px;
}

/* ---------- Typography ---------- */
.article h2 {
    font-family: "Newsreader", Georgia, serif;
    font-weight: 600; font-size: 38px; line-height: 1.12;
    letter-spacing: -.018em; color: var(--ink);
    margin: 0 0 22px;
    border: none; display: block; padding: 0;
}
.article h2 code { font-size: .72em; }
.article h3 {
    font-family: "Newsreader", Georgia, serif;
    font-weight: 600; font-size: 25px; line-height: 1.25;
    letter-spacing: -.01em; color: var(--ink);
    margin: 40px 0 14px;
    scroll-margin-top: 80px;
}
.article h3 code { font-size: .8em; }
.article h4 {
    font-size: 12.5px; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: var(--muted);
    margin: 26px 0 10px;
}
.article p { margin: 0 0 15px; max-width: 82ch; }
.article > p, .collapse-body > p { color: var(--ink-soft); }
.article a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-line); transition: border-color .12s; }
.article a:hover { border-color: var(--accent); }
.article strong { color: var(--ink); font-weight: 600; }
.article em { color: var(--ink-soft); }
.article ul, .article ol { padding-left: 24px; margin: 4px 0 16px; max-width: 82ch; }
.article li { margin: 7px 0; color: var(--ink-soft); }
.article li::marker { color: var(--faint); }
.muted { color: var(--faint); }

/* ---------- Inline + block code ---------- */
code {
    font-family: "JetBrains Mono", SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    background: var(--chip-bg);
    color: var(--code-ink);
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--chip-line);
    white-space: nowrap;
}
/* allow inline code to break only on very small screens to avoid page overflow */
@media (max-width: 560px) { code { white-space: normal; overflow-wrap: anywhere; } }
.code-wrap { position: relative; margin: 18px 0; }
.code-wrap pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 18px 20px;
    margin: 0;
    overflow-x: auto;
    line-height: 1.62;
    box-shadow: var(--shadow-soft);
}
pre code {
    background: none; border: none; padding: 0;
    font-size: 13px; color: var(--code-ink);
    display: block; white-space: pre;
}
.tok-c { color: var(--tok-c); font-style: italic; }
.tok-s { color: var(--tok-s); }
.tok-k { color: var(--tok-k); font-weight: 600; }
.tok-n { color: var(--tok-n); }
.copy-btn {
    position: absolute; top: 9px; right: 9px;
    font-family: "Source Sans 3", sans-serif; font-size: 12px; font-weight: 600;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    border: 1px solid var(--border);
    border-radius: 7px; padding: 4px 10px;
    cursor: pointer; opacity: 0;
    transition: opacity .15s, color .12s, background .12s;
}
.code-wrap:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--ink); background: var(--surface); }
.copy-btn.done { color: var(--good); border-color: var(--good-line); }

/* ---------- Callout boxes ---------- */
.box {
    padding: 15px 18px; border-radius: 10px; margin: 18px 0;
    border: 1px solid var(--accent-line);
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    font-size: 15px;
}
.box p:last-child { margin-bottom: 0; }
.box.warn { border-color: var(--warn-line); border-left-color: var(--warn); background: var(--warn-bg); }
.box.bad  { border-color: var(--bad-line);  border-left-color: var(--bad);  background: var(--bad-bg); }
.box.good { border-color: var(--good-line); border-left-color: var(--good); background: var(--good-bg); }
.box strong { color: var(--ink); }
.note {
    font-size: 14.5px; color: var(--muted);
    border-left: 2px solid var(--accent-line);
    padding: 2px 0 2px 14px; margin: 16px 0;
}

/* ---------- Cards ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px 0; }
.card {
    padding: 20px 22px; border: 1px solid var(--border);
    border-radius: 13px; background: var(--surface);
    box-shadow: var(--shadow-soft);
}
.card h4 { margin-top: 0; color: var(--accent-ink); }
.card ul { margin-bottom: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-soft); }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
td { line-height: 1.5; }
td p { max-width: none; margin: 0 0 8px; }
td p:last-child { margin-bottom: 0; }
th {
    background: var(--surface-2); font-weight: 700; color: var(--muted);
    text-transform: uppercase; font-size: 11.5px; letter-spacing: .05em;
    position: sticky; top: 0; white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td code { font-size: 12px; }
/* Yes/no capability marks — semantic color so ✓ vs ✗ reads at a glance in BOTH
   themes (the plain glyph washed out against the dark surface). */
.yes-mark { color: var(--good); font-weight: 700; }
.no-mark  { color: var(--bad);  font-weight: 700; }

/* ---------- Flow + diagram blocks ---------- */
.flow {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 20px;
    font-family: "JetBrains Mono", SFMono-Regular, Consolas, monospace;
    font-size: 12.5px; line-height: 1.7;
    overflow-x: auto; white-space: pre;
    color: var(--code-ink);
    margin: 18px 0;
}
.flow .auto, .flow .manual { padding: 1px 5px; border-radius: 4px; }
.flow .auto { background: var(--good-bg); color: var(--good); box-shadow: inset 0 0 0 1px var(--good-line); }
.flow .manual { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }

/* ---------- Architecture layer diagram (HTML, theme-aware) ---------- */
.arch { position: relative; display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.arch:hover .copy-btn { opacity: 1; }
.arch-layer {
    border: 1px solid var(--border); border-radius: 11px;
    background: var(--surface); box-shadow: var(--shadow-soft); overflow: hidden;
}
.arch-row {
    display: flex; flex-wrap: wrap; align-items: baseline;
    column-gap: 12px; row-gap: 2px;
    padding: 8px 15px; border-top: 1px solid var(--border-soft);
}
.arch-row:first-child { border-top: none; }
.arch-head { background: var(--accent-soft); }
.arch-sub-indent { padding-left: 30px; }
.arch-pkg {
    font-family: "JetBrains Mono", SFMono-Regular, Consolas, monospace;
    font-size: 13px; font-weight: 600; color: var(--accent-ink);
    white-space: nowrap; flex: none;
}
.arch-pkg.sub { font-weight: 500; color: var(--ink-soft); }
.arch-desc { font-size: 13.5px; color: var(--muted); }
.arch-head .arch-desc { color: var(--ink-soft); font-size: 14px; }

/* ---------- Tag pills ---------- */
.tag {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    font-family: "Source Sans 3", sans-serif;
}
.tag.auto { background: var(--good-bg); color: var(--good); box-shadow: inset 0 0 0 1px var(--good-line); }
.tag.manual { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }

/* ---------- Collapsible h3 groups ---------- */
h3.collapsible { cursor: pointer; display: flex; align-items: center; gap: 10px; user-select: none; }
h3.collapsible .chev {
    flex: none; width: 18px; height: 18px;
    display: grid; place-items: center; color: var(--faint);
    transition: transform .2s; font-size: 13px;
}
h3.collapsible:hover .chev { color: var(--accent); }
h3.collapsible.collapsed .chev { transform: rotate(-90deg); }
.collapse-body { overflow: hidden; }

/* ---------- On this page ---------- */
.rail { position: relative; }
.rail-inner { position: sticky; top: 76px; }
.rail-title { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.rail a {
    display: block; font-size: 13.5px; color: var(--muted);
    text-decoration: none; padding: 5px 0 5px 14px;
    border-left: 2px solid var(--border); line-height: 1.4;
    transition: color .12s, border-color .12s;
}
.rail a:hover { color: var(--ink); }
.rail a.active { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }
.rail .empty { font-size: 13px; color: var(--faint); font-style: italic; }

/* ---------- Prev / next ---------- */
.pager { display: flex; gap: 14px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.pager a {
    flex: 1; text-decoration: none; border: 1px solid var(--border);
    border-radius: 12px; padding: 15px 18px; background: var(--surface);
    transition: border-color .14s, box-shadow .14s, transform .14s;
}
.pager a:hover { border-color: var(--accent-line); box-shadow: var(--shadow-soft); }
.pager a.next { text-align: right; }
.pager .dir { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.pager .ttl { font-family: "Newsreader", Georgia, serif; font-size: 18px; color: var(--accent-ink); margin-top: 3px; }
.pager a.placeholder { visibility: hidden; }

/* ---------- Mobile ---------- */
.scrim { display: none; }
@media (max-width: 1080px) {
    .content-grid { grid-template-columns: minmax(0,1fr); }
    .rail { display: none; }
}
@media (max-width: 820px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; width: 86%; max-width: 320px;
        transform: translateX(-104%); transition: transform .26s ease;
        box-shadow: var(--shadow);
    }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,12,8,.4); z-index: 35; }
    .hamburger { display: grid; }
    .topbar { padding: 12px 18px; }
    .content-grid { padding: 28px 20px 90px; }
    .hero-title { font-size: 44px; }
    .article h2 { font-size: 30px; }
    .grid-2 { grid-template-columns: 1fr; }
}
/* ---------- v2: anchors, search marks, toast, changelog, width, print ---------- */
.brand .ver { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 6px; padding: 1px 7px; margin-left: auto; align-self: center; flex: none; white-space: nowrap; }

.h3-anchor { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 8px; color: var(--faint); cursor: pointer; opacity: 0; vertical-align: middle; text-decoration: none; border-bottom: none; transition: opacity .14s, color .12s; }
.article h3:hover .h3-anchor { opacity: .65; }
.h3-anchor:hover { opacity: 1; color: var(--accent); border-bottom: none; }
.h3-anchor.done { opacity: 1; color: var(--good); }
.h3-anchor svg { width: 15px; height: 15px; }

mark.search-hit { background: #ffe39c; color: #3a2f12; border-radius: 3px; padding: 0 1px; }
[data-theme="dark"] mark.search-hit { background: #5b4a1e; color: #ffe9b8; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); font-size: 13.5px; font-weight: 600; padding: 9px 16px; border-radius: 9px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

[data-width="wide"] .article p,
[data-width="wide"] .article ul,
[data-width="wide"] .article ol { max-width: none; }

.changelog { margin-top: 6px; }
.release { padding-bottom: 6px; }
.release-head { display: flex; align-items: center; gap: 12px; margin: 22px 0 8px; }
.release-tag { font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 7px; padding: 3px 10px; }
.release-date { font-size: 13px; color: var(--faint); }
/* release severity — icon + tag tint applied by app.js (decorateReleases).
   Shape-distinct icons (▲/◆/✚) carry the meaning so it survives red-green
   color blindness; color reinforces. Reuses the theme's --good/--warn/--bad. */
.sev-icon { font-family: "JetBrains Mono", monospace; font-size: 12px; line-height: 1; flex: none; }
.sev-icon.sev-breaking { color: var(--bad); }
.sev-icon.sev-change   { color: var(--warn); }
.sev-icon.sev-new      { color: var(--good); }
.release.sev-breaking .release-tag { color: var(--bad);  background: var(--bad-bg);  border-color: var(--bad-line); }
.release.sev-change   .release-tag { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.release.sev-new      .release-tag { color: var(--good); background: var(--good-bg); border-color: var(--good-line); }
.changelog-legend { display: flex; flex-wrap: wrap; gap: 18px; margin: 12px 0 20px; font-size: 13px; color: var(--muted); }
.changelog-legend .legend-item { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Features catalog (what-the-framework-does page) ---------- */
.feat-lead { font-size: 16.5px; }
.feat-lead .em { color: var(--accent-ink); font-weight: 600; }

/* stat strip — factual at-a-glance figures */
.stat-strip { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 30px; }
.stat {
    flex: 1 1 130px; min-width: 130px;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface); box-shadow: var(--shadow-soft);
    padding: 14px 16px;
}
.stat .num { font-family: "Newsreader", Georgia, serif; font-size: 27px; font-weight: 600; line-height: 1; color: var(--accent-ink); letter-spacing: -.01em; }
.stat .lbl { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* spotlight — the headline "one handler, every surface" band */
.spotlight {
    display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: center;
    margin: 26px 0 34px; padding: 24px 26px;
    border: 1px solid var(--accent-line); border-left: 3px solid var(--accent);
    border-radius: 14px; background: var(--accent-soft);
}
.spot-title { font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: 24px; line-height: 1.1; letter-spacing: -.01em; color: var(--accent-ink); margin: 0 0 12px; }
.spotlight p { margin: 0 0 10px; font-size: 14.5px; color: var(--ink-soft); }
.spotlight p:last-child { margin-bottom: 0; }
.spotlight .diagram { width: 100%; height: auto; color: var(--accent); }
.spotlight .diagram .ink { color: var(--ink-soft); }

/* capability cards — organized by outcome, not by layer */
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 20px 0; }
.cap-card {
    display: flex; flex-direction: column;
    padding: 20px 22px; border: 1px solid var(--border);
    border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-soft);
    transition: box-shadow .16s, border-color .16s, transform .16s;
}
.cap-card:hover { box-shadow: var(--shadow); border-color: var(--accent-line); transform: translateY(-2px); }
.cap-head { display: flex; align-items: center; gap: 13px; margin-bottom: 4px; }
.cap-ico {
    flex: none; width: 42px; height: 42px; display: grid; place-items: center;
    border-radius: 11px; background: var(--accent-soft);
    border: 1px solid var(--accent-line); color: var(--accent);
}
.cap-ico svg { width: 23px; height: 23px; }
.cap-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.cap-lead { font-family: "Newsreader", Georgia, serif; font-style: italic; font-size: 15.5px; color: var(--muted); margin: 2px 0 12px; }
.cap-list { margin: 0; padding-left: 18px; }
.cap-list li { margin: 5px 0; font-size: 14px; line-height: 1.5; }
.cap-list li::marker { color: var(--accent-line); }
.cap-more { margin-top: auto; padding-top: 12px; font-size: 13.5px; }
.cap-more a { font-weight: 600; }

@media (max-width: 820px) {
    .cap-grid { grid-template-columns: 1fr; }
    .spotlight { grid-template-columns: 1fr; }
    .spotlight .diagram { max-width: 360px; }
}

@media print {
    .sidebar, .topbar, .rail, .pager, .copy-btn, .h3-anchor, .scrim, .toast { display: none !important; }
    .app { display: block; }
    .content-col { height: auto; overflow: visible; }
    .content-grid { display: block; max-width: none; margin: 0; padding: 0; gap: 0; }
    .doc-section { display: block !important; break-before: page; }
    .doc-section:first-child { break-before: avoid; }
    .collapse-body { display: block !important; }
    h3.collapsible { cursor: auto; }
    h3.collapsible .chev { display: none; }
    .code-wrap pre, .flow, .arch-layer, .table-wrap, .card, .box, .cap-card, .spotlight, .stat { break-inside: avoid; }
    .cap-card:hover, .spotlight { box-shadow: none; }
    body { background: #fff; }
}