/* LLM Wiki Brain — site styles. The design system of https://jonyfs.github.io/llm-wiki-template/ (same author, MIT):
   tokens, nav, hero, cards, diagram, tables, code boxes and footer, plus the demo frame at the end.
   Mobile-first, system fonts, no external requests (CSP: font-src 'self'). */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark light;
  --bg: #0b0d12; --bg-soft: #12151d; --card: #171a24; --border: #2a2f40;
  --text: #e8eaf0; --muted: #a1a9b8; --accent: #8b97ff; --accent-2: #5eead4; --code: #0f1117;
  --primary: #4f46e5; --primary-2: #4f5bd5; --on-primary: #fff;
  --glass: rgb(23 26 36 / .72); --glass-border: rgb(255 255 255 / .12);
  --ok: #5eead4; --no: #f87171;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .25);
  --shadow-md: 0 10px 28px rgb(0 0 0 / .32);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / .45);
  --radius: 12px; --radius-lg: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --nav-h: 64px;
  --gutter: clamp(16px, 4vw, 40px);
  --step--1: clamp(.875rem, .85rem + .12vw, .95rem);
  --step-0: clamp(1rem, .96rem + .22vw, 1.125rem);
  --step-1: clamp(1.1rem, 1.02rem + .4vw, 1.35rem);
  --step-3: clamp(1.7rem, 1.3rem + 1.8vw, 2.5rem);
  --step-4: clamp(2.1rem, 1.3rem + 3.8vw, 4.25rem);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* graph */
  --g-bg: #0d1017; --g-edge: 139 151 255; --g-label: #e8eaf0;
}
:root[data-theme="light"] {
  --bg: #f6f7fb; --bg-soft: #eceef6; --card: #fff; --border: #d3d8e6;
  --text: #171a26; --muted: #576075; --accent: #4338ca; --accent-2: #0f766e; --code: #eff1f8;
  --glass: rgb(255 255 255 / .8); --glass-border: rgb(0 0 0 / .08);
  --ok: #0f766e; --no: #b91c1c;
  --shadow-md: 0 10px 28px rgb(20 25 60 / .1);
  --shadow-lg: 0 24px 64px rgb(20 25 60 / .14);
  --g-bg: #fbfbfe; --g-edge: 67 56 202; --g-label: #171a26;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); scrollbar-gutter: stable; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  font: var(--step-0)/1.65 var(--font); color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: clip;
}
:root[data-theme="dark"] body { background: radial-gradient(120% 70% at 50% -10%, #161b2e, var(--bg) 60%) fixed; }
main { flex: 1 0 auto; }
img, svg, canvas, video { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; margin: 0 0 .5em; overflow-wrap: break-word; }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
code { font: .88em var(--mono); background: var(--code); border: 1px solid var(--border); padding: .05em .4em; border-radius: 6px; overflow-wrap: anywhere; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 10px; text-decoration: none; }
.skip:focus { top: 0; }
.container { width: min(100% , 1240px); margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }

/* ---------- Buttons & controls ---------- */
.btn, .ctl {
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; min-width: 44px; padding: .5rem 1rem; font: 600 1rem/1.2 var(--font);
  color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; cursor: pointer; touch-action: manipulation;
  transition: transform .18s var(--ease), border-color .18s, background-color .18s, box-shadow .18s;
}
.btn:hover, .ctl:hover { border-color: var(--accent); text-decoration: none; }
.btn:active, .ctl:active { transform: scale(.97); }
.btn.primary { color: var(--on-primary); border-color: transparent; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 20px rgb(79 70 229 / .35); }
.btn.primary:hover { box-shadow: 0 10px 28px rgb(79 70 229 / .5); }
.ctl[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in oklab, var(--card) 82%, var(--accent)); }
.ctl svg, .btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.field { min-height: 44px; padding: .5rem .85rem; font: 1rem var(--font); color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.field:focus-visible { border-color: var(--accent); outline-offset: 1px; }
::placeholder { color: var(--muted); opacity: 1; }

/* ---------- Progress & back to top ---------- */
#progress { position: fixed; inset: 0 auto auto 0; height: 3px; width: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--primary), var(--accent-2)); z-index: 60; pointer-events: none; }
#backToTop { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; border-radius: 999px; box-shadow: var(--shadow-md); }
#backToTop[hidden] { display: none; }

/* ---------- Nav ---------- */
.site-nav { position: sticky; top: 0; z-index: 50; background: var(--glass); border-bottom: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); padding-top: env(safe-area-inset-top); }
.nav-row { display: flex; align-items: center; gap: .5rem; min-height: var(--nav-h); }
.brand { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text); text-decoration: none; margin-right: auto; min-height: 44px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 0 4px rgb(139 151 255 / .15); }
.nav-cta { display: none; }
.menu-btn svg .x { display: none; }
.menu-btn[aria-expanded="true"] svg .bars { display: none; }
.menu-btn[aria-expanded="true"] svg .x { display: inline; }
.nav-panel {
  position: absolute; inset: 100% 0 auto 0; display: none; flex-direction: column; gap: .25rem;
  padding: .75rem var(--gutter) 1rem; background: var(--card); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
  max-height: calc(100dvh - var(--nav-h)); overflow-y: auto;
}
.nav-panel[data-open] { display: flex; }
.nav-links { display: flex; flex-direction: column; }
.nav-links a { display: flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; padding: 0 .25rem; border-radius: 8px; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--accent); }
.nav-tools { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .5rem; }
.nav-tools #siteSearch { flex: 1 1 180px; }
@media (min-width: 1300px) {
  .menu-btn { display: none; }
  .nav-cta { display: inline-flex; }
  .nav-panel { position: static; display: flex; flex-direction: row; align-items: center; gap: 1rem; padding: 0; background: none; border: 0; box-shadow: none; max-height: none; overflow: visible; order: 2; margin-left: auto; }
  .nav-links { flex-direction: row; gap: .25rem; }
  .nav-links a { color: var(--muted); padding: 0 .45rem; font-size: var(--step--1); white-space: nowrap; }
  .nav-tools { padding: 0; flex-wrap: nowrap; }
  .nav-tools #siteSearch { flex: 0 1 120px; }
  .brand { margin-right: 0; }
  .nav-actions { order: 3; }
}
.nav-actions { display: flex; gap: .5rem; align-items: center; }

