/**
 * sonaloop-design — documentation site chrome.
 *
 * This file styles the DOCS SHELL only (top bar, sidebar, prose, preview frames).
 * It is NOT part of the design system itself — every component shown in the docs is
 * rendered with the real `.sl-*` classes from /styles/components.css, and every colour
 * here is pulled from the canonical `--sl-*` tokens so the docs dogfood the system and
 * stay theme-aware. Modelled on the Geist (Vercel) design-system site.
 */

:root {
  --ds-topbar-h: 56px;
  --ds-sidebar-w: 264px;
  --ds-content-max: 1180px;
  --ds-pad: 40px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sl-sans, "Sona", system-ui, -apple-system, sans-serif);
  background: var(--sl-bg);
  color: var(--sl-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -.011em;
}

a { color: inherit; }

.ds-skip {
  position: fixed; left: 12px; top: 8px; z-index: 200; transform: translateY(-200%);
  background: var(--sl-ink); color: var(--sl-bg); padding: 8px 14px; border-radius: 8px;
  font-size: 13px; text-decoration: none;
}
.ds-skip:focus { transform: none; }

/* ── App shell ── the docs site dogfoods the shared .sl-app-shell layout (components.css):
   a full-height sidebar (brand · search · collapsible nav · settings menu) + a topbar over
   the content. Only the docs-specific touches live here. */
.sl-app-shell { --sl-sidebar-w: 264px; }
.sl-sb-search .sl-cmdk-trigger { font-size: 13px; }
/* the docs nav has many sections — use the shared collapsible .sl-nav-group, denser rows */
.sl-sb-scroll .sl-nav a { font-size: 13.5px; }
/* the Introduction renders as a plain top-level link above the sections */
.sl-sb-scroll .sl-nav--top { margin-bottom: var(--sl-s-2); }
/* settings popover: full-width theme segmented + the source link */
.sl-um-pop .sl-segmented { width: 100%; }
.sl-um-pop .sl-segmented__item svg { width: 16px; height: 16px; }
.ds-um-link { color: var(--sl-muted); font-size: 13px; text-decoration: none; }
.ds-um-link:hover { color: var(--sl-accent); }

/* content area inside the shell */
.sl-shell-body { padding: var(--ds-pad) var(--ds-pad) 96px; }
.ds-page { max-width: var(--ds-content-max); margin: 0 auto; }

/* ── Page header / prose ──────────────────────────────────────────────────────── */
.ds-eyebrow {
  font-family: var(--sl-mono); font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .14em; color: var(--sl-accent); margin: 0 0 14px;
}
.ds-h1 { font-size: 44px; line-height: 1.05; font-weight: 700; letter-spacing: -.03em; margin: 0 0 14px; }
.ds-lead { font-size: 19px; line-height: 1.55; color: var(--sl-muted); margin: 0 0 8px; max-width: 60ch; }

.ds-h2 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin: 56px 0 6px; }
.ds-h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 32px 0 12px; }
.ds-p { font-size: 15px; line-height: 1.65; color: var(--sl-muted); margin: 0 0 14px; max-width: 70ch; }
.ds-p code, .ds-li code {
  font-family: var(--sl-mono); font-size: .88em; padding: .1em .4em; border-radius: 5px;
  background: var(--sl-surface-2); color: var(--sl-ink); border: 1px solid var(--sl-line);
}
.ds-ul { margin: 0 0 14px; padding-left: 20px; }
.ds-li { font-size: 15px; line-height: 1.65; color: var(--sl-muted); margin: 0 0 6px; max-width: 70ch; }
.ds-divline { height: 1px; background: var(--sl-line); border: 0; margin: 0; }

/* ── Intro landing grid (Geist hero cards) ────────────────────────────────────── */
.ds-hero-grid {
  margin-top: 40px; border: 1px solid var(--sl-line); border-radius: 14px; overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; background: var(--sl-line); gap: 1px;
}
.ds-hero-cell { background: var(--sl-bg); padding: 30px 30px 26px; display: flex; flex-direction: column; text-decoration: none; transition: background .14s; }
.ds-hero-cell:hover { background: var(--sl-hover); }
.ds-hero-canvas { height: 168px; display: flex; align-items: center; justify-content: center; margin-bottom: 22px; overflow: hidden; }
.ds-hero-cell h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 5px; color: var(--sl-ink); }
.ds-hero-cell p { font-size: 14px; line-height: 1.5; color: var(--sl-muted); margin: 0; }
@media (max-width: 860px) { .ds-hero-grid { grid-template-columns: 1fr; } }

