:root {
  --bg: #eceef1;
  --surface: #ffffff;
  --soft: #f3f4f6;
  --soft-2: #e8eaee;
  --ink: #111418;
  --ink-2: #555c68;
  --ink-3: #8b929d;
  --hair: rgba(17, 20, 24, 0.08);
  --accent: #2f7d32;
  --warn: #c2410c;
  --viewport: #0c0e10;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.06), 0 16px 40px rgba(16, 24, 40, 0.1);
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1012; --surface: #16191c; --soft: #1e2226; --soft-2: #262b30;
    --ink: #eef1f4; --ink-2: #a6adb8; --ink-3: #6f7782; --hair: rgba(255, 255, 255, 0.07);
    --accent: #83d06c; --warn: #fb923c; --viewport: #07080a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1012; --surface: #16191c; --soft: #1e2226; --soft-2: #262b30;
  --ink: #eef1f4; --ink-2: #a6adb8; --ink-3: #6f7782; --hair: rgba(255, 255, 255, 0.07);
  --accent: #83d06c; --warn: #fb923c; --viewport: #07080a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); }

/* ---------------------------------------------------------------- home */
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.home-body { min-height: 100vh; }
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; padding: 0 max(16px, calc((100vw - 1180px) / 2 + 24px)); background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 640; letter-spacing: -0.01em; font-size: 15px; }
.brand svg { width: 22px; height: 22px; fill: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-size: 13.5px; padding: 8px 10px; border-radius: 8px; }
.nav-links a:hover { color: var(--ink); background: var(--soft-2); }
.theme { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; margin-left: 4px; }
.theme:hover { background: var(--soft-2); color: var(--ink); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.home { max-width: 1180px; margin: 0 auto; padding: 40px 24px 64px; }
.hero { padding: 36px 0 8px; }
.eyebrow { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 18px; font-size: 12.5px; color: var(--ink-2); background: var(--surface); padding: 5px 12px 5px 8px; border-radius: 999px; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.04; letter-spacing: -0.035em; margin: 0 0 18px; font-weight: 680; }
.hero h1 span { color: var(--ink-3); }
.hero .lede { color: var(--ink-2); margin: 0; max-width: 600px; font-size: clamp(15px, 1.6vw, 17px); line-height: 1.6; }
.metrics { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.metrics div { background: var(--surface); border-radius: 12px; padding: 10px 16px 11px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 120px; }
.metrics b { font-size: 22px; font-weight: 660; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.metrics span { font-size: 12px; color: var(--ink-3); }

/* every look, drifting past */
.reel { margin: 44px calc(50% - 50vw) 8px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.reel-row { display: flex; gap: 12px; width: max-content; animation: reel 120s linear infinite; }
.reel-row + .reel-row { animation-direction: reverse; animation-duration: 140s; }
.reel:hover .reel-row { animation-play-state: paused; }
.reel.still .reel-row { animation: none; }
.reel a { position: relative; flex: none; width: clamp(180px, 22vw, 260px); aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--soft-2); display: block; }
.reel img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.reel a:hover img { transform: scale(1.05); }
.reel a span { position: absolute; left: 8px; bottom: 8px; font-size: 11.5px; color: #fff; background: rgba(0, 0, 0, 0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); padding: 2px 8px; border-radius: 999px; opacity: 0; transition: opacity 0.2s; }
.reel a:hover span { opacity: 1; }
@keyframes reel { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .reel-row { animation: none; } }

/* search + filters, stuck under the nav */
.assets { margin-top: 36px; }
.toolbar { position: sticky; top: 56px; z-index: 10; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 0; margin-bottom: 8px; }
.toolbar::before { content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); opacity: 0; transition: opacity 0.2s; }
.toolbar.stuck::before { opacity: 1; }
.search-wrap { flex: 1 1 260px; max-width: 380px; position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 12px; width: 16px; height: 16px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.search { width: 100%; background: var(--surface); border: 0; border-radius: 11px; padding: 11px 40px 11px 36px; font: inherit; font-size: 14px; color: var(--ink); box-shadow: var(--shadow); outline: none; transition: box-shadow 0.15s; }
.search:focus { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.search::placeholder { color: var(--ink-3); }
.search::-webkit-search-cancel-button { display: none; }
.search-wrap kbd { position: absolute; right: 10px; font: 11px var(--mono); color: var(--ink-3); background: var(--soft); border-radius: 5px; padding: 2px 7px; pointer-events: none; }
.search:focus + kbd { opacity: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 0; border-radius: 999px; padding: 7px 13px; color: var(--ink-2); cursor: pointer; font-size: 13px; box-shadow: var(--shadow); min-height: 34px; }
.chip i { font-style: normal; color: var(--ink-3); font-size: 11.5px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] i { color: inherit; opacity: 0.6; }
.toolbar .count { margin-left: auto; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; }
.card { position: relative; background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: box-shadow 0.2s, transform 0.2s; animation: card-in 0.35s both; }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card:focus-within { box-shadow: 0 0 0 2px var(--accent), var(--shadow-hover); }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; transition: none; } .card:hover { transform: none; } }
.card-hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; outline: none; }
.card .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--soft-2); overflow: hidden; pointer-events: none; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .look { position: absolute; left: 10px; bottom: 10px; font-size: 11.5px; color: #fff; background: rgba(0, 0, 0, 0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); padding: 3px 9px; border-radius: 999px; }
.card .ticks { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; gap: 3px; opacity: 0; transition: opacity 0.2s; }
.card:hover .ticks, .card .ticks:has(i.on:not(:first-child)) { opacity: 1; }
.card .ticks i { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, 0.38); }
.card .ticks i.on { background: #fff; }
.card .body { padding: 18px 20px 18px; pointer-events: none; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card .title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card h2 { font-size: 19px; margin: 0; font-weight: 650; letter-spacing: -0.015em; }
.card .summary { margin: 0; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.state { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.state::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3b82f6; margin-right: 6px; vertical-align: 1px; }
.state.stable::before { background: var(--accent); }
.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 2px; }
.nums div { display: flex; flex-direction: column; background: var(--soft); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.nums b { font-size: 15px; font-weight: 640; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nums span { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags span { font-size: 11.5px; color: var(--ink-2); background: var(--soft); border-radius: 6px; padding: 2px 7px; }
.actions { display: flex; gap: 2px; position: relative; z-index: 2; pointer-events: auto; }
.actions a { text-decoration: none; font-size: 13px; color: var(--ink-2); padding: 7px 10px; border-radius: 8px; }
.actions a:hover { background: var(--soft); color: var(--ink); }
.actions a.go { color: var(--ink); font-weight: 600; }
.card .meta { font-size: 11.5px; color: var(--ink-3); }
.empty { text-align: center; padding: 64px 24px; color: var(--ink-2); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.empty b { color: var(--ink); font-size: 16px; }
.empty p { margin: 6px 0 0; }
.empty button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }

.section-title { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-3); margin: 64px 0 14px; font-weight: 600; }
.rows { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.row { display: grid; grid-template-columns: 180px 1fr auto; gap: 18px; padding: 18px 20px; align-items: baseline; }
.row + .row { border-top: 1px solid var(--hair); }
.row b { font-weight: 620; }
.row p { margin: 0; color: var(--ink-2); }
.row small { color: var(--ink-3); display: block; margin-top: 3px; font-family: var(--mono); font-size: 11.5px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step { background: var(--surface); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow); }
.step b { display: block; margin: 8px 0 6px; font-size: 15px; }
.step p { margin: 0; color: var(--ink-2); }
.step .n { color: var(--accent); font: 600 12px var(--mono); }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--hair); color: var(--ink-3); font-size: 12.5px; }
@media (max-width: 720px) {
  .home { padding: 12px 16px 48px; }
  .hero { padding-top: 20px; }
  .nav-links a { display: none; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .toolbar { gap: 8px; }
  .search-wrap { max-width: none; flex-basis: 100%; }
  .search-wrap kbd { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .toolbar .count { display: none; }
  .metrics div { flex: 1 1 40%; min-width: 0; }
  .reel { margin-top: 32px; }
  .actions a { padding: 10px 10px; }
}

/* ---------------------------------------------------------------- viewer */
.viewer { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 20px; min-height: 56px; padding: 0 12px 0 20px; background: var(--surface); border-bottom: 1px solid var(--hair); min-width: 0; }
.topbar .back { text-decoration: none; color: var(--ink-3); white-space: nowrap; }
.topbar .back:hover { color: var(--ink); }
.topbar h1 { font-size: 15px; margin: 0; font-weight: 620; white-space: nowrap; }
.tabs { display: flex; gap: 2px; background: var(--soft); padding: 3px; border-radius: 10px; }
.tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.topbar .stats { margin-left: auto; font: 12px var(--mono); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.topbar .stats b { color: var(--ink); font-weight: 500; }
.topbar .theme { flex: none; }
.stage { position: relative; min-height: 0; }
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: rgba(255, 255, 255, 0.7); font-size: 13px; z-index: 3; background: var(--viewport); text-align: center; padding: 24px; }
.loading .spin { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.15); border-top-color: rgba(255, 255, 255, 0.8); animation: spin 0.8s linear infinite; }
.loading.failed { gap: 6px; }
.loading.failed b { color: #fff; font-size: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pane { position: absolute; inset: 0; display: none; }
.pane.on { display: grid; }
.pane-3d { grid-template-columns: 1fr 340px; }
.viewport { position: relative; background: var(--viewport); min-width: 0; overflow: hidden; }
.viewport canvas { display: block; width: 100%; height: 100%; outline: none; }
.hud { position: absolute; left: 14px; bottom: 12px; color: rgba(255, 255, 255, 0.72); font-size: 12px; pointer-events: none; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.hud kbd { font: 11px var(--mono); background: rgba(255, 255, 255, 0.14); border-radius: 4px; padding: 1px 5px; }
.panel { background: var(--surface); overflow-y: auto; padding: 18px 18px 40px; border-left: 1px solid var(--hair); }
.panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 22px 0 10px; font-weight: 600; }
.panel h3:first-child { margin-top: 0; }
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.swatch { border: 0; padding: 0; background: var(--soft); border-radius: 10px; overflow: hidden; cursor: pointer; text-align: left; position: relative; }
.swatch img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.swatch span { display: block; padding: 6px 9px 7px; font-size: 12px; color: var(--ink-2); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch[aria-pressed="true"] span { color: var(--ink); font-weight: 600; }
.seg { display: flex; background: var(--soft); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 7px; padding: 5px 0; cursor: pointer; font-size: 12px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.ctl { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; margin: 9px 0; }
.ctl label { font-size: 12.5px; color: var(--ink-2); }
.ctl output { font: 11.5px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ctl input[type="range"] { grid-column: 1 / -1; width: 100%; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; height: 18px; }
.ctl input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--soft-2); }
.ctl input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--soft-2); }
.ctl input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); margin-top: -5px; border: 0; }
.ctl input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 0; }
.ctl.color { grid-template-columns: 1fr auto auto; }
.ctl input[type="color"] { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer; }
.ctl input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.ctl input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--hair); }
.toggle { display: flex; align-items: center; justify-content: space-between; margin: 9px 0; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 30px; height: 18px; border-radius: 9px; background: var(--soft-2); position: relative; cursor: pointer; margin: 0; transition: background 0.15s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: left 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.toggle input:checked { background: var(--ink); }
.toggle input:checked::after { left: 14px; }
details.group { margin: 4px 0; }
details.group summary { cursor: pointer; list-style: none; padding: 8px 0; font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; }
details.group summary::-webkit-details-marker { display: none; }
details.group summary::after { content: "+"; color: var(--ink-3); font-weight: 400; }
details.group[open] summary::after { content: "\2212"; }
details.group + details.group { border-top: 1px solid var(--hair); }
.btn { border: 0; background: var(--ink); color: var(--bg); border-radius: 9px; padding: 9px 12px; cursor: pointer; font-size: 13px; width: 100%; }
.btn.soft { background: var(--soft); color: var(--ink); }
.btn + .btn { margin-top: 8px; }
.note { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }
.budget { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.budget div { background: var(--soft); border-radius: 9px; padding: 8px 10px; }
.budget b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 620; }
.budget span { font-size: 11px; color: var(--ink-3); }

/* diagrams + docs */
.scroll { overflow-y: auto; }
.pane-diagrams, .pane-docs, .pane-use { background: var(--bg); }
.diagrams { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 20px; }
.figure { background: var(--surface); border-radius: var(--radius); padding: 18px 20px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.figure h2 { font-size: 15px; margin: 0; font-weight: 620; }
.figure p { margin: 0; color: var(--ink-2); font-size: 13px; }
.figure canvas { width: 100%; border-radius: 10px; background: var(--soft); display: block; }
.figure .ctls { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

.doc { max-width: 1180px; margin: 0 auto; padding: 28px 24px 96px; display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 48px; }
.toc { position: sticky; top: 24px; align-self: start; font-size: 13px; }
.toc a { display: block; text-decoration: none; color: var(--ink-3); padding: 3px 0; }
.toc a.l3 { padding-left: 12px; font-size: 12.5px; }
.toc a:hover { color: var(--ink); }
.md { line-height: 1.65; font-size: 15px; }
.md h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 12px; line-height: 1.2; }
.md h2 { font-size: 21px; margin: 40px 0 10px; letter-spacing: -0.01em; }
.md h3 { font-size: 16px; margin: 28px 0 8px; }
.md p, .md ul, .md ol { color: var(--ink-2); }
.md strong { color: var(--ink); }
.md code { font-size: 0.86em; background: var(--soft); padding: 1px 5px; border-radius: 5px; color: var(--ink); }
.md pre { background: var(--surface); box-shadow: var(--shadow); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 16px 0; padding: 12px 16px; background: var(--soft); border-radius: 10px; color: var(--ink-2); }
.md hr { border: 0; border-top: 1px solid var(--hair); margin: 32px 0; }
.md-table { overflow-x: auto; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); margin: 14px 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 13px; }
.md th { text-align: left; font-weight: 600; color: var(--ink); padding: 9px 14px; }
.md td { padding: 8px 14px; color: var(--ink-2); border-top: 1px solid var(--hair); vertical-align: top; }
.md a { color: var(--accent); }
.md img { max-width: 100%; border-radius: 12px; display: block; margin: 18px 0; box-shadow: var(--shadow); }
@media (max-width: 900px) {
  .pane-3d { grid-template-columns: 1fr; grid-template-rows: 58vh 1fr; }
  .panel { border-left: 0; }
  .doc { grid-template-columns: 1fr; } .toc { display: none; }
  .diagrams { grid-template-columns: 1fr; }
  .topbar .stats { display: none; }
  .topbar { flex-wrap: wrap; gap: 6px 14px; padding: 8px 8px 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar .theme { margin-left: auto; }
  .tabs { order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs button { flex: 1 0 auto; padding: 8px 12px; }
  .pane-3d { grid-template-rows: 50vh 1fr; grid-template-rows: 50dvh 1fr; }
  .panel { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
}
/* a state as a dot plus a word */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); margin: 0 4px 1px 2px; vertical-align: middle; opacity: 0.5; }
.dot.on { background: #2f9e6e; opacity: 1; }
.seg button:disabled { opacity: 0.35; cursor: default; }