/* ---------- Sections ---------- */
section { padding-block: clamp(56px, 9vw, 104px); content-visibility: auto; contain-intrinsic-size: auto 720px; }
section + section { border-top: 1px solid var(--border); }
.section-title { font-size: var(--step-3); margin-bottom: .35em; }
.section-sub { font-size: var(--step-1); color: var(--muted); max-width: 62ch; margin-bottom: clamp(24px, 4vw, 44px); }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; text-align: center; padding-block: clamp(56px, 10vw, 120px) clamp(40px, 6vw, 72px); overflow: clip; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(55% 55% at 50% 0%, rgb(124 140 255 / .2), transparent 70%), radial-gradient(35% 40% at 90% 20%, rgb(94 234 212 / .1), transparent 70%); }
.badge { display: inline-block; max-width: 100%; padding: .35rem .9rem; margin-bottom: 1.25rem; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--accent); font-size: var(--step--1); font-weight: 600; }
.hero-title { font-size: var(--step-4); line-height: 1.05; letter-spacing: -.03em; margin: 0 auto .4em; max-width: 22ch; }
.grad { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: var(--step-1); color: var(--muted); max-width: 60ch; margin: 0 auto 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: clamp(14px, 2vw, 24px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.card { min-width: 0; padding: clamp(18px, 2.4vw, 26px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow-wrap: break-word; transition: border-color .2s, transform .25s var(--ease), box-shadow .25s; }
.card h3 { margin-bottom: .4em; }
.card p { margin: 0 0 .75em; color: var(--muted); font-size: var(--step--1); line-height: 1.6; }
.card p:last-child { margin-bottom: 0; }
.card .icon { font-size: 1.5rem; margin-bottom: .5rem; line-height: 1; }
.card.prose { max-width: 820px; }
.card.prose p { font-size: var(--step-0); }
@media (hover: hover) { .card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-md); } }
.flow-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 32px); box-shadow: var(--shadow-sm); }
.flow-note { text-align: center; color: var(--muted); font-size: var(--step--1); margin: 1.25rem auto 0; }