/* hero canvases — the Brand Assets cell renders the canonical .sl-logo lockup (same as the
   sidebar/appshell), so no bespoke wordmark styling here. */
.ds-canvas-icons { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; color: var(--sl-ink); }
.ds-canvas-icons svg { width: 22px; height: 22px; }
.ds-canvas-colors { display: flex; gap: 12px; align-items: stretch; height: 96px; }
.ds-canvas-colors i { width: 14px; border-radius: 999px; border: 5px solid var(--sl-surface); box-shadow: 0 0 0 1px var(--sl-line); display: block; }
.ds-canvas-type { display: flex; gap: 16px; }
.ds-canvas-type span { font-size: 30px; color: var(--sl-faint); }
.ds-canvas-type .mono { font-family: var(--sl-mono); }
.ds-canvas-grid { width: 200px; height: 120px; background-image: linear-gradient(var(--sl-line) 1px, transparent 1px), linear-gradient(90deg, var(--sl-line) 1px, transparent 1px); background-size: 28px 28px; opacity: .8; position: relative; }
.ds-canvas-grid::before, .ds-canvas-grid::after { content: "+"; position: absolute; color: var(--sl-muted); font-size: 18px; }
.ds-canvas-grid::before { top: -10px; left: -7px; }
.ds-canvas-grid::after { bottom: -13px; right: -7px; }
/* Website tile — a miniature marketing page (browser-less): nav row + headline + actions. */
.ds-canvas-web { width: 244px; }
.ds-canvas-web .wb { border: 1px solid var(--sl-line); border-radius: 11px; overflow: hidden; background: var(--sl-surface); }
.ds-canvas-web .wb-bar { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-bottom: 1px solid var(--sl-line); background: var(--sl-bg); }
.ds-canvas-web .wb-bar > svg { width: 16px; height: 16px; color: var(--sl-accent); flex: none; }
.ds-canvas-web .wb-links { display: flex; gap: 7px; flex: 1; }
.ds-canvas-web .wb-links i { width: 26px; height: 5px; border-radius: 3px; background: var(--sl-line); display: block; }
.ds-canvas-web .wb-cta { font-size: 10px; padding: .18em .55em; }
.ds-canvas-web .wb-body { padding: 16px 13px 17px; }
.ds-canvas-web .wb-h { height: 9px; border-radius: 4px; background: var(--sl-ink); opacity: .82; margin-bottom: 8px; }
.ds-canvas-web .wb-actions { display: flex; gap: 7px; margin-top: 12px; }
.ds-canvas-web .wb-actions .sl-btn { font-size: 10px; padding: .28em .7em; }

/* Patterns tile — a mini app shell (sidebar · topbar · rows) with a floating ⌘K palette */
.ds-canvas-app { position: relative; }
.ds-canvas-app .ab { display: flex; width: 244px; height: 122px; border: 1px solid var(--sl-line); border-radius: 11px; overflow: hidden; background: var(--sl-surface); }
.ds-canvas-app .ab-side { width: 62px; background: var(--sl-bg); border-right: 1px solid var(--sl-line); padding: 11px 9px; display: flex; flex-direction: column; gap: 8px; }
.ds-canvas-app .ab-side i { height: 6px; border-radius: 3px; background: var(--sl-line); display: block; }
.ds-canvas-app .ab-side i.is-active { background: var(--sl-accent); }
.ds-canvas-app .ab-main { flex: 1; display: flex; flex-direction: column; }
.ds-canvas-app .ab-top { display: flex; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--sl-line); }
.ds-canvas-app .ab-top i { width: 56px; height: 5px; border-radius: 3px; background: var(--sl-line); display: block; }
.ds-canvas-app .ab-body { padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.ds-canvas-app .ab-body i { height: 7px; border-radius: 3px; background: var(--sl-line); display: block; }
.ds-canvas-app .ab-pal { position: absolute; left: 50%; top: 50%; transform: translate(-34%, -44%); width: 118px;
  border: 1px solid var(--sl-line); border-radius: 9px; background: var(--sl-surface);
  box-shadow: 0 10px 26px rgba(20, 16, 8, .14); padding: 9px 10px; display: flex; flex-direction: column; gap: 7px; }
.ds-canvas-app .ab-pal i { height: 5px; border-radius: 3px; background: var(--sl-line); display: block; }
.ds-canvas-app .ab-pal-k { font-family: var(--sl-mono); font-size: 9px; color: var(--sl-faint); }

/* Deck tile — a 16:10 slide (kicker · title · bar chart · page number) over a stacked twin */
.ds-canvas-deck { position: relative; }
.ds-canvas-deck .dk { width: 196px; aspect-ratio: 16 / 10; border: 1px solid var(--sl-line); border-radius: 8px;
  background: var(--sl-surface); padding: 14px 16px; display: flex; flex-direction: column; position: relative; }
.ds-canvas-deck .dk--back { position: absolute; inset: 0; transform: translate(10px, -9px) rotate(1.6deg); opacity: .45; }
.ds-canvas-deck .dk-kicker { width: 44px; height: 4px; border-radius: 2px; background: var(--sl-accent); display: block; }
.ds-canvas-deck .dk-title { margin-top: 11px; display: flex; flex-direction: column; gap: 6px; }
.ds-canvas-deck .dk-title i { height: 9px; border-radius: 4px; background: var(--sl-ink); opacity: .82; display: block; }
.ds-canvas-deck .dk-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; }
.ds-canvas-deck .dk-bars { display: flex; gap: 5px; align-items: flex-end; }
.ds-canvas-deck .dk-bars i { width: 9px; border-radius: 2px 2px 0 0; background: var(--sl-accent); opacity: .75; display: block; }
.ds-canvas-deck .dk-num { font-family: var(--sl-mono); font-size: 9px; color: var(--sl-faint); }

