    /* fonts are deployed by the landing build (docs/fonts/); this file is
       docs/gallery/gallery.css, so ../fonts/ is relative to it */
    @font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap;
      src: url('../fonts/barlow-condensed-600.woff2') format('woff2'); }
    @font-face { font-family: 'Inter'; font-weight: 400; font-display: swap;
      src: url('../fonts/inter-regular.woff2') format('woff2'); }
    @font-face { font-family: 'Inter'; font-weight: 500; font-display: swap;
      src: url('../fonts/inter-medium.woff2') format('woff2'); }
    @font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap;
      src: url('../fonts/jetbrains-mono-regular.woff2') format('woff2'); }

    /* Palette and type: scripts/site/tokens.css, shared with the landing page. */
    :root {
      color-scheme: dark;
      --bg: #1a1b1e; --bg2: #131417; --panel: #222327; --panel-2: #2a2b30;
      --border: #3a3b40; --text: #e8e9eb; --dim: #9698a0;
      --select: #ff8c19; --ok: #6dc96d;
      --ax-x: #ff3352; --ax-y: #8bdc00; --ax-z: #2890ff;
      /* text on a --select fill; viewport gradient stops; lightbox scrim */
      --on-select: #1a1b1e;
      --vp-top: #212226; --vp-mid: #1c1d21; --vp-bot: #232428;
      --scrim: rgb(0 0 0 / 0.85);
      /* shared header/footer content width (scripts/site/chrome.py) */
      --chrome-maxw: 1060px;
      --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
      --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
      --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
      /* gallery vocabulary for the same values */
      --surface: var(--panel); --surface-2: var(--panel-2); --text-dim: var(--dim);
      --font-sans: var(--font-body);
    }
    /* ---- shared chrome (scripts/site/chrome.py): header + footer ---- */
    .site-header { position: sticky; top: 0; z-index: 20;
      background: color-mix(in srgb, var(--panel) 92%, transparent);
      backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--border); }
    .site-header-inner { max-width: var(--chrome-maxw); margin: 0 auto; display: flex;
      align-items: center; gap: 1rem; padding: 0 1.25rem; min-height: 46px; }
    .site-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700;
      font-size: 0.9rem; white-space: nowrap; color: var(--text); text-decoration: none; }
    .site-brand:hover { color: var(--select); text-decoration: none; }
    .site-brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--select); flex-shrink: 0; }
    .site-nav { margin-left: auto; }
    .site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; list-style: none; align-items: center; margin: 0; padding: 0; }
    .site-nav a { color: var(--dim); font-size: 0.8125rem; font-weight: 500; text-decoration: none;
      transition: color 0.15s; }
    .site-nav a:hover, .site-nav a[aria-current] { color: var(--select); text-decoration: none; }
    .site-nav .gh { border-left: 1px solid var(--border); padding-left: 1.1rem; }
    .site-menu-btn { display: none; margin-left: auto; align-items: center; gap: 0.45rem;
      background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px;
      color: var(--text); font: 500 0.78rem var(--font-body); padding: 0.32rem 0.7rem; cursor: pointer; }
    .site-menu-btn:hover { border-color: var(--select); color: var(--select); }
    .site-menu-icon, .site-menu-icon::before, .site-menu-icon::after { display: block; width: 14px; height: 2px;
      background: currentColor; border-radius: 1px; position: relative; }
    .site-menu-icon::before, .site-menu-icon::after { content: ''; position: absolute; left: 0; }
    .site-menu-icon::before { top: -4px; } .site-menu-icon::after { top: 4px; }
    @media (max-width: 820px) {
      /* No JS: the nav wraps under the brand instead of hiding. */
      .site-header-inner { flex-wrap: wrap; padding-top: 0.4rem; padding-bottom: 0.4rem; }
      .site-nav { margin-left: 0; width: 100%; }
      html.js .site-header-inner { flex-wrap: nowrap; padding-top: 0; padding-bottom: 0; }
      html.js .site-menu-btn { display: inline-flex; }
      html.js .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%;
        background: var(--panel); border-bottom: 1px solid var(--border);
        box-shadow: 0 12px 24px color-mix(in srgb, var(--bg2) 70%, transparent); }
      html.js .site-header.open .site-nav { display: block; }
      html.js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0.35rem 0; }
      html.js .site-nav a { display: block; padding: 0.7rem 1.25rem; font-size: 0.95rem; }
      html.js .site-nav .gh { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); }
    }

    .site-footer { border-top: 1px solid var(--border); background: var(--panel); margin-top: 2rem; }
    .site-footer-inner { max-width: var(--chrome-maxw); margin: 0 auto; padding: 0.55rem 1.25rem;
      display: flex; align-items: center; gap: 0.4rem 1rem; flex-wrap: wrap;
      font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.04em;
      text-transform: uppercase; color: var(--dim); }
    .site-footer-inner code { font-family: inherit; text-transform: none; }
    .site-footer .ok { color: var(--ok); }
    .site-footer .links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
    .site-footer a { color: var(--dim); text-decoration: none; }
    .site-footer a:hover { color: var(--select); text-decoration: none; }
    @media (prefers-reduced-motion: reduce) { .site-nav a { transition: none; } }
    :root {
      --radius: 4px; --radius-lg: 6px; --maxw: var(--chrome-maxw);
      --code-k: #ff7b72; --code-s: #a5d6ff; --code-c: var(--dim); --code-n: #79c0ff;
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }
    body { font-family: var(--font-sans); background: var(--bg); color: var(--text);
      line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; }
    a { color: var(--select); text-decoration: none; }
    a:hover { text-decoration: underline; }
    :focus-visible { outline: 2px solid var(--select); outline-offset: 2px; border-radius: 3px; }
    ::selection { background: color-mix(in srgb, var(--select) 40%, transparent); }
    .skip { position: absolute; left: -999px; top: 0; background: var(--select); color: var(--on-select);
      padding: 0.5rem 1rem; border-radius: var(--radius); z-index: 10; font-weight: 500; }
    .skip:focus { left: 0.5rem; top: 0.5rem; }
    .hud { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.04em;
      color: var(--text-dim); text-transform: uppercase; }

    .crumbs { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
      text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.9rem; }
    .crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; }
    .crumbs li + li::before { content: '/'; margin-right: 0.5rem; color: var(--border); }
    .crumbs a { color: var(--text-dim); }
    .crumbs a:hover { color: var(--select); text-decoration: none; }
    .slug { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
    header.hero .slug { margin-top: 0.35rem; font-size: 0.85rem; }

    header.hero { max-width: var(--maxw); margin: 0 auto; padding: 2.75rem 1.25rem 1.25rem; }
    header.hero h1 { font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
      font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: 0.005em; line-height: 0.98; }
    header.hero p { color: var(--text-dim); max-width: 62ch; margin-top: 0.7rem; font-size: 1rem; }

    /* ---- index: sticky controls (search, density toggle, tag chips) ---- */
    .controls { position: sticky; top: 46px; z-index: 4;
      background: color-mix(in srgb, var(--bg) 94%, transparent);
      backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--border); }
    .controls-inner { max-width: var(--maxw); margin: 0 auto; padding: 0.55rem 1.25rem 0.6rem;
      display: flex; flex-direction: column; gap: 0.5rem; }
    .controls-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
    .searchwrap { position: relative; flex: 1 1 240px; min-width: 150px; }
    .searchwrap input { width: 100%; background: var(--surface-2); border: 1px solid var(--border);
      color: var(--text); border-radius: var(--radius); padding: 0.34rem 1.9rem 0.34rem 0.7rem;
      font-family: var(--font-sans); font-size: 0.85rem; line-height: 1.4; }
    .searchwrap input:focus { border-color: var(--select); outline: none; }
    .searchwrap input::placeholder { color: var(--text-dim); }
    .searchwrap input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
    .q-clear { position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%);
      background: none; border: none; color: var(--text-dim); font-size: 1.05rem; line-height: 1;
      cursor: pointer; padding: 0.25rem 0.45rem; border-radius: 3px; }
    .q-clear:hover { color: var(--select); }
    .count { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em;
      text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
    .density { display: flex; border: 1px solid var(--border); border-radius: var(--radius);
      overflow: hidden; }
    .density-btn { background: var(--surface-2); border: none; color: var(--text-dim); cursor: pointer;
      font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em;
      text-transform: uppercase; padding: 0.36rem 0.7rem; transition: color 0.15s, background 0.15s; }
    .density-btn + .density-btn { border-left: 1px solid var(--border); }
    .density-btn:hover { color: var(--select); }
    .density-btn.active { background: var(--select); color: var(--on-select); }
    /* Segmented groups clip overflow, so the ring has to sit inside. */
    .density-btn:focus-visible, .chip:focus-visible { outline-offset: -2px; }
    .sort select { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
      border-radius: var(--radius); padding: 0.3rem 0.5rem; cursor: pointer;
      font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; }
    .sort select:hover, .sort select:focus { color: var(--select); border-color: var(--select); outline: none; }
    /* Category row: one segmented group that scrolls sideways on narrow
       screens rather than wrapping its bordered buttons. */
    .cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin;
      scrollbar-color: var(--border) transparent; }
    .cats[hidden] { display: none; }
    .cats .density { flex: 0 0 auto; }
    .cats-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em;
      text-transform: uppercase; color: var(--text-dim); flex: 0 0 auto; }
    /* Filters: inline on wide screens; on phones (with JS) they fold behind
       one "Filters" button so the first card sits above the fold. */
    .filters { display: flex; flex-direction: column; gap: 0.5rem; }
    .filters-toggle { display: none; background: var(--surface-2); border: 1px solid var(--border);
      color: var(--text-dim); border-radius: var(--radius); padding: 0.34rem 0.75rem; cursor: pointer;
      font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase;
      white-space: nowrap; }
    .filters-toggle:hover, .filters-toggle.has-active { color: var(--select); border-color: var(--select); }
    .cat-btn { background: var(--surface-2); border: none; color: var(--text-dim); cursor: pointer;
      font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; white-space: nowrap;
      text-transform: uppercase; padding: 0.36rem 0.7rem; transition: color 0.15s, background 0.15s; }
    .cat-btn + .cat-btn { border-left: 1px solid var(--border); }
    .cat-btn:hover { color: var(--select); }
    .cat-btn.active { background: var(--select); color: var(--on-select); }
    .cat-btn:focus-visible { outline-offset: -2px; }

    /* Tag chips wrap by default (no-JS safe). With JS the row becomes a scroll
       strip on wide viewports; inside the phone drawer it wraps again. */
    .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
    html.js .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem;
      scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
    html.js .chips::-webkit-scrollbar { height: 5px; }
    html.js .chips::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    .chip { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
      border-radius: 3px; padding: 0.22rem 0.7rem; font-size: 0.72rem; font-weight: 400;
      font-family: var(--font-mono); cursor: pointer; white-space: nowrap; flex: 0 0 auto;
      transition: color 0.15s, border-color 0.15s; }
    .chip:hover { color: var(--select); border-color: var(--select); }
    .chip.active { color: var(--on-select); background: var(--select); border-color: var(--select); }
    @media (max-width: 639px) {
      .controls-inner { padding: 0.45rem 1rem 0.5rem; gap: 0.4rem; }
      .controls-row { gap: 0.4rem; }
      .density-btn { padding: 0.36rem 0.5rem; }
      html.js .controls-main { flex-wrap: nowrap; }
      html.js .searchwrap { flex: 1 1 auto; min-width: 0; }
      html.js .filters-toggle { display: inline-block; }
      html.js .filters { display: none; max-height: calc(100vh - 140px); overflow-y: auto;
        padding: 0.4rem 0 0.2rem; border-top: 1px solid var(--border); }
      html.js .filters.open { display: flex; }
      html.js .filters .chips { flex-wrap: wrap; overflow-x: visible; }
      html.js .cats { flex-wrap: wrap; }
      html.js .cats .density { flex-wrap: wrap; }
    }
    @media (max-width: 420px) {
      /* visually hidden, still the live region screen readers hear */
      html.js .controls-main .count { position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
    }

    /* Compact density: hero + name + one-line teaser. The description and
       WITNESSES text stay in the DOM (searchable, screen-reader reachable,
       present with JS disabled when the class is never applied) but are
       visually collapsed. Applied only by JS via the density-compact class. */
    html.density-compact .grid { gap: 1rem; }
    html.density-compact .card-body { padding: 0.65rem 0.9rem 0.7rem; }
    html.density-compact .card-body h2 { font-size: 0.88rem; margin-bottom: 0.15rem; }
    html.density-compact .teaches { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    html.density-compact .witnesses { position: absolute; width: 1px; height: 1px; margin: -1px;
      padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
    html.density-compact .card-body .slug { display: none; }
    html.density-compact .card-link { display: none; }
    .noresults { color: var(--text-dim); text-align: center; padding: 3rem 1rem; font-size: 0.95rem; }
    .noresults .chip { margin-left: 0.6rem; }
    .to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 6; cursor: pointer;
      background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
      border-radius: var(--radius); padding: 0.45rem 0.75rem;
      font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em;
      text-transform: uppercase; opacity: 0; visibility: hidden;
      transition: opacity 0.2s, visibility 0.2s, color 0.15s, border-color 0.15s; }
    .to-top.show { opacity: 1; visibility: visible; }
    .to-top:hover { color: var(--select); border-color: var(--select); }

    main { max-width: var(--maxw); margin: 0 auto; padding: 1rem 1.25rem 2rem; }
    .grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: stretch; }
    .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
      overflow: hidden; display: flex; flex-direction: column;
      outline: 2px solid transparent; outline-offset: -1px;
      transition: outline-color 0.12s ease, border-color 0.12s ease; }
    .card { position: relative; }
    .card:hover, .card:focus-within { border-color: var(--select); outline-color: var(--select); }
    /* One link per card: the title's ::after covers the whole card, so the
       render and body are clickable without a second, duplicate link. */
    .card .stretch::after { content: ''; position: absolute; inset: 0; z-index: 1; }
    .card .stretch:focus-visible { outline: none; }
    .card.hidden { display: none; }
    .card-media { display: block; background: var(--bg2); line-height: 0; overflow: hidden; }
    .card-media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
      transition: transform 0.35s ease, opacity 0.3s ease; }
    .card:hover .card-media img { transform: scale(1.03); }
    html.js .grid .card-media img { opacity: 0; }
    html.js .grid .card-media img.is-loaded { opacity: 1; }
    .card-body { padding: 1.15rem 1.4rem 1.45rem; display: flex; flex-direction: column; flex: 1 1 auto; }
    .card-body h2 { font-size: 1.02rem; font-weight: 500; line-height: 1.3; }
    .card-body h2 a { color: var(--text); }
    .card-body h2 a:hover, .card:hover .card-body h2 a { color: var(--select); text-decoration: none; }
    .card-body .slug { margin: 0.1rem 0 0.5rem; }
    .teaches { color: var(--text); margin-bottom: 0.7rem; font-size: 0.92rem; }
    .witnesses { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 1rem; }
    .tag { display: inline-block; font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase;
      letter-spacing: 0.06em; color: var(--select); border: 1px solid color-mix(in srgb, var(--select) 55%, transparent);
      border-radius: 3px; padding: 0.08rem 0.5rem; margin-right: 0.4rem; vertical-align: 1px; }
    .card-link { font-weight: 600; font-size: 0.95rem; margin-top: auto; color: var(--select); }

    /* ---- detail page ---- */
    .detail-hero { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
      background: var(--bg2); padding: 0; display: block; width: 100%; cursor: zoom-in; line-height: 0; }
    .detail-hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
    .zoom-hint { color: var(--text-dim); font-size: 0.78rem; margin-top: 0.4rem; }
    .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
      clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
    .callout { border: 1px solid color-mix(in srgb, var(--select) 45%, var(--border));
      border-left: 3px solid var(--select); border-radius: var(--radius);
      background: color-mix(in srgb, var(--select) 7%, var(--surface));
      padding: 0.85rem 1.1rem; margin: 1.5rem 0; font-size: 0.95rem; }
    .runline { display: flex; align-items: stretch; gap: 0.5rem; margin: 1.5rem 0; }
    .runline pre { flex: 1 1 auto; background: var(--surface-2); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 0.7rem 0.9rem; overflow-x: auto;
      font-family: var(--font-mono); font-size: 0.83rem; line-height: 1.5; }
    .copy-btn { flex: 0 0 auto; background: var(--surface-2); border: 1px solid var(--border);
      color: var(--text-dim); border-radius: var(--radius); padding: 0 0.85rem; cursor: pointer;
      font-family: var(--font-sans); font-size: 0.82rem; font-weight: 500; transition: color 0.15s, border-color 0.15s; }
    .copy-btn:hover { color: var(--select); border-color: var(--select); }
    .detail-section { margin-top: 2.25rem; scroll-margin-top: 60px; }
    .detail-section > h2 { font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
      font-size: 1.45rem; letter-spacing: 0.005em; padding-bottom: 0.5rem;
      border-bottom: 1px solid var(--border); margin-bottom: 1rem; }

    .md h1, .md h2, .md h3 { letter-spacing: -0.01em; margin: 1.4rem 0 0.6rem; line-height: 1.25; }
    .md h1 { font-size: 1.35rem; } .md h2 { font-size: 1.15rem; } .md h3 { font-size: 1rem; }
    .md p { margin: 0.7rem 0; }
    .md > p, .md > ul, .md > ol, .md > h2, .md > h3 { max-width: 75ch; }
    .md ul, .md ol { margin: 0.7rem 0 0.7rem 1.4rem; }
    .md li { margin: 0.3rem 0; }
    .md .table-wrap { overflow-x: auto; margin: 0.9rem 0; }
    .md table { border-collapse: collapse; font-size: 0.86rem; min-width: 100%; }
    .md th, .md td { text-align: left; vertical-align: top; padding: 0.4rem 0.75rem 0.4rem 0;
      border-bottom: 1px solid var(--border); }
    .md th { color: var(--text-dim); font-weight: 600; white-space: nowrap; }
    .md code { background: var(--surface-2); border: 1px solid var(--border); padding: 0.08rem 0.35rem;
      border-radius: 4px; font-family: var(--font-mono); font-size: 0.84em; }
    .md pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
      padding: 0.85rem 1rem; overflow-x: auto; margin: 0.9rem 0; }
    .md pre code { background: none; border: none; padding: 0; font-size: 0.83rem; line-height: 1.55; }

    .src pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
      padding: 1rem 1.1rem; overflow-x: auto; font-family: var(--font-mono);
      font-size: 0.82rem; line-height: 1.55; }
    .src .k { color: var(--code-k); } .src .s { color: var(--code-s); }
    .src .c { color: var(--code-c); font-style: italic; } .src .n { color: var(--code-n); }
    .src-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
      flex-wrap: wrap; margin-bottom: 0.6rem; color: var(--text-dim); font-size: 0.85rem; }
    .src-meta code { font-family: var(--font-mono); font-size: 0.82rem; }

    /* ---- detail page: pager, tags, related, anchors, code blocks ---- */
    .pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem;
      margin: 0 0 1.25rem; font-size: 0.85rem; }
    .pager-foot { margin: 2.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border); }
    .pager a { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.8rem;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .pager a:hover { color: var(--select); text-decoration: none; }
    .pager [rel="next"] { text-align: right; }
    .pager-pos { text-align: center; }
    @media (max-width: 559px), (hover: none) { .pager-keys { display: none; } }
    .pager kbd { font-family: var(--font-mono); font-size: 0.65rem; border: 1px solid var(--border);
      border-radius: 3px; padding: 0 0.3rem; margin: 0 0.1rem; }
    .taglist { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: -0.5rem 0 1.5rem; }
    .taglist a { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim);
      background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px;
      padding: 0.12rem 0.6rem; transition: color 0.15s, border-color 0.15s; }
    .taglist a:hover { color: var(--select); border-color: var(--select); text-decoration: none; }
    .related-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
    @media (min-width: 560px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }
    .card.mini .card-body { padding: 0.65rem 0.9rem 0.75rem; }
    .card.mini h3 { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.2rem; }
    .card.mini h3 a { color: var(--text); }
    .card.mini h3 a:hover, .card.mini:hover h3 a { color: var(--select); text-decoration: none; }
    .card.mini p { color: var(--text-dim); font-size: 0.78rem; line-height: 1.45;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .md h1, .md h2, .md h3 { scroll-margin-top: 60px; }
    .anchor { color: var(--text-dim); margin-left: 0.4rem; font-weight: 400; opacity: 0;
      transition: opacity 0.15s; }
    .md h1:hover .anchor, .md h2:hover .anchor, .md h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
    .anchor:hover { color: var(--select); text-decoration: none; }
    .codewrap { position: relative; }
    .codewrap > .copy-btn { position: absolute; top: 0.45rem; right: 0.45rem; padding: 0.2rem 0.55rem;
      font-size: 0.72rem; opacity: 0; transition: opacity 0.15s, color 0.15s, border-color 0.15s; }
    .codewrap:hover > .copy-btn, .codewrap > .copy-btn:focus-visible, .codewrap > .copy-btn.done { opacity: 1; }
    @media (hover: none) { .codewrap > .copy-btn { opacity: 1; } }
    .copy-btn.done { color: var(--ok); border-color: var(--ok); }
    .copy-btn.fail { color: var(--code-k); border-color: var(--code-k); }
    .src .code { display: grid; grid-template-columns: auto minmax(0, 1fr);
      background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
      overflow: hidden; }
    .src .code pre { background: none; border: 0; border-radius: 0; }
    .src .code .gutter { color: color-mix(in srgb, var(--text-dim) 60%, transparent); text-align: right;
      user-select: none; padding-right: 0.75rem; border-right: 1px solid var(--border);
      background: var(--bg2); overflow: hidden; }
    .src .code.collapsed { max-height: 42rem; position: relative; }
    .src .code.collapsed::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5rem;
      background: linear-gradient(transparent, var(--surface-2)); pointer-events: none; }
    .src-expand { display: block; margin: 0.6rem auto 0; background: var(--surface-2);
      border: 1px solid var(--border); color: var(--text-dim); border-radius: var(--radius);
      padding: 0.4rem 0.9rem; cursor: pointer; font: 500 0.8rem var(--font-sans);
      transition: color 0.15s, border-color 0.15s; }
    .src-expand:hover { color: var(--select); border-color: var(--select); }

    .lightbox { border: 0; margin: 0; padding: 2rem; width: 100%; height: 100%; max-width: none;
      max-height: none; background: var(--scrim); cursor: zoom-out; }
    /* margin:auto (not align/justify-content) centers without clipping the
       top-left of a native-size image that overflows a small viewport. */
    .lightbox[open] { display: flex; overflow: auto; }
    .lightbox::backdrop { background: transparent; }
    .lightbox img { margin: auto; max-width: 100%; max-height: 100%; border-radius: var(--radius);
      cursor: zoom-in; }
    .lightbox.native img { max-width: none; max-height: none; cursor: zoom-out; }
    .lightbox-bar { position: absolute; top: 0.9rem; right: 0.9rem; display: flex; gap: 0.5rem; }
    .lightbox-close { background: var(--surface-2);
      color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
      font: 500 0.8rem var(--font-sans); padding: 0.4rem 0.75rem; cursor: pointer; }
    .lightbox-close:hover { border-color: var(--select); color: var(--select); }

    @media (min-width: 720px) { .grid { grid-template-columns: 1fr 1fr; gap: 1.75rem; } }
    @media (min-width: 560px) { html.density-compact .grid { grid-template-columns: 1fr 1fr; gap: 1rem; } }
    @media (min-width: 900px) { html.density-compact .grid { grid-template-columns: repeat(3, 1fr); } }
    @media (min-width: 1560px) {
      html.density-compact .controls-inner,
      html.density-compact main { max-width: 1400px; }
      html.density-compact .grid { grid-template-columns: repeat(4, 1fr); }
    }
    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      *, *::before, *::after { transition: none !important; }
      .card:hover .card-media img { transform: none; }
    }