/* ---------- Diagram (replaces tiny-text SVGs) ---------- */
.diagram { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; grid-template-columns: 1fr; }
.diagram > li { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.node { flex: 1; min-width: 0; text-align: center; padding: 16px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-soft); }
.node.hl { border-color: var(--accent); }
.node b { display: block; font-size: 1.05rem; margin-bottom: .2rem; overflow-wrap: anywhere; }
.node span { display: block; color: var(--muted); font-size: var(--step--1); line-height: 1.45; }
.node .tag { margin-top: .4rem; font-size: .8rem; font-weight: 600; color: var(--ok); }
.arrow { display: grid; place-items: center; height: 28px; color: var(--accent); font-weight: 700; }
.arrow::before { content: "\2193"; }
@media (min-width: 760px) {
  .diagram { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
  .diagram > li { flex-direction: row; align-items: stretch; }
  .diagram > li:last-child .arrow { display: none; }
  .arrow { height: auto; width: 32px; flex: none; }
  .arrow::before { content: "\2192"; }
}
.diagram.cols-5 { --cols: 5; }
.diagram.cols-4 { --cols: 4; }
@media (min-width: 760px) and (max-width: 1099px) { .diagram.cols-5 { --cols: 3; } .diagram.cols-4 { --cols: 2; } }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); -webkit-overflow-scrolling: touch; }
.compare { width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--step--1); }
.compare th, .compare td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare thead th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--card); }
.compare tbody tr:last-child td { border-bottom: 0; }
.compare td:first-child { font-weight: 600; }
.compare .yes { color: var(--ok); } .compare .no { color: var(--no); } .compare .mid { color: var(--muted); }