/* ── Preview frames ───────────────────────────────────────────────────────────── */
.ds-preview {
  position: relative; border: 1px solid var(--sl-line); border-radius: 12px; overflow: hidden;
  background:
    radial-gradient(var(--sl-line) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--sl-surface);
  margin: 18px 0 0;
}
.ds-preview-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--sl-line); background: var(--sl-bg);
}
.ds-preview-bar .ds-pv-label { font-family: var(--sl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--sl-faint); }
.ds-preview-bar .ds-top-spacer { flex: 1; }
.ds-preview-stage { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 38px 30px; min-height: 96px; }
.ds-preview-stage.is-center { justify-content: center; }
.ds-preview-stage.flavor-app { font-size: 13px; }
.ds-preview-stage.flavor-web { font-size: 16px; }
/* The docs' svgReg() emits icons without an intrinsic size (real apps size their own —
   React via the size prop, the Python app via .ic), so size segmented preview icons here,
   else icon-only items (e.g. the Theme Toggle) collapse to nothing. */
.ds-preview-stage .sl-segmented__item svg { width: 1.05em; height: 1.05em; flex: none; }
.ds-preview-stage .sl-segmented--stacked .sl-segmented__item svg { width: 1.25em; height: 1.25em; }
/* Same deal for the Empty State hi-fi glyphs (React consumers size them via the icon's
   `size` prop; --sm has its own scale in the shared CSS, so leave it alone here). */
.ds-preview-stage .sl-empty:not(.sl-empty--sm) .sl-empty__icon svg { width: 44px; height: 44px; }

/* ── Website-section previews ──────────────────────────────────────────────────────
   Marketing/app blocks need to render edge-to-edge on the page surface (the navbar and
   footer are full-bleed; measure-frame caps their inner width). So drop the dotted matte
   and the centring/padding the component stage uses, and sit the block on plain paper. */
.ds-preview--web { background: var(--sl-bg); }
/* Bare variant preview — no bar/label/badge; the section heading already names it. */
.ds-preview--bare { margin-top: 10px; }
.ds-used-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.ds-used-inline__label { font-family: var(--sl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--sl-faint); }
.ds-preview--web .ds-pv-note { font-family: var(--sl-mono); font-size: 11px; letter-spacing: .04em; color: var(--sl-faint); }

/* Parametric controls — segmented toggles per enumerated prop; swaps a pre-rendered variant. */
.ds-wb-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  padding: 9px 14px; border-bottom: 1px solid var(--sl-line); background: var(--sl-bg);
}
.ds-wb-ctrl { display: inline-flex; align-items: center; gap: 8px; }
.ds-wb-ctrl__label { font-family: var(--sl-mono); font-size: 11px; text-transform: lowercase; letter-spacing: .03em; color: var(--sl-faint); }
.ds-wb-controls .ds-seg-btn { width: auto; min-width: 30px; padding: 0 10px; font-size: 12px; font-weight: 550; }
.ds-web-stage {
  display: block; padding: 0; min-height: 0; gap: 0;
  background: var(--sl-bg); font-size: 16px; overflow: hidden;
}
/* Tailwind's preflight is OFF here (so it can't touch the .ds-* chrome), which means UA
   defaults leak into the previews — link colour/underline, list bullets, heading margins,
   button chrome. Replay the handful of resets the marketing blocks assume, scoped to the
   stage. They're wrapped in :where() for ZERO specificity (exactly how preflight behaves),
   so the blocks' own classes — e.g. .sl-btn--primary's colour — always win. The copy-paste
   markup stays clean because a real Tailwind app ships preflight. */
:where(.ds-web-stage a) { color: inherit; text-decoration: none; }
:where(.ds-web-stage ul, .ds-web-stage ol) { list-style: none; margin: 0; padding: 0; }
/* Mirror preflight on headings: without it the UA's bold/large `h1`–`h3` defaults leak in and
   render the marketing headlines heavier than on the real site (which ships preflight). The
   blocks' text-*/font-* utilities still win (higher specificity than this :where reset). */
:where(.ds-web-stage h1, .ds-web-stage h2, .ds-web-stage h3, .ds-web-stage h4, .ds-web-stage p, .ds-web-stage figure) { margin: 0; }
:where(.ds-web-stage h1, .ds-web-stage h2, .ds-web-stage h3, .ds-web-stage h4) { font-size: inherit; font-weight: inherit; }
:where(.ds-web-stage button) { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

/* "Used on the website" — auto-detected consumer chips (page name + route). */
.ds-usechips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }
.ds-usechip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px;
  border: 1px solid var(--sl-line); border-radius: 8px; background: var(--sl-surface);
  font-size: 13px; color: var(--sl-ink);
}
.ds-usechip code {
  font-family: var(--sl-mono); font-size: 11.5px; color: var(--sl-muted);
  background: var(--sl-surface-2); border: 1px solid var(--sl-line); border-radius: 5px; padding: 1px 6px;
}
a.ds-usechip { text-decoration: none; transition: border-color .12s, background .12s, color .12s; }
a.ds-usechip:hover { border-color: color-mix(in srgb, var(--sl-accent) 50%, var(--sl-line)); background: var(--sl-hover); }
a.ds-usechip:hover code { color: var(--sl-accent); border-color: color-mix(in srgb, var(--sl-accent) 35%, var(--sl-line)); }

/* "Source" link — the component's location in the design-system repo (detected, not hardcoded). */
.ds-source { display: flex; align-items: center; gap: 7px; margin: 14px 0 0; font-size: 13px; color: var(--sl-muted); }
.ds-source__ico { line-height: 0; color: var(--sl-faint); }
.ds-source__ico svg { width: 15px; height: 15px; }
.ds-source a { color: var(--sl-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.ds-source a:hover { color: var(--sl-accent); }
.ds-source code { font-family: var(--sl-mono); font-size: 12px; }
.ds-source__line { font-family: var(--sl-mono); font-size: 11px; color: var(--sl-faint); }

/* Segmented toggles — density switch, parametric controls, code tabs. A pill group whose
   active button is lifted. Without an explicit background these fall back to raw UA button
   chrome (light grey + border) — fine-ish on light, glaringly bright in dark mode. */
.ds-seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--sl-line); border-radius: 9px; background: var(--sl-surface); }
.ds-seg-btn { appearance: none; border: 0; background: transparent; color: var(--sl-muted); font: inherit; line-height: 1; height: 26px; padding: 0 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: background .12s, color .12s; }
.ds-seg-btn:hover { color: var(--sl-ink); }
.ds-seg-btn.is-active { color: var(--sl-ink); background: var(--sl-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }

/* density toggle reused from .ds-seg, smaller text variant */
.ds-seg.ds-seg--text .ds-seg-btn { width: auto; padding: 0 11px; font-size: 12px; font-weight: 550; }

/* ── Code blocks ──────────────────────────────────────────────────────────────── */
/* Tabbed code blocks — one panel at a time, tab bar shares .ds-seg styling */
.ds-codetabs { margin: 16px 0 0; }
.ds-codetabs__tabs { display: flex; flex-wrap: wrap; max-width: 100%; }
.ds-codetabs__panel.is-hidden { display: none; }
.ds-codetabs__panel .ds-code { margin-top: 10px; }

.ds-code { position: relative; margin: 14px 0 0; border: 1px solid var(--sl-line); border-radius: 10px; background: var(--sl-surface); overflow: hidden; }
.ds-code-head { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--sl-line); }
.ds-code-lang { font-family: var(--sl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--sl-faint); flex: 1; }
.ds-copy { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--sl-line); background: var(--sl-bg); color: var(--sl-muted); border-radius: 7px; padding: 4px 9px; font: inherit; font-size: 12px; cursor: pointer; transition: color .12s, border-color .12s; }
.ds-copy:hover { color: var(--sl-ink); border-color: color-mix(in srgb, var(--sl-ink) 22%, var(--sl-line)); }
.ds-copy svg { width: 13px; height: 13px; }
.ds-copy__check { display: none; }
.ds-copy.is-copied { color: var(--sl-green); border-color: color-mix(in srgb, var(--sl-green) 42%, var(--sl-line)); }
.ds-copy.is-copied .ds-copy__ico { display: none; }
.ds-copy.is-copied .ds-copy__check { display: inline; }
.ds-code pre { margin: 0; padding: 16px; overflow-x: auto; }
.ds-code code { font-family: var(--sl-mono); font-size: 13px; line-height: 1.65; color: var(--sl-ink); white-space: pre; }
.ds-tok-key { color: var(--sl-accent); }
.ds-tok-str { color: var(--sl-green); }
.ds-tok-cmt { color: var(--sl-faint); font-style: italic; }
.ds-tok-tag { color: var(--sl-violet); }