/* ---------- Code ---------- */
.code-box { position: relative; }
.qs { background: var(--code); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-lg); padding: 44px 18px 18px; font: .92rem/1.7 var(--mono); }
.qs .line { display: block; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.7em; }
.qs .c { color: var(--muted); } .qs .k { color: var(--accent); }
.qs::before { content: "Terminal"; position: absolute; top: 12px; left: 18px; font: 600 .7rem var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.code-box .btn { position: absolute; top: 6px; right: 6px; min-height: 36px; padding: .25rem .75rem; font-size: .85rem; }

/* ---------- Chips ---------- */
.compat { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: .45rem 1rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: var(--step--1); max-width: 100%; overflow-wrap: anywhere; }

/* ---------- Walkthrough ---------- */
.steps-list { margin: 0; padding-left: 1.25em; display: grid; gap: .85rem; }
.steps-list li::marker { color: var(--accent); font-weight: 700; }
.steps-list li { padding-left: .25em; overflow-wrap: break-word; }
.steps-list .muted { color: var(--muted); }

/* ---------- Graph ---------- */
.graph-list { margin-top: 14px; }
.graph-list summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.graph-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.graph-list button { font: .85rem var(--mono); min-height: 36px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding-block: 36px max(36px, env(safe-area-inset-bottom)); color: var(--muted); font-size: var(--step--1); }
footer .inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
footer a { display: inline-flex; align-items: center; min-height: 36px; color: var(--muted); }
footer a:hover { color: var(--accent); }

/* ---------- Misc ---------- */
#searchEmpty { padding: 48px var(--gutter); text-align: center; color: var(--muted); }

/* Reveal: progressive enhancement, never hides content without JS */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 480px) {
  .hero-cta .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media (prefers-contrast: more) { :root { --border: currentColor; } .card, .flow-card { border-width: 2px; } }
@media (forced-colors: active) { .btn.primary { background: Highlight; color: HighlightText; } .grad { color: CanvasText; background: none; } }
@media print {
  .site-nav, #progress, #backToTop, .menu-btn { display: none !important; }
  body { background: #fff; color: #000; display: block; }
  .card, .flow-card { break-inside: avoid; box-shadow: none; }
  section { content-visibility: visible; }
}

/* ---------- Small helpers ---------- */
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: inline; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
.center { text-align: center; }
.mx { margin-inline: auto; }
.mt { margin-top: 1.25rem; }
.mt-grid { margin-top: 24px; }
.hint { color: var(--muted); font-size: var(--step--1); margin-top: 16px; }
.muted { color: var(--muted); }
.section-title:not(:has(+ .section-sub)) { margin-bottom: clamp(24px, 4vw, 44px); }

.compare code { white-space: nowrap; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

/* ---------- Full screen ---------- */
html.graph-full { overflow: hidden; }
.graph-wrap.is-full { display: flex; flex-direction: column; width: 100%; height: 100%; background: var(--g-bg); padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.graph-wrap.is-full:not(:fullscreen):not(:-webkit-full-screen) { position: fixed; inset: 0; z-index: 90; height: 100dvh; }
html.graph-full #graph { content-visibility: visible; contain: none; }
html.graph-full { scrollbar-gutter: auto; }

/* ---------- Idea page: figures ---------- */
:root { --c-source: #5eead4; --c-entity: #fbbf24; --c-concept: #8b97ff; --c-synthesis: #f472b6; --c-idx: #a1a9b8; }
:root[data-theme="light"] { --c-source: #0f766e; --c-entity: #b45309; --c-concept: #4338ca; --c-synthesis: #be185d; --c-idx: #576075; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.fig { margin: 0; padding: clamp(14px, 2.4vw, 22px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); min-width: 0; }
.fig.hl { border-color: var(--accent); }
.fig h3 { margin-bottom: .75rem; }
.fig svg { display: block; width: 100%; height: auto; }
.fig .steps-list { margin-top: 14px; color: var(--muted); font-size: var(--step--1); gap: .45rem; }
.fig-grid { display: grid; gap: clamp(14px, 2vw, 24px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: start; }
.fig-grid.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: center; }
/* svg parts */
.doc { fill: var(--card); stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; }
.ln { stroke: var(--muted); stroke-width: 1.5; fill: none; stroke-linecap: round; }
.lk { stroke: var(--muted); stroke-width: 1.6; fill: none; opacity: .65; }
.ar { stroke: var(--accent); stroke-width: 2.4; fill: none; stroke-linecap: round; }
.ar.thin { stroke-width: 1.4; opacity: .55; }
.ar.dash { stroke-dasharray: 6 7; }
.mk { fill: var(--accent); }
.bx { fill: var(--bg-soft); stroke: var(--border); stroke-width: 1.5; }
.bx.acc { stroke: var(--accent); }
.tile { fill: var(--card); stroke: var(--border); stroke-width: 1.4; }
.n-src, .n-ent, .n-con, .n-syn { stroke: var(--bg-soft); stroke-width: 2; }
.n-src, .s-src { fill: var(--c-source); } .n-ent, .s-ent { fill: var(--c-entity); }
.n-con, .s-con { fill: var(--c-concept); } .n-syn, .s-syn { fill: var(--c-synthesis); }
.s-idx, .s-log { fill: var(--c-idx); }
.stale { fill: none; stroke: var(--c-source); stroke-width: 2.4; stroke-dasharray: 2 5; stroke-linecap: round; }
.orphan { fill: none; stroke: var(--no); stroke-width: 2.2; stroke-dasharray: 5 5; }
.bad { stroke: var(--no); stroke-width: 2.6; fill: none; stroke-linecap: round; }
.mono { font: 600 22px var(--mono); fill: var(--text); } .mono.sm { font-size: 17px; fill: var(--muted); }
.lock { fill: var(--muted); } .lockln { fill: none; stroke: var(--muted); stroke-width: 3; }
.key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; color: var(--muted); font-size: var(--step--1); }
.key .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
/* text blocks */
.legend { margin: 0; display: grid; gap: 16px; }
.legend dt { font-weight: 600; padding-left: 12px; border-left: 3px solid var(--border); }
.legend dd { margin: 4px 0 0; padding-left: 15px; color: var(--muted); font-size: var(--step--1); }
.legend .k-acc { border-color: var(--accent); } .legend .k-wiki { border-color: var(--c-concept); } .legend .k-raw { border-color: var(--c-source); }
.op { display: grid; gap: clamp(14px, 2vw, 28px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; margin-bottom: clamp(36px, 5vw, 64px); }
.op > h3 { grid-column: 1 / -1; margin: 0; font-size: var(--step-2, 1.5rem); }
.op-text p { margin: 0 0 .9em; }
.example { border-left: 3px solid var(--accent-2); padding: .1rem 0 .1rem 14px; color: var(--muted); font-size: var(--step--1); max-width: 62ch; }
.tick { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.tick li { position: relative; padding-left: 26px; color: var(--muted); }
.tick li::before { content: ""; position: absolute; left: 0; top: .5em; width: 14px; height: 8px; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg) scale(.9); }
.card .tick { font-size: var(--step--1); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 auto 1rem; max-width: 760px; }
.toc .chip { text-decoration: none; color: var(--text); min-height: 36px; display: inline-flex; align-items: center; }
.toc .chip:hover { border-color: var(--accent); }
.prose-block { max-width: 760px; }
.prose-block p { font-size: var(--step-0); color: var(--text); }
.qs[data-label]::before { content: attr(data-label); text-transform: none; letter-spacing: 0; font-family: var(--mono); }
.card .qs { margin-top: 14px; font-size: .82rem; padding: 40px 14px 14px; }
@media (prefers-reduced-motion: no-preference) { .fig .ar.dash { animation: dashmove 2.4s linear infinite; } @keyframes dashmove { to { stroke-dashoffset: -26; } } }
.fig-grid + p, .fig-grid + .example { margin-top: 20px; }
.grid + p.hint, .grid + .hint { margin-top: 20px; }
.key .s-src { background: var(--c-source); } .key .s-ent { background: var(--c-entity); } .key .s-con { background: var(--c-concept); }
.key .s-syn { background: var(--c-synthesis); } .key .s-idx, .key .s-log { background: var(--c-idx); }
.qs { position: relative; }
.tick + p { margin-top: 1em; }

/* ---------- Reading journey ---------- */
.eyebrow { display: flex; align-items: center; gap: .6rem; margin: 0 0 .6rem; font-size: var(--step--1); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.num { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; margin-right: .45rem; border-radius: 999px; background: color-mix(in oklab, var(--accent) 18%, transparent); color: var(--accent); font-size: .85em; font-weight: 700; letter-spacing: 0; }
.eyebrow .num { margin-right: 0; }
.hero .toc { margin-top: 1rem; }
.hero .hint { margin-top: 1.25rem; text-align: center; margin-inline: auto; }


/* ---------- LLM Wiki Brain additions ---------- */
.shot { margin: clamp(28px, 5vw, 56px) auto 0; max-width: 1100px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: #1e1e1e; box-shadow: var(--shadow-lg); }
.shot img { display: block; width: 100%; height: auto; }
.shot-cap { margin: .75rem auto 0; max-width: 70ch; color: var(--muted); font-size: var(--step--1); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin: 1.25rem 0 0; color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.hero-meta span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent-2); vertical-align: middle; }
.cards-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.kbd { font: 600 .8em var(--mono); background: var(--code); border: 1px solid var(--border); border-bottom-width: 2px; padding: .05em .45em; border-radius: 6px; white-space: nowrap; }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; font-weight: 600; }
.faq details[open] { border-color: var(--accent); }
.faq details p { color: var(--muted); }
.final-cta { text-align: center; }
.final-cta .hero-cta { margin-top: 1rem; }
.lang-note { color: var(--muted); font-size: var(--step--1); }
.table-wrap + .hint { margin-top: 14px; }
.compare td code { white-space: normal; }

/* The live demo: the plugin's own view running on a synthetic vault, in Obsidian's variables. */
.demo-frame {
  --background-primary: #1e1e1e; --background-secondary: #262626; --background-modifier-border: #363636; --background-modifier-hover: rgb(255 255 255 / .075);
  --text-normal: #dadada; --text-muted: #b3b3b3; --text-faint: #666; --text-on-accent: #fff; --text-warning: #d4a72c; --interactive-accent: #7b6cd9;
  --font-ui-small: 13px; --font-ui-smaller: 12px; --font-monospace: ui-monospace, "SF Mono", Menlo, monospace;
  --radius-m: 8px; --shadow-s: 0 1px 6px rgb(0 0 0 / .4); --size-4-1: 4px; --size-4-2: 8px; --size-4-4: 16px;
  position: relative; display: flex; flex-direction: column; height: clamp(520px, 78vh, 720px); overflow: hidden;
  background: var(--background-primary); color: var(--text-normal); font: 13px var(--font);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
:root[data-theme="light"] .demo-frame {
  --background-primary: #fff; --background-secondary: #f6f6f6; --background-modifier-border: #dcdcdc; --background-modifier-hover: rgb(0 0 0 / .06);
  --text-normal: #222; --text-muted: #5c5c5c; --text-faint: #999; --interactive-accent: #705dcf; --shadow-s: 0 1px 6px rgb(0 0 0 / .15);
}
.demo-frame button, .demo-frame select, .demo-frame input { font: inherit; color: var(--text-normal); background: var(--background-modifier-hover); border: 1px solid var(--background-modifier-border); border-radius: 5px; padding: 2px 8px; min-height: 26px; }
.demo-frame input[type="range"], .demo-frame input[type="checkbox"] { padding: 0; min-height: 0; }
.demo-frame button { cursor: pointer; }
.demo-frame button:disabled { opacity: .45; cursor: default; }
.demo-frame .llm-wiki-brain { flex: 1; min-height: 0; }
.demo-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); }
@media (max-width: 640px) { .demo-frame { height: 640px; } }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); margin-top: clamp(24px, 4vw, 40px); }
.gallery figure { margin: 0; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--card); box-shadow: var(--shadow-sm); }
.gallery img { display: block; width: 100%; height: auto; background: #1e1e1e; }
.gallery figcaption { padding: clamp(14px, 2vw, 20px); }
.gallery figcaption h3 { margin-bottom: .3em; }
.gallery figcaption p { margin: 0; color: var(--muted); font-size: var(--step--1); line-height: 1.6; }
.gallery .narrow { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); align-items: center; }
@media (max-width: 720px) { .gallery { grid-template-columns: minmax(0, 1fr); } .gallery .narrow { grid-template-columns: minmax(0, 1fr); } .gallery .narrow img { max-width: 280px; margin: 0 auto; } }