/* ── Tables (props / variants) ───────────────────────────────────────────────── */
.ds-table { width: 100%; border-collapse: collapse; margin: 16px 0 0; font-size: 14px; }
.ds-table th, .ds-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--sl-line); vertical-align: top; }
.ds-table thead th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--sl-faint); }
.ds-table td { color: var(--sl-muted); }
.ds-table td:first-child { color: var(--sl-ink); }
.ds-table code, .ds-table .mono { font-family: var(--sl-mono); font-size: 12.5px; color: var(--sl-accent); }

/* ── Colors page ──────────────────────────────────────────────────────────────── */
.ds-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-top: 18px; }
.ds-swatch { border: 1px solid var(--sl-line); border-radius: 10px; overflow: hidden; background: var(--sl-surface); cursor: pointer; transition: border-color .12s; }
.ds-swatch:hover { border-color: color-mix(in srgb, var(--sl-ink) 22%, var(--sl-line)); }
.ds-swatch .chip { height: 72px; border-bottom: 1px solid var(--sl-line); }
.ds-swatch .meta { padding: 9px 11px; }
.ds-swatch .name { font-family: var(--sl-mono); font-size: 12px; color: var(--sl-ink); display: block; }
.ds-swatch .val { font-family: var(--sl-mono); font-size: 11px; color: var(--sl-faint); display: block; margin-top: 2px; text-transform: uppercase; }

/* ── Typography specimens ────────────────────────────────────────────────────── */
.ds-type-row { display: flex; align-items: baseline; gap: 22px; padding: 14px 0; border-bottom: 1px solid var(--sl-line); }
.ds-type-row .ds-type-meta { width: 150px; flex: none; font-family: var(--sl-mono); font-size: 12px; color: var(--sl-faint); }
.ds-type-row .ds-type-sample { color: var(--sl-ink); letter-spacing: -.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-weights { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 18px; }
.ds-weights div { font-size: 30px; letter-spacing: -.02em; color: var(--sl-ink); }
.ds-weights small { display: block; font-family: var(--sl-mono); font-size: 11px; color: var(--sl-faint); margin-top: 4px; text-transform: uppercase; letter-spacing: .1em; }

/* Glyph specimen — full character set, one card per family */
.ds-specimen { border: 1px solid var(--sl-line); border-radius: 12px; padding: 18px 20px 8px; margin-top: 16px; background: var(--sl-surface); }
.ds-specimen + .ds-specimen { margin-top: 14px; }
.ds-specimen-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--sl-line); }
.ds-specimen-name { font-family: var(--sl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--sl-faint); }
.ds-specimen-aa { font-size: 40px; line-height: 1; letter-spacing: -.02em; color: var(--sl-ink); }
.ds-glyph-row { display: flex; align-items: flex-start; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--sl-line); }
.ds-glyph-row:last-child { border-bottom: 0; }
.ds-glyph-label { width: 92px; flex: none; font-family: var(--sl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--sl-faint); padding-top: 10px; }
.ds-glyph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; flex: 1; min-width: 0; }
.ds-glyph { font: inherit; font-size: 22px; line-height: 1; color: var(--sl-ink); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 9px 0; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.ds-glyph:hover { background: var(--sl-hover); border-color: var(--sl-line); color: var(--sl-accent); }
.ds-glyph:active { transform: translateY(1px); }

/* Sona Pixel showcase — compare the five fills */
.ds-pixel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.ds-pixel-card { border: 1px solid var(--sl-line); border-radius: 12px; padding: 18px 18px 16px; background: var(--sl-surface); }
.ds-pixel-card .lbl { font-family: var(--sl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--sl-faint); }
.ds-pixel-sample { font-size: 30px; line-height: 1.1; color: var(--sl-ink); margin: 14px 0 10px; word-break: break-all; }
.ds-pixel-sub { font-size: 15px; line-height: 1.5; color: var(--sl-muted); word-break: break-all; }
.ds-pixel-note { font-size: 12.5px; color: var(--sl-faint); margin-top: 12px; }

/* Sona Pixel Loop hero — the first 100%-own face */
.ds-pixel-hero { border: 1px solid var(--sl-accent); border-radius: 14px; padding: 24px 26px; margin: 16px 0; background: linear-gradient(180deg, var(--sl-accent-weak), var(--sl-surface)); }
.ds-pixel-hero-tag { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ds-pixel-badge { font-family: var(--sl-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--sl-accent); border: 1px solid var(--sl-accent); border-radius: 999px; padding: 3px 9px; }
.ds-pixel-hero-sample { font-size: 52px; line-height: 1; color: var(--sl-ink); letter-spacing: 2px; margin: 16px 0 6px; }
.ds-pixel-hero-sub { font-size: 22px; line-height: 1.2; color: var(--sl-accent); letter-spacing: 1px; }
.ds-pixel-hero-note { font-size: 13px; line-height: 1.6; color: var(--sl-muted); margin: 14px 0 0; max-width: 60ch; }
.ds-pixel-hero-note b { color: var(--sl-ink); font-weight: 600; }

/* ── Icon gallery ─────────────────────────────────────────────────────────────── */
.ds-icon-search { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; max-width: 360px; }
.ds-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.ds-icon-cell { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 16px 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--sl-ink); cursor: pointer; text-align: center; }
.ds-icon-cell:hover { background: var(--sl-hover); border-color: var(--sl-line); }
.ds-icon-cell svg { width: 22px; height: 22px; }
.ds-icon-cell.hifi svg { width: 38px; height: 38px; }
.ds-icon-cell span { font-family: var(--sl-mono); font-size: 10px; color: var(--sl-faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Figures — the FIG 0.x illustrative plates (figures.data.mjs) ─────────────── */
/* A hairline-framed band of three plates, after the reference composition:
   mono FIG id on top, the drawing, then title + note. Hovering a plate drives
   its figure's ambient gesture (.pi-hover). --sl-fig-surface turns the
   wireframes into occluded solids against the page background. */
.ds-fig-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border-block: 1px solid var(--sl-line); }
.ds-fig-plate { margin: 0; padding: 28px 28px 32px; --sl-fig-surface: var(--sl-bg); }
.ds-fig-plate + .ds-fig-plate { border-left: 1px solid var(--sl-line); }
.ds-fig-plate svg { display: block; width: 100%; height: auto; color: var(--sl-ink); }
.ds-fig-id { font-family: var(--sl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--sl-faint); margin-bottom: 14px; }
.ds-fig-title { font-size: 15px; font-weight: 600; color: var(--sl-ink); margin-top: 16px; }
.ds-fig-note { font-size: 13.5px; line-height: 1.55; color: var(--sl-muted); margin: 6px 0 0; max-width: 40ch; }
@media (max-width: 900px) {
  .ds-fig-grid { grid-template-columns: 1fr; }
  .ds-fig-plate + .ds-fig-plate { border-left: 0; border-top: 1px solid var(--sl-line); }
}

/* ── Materials / surfaces ─────────────────────────────────────────────────────── */
.ds-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 18px; }
.ds-tile { border-radius: 12px; border: 1px solid var(--sl-line); padding: 22px 18px; }
.ds-tile .lbl { font-family: var(--sl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--sl-faint); }
.ds-tile .nm { font-size: 14px; font-weight: 550; margin-top: 6px; color: var(--sl-ink); }
.ds-radii { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 18px; }
.ds-radii div { text-align: center; }
.ds-radii .box { width: 80px; height: 80px; background: var(--sl-accent-weak); border: 1px solid color-mix(in srgb, var(--sl-accent) 40%, transparent); }
.ds-radii small { display: block; font-family: var(--sl-mono); font-size: 11px; color: var(--sl-faint); margin-top: 8px; }
/* Images foundation — reference-image gallery (light/dark pairs) */
.ds-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 18px; }
.ds-image-tile { margin: 0; border-radius: 12px; border: 1px solid var(--sl-line); overflow: hidden; background: var(--sl-surface); }
.ds-image-frame { position: relative; }
.ds-image-frame img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; cursor: zoom-in; }
/* films: bare 16:9 video + a Geist-style floating control pill */
.ds-film { position: relative; }
.ds-film video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--sl-bg); }
.ds-vidbar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  width: min(540px, calc(100% - 48px)); padding: 8px 16px; border-radius: 999px; background: #fff; color: #1a1815;
  box-shadow: 0 10px 34px rgba(15, 18, 24, 0.22), 0 1px 4px rgba(15, 18, 24, 0.12);
  opacity: 0; transition: opacity 0.18s ease; }
/* the pill appears on hover (and stays while paused, so it's discoverable) */
.ds-film:hover .ds-vidbar, .ds-film:not(.is-playing) .ds-vidbar { opacity: 1; }
.ds-film:fullscreen video { height: 100%; aspect-ratio: auto; object-fit: contain; background: #000; }
.ds-vidbar .vb-full { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: 999px;
  background: transparent; color: #635e56; cursor: pointer; }
.ds-vidbar .vb-full:hover { color: #1a1815; }
.ds-vidbar .vb-full svg { width: 15px; height: 15px; }
.ds-vidbar .vb-play { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 999px;
  background: transparent; color: inherit; cursor: pointer; }
.ds-vidbar .vb-play svg { width: 16px; height: 16px; }
.ds-vidbar .vb-play svg + svg { display: none; }
.ds-film.is-playing .vb-play svg { display: none; }
.ds-film.is-playing .vb-play svg + svg { display: block; }
.ds-vidbar .vb-time { font-family: var(--sl-mono); font-size: 11.5px; font-variant-numeric: tabular-nums; color: #635e56; }
/* 4px visual rail inside a 16px hit area (padding + content-box) so the
   scrubber is comfortably clickable and drag-scrubbable */
.ds-vidbar .vb-track { flex: 1; height: 16px; padding: 6px 0; box-sizing: border-box; border-radius: 999px;
  background: rgba(26, 24, 21, 0.14); background-clip: content-box; cursor: pointer; touch-action: none; }
.ds-vidbar .vb-track i { display: block; height: 100%; background: #1a1815; border-radius: 999px; pointer-events: none; }
/* show the variant the tile is set to (defaults to the page theme, per-tile togglable) */
[data-img-pair] .img-dark { display: none; }
[data-img-pair][data-shown="dark"] .img-light { display: none; }
[data-img-pair][data-shown="dark"] .img-dark { display: block; }
.ds-image-tile figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border-top: 1px solid var(--sl-line); }
.ds-image-tile .nm { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 550; color: var(--sl-ink); }
.ds-image-tile .lbl { font-family: var(--sl-mono); font-size: 10.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--sl-faint); }
.ds-img-toggle { display: inline-flex; flex-shrink: 0; border: 1px solid var(--sl-line); border-radius: var(--sl-radius-full); overflow: hidden; }
.ds-img-toggle button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--sl-faint); cursor: pointer; }
.ds-img-toggle button svg { width: 14px; height: 14px; }
.ds-img-toggle button.is-active { background: var(--sl-accent-weak); color: var(--sl-accent); }
.ds-img-toggle button:hover:not(.is-active) { color: var(--sl-ink); }

/* Lightbox — click a canvas preview to view it large */
.ds-lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 4vh 4vw; background: color-mix(in srgb, var(--sl-bg) 78%, #000); backdrop-filter: blur(10px); }
.ds-lightbox.is-open { display: flex; }
.ds-lightbox img { max-width: 100%; max-height: 92vh; border-radius: 12px; border: 1px solid var(--sl-line); box-shadow: var(--sl-shadow-lg, 0 30px 80px rgba(0,0,0,.5)); cursor: zoom-out; }
.ds-lightbox-close { position: absolute; top: 18px; right: 22px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--sl-line); border-radius: var(--sl-radius-full); background: var(--sl-surface); color: var(--sl-ink); font-size: 15px; cursor: pointer; }
.ds-lightbox-close:hover { background: var(--sl-hover); }

.ds-space-row { display: flex; align-items: flex-end; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.ds-space-row div { text-align: center; }
.ds-space-row .bar { background: var(--sl-accent); border-radius: 3px; width: 26px; }
.ds-space-row small { display: block; font-family: var(--sl-mono); font-size: 11px; color: var(--sl-faint); margin-top: 8px; }

/* ── Brand page ───────────────────────────────────────────────────────────────── */
/* The Sonaloop lockup renders the live .sl-logo (sized via its own font-size). The `> svg`
   / `.wm` rules only style the product sub-pages' hi-fi marks + wordmark (Cloud / Research),
   which sit as direct children of the hero/panel — the nested .sl-logo is unaffected. */
.ds-brand-hero { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 60px; border: 1px solid var(--sl-line); border-radius: 14px; background: var(--sl-surface); margin-top: 20px; }
.ds-brand-hero > svg { width: 56px; height: 56px; color: var(--sl-ink); }
.ds-brand-hero .wm { font-family: var(--sl-mono); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--sl-ink); }
.ds-brand-clear { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.ds-brand-panel { border: 1px solid var(--sl-line); border-radius: 12px; padding: 30px; display: flex; align-items: center; justify-content: center; min-height: 150px; }
.ds-brand-panel.on-dark { background: #101113; color: #e6e7ea; }
.ds-brand-panel > svg { width: 40px; height: 40px; }

/* ── Footer next-link ─────────────────────────────────────────────────────────── */
.ds-footer { max-width: var(--ds-content-max); margin: 72px auto 0; padding-top: 26px; border-top: 1px solid var(--sl-line); display: flex; justify-content: space-between; align-items: center; }
.ds-next { display: inline-flex; flex-direction: column; align-items: flex-end; text-decoration: none; padding: 12px 18px; border: 1px solid var(--sl-line); border-radius: 11px; transition: border-color .12s, background .12s; }
.ds-next:hover { border-color: color-mix(in srgb, var(--sl-ink) 22%, var(--sl-line)); background: var(--sl-hover); }
.ds-next small { font-family: var(--sl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--sl-faint); }
.ds-next b { font-size: 15px; font-weight: 600; color: var(--sl-ink); display: inline-flex; align-items: center; gap: 7px; }
.ds-next b::after { content: "→"; color: var(--sl-accent); }
.ds-foot-meta { font-size: 13px; color: var(--sl-faint); }
.ds-foot-meta a { color: var(--sl-accent); text-decoration: none; }

/* The ⌘K search palette is the shared `.sl-cmdk` component (styles/components.css) — the same
   one the marketing website mounts. Its markup lives in index.html; behaviour in app.js. Only a
   docs-specific :hover affordance on rows is layered here (the shared CSS drives selection state). */
.sl-cmdk-list .sl-cmdk-item:hover { background: var(--sl-hover); }

/* ── Misc ─────────────────────────────────────────────────────────────────────── */
.ds-callout { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--sl-line); border-left: 3px solid var(--sl-accent); border-radius: 10px; background: var(--sl-surface); margin: 18px 0 0; }
.ds-callout .ico { color: var(--sl-accent); flex: none; }
.ds-callout p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--sl-muted); }
.ds-callout p b { color: var(--sl-ink); font-weight: 600; }

.ds-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.ds-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 18px; }
@media (max-width: 980px) {
  /* The .sl-app-shell sidebar collapses to a slide-in overlay below 760px (components.css);
     here we only tighten the content padding and collapse the docs' own content grids. */
  .sl-shell-body { padding: 24px 18px 80px; }
  .ds-grid-2, .ds-grid-3, .ds-brand-clear { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── Deck (PPTX master template previews — painted by site/deck.preview.mjs) ────── */
/* A slide is a light-theme 16:9 surface (decks are projected/printed; they do NOT follow
   the site theme). All inner units are cqw, so the same painter serves thumbs + full pages. */
.deck-stage { container-type: inline-size; width: 100%; border: 1px solid var(--sl-line); border-radius: 10px; overflow: hidden; box-shadow: var(--sl-shadow-sm, 0 1px 2px rgba(26,24,21,.05)); }
.deck-slide { position: relative; aspect-ratio: 16 / 9; width: 100%; }
.deck-full { margin-top: 18px; }
.deck-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.deck-card { display: block; text-decoration: none; color: inherit; }
.deck-card .deck-stage { transition: border-color .15s var(--sl-ease, ease), box-shadow .15s var(--sl-ease, ease); }
.deck-card:hover .deck-stage { border-color: var(--sl-accent); box-shadow: var(--sl-shadow-lg, 0 8px 28px rgba(26,24,21,.12)); }
.deck-card__cap { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.deck-card__num { font-family: var(--sl-mono); font-size: 11px; color: var(--sl-faint); }
.deck-card__title { font-size: 13px; font-weight: 600; color: var(--sl-ink); }
.deck-card__kind { margin-left: auto; font-family: var(--sl-mono); font-size: 11px; color: var(--sl-muted); }
@media (max-width: 980px) { .deck-grid { grid-template-columns: 1fr; } }
