/* libresprite.dev — design system.
   "The pixel grid": the visual grammar of a sprite editor without copying any vendor's UI —
   warm paper and graphite, one burnt-orange signal colour, a 1px pixel grid, the transparency
   checkerboard, frame strips and real keycaps. No colour gradients (hard-stop patterns only).
   Every colour is a token; dark mode redefines the tokens. */

@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('/fonts/bricolage-latin-var.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin-var.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }
@font-face { font-family: 'Silkscreen'; src: url('/fonts/silkscreen-latin-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #f6f5f1; --bg-2: #ecebe5; --surface: #ffffff; --raised: #fbfaf7;
  --ink: #16161a; --ink-2: #45464d; --ink-3: #63646b; --ink-4: #9b9ca3;
  --line: #e3e1da; --line-2: #cfccc3; --line-3: #b5b2a8;
  --accent: #c2410c; --accent-ink: #a53a0c; --accent-soft: #fcebe1; --on-accent: #ffffff;
  --ok: #2f6b2c; --ok-soft: #e6f2e4; --warn: #8a5a00; --warn-soft: #f9efd7; --bad: #b42323; --bad-soft: #fbe3e1;
  --pol: #5b46b8; --pol-soft: #ece8fa; --info: #2453b3; --info-soft: #e4ecfb;
  --code-bg: #17171b; --code-ink: #e8e6df; --code-line: #2a2a30; --code-3: #8e8f98;
  --c-key: #9fc2ff; --c-str: #b6df98; --c-num: #ffb088; --c-com: #8d8e99; --c-var: #f2c66b; --c-flag: #ff9d6e; --c-cmd: #ffffff;
  --viz: #c2410c; --viz-2: #16161a; --viz-track: rgba(22, 22, 26, .06);
  --px-1: #c2410c; --px-2: #2453b3; --px-3: #2f6b2c; --px-4: #b8860b; --px-5: #5b46b8; --px-6: #16161a;
  --chk-a: #ffffff; --chk-b: #e9e7e1;
  --app: #2b2b30; --app-2: #232327; --app-3: #38383e; --app-ink: #d9d9de; --app-ink-2: #a8a8b0; --app-line: #45454c;
  --shadow-s: 0 1px 0 rgba(22, 22, 26, .04), 0 1px 3px rgba(22, 22, 26, .06);
  --shadow: 0 1px 0 rgba(22, 22, 26, .04), 0 12px 32px -16px rgba(22, 22, 26, .25);
  --shadow-l: 0 2px 0 rgba(22, 22, 26, .03), 0 30px 80px -30px rgba(22, 22, 26, .38);
  --shadow-px: 4px 4px 0 var(--ink);
  --r: 8px; --r-s: 4px; --r-l: 12px;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Bricolage Grotesque', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --pixel: 'Silkscreen', 'JetBrains Mono', ui-monospace, monospace;
  --w: 1240px; --w-text: 740px; --gut: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --grid-line: rgba(22, 22, 26, .07);
  --grid-size: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121214; --bg-2: #18181b; --surface: #1b1b1e; --raised: #1f1f23;
    --ink: #ecebe6; --ink-2: #b4b4ba; --ink-3: #8a8b93; --ink-4: #5e5e66;
    --line: #2a2a2f; --line-2: #37373d; --line-3: #4b4b53;
    --accent: #ff7a3d; --accent-ink: #ff9a66; --accent-soft: #2e180c; --on-accent: #16161a;
    --ok: #6fcf6a; --ok-soft: #13240f; --warn: #e6b04f; --warn-soft: #2a2010; --bad: #f2756f; --bad-soft: #2d1614;
    --pol: #ab9dff; --pol-soft: #1d1a33; --info: #82acff; --info-soft: #121d30;
    --code-bg: #0c0c0e; --code-line: #202025;
    --viz: #ff7a3d; --viz-2: #ecebe6; --viz-track: rgba(236, 235, 230, .07);
    --px-1: #ff7a3d; --px-2: #82acff; --px-3: #6fcf6a; --px-4: #e6b04f; --px-5: #ab9dff; --px-6: #ecebe6;
    --chk-a: #222226; --chk-b: #2b2b30;
    --shadow-s: 0 1px 0 rgba(0, 0, 0, .3); --shadow: 0 16px 40px -18px rgba(0, 0, 0, .7); --shadow-l: 0 30px 80px -30px rgba(0, 0, 0, .8);
    --shadow-px: 4px 4px 0 #000;
    --grid-line: rgba(236, 235, 230, .055);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121214; --bg-2: #18181b; --surface: #1b1b1e; --raised: #1f1f23;
  --ink: #ecebe6; --ink-2: #b4b4ba; --ink-3: #8a8b93; --ink-4: #5e5e66;
  --line: #2a2a2f; --line-2: #37373d; --line-3: #4b4b53;
  --accent: #ff7a3d; --accent-ink: #ff9a66; --accent-soft: #2e180c; --on-accent: #16161a;
  --ok: #6fcf6a; --ok-soft: #13240f; --warn: #e6b04f; --warn-soft: #2a2010; --bad: #f2756f; --bad-soft: #2d1614;
  --pol: #ab9dff; --pol-soft: #1d1a33; --info: #82acff; --info-soft: #121d30;
  --code-bg: #0c0c0e; --code-line: #202025;
  --viz: #ff7a3d; --viz-2: #ecebe6; --viz-track: rgba(236, 235, 230, .07);
  --px-1: #ff7a3d; --px-2: #82acff; --px-3: #6fcf6a; --px-4: #e6b04f; --px-5: #ab9dff; --px-6: #ecebe6;
  --chk-a: #222226; --chk-b: #2b2b30;
  --shadow-s: 0 1px 0 rgba(0, 0, 0, .3); --shadow: 0 16px 40px -18px rgba(0, 0, 0, .7); --shadow-l: 0 30px 80px -30px rgba(0, 0, 0, .8);
  --shadow-px: 4px 4px 0 #000;
  --grid-line: rgba(236, 235, 230, .055);
  color-scheme: dark;
}

/* ── base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16.5px/1.65 var(--sans); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg, video { max-width: 100%; }
img { height: auto; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.15rem, 4.6vw, 3.55rem); font-weight: 760; letter-spacing: -.04em; line-height: 1.04; }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.85rem); font-weight: 720; margin: 3.2rem 0 1rem; position: relative; }
h3 { font-size: 1.16rem; font-weight: 680; margin: 2rem 0 .6rem; letter-spacing: -.015em; }
h4 { font-size: 1rem; font-weight: 680; margin: 1.5rem 0 .4rem; }
p { margin: 0 0 1.05rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
li { margin: .3rem 0; }
li::marker { color: var(--ink-3); }
strong { font-weight: 650; }
small, .small { font-size: 14px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
code, kbd, pre { font-family: var(--mono); }
:not(pre) > code { font-size: .86em; padding: .12em .38em; border-radius: 5px; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); white-space: break-spaces; overflow-wrap: anywhere; }
kbd { display: inline-block; font-size: 12px; font-weight: 600; line-height: 1; padding: 4px 6px 3px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface); color: var(--ink-2); }
.muted { color: var(--ink-3); }
.sr, .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 500; padding: 10px 14px; background: var(--ink); color: var(--bg); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.mono { font-family: var(--mono); }
.c { text-align: center; }

/* ── header ───────────────────────────────────────────────────────────── */
.site-h { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.site-h-in { max-width: var(--w); margin: 0 auto; padding: 0 var(--gut); height: 62px; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.logo { color: var(--ink); }
.brand-n { font-weight: 730; font-size: 17px; letter-spacing: -.03em; }
.brand-tld { color: var(--ink-3); font-weight: 560; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav li { margin: 0; }
.nav-i { position: relative; }
.nav-b { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: 560 14.5px var(--sans); cursor: pointer; }
.nav-b:hover, .nav-i.open .nav-b { background: var(--bg-2); color: var(--ink); }
.nav-b.is-cur { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; }
.nav-b svg { transition: transform .2s var(--ease); opacity: .6; }
.nav-i.open .nav-b svg { transform: rotate(180deg); }
.nav-p { position: absolute; top: calc(100% + 10px); left: -12px; z-index: 120; display: none; min-width: 330px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-l); }
.nav-i.open .nav-p { display: block; animation: drop .18s var(--ease); }
.nav-p-in { display: flex; gap: 6px; }
.nav-g { min-width: 300px; padding: 4px; }
.nav-g + .nav-g { border-left: 1px solid var(--line); padding-left: 10px; }
.nav-g ul { display: block; }
.nav-gt { margin: 4px 10px 6px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.nav-g a { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.nav-g a:hover, .nav-g a[aria-current] { background: var(--bg-2); }
.nav-l { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.nav-d { font-size: 13px; color: var(--ink-3); line-height: 1.4; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
.site-h-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search-b { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-3); font: 500 14px var(--sans); cursor: pointer; min-width: 190px; }
.search-b:hover { border-color: var(--line-2); color: var(--ink-2); }
.search-b kbd { margin-left: auto; font-size: 11px; padding: 3px 5px 2px; }
.ver { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line); font: 600 12.5px var(--mono); color: var(--ink-2); text-decoration: none; background: var(--surface); }
.ver:hover { color: var(--ink); border-color: var(--line-2); }
.ver-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.icon-b, .burger { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-b:hover, .burger:hover { background: var(--bg-2); color: var(--ink); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; } :root[data-theme="dark"] .i-moon { display: inline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: none; } :root:not([data-theme="light"]) .i-moon { display: inline; } }

.burger { display: none; }
.drawer { position: fixed; inset: 62px 0 0; z-index: 99; overflow-y: auto; background: var(--bg); padding: 20px var(--gut) 60px; }
.drawer-in { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.drawer-g p { margin: 0 0 6px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.drawer-g ul { list-style: none; padding: 0; margin: 0; }
.drawer-g li { margin: 0; }
.drawer-g a { display: block; padding: 7px 0; text-decoration: none; font-weight: 560; border-bottom: 1px solid var(--line); }
.drawer-g a[aria-current] { color: var(--accent-ink); }
@media (max-width: 1080px) { .search-l, .search-b kbd { display: none; } .search-b { min-width: 0; width: 36px; padding: 0; justify-content: center; } }
@media (max-width: 900px) { .nav { display: none; } .burger { display: inline-grid; } .ver { display: none; } }
@media (max-width: 420px) { .brand-tld { display: none; } }

/* ── page layout ──────────────────────────────────────────────────────── */
.page-layout { max-width: var(--w); margin: 0 auto; padding: 22px var(--gut) 80px; display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 64px; }
.page-layout.no-rail, .page-layout--wide, .page-layout--tool, .page-layout--plain { grid-template-columns: minmax(0, 1fr); }
.page-article { min-width: 0; width: 100%; max-width: var(--w-text); }
.page-layout--wide .page-article, .page-layout--tool .page-article { max-width: none; }
.page-layout--article.no-rail .page-article, .page-layout--plain .page-article { margin: 0 auto; }
.crumbs ol { list-style: none; padding: 0; margin: 6px 0 22px; display: flex; flex-wrap: wrap; gap: 4px; font: 500 12.5px var(--mono); color: var(--ink-3); }
.crumbs li { margin: 0; display: flex; align-items: center; gap: 4px; }
.crumbs li + li::before { content: '/'; color: var(--ink-4); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.page-hero { padding: 6px 0 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font: 600 12px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-ink); }
.eyebrow::before { content: ''; width: 18px; height: 2px; background: var(--accent); }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.24rem); line-height: 1.55; color: var(--ink-2); margin: 16px 0 0; max-width: 64ch; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 20px; font-size: 13.5px; color: var(--ink-3); }
.page-meta a { color: var(--ink-3); }
.pm-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 12.5px; }
.page-rail { position: relative; }
.rail-toc { position: sticky; top: 92px; max-height: calc(100vh - 120px); overflow-y: auto; padding-left: 16px; border-left: 1px solid var(--line); }
.rail-toc-t { margin: 0 0 10px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.toc-list { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc-list li { margin: 0; counter-increment: toc; }
.toc-item { position: relative; display: block; padding: 5px 0; font-size: 13.5px; line-height: 1.4; color: var(--ink-3); text-decoration: none; }
.toc-item:hover { color: var(--ink); }
.toc-item.is-active { color: var(--ink); font-weight: 600; }
.toc-item.is-active::before { content: ''; position: absolute; left: -17px; top: 6px; bottom: 6px; width: 2px; background: var(--accent); }
.rail-top { display: inline-block; margin-top: 16px; font: 500 12px var(--mono); color: var(--ink-3); text-decoration: none; }
.toc-inline { display: none; margin: 0 0 28px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.toc-inline summary { cursor: pointer; padding: 12px 16px; font-weight: 620; font-size: 15px; list-style: none; display: flex; justify-content: space-between; }
.toc-inline summary span { font: 500 12px var(--mono); color: var(--ink-3); }
.toc-inline .toc-list { padding: 0 16px 12px; counter-reset: toc; }
.toc-inline .toc-item::before { content: counter(toc, decimal-leading-zero); font: 500 11px var(--mono); color: var(--ink-4); margin-right: 10px; }
@media (max-width: 1080px) { .page-layout { grid-template-columns: minmax(0, 1fr); } .page-rail { display: none; } .toc-inline { display: block; } .page-article { margin: 0 auto; } }
.h-anchor { position: absolute; left: -1.1em; top: 0; padding-right: .3em; color: var(--ink-4); text-decoration: none; opacity: 0; font-weight: 500; }
h2:hover .h-anchor, .h-anchor:focus { opacity: 1; }
@media (max-width: 900px) { .h-anchor { display: none; } }
.page-article > h2:first-of-type { margin-top: 2rem; }
.page-feedback { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-3); }

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: 620 15px var(--sans); text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), background .15s; }
.btn:hover { color: var(--bg); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { color: var(--on-accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.4rem 0; }

/* ── code ─────────────────────────────────────────────────────────────── */
.code { margin: 1.3rem 0 1.6rem; border-radius: var(--r); background: var(--code-bg); color: var(--code-ink); overflow: hidden; border: 1px solid var(--code-line); box-shadow: var(--shadow-s); }
.code-h { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--code-line); }
.code-dots { display: inline-flex; gap: 5px; }
.code-dots i { width: 8px; height: 8px; border-radius: 50%; background: #2e3238; }
.code-t { font: 500 12px var(--mono); color: var(--code-3); }
.code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; tab-size: 4; }
.code code { font-family: var(--mono); }
.copy { margin-left: auto; height: 28px; padding: 0 11px; border: 1px solid #30343a; border-radius: 7px; background: #1b1e22; color: #d6d3cc; font: 600 12px var(--sans); cursor: pointer; }
.copy:hover { background: #262a2f; color: #fff; }
.copy.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.c-key { color: var(--c-key); } .c-str { color: var(--c-str); } .c-num, .c-lit { color: var(--c-num); } .c-com { color: var(--c-com); font-style: italic; }
.c-var { color: var(--c-var); } .c-flag { color: var(--c-flag); } .c-cmd { color: var(--c-cmd); font-weight: 600; } .c-prompt { color: var(--code-3); user-select: none; } .c-out { color: var(--code-3); }
.cmdline, .pathbox { display: flex; align-items: center; gap: 8px; margin: .8rem 0 1.1rem; padding: 6px 6px 6px 14px; border-radius: var(--r); background: var(--code-bg); border: 1px solid var(--code-line); }
.cmdline code, .pathbox code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: none !important; border: 0 !important; padding: 0 !important; color: var(--code-ink) !important; font-size: 13.5px !important; scrollbar-width: none; }
.copy-sm { margin-left: 0; flex-shrink: 0; }
.kseq { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.kplus { color: var(--ink-3); font-size: 12px; }

/* ── callouts, answer box ─────────────────────────────────────────────── */
.callout { display: grid; grid-template-columns: 22px 1fr; gap: 12px; margin: 1.4rem 0 1.7rem; padding: 15px 18px 14px 15px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.callout > div > :last-child { margin-bottom: 0; }
.callout-i { color: var(--ink-3); padding-top: 2px; }
.callout-t { margin: 0 0 4px; font-weight: 680; }
.callout-tip { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); background: var(--ok-soft); } .callout-tip .callout-i { color: var(--ok); }
.callout-ok { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); background: var(--ok-soft); } .callout-ok .callout-i { color: var(--ok); }
.callout-warn { border-color: color-mix(in srgb, var(--warn) 32%, var(--line)); background: var(--warn-soft); } .callout-warn .callout-i { color: var(--warn); }
.callout-danger { border-color: color-mix(in srgb, var(--bad) 32%, var(--line)); background: var(--bad-soft); } .callout-danger .callout-i { color: var(--bad); }
.callout-new { border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); background: var(--accent-soft); } .callout-new .callout-i { color: var(--accent-ink); }
.callout-note .callout-i { color: var(--info); }
.answer { position: relative; margin: 0 0 2rem; padding: 20px 22px 18px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-s); }
.answer::before { content: ''; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--accent); }
.answer-k { margin: 0 0 6px; font: 600 11px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-ink); }
.answer-q { margin: 0 0 6px; font-weight: 680; font-size: 1.05rem; }
.answer-a > :last-child { margin-bottom: 0; }
.answer-a ul { margin-bottom: 0; }

/* ── cards ────────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 1.3rem 0 1.8rem; }
.cards-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cards-3 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 17px 18px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s var(--ease), box-shadow .15s; }
.card:hover { color: var(--ink); border-color: var(--line-3); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-i { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-bottom: 6px; border-radius: 9px; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); }
.card-k { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.card-t { font-weight: 680; font-size: 15.5px; letter-spacing: -.01em; padding-right: 22px; }
.card-d { font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.card-go { position: absolute; top: 17px; right: 16px; color: var(--ink-4); transition: transform .15s var(--ease), color .15s; }
.card:hover .card-go { color: var(--accent); transform: translateX(3px); }

/* ── steps ────────────────────────────────────────────────────────────── */
.steps { list-style: none; padding: 0; margin: 1.5rem 0 2rem; counter-reset: step; }
.step { position: relative; margin: 0; padding: 0 0 26px 56px; counter-increment: step; }
.step::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: -1px; width: 38px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: var(--bg); font: 600 13px var(--mono); }
.step::after { content: ''; position: absolute; left: 18.5px; top: 36px; bottom: 6px; width: 1px; background: var(--line-2); }
.step:last-child::after { display: none; }
.step-t { margin: 2px 0 6px; font-size: 1.06rem; }
.step-b > :last-child { margin-bottom: 0; }

/* ── tabs ─────────────────────────────────────────────────────────────── */
.tabs { margin: 1.4rem 0 1.8rem; }
.tab-bar { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 14px; }
.tab-btn { flex-shrink: 0; height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); font: 600 14px var(--sans); cursor: pointer; }
.tab-btn[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }
.tabs.is-js > .tab-panel { display: none; }
.tabs.is-js > .tab-panel.is-active { display: block; animation: fade .2s ease; }
.tabs:not(.is-js) > .tab-panel::before { content: attr(data-label); display: block; font-weight: 700; margin: 1rem 0 .5rem; }
@keyframes fade { from { opacity: 0; } }

/* ── FAQ ──────────────────────────────────────────────────────────────── */
.faq { margin: 1.2rem 0 2rem; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { display: flex; align-items: center; gap: 16px; padding: 16px 0; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-q { flex: 1; margin: 0; font-size: 1.04rem; font-weight: 640; letter-spacing: -.01em; }
.faq-i { position: relative; width: 14px; height: 14px; flex-shrink: 0; }
.faq-i::before, .faq-i::after { content: ''; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; background: var(--ink-3); transition: transform .2s var(--ease); }
.faq-i::after { transform: rotate(90deg); }
.faq-item[open] .faq-i::after { transform: rotate(0); }
.faq-a { padding: 0 0 16px; color: var(--ink-2); }
.faq-a > :last-child { margin-bottom: 0; }

/* ── tables ───────────────────────────────────────────────────────────── */
.table-wrap { margin: 1.2rem 0 1.8rem; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font: 600 11px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); background: var(--raised); white-space: nowrap; position: sticky; top: 0; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 620; }
tbody tr:hover { background: color-mix(in srgb, var(--bg-2) 55%, transparent); }
td code, th code { font-size: 12.5px; }
.errmsg { font: 500 .86em/1.5 var(--mono); color: var(--bad); background: var(--bad-soft); padding: .12em .4em; border-radius: 5px; overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.yes { color: var(--ok); font-weight: 650; } .no { color: var(--bad); font-weight: 650; } .part { color: var(--warn); font-weight: 650; }
.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 5px; font: 600 11px var(--mono); letter-spacing: .02em; color: var(--ink-2); background: var(--bg-2); border: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tag-def { color: var(--accent-ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.tag-pol { color: var(--pol); background: var(--pol-soft); border-color: color-mix(in srgb, var(--pol) 25%, transparent); }
.tag-ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; } .tag-warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; } .tag-bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.rec { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.rec::before { content: ''; width: 8px; height: 8px; border-radius: 2px; }
.rec-ok { color: var(--ok); } .rec-ok::before { background: var(--ok); }
.rec-warn { color: var(--warn); } .rec-warn::before { background: var(--warn); border-radius: 50%; }
.rec-bad { color: var(--bad); } .rec-bad::before { background: var(--bad); transform: rotate(45deg); }
.filter-bar { display: flex; align-items: center; gap: 12px; margin: 1.2rem 0 -.4rem; flex-wrap: wrap; }
.filter { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink-3); }
.filter:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.filter input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: 15px var(--sans); }
.filter-count { font: 500 12.5px var(--mono); color: var(--ink-3); }

/* ── charts (lib/charts.mjs) ──────────────────────────────────────────── */
.viz { margin: 1.6rem 0 2rem; padding: 20px 20px 14px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); }
.viz-head { display: flex; flex-direction: column; gap: 2px; margin: 0 0 18px; }
.viz-title { font-weight: 680; font-size: 1.02rem; letter-spacing: -.01em; }
.viz-sub { font-size: 13.5px; color: var(--ink-3); }
.viz-note { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-3); }
.viz-source { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11.5px; }
.viz-table { margin-top: 8px; font-size: 13px; }
.viz-table > summary { cursor: pointer; color: var(--ink-3); width: fit-content; }
.viz-table .table-wrap { margin: 8px 0 0; }
.viz-hbars { display: grid; gap: 9px; }
.hb-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 12px; font-size: 13.5px; }
.hb-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 14px; border-radius: 3px; background: var(--viz-track); }
.hb-bar { display: block; height: 100%; width: var(--w); border-radius: 3px; background: var(--ink-3); transform-origin: left; }
.hb-row.is-hl .hb-bar, .hb-bar:hover, .hb-bar:focus-visible { background: var(--viz); }
.hb-val { font: 600 12.5px var(--mono); color: var(--ink); min-width: 5.5ch; text-align: right; font-variant-numeric: tabular-nums; }
.viz-cols, .viz-area { position: relative; }
.vc-grid { position: absolute; inset: 0 0 26px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.vc-tick { border-top: 1px dashed var(--line); height: 0; position: relative; }
.vc-tick span { position: absolute; left: 0; top: -9px; font: 10.5px var(--mono); color: var(--ink-3); background: var(--surface); padding-right: 6px; }
.vc-plot { position: relative; height: 230px; margin-left: 38px; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; align-items: end; padding-bottom: 26px; }
.vc-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.vc-bar { position: relative; width: min(100%, 24px); height: var(--h); border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--ink) 22%, var(--surface)); transform-origin: bottom; }
.vc-col.is-hl .vc-bar, .vc-bar:hover, .vc-bar:focus-visible { background: var(--viz); }
.vc-val { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font: 600 11px var(--mono); color: var(--ink); white-space: nowrap; }
.vc-x { position: absolute; bottom: -22px; font: 10px var(--mono); color: var(--ink-3); white-space: nowrap; }
.vc-x-minor { visibility: hidden; }
@media (max-width: 760px) { .vc-x { transform: rotate(-55deg); transform-origin: top right; right: 50%; bottom: -34px; font-size: 9px; } .vc-plot { height: 190px; padding-bottom: 44px; } .vc-grid { bottom: 44px; } .vc-val { font-size: 9.5px; } }
.ar-plot { position: relative; height: 220px; margin-left: 34px; }
.ar-plot .vc-grid { inset: 0; left: -34px; }
.ar-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ar-fill { fill: var(--viz); opacity: .1; }
.ar-line { fill: none; stroke: var(--viz); stroke-width: 2px; stroke-linejoin: round; }
.ar-hit { position: absolute; left: var(--x); top: var(--y); width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; }
.ar-lab { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -150%); font: 600 11px var(--mono); color: var(--ink); white-space: nowrap; }
.ar-x { position: relative; height: 22px; margin: 6px 0 0 34px; }
.ar-x span { position: absolute; left: var(--x); transform: translateX(-50%); font: 10.5px var(--mono); color: var(--ink-3); }
.viz-tip { position: fixed; z-index: 300; max-width: 290px; padding: 7px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); font: 600 12.5px/1.4 var(--sans); pointer-events: none; box-shadow: var(--shadow); transform: translate(-50%, calc(-100% - 12px)); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1.4rem 0 1.9rem; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); overflow: hidden; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--line); margin-right: -1px; border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.stat-v { font-size: clamp(1.4rem, 3.6vw, 1.85rem); font-weight: 740; letter-spacing: -.035em; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 13.5px; color: var(--ink-2); }
.stat-n { font: 11.5px/1.4 var(--mono); color: var(--ink-3); }
@media (prefers-reduced-motion: no-preference) {
  .js .viz .hb-bar, .js .viz .vc-bar { transform: scale(0); }
  .viz.in-view .hb-bar { animation: growX .9s var(--ease) forwards; }
  .viz.in-view .vc-bar { animation: growY .8s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 22ms); }
}
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ── screenshots, diagrams ────────────────────────────────────────────── */
.shot { margin: 1.6rem 0 2rem; }
.shot-frame { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); box-shadow: var(--shadow); line-height: 0; }
.shot img { width: 100%; display: block; }
.shot figcaption { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.shot-badge { display: inline-flex; width: fit-content; align-items: center; gap: 6px; font: 600 11px var(--mono); letter-spacing: .03em; color: var(--ok); }
.shot-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.diagram { margin: 1.6rem 0 2rem; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram figcaption { margin-top: 10px; font-size: 13.5px; color: var(--ink-3); }
.dg-box { fill: var(--raised); stroke: var(--line-2); stroke-width: 1.2; }
.dg-box-a { fill: var(--accent-soft); stroke: var(--accent); }
.dg-box-g { fill: var(--ok-soft); stroke: var(--ok); }
.dg-box-i { fill: var(--ink); stroke: var(--ink); }
.dg-t { fill: var(--ink); font: 600 15px var(--sans); }
.dg-ti { fill: var(--bg); font: 600 15px var(--sans); }
.dg-s { fill: var(--ink-3); font: 500 12.5px var(--mono); }
.dg-a { fill: var(--accent-ink); font: 600 12.5px var(--mono); }
.dg-line { stroke: var(--ink-3); stroke-width: 1.4; fill: none; }
.dg-line-a { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.dg-dash { stroke-dasharray: 4 4; }
.dg-arrow { fill: var(--ink-3); }
.dg-arrow-a { fill: var(--accent); }

/* ── related, footer ──────────────────────────────────────────────────── */
.next { margin-top: 56px; padding-top: 6px; }
.next h2 { font-size: 1.15rem; margin: 1rem 0 .4rem; }
.site-f { border-top: 1px solid var(--line); background: var(--bg-2); }
.site-f-in { max-width: var(--w); margin: 0 auto; padding: 48px var(--gut) 30px; display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(auto-fit, minmax(130px, 1fr)); gap: 30px 26px; }
@media (max-width: 640px) { .site-f-in { grid-template-columns: 1fr 1fr; } .f-brand { grid-column: 1 / -1; } }
.f-brand p { font-size: 14px; color: var(--ink-3); margin: 14px 0 0; max-width: 40ch; }
.f-mail { font-size: 14px; }
.f-h { margin: 4px 0 10px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.f-col ul { list-style: none; padding: 0; margin: 0; }
.f-col li { margin: 0 0 7px; }
.f-col a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.f-col a:hover { color: var(--ink); text-decoration: underline; }
.f-legal { max-width: var(--w); margin: 0 auto; padding: 18px var(--gut) 34px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 12.5px; color: var(--ink-3); }
.f-legal p { margin: 0; max-width: 80ch; }
.f-legal a { color: var(--ink-3); }

/* ── search palette ───────────────────────────────────────────────────── */
.palette { position: fixed; inset: 0; z-index: 400; background: color-mix(in srgb, var(--bg) 55%, rgba(0, 0, 0, .45)); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 11vh 16px 16px; }
.palette[hidden] { display: none; }
.palette-box { width: min(640px, 100%); max-height: 72vh; display: flex; flex-direction: column; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-l); overflow: hidden; animation: drop .18s var(--ease); }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.palette-in input { flex: 1; height: 56px; border: 0; outline: 0; background: none; color: var(--ink); font: 17px var(--sans); }
.palette-in input::-webkit-search-cancel-button { display: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.palette-list li { margin: 0; }
.palette-list a { display: grid; grid-template-columns: 62px 1fr; gap: 0 10px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.palette-list a[aria-selected="true"] { background: var(--bg-2); }
.pl-kind { grid-row: span 2; align-self: start; margin-top: 2px; font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); }
.pl-t { font-weight: 620; font-size: 15px; }
.pl-d { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 18px 12px; color: var(--ink-3); font-size: 14px; }
.palette-foot { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

/* ── misc utilities ───────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 1.3rem 0 1.8rem; }
.panel { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.panel > :last-child { margin-bottom: 0; }
.panel h3:first-child { margin-top: 0; }
.pros, .cons { list-style: none; padding: 0; }
.pros li, .cons li { position: relative; padding-left: 24px; }
.pros li::before { content: '+'; position: absolute; left: 4px; color: var(--ok); font: 700 15px var(--mono); }
.cons li::before { content: '−'; position: absolute; left: 4px; color: var(--bad); font: 700 15px var(--mono); }
.nextlist li { margin: .45rem 0; }
.spec { display: grid; grid-template-columns: minmax(130px, auto) 1fr; margin: 1.2rem 0 1.8rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.spec dt, .spec dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.spec dt { font: 600 11.5px/1.9 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); background: var(--raised); }
.spec dd { font-size: 14.5px; min-width: 0; overflow-wrap: anywhere; }
.spec dt:nth-last-of-type(1), .spec dd:last-child { border-bottom: 0; }
@media (max-width: 560px) { .spec { grid-template-columns: 1fr; } .spec dt { border-bottom: 0; padding-bottom: 0; } }
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  .js .reveal.in-view { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
@media print { .site-h, .site-f, .page-rail, .toc-inline, .next, .page-feedback, .copy { display: none !important; } body { background: #fff; } }

/* ── hashes, chains (download flow) ───────────────────────────────────── */
.tbl-hash th { width: 30%; }
.hash-f { display: block; font: 500 12px var(--mono); color: var(--ink-3); margin-top: 2px; }
.hash { font-size: 12px !important; word-break: break-all; }
.hash-n { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.chain { list-style: none; padding: 0; margin: 1.6rem 0 2rem; display: grid; gap: 0; counter-reset: ch; }
.chain li { position: relative; margin: 0; padding: 0 0 22px 46px; counter-increment: ch; }
.chain li::before { content: counter(ch); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--ink); font: 600 13px var(--mono); background: var(--bg); z-index: 1; }
.chain li::after { content: ''; position: absolute; left: 15px; top: 30px; bottom: 0; border-left: 1.5px dashed var(--line-3); }
.chain li:last-child::after { display: none; }
.chain-t { display: block; font-weight: 660; margin: 3px 0 2px; }
.chain-h { display: inline-block; margin: 2px 0 4px; padding: 2px 8px; border-radius: 6px; background: var(--code-bg); color: var(--code-ink); font: 500 12.5px var(--mono); word-break: break-all; }
.chain-d { display: block; font-size: 14.5px; color: var(--ink-2); }
.chain li.is-you::before { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }


/* compatibility matrix */
.matrix td, .matrix th { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.cell { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.cell::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.cell-ok { color: var(--ok); } .cell-part { color: var(--warn); } .cell-bad { color: var(--bad); } .cell-na { color: var(--ink-3); }

/* before / after compare */
.cmp { position: relative; margin: 1.6rem 0 2rem; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow); line-height: 0; user-select: none; touch-action: pan-y; }
.cmp img { width: 100%; display: block; }
.cmp-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--x, 50%)) 0 0); }
.cmp-top img { height: 100%; object-fit: cover; }
.cmp-h { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; margin-left: -1px; background: var(--accent); }
.cmp-h::after { content: ''; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.cmp input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.cmp-l { position: absolute; top: 10px; padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, .66); color: #fff; font: 600 11.5px/1.3 var(--mono); }
.cmp-l.l { left: 10px; } .cmp-l.r { right: 10px; }
.cmp + figcaption, .cmp-cap { margin: -1.2rem 0 2rem; font-size: 14px; color: var(--ink-2); }

/* terminal / log output */
.term { margin: 1.2rem 0 1.6rem; border-radius: var(--r); background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--code-line); overflow: hidden; }
.term pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.6 var(--mono); }
.term .w { color: #ffcf7a; } .term .e { color: #ff8b8b; } .term .ok { color: #8fe0b0; } .term .d { color: var(--code-3); }

/* file tree */
.tree { margin: 1.2rem 0 1.8rem; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font: 13.5px/1.75 var(--mono); }
.tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px dashed var(--line-2); }
.tree > ul { padding-left: 0; border: 0; }
.tree li { margin: 0; }
.tree .dir { font-weight: 600; }
.tree .note { font-family: var(--sans); font-size: 13px; color: var(--ink-3); margin-left: 8px; }
.tree .pg { color: var(--accent-ink); }

/* misc */
.badge-ind { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; border: 1px dashed var(--line-3); font-size: 13px; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 1.2rem 0 1.8rem; }
.kv > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.kv b { display: block; font: 650 1.2rem var(--display); letter-spacing: -.02em; }
.kv span { font-size: 13px; color: var(--ink-3); }
.ind-note { margin: 0 auto; max-width: var(--w); padding: 10px var(--gut) 0; font-size: 12.5px; color: var(--ink-3); }
.cheat-t { font: 600 13px var(--mono); color: var(--ink-3); margin: 0 0 8px; }
.cheat table { font-size: 13px; } .cheat td, .cheat th { padding: 5px 10px; }
@media print {
  body.print-cheat * { visibility: hidden; }
  body.print-cheat .cheat, body.print-cheat .cheat * { visibility: visible; }
  body.print-cheat .cheat { position: absolute; left: 0; top: 0; width: 100%; }
  body.print-cheat .table-wrap { border: 0; overflow: visible; }
  body.print-cheat kbd { border: 1px solid #999; }
}
.btn-mini { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.kb-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 16px; }

/* review verdict */
.verdict-box { margin: 1.4rem 0 2rem; padding: 20px 22px; border: 1px solid var(--line-2); border-left: 4px solid var(--accent); border-radius: var(--r-l); background: var(--surface); }
.vb-t { margin: 0 0 4px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.vb-main { margin: 0 0 12px; font-size: 1.12rem; }
.verdict-box ul { margin: 0; font-size: 14.5px; }
.verdict-box li { margin-bottom: 6px; }

/* fit bar */
.fitbar { margin: 1.4rem 0 1.8rem; }
.fb-bar { display: flex; height: 18px; border-radius: 6px; overflow: hidden; gap: 2px; }
.fb-bar span { display: block; min-width: 4px; }
.fb-same { background: var(--ok); } .fb-close { background: var(--info); } .fb-work { background: var(--warn); } .fb-plugin { background: var(--pol); } .fb-none { background: var(--bad); }
.fb-legend { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.fb-legend small { color: var(--ink-3); font-family: var(--mono); }
.fitbar figcaption { margin-top: 8px; font-size: 13px; color: var(--ink-3); }

/* Other-setups table: one card per row on phones */
@media (max-width: 640px) {
  .setups thead { display: none; }
  .setups, .setups tbody, .setups tr, .setups td { display: block; width: 100%; }
  .setups tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .setups tr:last-child { border-bottom: 0; }
  .setups td, .setups td:first-child { padding: 3px 0; border: 0; text-align: left; }
  .setups td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-3); font-size: 13px; }
  .setups td[data-l] code { white-space: normal; overflow-wrap: anywhere; }
}

/* ── libresprite.dev identity ─────────────────────────────────────────── */
h1, h2, h3, .brand-n, .card-t, .stat-v, .hero-t, .faq-q, .step-t, .viz-title, .answer-q { font-family: var(--display); }
h1 { font-weight: 700; letter-spacing: -.035em; font-variation-settings: 'opsz' 96; }
h2 { font-weight: 650; letter-spacing: -.025em; }
h3 { font-weight: 620; letter-spacing: -.012em; }
.logo { color: var(--ink); flex-shrink: 0; }
.logo-px { fill: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .brand:hover .logo-px { animation: px-draw .9s steps(6) 1; }
}
@keyframes px-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.brand-n { font-weight: 680; font-size: 17.5px; letter-spacing: -.025em; }
.px-label, .kicker-px { font-family: var(--pixel); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.eyebrow { font-family: var(--pixel); font-weight: 400; font-size: 11.5px; letter-spacing: .06em; }
.eyebrow::before { width: 8px; height: 8px; background: var(--accent); }

/* the pixel grid (a pattern, not a gradient: 1px hard lines only) */
.pxgrid { background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: var(--grid-size) var(--grid-size); }
/* transparency checkerboard (hard stops only) */
.checker { background-color: var(--chk-a); background-image: conic-gradient(var(--chk-b) 25%, transparent 0 50%, var(--chk-b) 0 75%, transparent 0); background-size: 16px 16px; }
.pixelated, .sprite { image-rendering: pixelated; image-rendering: crisp-edges; }

/* pixel corners on figures and screenshots (four 4px squares, like selection handles) */
.shot, .px-frame { position: relative; }
.shot::before, .shot::after, .px-frame::before, .px-frame::after { content: ''; position: absolute; width: 6px; height: 6px; background: var(--ink); pointer-events: none; }
.shot::before, .px-frame::before { left: -3px; top: -3px; }
.shot::after, .px-frame::after { right: -3px; top: -3px; }
.shot-badge { color: var(--ink-2); }
.shot-badge::before { background: var(--ok); border-radius: 0; }
.shot-meta { font: 500 11.5px var(--mono); color: var(--ink-3); }
.shot-frame { border-radius: var(--r-s); }

/* frame strip: numbered steps and timelines look like animation frames */
.steps { counter-reset: st; }
.step { position: relative; }
.frame-strip { display: flex; gap: 6px; margin: 1.2rem 0; padding: 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); overflow-x: auto; }
.frame-strip > * { flex: 0 0 auto; display: grid; place-items: center; min-width: 64px; height: 64px; border: 1px solid var(--line); border-radius: var(--r-s); font: 400 11px var(--pixel); color: var(--ink-3); }
.frame-strip > .is-cur { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-ink); }

/* hard pixel shadow for emphasis blocks (used sparingly: hero canvas, primary CTA) */
.px-shadow { box-shadow: var(--shadow-px); border: 1.5px solid var(--ink); }
.btn-accent { box-shadow: 3px 3px 0 var(--ink); border-color: var(--ink); }
.btn-accent:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-accent:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
:root[data-theme="dark"] .btn-accent { box-shadow: 3px 3px 0 #000; border-color: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-accent { box-shadow: 3px 3px 0 #000; border-color: #000; } }

/* palette swatches (data from LibreSprite's .gpl files) */
.swatches { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line-2); width: fit-content; }
.swatches i { display: block; width: 14px; height: 14px; }

/* status chips used in matrices */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 4px; font: 600 11.5px var(--mono); border: 1px solid currentColor; }
.chip-ok { color: var(--ok); background: var(--ok-soft); } .chip-warn { color: var(--warn); background: var(--warn-soft); } .chip-bad { color: var(--bad); background: var(--bad-soft); } .chip-na { color: var(--ink-3); background: var(--bg-2); }

/* version strip under page heroes */
.verline { display: inline-flex; align-items: center; gap: 8px; font: 500 12.5px var(--mono); color: var(--ink-3); }
.verline b { color: var(--ink); font-weight: 600; }

/* ── home ─────────────────────────────────────────────────────────────── */
.home-hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.home-hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); pointer-events: none; }
.home-hero-in { position: relative; max-width: var(--w); margin: 0 auto; padding: clamp(36px, 6vw, 72px) var(--gut) clamp(40px, 6vw, 72px); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 960px) { .home-hero-in { grid-template-columns: 1fr; } }
.home-hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.3rem); line-height: 1; margin: 0 0 18px; }
.home-hero h1 em { font-style: normal; color: var(--accent-ink); }
.home-hero .lede { margin-top: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font: 500 12.5px var(--mono); color: var(--ink-3); }
.hero-meta b { color: var(--ink); font-weight: 600; }
.hero-meta span::before { content: '■ '; color: var(--accent); font-size: 9px; vertical-align: 2px; }
.home-sec { max-width: var(--w); margin: 0 auto; padding: clamp(44px, 6vw, 80px) var(--gut) 0; }
.home-sec > h2 { margin-top: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); max-width: 24ch; }
.home-sec > .lede { margin: 0 0 28px; }
.sec-k { display: block; margin-bottom: 10px; font: 400 11px var(--pixel); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.home-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (max-width: 900px) { .home-2col { grid-template-columns: 1fr; } }
.home-text { max-width: 60ch; }
.home-end { padding-bottom: 80px; }

/* live sprite hero */
.pxh { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'bar bar' 'sw stage' 'tl tl' 'st st'; gap: 10px; padding: 12px; background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-px); max-width: 520px; justify-self: center; width: 100%; }
.pxh-bar { grid-area: bar; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pxh-bar .sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.pxh button { font: 600 12.5px var(--sans); color: var(--ink-2); background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r-s); height: 32px; min-width: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.pxh button:hover { border-color: var(--ink); color: var(--ink); }
.pxh button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pxh button kbd { font-size: 10px; padding: 1px 4px; border-bottom-width: 1px; background: transparent; color: inherit; border-color: currentColor; opacity: .7; }
.pxh-stage { grid-area: stage; position: relative; aspect-ratio: 1; border: 1px solid var(--line-2); }
.pxh-canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: crosshair; touch-action: none; }
.pxh-swatches { grid-area: sw; display: grid; grid-template-columns: 1fr; gap: 4px; align-content: start; }
.pxh-swatches button { width: 28px; height: 28px; min-width: 0; padding: 0; background: var(--c) !important; border: 1px solid var(--line-3); }
.pxh-swatches button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--ink); }
.pxh-frames { grid-area: tl; display: flex; gap: 6px; }
.pxh-frames button { flex: 1; height: auto; padding: 4px; flex-direction: column; gap: 2px; font: 400 10px var(--pixel); }
.pxh-frames canvas { width: 100%; max-width: 56px; aspect-ratio: 1; image-rendering: pixelated; background-color: var(--chk-a); background-image: conic-gradient(var(--chk-b) 25%, transparent 0 50%, var(--chk-b) 0 75%, transparent 0); background-size: 8px 8px; }
.pxh-frames button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.pxh-status { grid-area: st; margin: 0; font: 500 11.5px var(--mono); color: var(--ink-3); min-height: 1.4em; }
.pxh-hint { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.pxh:not(.is-ready) .pxh-stage::after { content: 'Loading the sprite…'; position: absolute; inset: 0; display: grid; place-items: center; font: 400 11px var(--pixel); color: var(--ink-3); }

/* layers × frames, exploded (CSS 3D, no WebGL) */
.xl { position: relative; height: 340px; perspective: 1100px; display: grid; place-items: center; }
.xl-stack { position: relative; width: 220px; height: 220px; transform-style: preserve-3d; transform: rotateX(56deg) rotateZ(-38deg); transition: transform 1.1s var(--ease); }
.xl-layer { position: absolute; inset: 0; border: 1.5px solid var(--ink); background-size: 100% 100%; image-rendering: pixelated; transition: transform 1.1s var(--ease); }
.xl-layer.bg { background-color: var(--chk-a); background-image: conic-gradient(var(--chk-b) 25%, transparent 0 50%, var(--chk-b) 0 75%, transparent 0); background-size: 27.5px 27.5px; }
.xl-layer.body { background-image: url('/img/sprout/layer-body-0.png'); background-color: transparent; border-style: dashed; border-color: var(--ink-3); }
.xl-layer.leaf { background-image: url('/img/sprout/layer-leaf-0.png'); background-color: transparent; border-style: dashed; border-color: var(--accent); }
.xl-tag { position: absolute; left: calc(100% + 10px); top: 0; white-space: nowrap; font: 400 10px var(--pixel); color: var(--ink-2); transform: rotateZ(38deg) rotateX(-56deg); transform-origin: left top; }
.xl.is-open .xl-layer.body { transform: translateZ(60px); }
.xl.is-open .xl-layer.leaf { transform: translateZ(120px); }
@media (prefers-reduced-motion: reduce) { .xl-layer.body { transform: translateZ(60px); } .xl-layer.leaf { transform: translateZ(120px); } }
.xl-frames { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 420px; margin: 8px auto 0; }
.xl-frames div { aspect-ratio: 1; border: 1px solid var(--line-2); background: url('/img/sprout/sheet-horizontal.png') 0 0 / 400% 100% no-repeat, var(--surface); image-rendering: pixelated; position: relative; }
.xl-frames div:nth-child(2) { background-position: 33.333% 0, 0 0; } .xl-frames div:nth-child(3) { background-position: 66.666% 0, 0 0; } .xl-frames div:nth-child(4) { background-position: 100% 0, 0 0; }
.xl-frames span { position: absolute; left: 4px; bottom: 2px; font: 400 9px var(--pixel); color: var(--ink-3); }
.legend-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.legend-list li { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.legend-list b { display: block; font-family: var(--display); font-weight: 650; }
.legend-list span { font-size: 14.5px; color: var(--ink-2); }

/* release timeline */
.tl-scroll { overflow-x: auto; }
.tl-svg { min-width: 760px; width: 100%; height: auto; display: block; }
.tl-axis { stroke: var(--ink); stroke-width: 2; }
.tl-tick { stroke: var(--ink-3); }
.tl-y { fill: var(--ink-3); font: 500 11px var(--mono); }
.tl-stem { stroke: var(--line-3); stroke-dasharray: 2 3; }
.tl-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.tl-latest .tl-dot { fill: var(--accent); stroke: var(--accent); }
.tl-fork .tl-dot { fill: var(--ink); }
.tl-master .tl-dot { fill: var(--ok); stroke: var(--ok); }
.tl-t { fill: var(--ink); font: 650 12.5px var(--sans); }
.tl-s { fill: var(--ink-3); font: 500 10.5px var(--mono); }

/* can / can't */
.cando { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .cando { grid-template-columns: 1fr; } }
.cando > div { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.cando h3 { margin-top: 0; }
.home-sec .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .home-sec .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .home-sec .cards-3 { grid-template-columns: 1fr; } }
.pxh button { padding: 0 7px; font-size: 12px; }
.pxh-bar { gap: 3px; }
.xl-key { display: flex; justify-content: center; gap: 14px; margin: 0; font: 400 10px var(--pixel); color: var(--ink-3); }
.xl-key span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 1.5px dashed var(--ink-3); }
.xl-key .k-leaf::before { border-color: var(--accent); } .xl-key .k-bg::before { border-style: solid; border-color: var(--ink); }

/* download chooser */
.dlc { margin: 1.4rem 0 2.2rem; padding: 18px; border: 1.5px solid var(--ink); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-px); }
.dlc-q { margin-bottom: 14px; }
.dlc-l { margin: 0 0 8px; font: 400 11px var(--pixel); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.dlc-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.dlc-opts button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--raised); color: var(--ink); font: 600 14px var(--sans); cursor: pointer; }
.dlc-opts button:hover { border-color: var(--ink); }
.dlc-opts button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dlc-out { border-top: 1px dashed var(--line-2); padding-top: 14px; }
.dlc-file { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); }
.dlc-file > div { min-width: 0; flex: 1 1 280px; }
.dlc-fn { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dlc-meta { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.dlc-steps { margin: 14px 0 6px; font-size: 15px; }
.dlc-warn { padding: 10px 14px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 var(--r-s) var(--r-s) 0; font-size: 15px; }
.dlc-note { font-size: 14px; color: var(--ink-2); }
.dlc-more { margin: 8px 0 0; font-weight: 600; }
.dlc-tbl { width: 100%; font-size: 14px; border-collapse: collapse; }
.dlc-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl-hash td:first-child { min-width: 240px; }
.tbl-hash td:first-child code { display: inline; font-size: 12px !important; word-break: break-all; background: none; border: 0; padding: 0; }
.tbl-hash th { width: auto; }
.tbl-hash td:nth-child(4) { min-width: 220px; }
.setloc { margin: 1.2rem 0 2rem; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--surface); }
.setloc label { display: block; font: 400 11px var(--pixel); text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.setloc select { width: 100%; max-width: 460px; height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--raised); color: var(--ink); font: 500 15px var(--sans); }
.setloc-path { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 4px; }
.setloc-path span { font: 400 10px var(--pixel); text-transform: uppercase; color: var(--ink-3); }
.setloc-path code { font-size: 14px; }
.sym-index { columns: 2 280px; gap: 24px; padding: 0; list-style: none; margin: 1rem 0 2rem; }
.sym-index li { break-inside: avoid; margin: 0 0 6px; }
.sym-index a { font-size: 15px; }
.sym-index small { display: block; color: var(--ink-3); font: 500 11px var(--mono); }
.fpsc { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 18px; align-items: center; margin: 1.2rem 0 2rem; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--surface); }
@media (max-width: 520px) { .fpsc { grid-template-columns: 1fr; } }
.fpsc-sprite { width: 128px; height: 128px; border: 1px solid var(--line-2); background: url('/img/sprout/sheet-horizontal.png') 0 0 / 400% 100% no-repeat, var(--chk-a); image-rendering: pixelated; }
.fpsc-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.fpsc label { display: grid; gap: 4px; font: 400 10px var(--pixel); text-transform: uppercase; color: var(--ink-3); }
.fpsc input { width: 110px; height: 38px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--raised); color: var(--ink); font: 600 16px var(--mono); }
.fpsc button { height: 30px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--raised); color: var(--ink-2); font: 600 12px var(--mono); cursor: pointer; }
.fpsc-out { margin: 10px 0 0; font: 500 13px var(--mono); color: var(--ink-2); }

/* palette swatches (docs/palettes-and-color, tools/palettes) */
.pals { list-style: none; padding: 0; margin: 1.2rem 0 1.8rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pal { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.pal-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.pal-h code { font-size: 12.5px; background: none; padding: 0; }
.pal-n { font: 600 11px var(--mono); color: var(--ink-3); }
.pal-s { display: block; width: 100%; height: 36px; border: 1px solid var(--line-2); }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 1.2rem 0 1.8rem; }
.modes figure { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.modes img { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.modes figcaption { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.modes figcaption b { display: block; font: 600 12px var(--mono); color: var(--ink); }
@media (max-width: 640px) { .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* live keyboard (/shortcuts/) */
.kb { margin: 1.4rem 0 2rem; padding: 16px; border: 1.5px solid var(--ink); border-radius: var(--r-l); background: var(--app-2); color: var(--app-ink); box-shadow: var(--shadow-px); }
.kb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.kb-hint { margin: 0; font-size: 13px; color: var(--app-ink-2); }
.kb-hint kbd { background: var(--app-3); color: var(--app-ink); border-color: var(--app-line); }
.kb .seg { display: inline-flex; border: 1px solid var(--app-line); border-radius: 6px; overflow: hidden; }
.kb .seg button { font: 600 12.5px var(--sans); padding: 7px 12px; background: transparent; color: var(--app-ink-2); border: 0; cursor: pointer; }
.kb .seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.kb-body { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; container-type: inline-size; }
.kb-main { flex: 1 1 auto; min-width: 560px; }
.kb-nav { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: flex-end; }
.kb-nav .kb-row:nth-child(2) { margin-bottom: 22px; }
.kb-row { display: flex; gap: 4px; margin-bottom: 4px; }
.kb-fn { margin-bottom: 10px; }
.kk { --u: max(30px, calc((100cqw - 80px) / 18.2)); flex: var(--w, 1) 0 0; min-width: calc(var(--u) * var(--w, 1)); height: 46px; position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 4px 6px 5px; border: 1px solid var(--app-line); border-bottom-width: 3px; border-radius: 5px; background: var(--app-3); color: var(--app-ink-2); font: 600 11px var(--mono); text-align: left; cursor: pointer; overflow: hidden; transition: transform .08s, background .12s; }
.kb-nav .kk { flex: 0 0 var(--u); }
.kk-gap { visibility: hidden; cursor: default; }
.kk-c { font-size: 11.5px; line-height: 1; }
.kk-a { font: 500 8.5px/1.12 var(--sans); letter-spacing: -.01em; color: var(--app-ink); max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kk.has { background: #3b2a20; border-color: #8a4a26; color: #ffb48a; }
.kk.has .kk-a { color: #fff; }
.kk:hover, .kk:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kk.hit { transform: translateY(2px); border-bottom-width: 1px; background: var(--accent); color: #fff; }
.kk-mod { justify-content: center; align-items: center; color: var(--app-ink); }
.kk-mod[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.kk-mac { display: none; } .kb.is-mac .kk-mac { display: inline; } .kb.is-mac .kk-l { display: none; }
.kb-out { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--app-line); border-radius: 6px; min-height: 48px; }
.kb-out-k { font: 700 13px var(--mono); color: #ffb48a; }
.kb-out-a { font-size: 14.5px; color: #fff; }
.kb-out.none .kb-out-a { color: var(--app-ink-2); }
@media (max-width: 720px) { .kk { height: 40px; } .kk-a { display: none; } .kb-main { min-width: 520px; } }

/* shortcut finder */
.sf { margin: 1.2rem 0 2rem; }
.sf-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 10px; position: sticky; top: 64px; z-index: 3; background: var(--bg); padding: 8px 0; }
.sf-in { flex: 1 1 320px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 46px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--surface); box-shadow: 3px 3px 0 var(--ink); }
.sf-in input { flex: 1; border: 0; outline: 0; background: transparent; font: 500 15.5px var(--sans); color: var(--ink); min-width: 0; }
.sf-count { font: 600 12px var(--mono); color: var(--ink-3); }
.sf-t td:first-child { width: 46%; }
.sf-menu { display: block; font-size: 12px; color: var(--ink-3); }
.sf-g th { background: var(--bg-2); font: 700 11px var(--pixel); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); text-align: left; }
.sf-t tr.is-target td { background: var(--accent-soft); }
.kor { margin: 0 6px; font-size: 11px; color: var(--ink-3); }
.sf-none { padding: 14px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--ink-2); }

/* cheat sheet + print */
.cheat { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 1.2rem 0 1rem; }
.cheat section { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.cheat h3 { margin: 0 0 8px; font: 700 11px var(--pixel); letter-spacing: .05em; text-transform: uppercase; color: var(--accent-ink); }
.cheat dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; font-size: 13px; align-items: baseline; }
.cheat dt { white-space: nowrap; } .cheat dd { margin: 0; color: var(--ink-2); }
@media print {
  html.print-cheat body * { visibility: hidden; }
  html.print-cheat .cheat-wrap, html.print-cheat .cheat-wrap * { visibility: visible; }
  html.print-cheat .cheat-wrap { position: absolute; left: 0; top: 0; width: 100%; }
  html.print-cheat .cheat { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  html.print-cheat .cheat section { break-inside: avoid; border-color: #999; }
  html.print-cheat .no-print { display: none !important; }
}

/* vertical timeline (vs pages) */
.vt { list-style: none; margin: 1.2rem 0 2rem; padding: 0 0 0 22px; border-left: 2px solid var(--ink); }
.vt li { position: relative; margin: 0 0 14px; padding-left: 6px; }
.vt li::before { content: ""; position: absolute; left: -29px; top: 6px; width: 10px; height: 10px; background: var(--surface); border: 2px solid var(--ink); }
.vt li.ls::before { background: var(--accent); border-color: var(--accent); }
.vt li.as::before { background: var(--ink); }
.vt time { display: block; font: 600 12px var(--mono); color: var(--ink-3); }
.vt b { font-weight: 650; }
.vt-key { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin: -0.6rem 0 1rem; }
.vt-key span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 2px solid var(--ink); }
.vt-key .k-ls::before { background: var(--accent); border-color: var(--accent); } .vt-key .k-as::before { background: var(--ink); }
.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 1.4rem 0 2rem; }
.verdict > div { padding: 16px 18px; border: 1.5px solid var(--ink); border-radius: var(--r-l); background: var(--surface); }
.verdict > div:first-child { box-shadow: 4px 4px 0 var(--accent); }
.verdict > div:last-child { box-shadow: 4px 4px 0 var(--ink); }
.verdict h3 { margin: 0 0 8px; font-size: 1.05rem; }
.verdict ul { margin: 0; padding-left: 1.1rem; font-size: 14.5px; }
@media (max-width: 640px) { .verdict { grid-template-columns: 1fr; } }

/* numbered legend matching annotated screenshots */
.ilist { list-style: none; counter-reset: il; padding: 0; margin: 1rem 0 2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px 22px; }
.ilist li { counter-increment: il; position: relative; padding-left: 40px; font-size: 15px; line-height: 1.5; }
.ilist li::before { content: counter(il); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; display: grid; place-items: center; background: #c2410c; color: #fff; font: 700 13px var(--mono); border: 2px solid #fff; box-shadow: 2px 2px 0 #000; }
.menu-t td:first-child { width: 28%; font-weight: 550; } .menu-t td:nth-child(2) { width: 24%; } .menu-t .kseq { white-space: nowrap; display: inline-block; margin: 1px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 1.3rem 0 1rem; }
.script-demo figure { margin: 0; text-align: center; } .script-demo img { width: 100%; max-width: 192px; height: auto; }
.api-cls { margin: 2.2rem 0 1rem; } .api-sig { font: 600 13.5px var(--mono); }
.api-t td:first-child { width: 36%; } .api-rw { font: 600 10.5px var(--mono); color: var(--ink-3); margin-left: 6px; }

/* CLI builder */
.clib { margin: 1.2rem 0 2rem; padding: 18px; border: 1.5px solid var(--ink); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-px); }
.clib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.clib label { display: flex; flex-direction: column; gap: 5px; font: 600 12px var(--sans); color: var(--ink-2); }
.clib select, .clib input:not([type]), .clib input[name] { font: 500 14px var(--sans); padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--raised); color: var(--ink); }
.clib-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0; }
.clib-checks label { flex-direction: row; align-items: center; font-weight: 500; font-size: 13.5px; color: var(--ink); }
.clib-checks input { padding: 0; }
.clib-cmd { margin: 0 0 8px; } .clib-cmd pre { white-space: pre-wrap; word-break: break-all; }
.clib-notes { margin: 8px 0 0; padding-left: 1.1rem; color: var(--ink-2); }
.cli-t td:first-child { width: 38%; white-space: nowrap; }

/* palette browser */
.palb { display: grid; grid-template-columns: 280px 1fr; gap: 18px; margin: 1.2rem 0 2rem; padding: 16px; border: 1.5px solid var(--ink); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-px); position: relative; }
.palb-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.palb-search { display: flex; align-items: center; gap: 6px; padding: 0 10px; height: 38px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--raised); }
.palb-search input { border: 0; background: transparent; outline: 0; flex: 1; min-width: 0; font: 500 14px var(--sans); color: var(--ink); }
.palb-size select { width: 100%; padding: 7px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--raised); color: var(--ink); font: 500 13px var(--sans); }
.palb-list { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.palb-list button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.palb-list button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.palb-list button:hover { background: var(--bg-2); }
.pl-n { font: 600 13px var(--mono); } .pl-c { font: 600 11px var(--mono); color: var(--ink-3); }
.pl-s { grid-column: 1 / -1; display: flex; height: 8px; } .pl-s i { flex: 1; }
.palb-main { min-width: 0; } .palb-name { margin: 0 0 4px; font-size: 1.5rem; }
.palb-swatches { display: grid; grid-template-columns: repeat(var(--cols, 16), minmax(0, 1fr)); gap: 0; border: 1.5px solid var(--ink); margin: 10px 0 16px; }
.palb-swatches button { aspect-ratio: 1; border: 0; background: var(--c); cursor: copy; padding: 0; }
.palb-swatches button:hover, .palb-swatches button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; z-index: 1; }
.palb-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.palb-preview { width: 192px; height: 192px; border: 1.5px solid var(--ink); background-size: 24px 24px; }
.palb-dl { flex: 1; min-width: 240px; } .palb-dl .btn-row { margin: 6px 0 10px; }
.palb-toast { position: absolute; right: 16px; bottom: 16px; margin: 0; padding: 8px 12px; background: var(--ink); color: var(--bg); font: 600 12.5px var(--mono); border-radius: 6px; }
@media (max-width: 760px) { .palb { grid-template-columns: 1fr; } .palb-list { max-height: 260px; } }

/* upscaler */
.ups { margin: 1.2rem 0 2rem; padding: 16px; border: 1.5px solid var(--ink); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-px); }
.ups-drop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 26px 16px; border: 2px dashed var(--line-3); border-radius: var(--r); text-align: center; cursor: pointer; color: var(--ink-2); }
.ups-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.ups-controls { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; margin: 14px 0 8px; font-size: 14px; }
.ups-controls label { display: inline-flex; align-items: center; gap: 8px; }
.ups-controls select { padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--raised); color: var(--ink); }
.ups-scale-v { font: 700 14px var(--mono); min-width: 3ch; }
.ups-stage { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: var(--bg-2); }
.ups-out { display: block; max-width: none; }
.ups:not(.has-img) .ups-stage { display: none; }

/* canvas calculator */
.ccalc { margin: 1.2rem 0 1rem; padding: 16px; border: 1.5px solid var(--ink); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-px); }
.ccalc .btn-row { margin: 0 0 12px; }
.ccalc-f { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 10px; }
.ccalc-f label { display: flex; flex-direction: column; gap: 4px; font: 600 12px var(--sans); color: var(--ink-2); }
.ccalc-f input, .ccalc-f select { width: 130px; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--raised); color: var(--ink); font: 500 14px var(--mono); }
.ccalc-out tr.hl td { background: var(--accent-soft); }

/* sprite sheet studio */
.sss { margin: 1.2rem 0 2rem; padding: 16px; border: 1.5px solid var(--ink); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-px); }
.sss .seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.sss .seg button { font: 650 13.5px var(--sans); padding: 8px 14px; background: transparent; color: var(--ink); border: 0; cursor: pointer; }
.sss .seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.sss-drop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 22px 14px; border: 2px dashed var(--line-3); border-radius: var(--r); text-align: center; cursor: pointer; color: var(--ink-2); }
.sss-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.sss .for-cut, .sss.is-cut .for-make, .sss .sss-cut, .sss.is-cut .sss-make { display: none; }
.sss.is-cut .for-cut, .sss.is-cut .sss-cut { display: inline; } .sss.is-cut .sss-cut { display: block; }
.sss .by-count, .sss.by-count .by-size { display: none !important; } .sss.by-count .by-count { display: flex !important; }
.sss-grid { display: grid; grid-template-columns: 1fr 240px; gap: 18px; margin-top: 14px; }
.sss-opts { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 10px; }
.sss label { display: flex; flex-direction: column; gap: 4px; font: 600 12px var(--sans); color: var(--ink-2); }
.sss label.chk { flex-direction: row; align-items: center; font-weight: 500; font-size: 13px; color: var(--ink); align-self: flex-end; }
.sss input[type=number], .sss select { padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--raised); color: var(--ink); font: 500 13.5px var(--sans); max-width: 200px; }
.sss input[type=number] { width: 90px; }
.sss-list { max-height: 140px; overflow: auto; margin: 0 0 8px; padding-left: 0; list-style: none; columns: 2; }
.sss-list li span:first-child { display: inline-block; min-width: 2.2ch; font: 600 11px var(--mono); color: var(--ink-3); }
.sss-stage { max-height: 360px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); }
.sss-stage canvas { display: block; image-rendering: pixelated; min-width: 64px; zoom: 2; }
.sss-right { display: flex; flex-direction: column; gap: 10px; }
.sss-plabel { margin: 0; font: 700 11px var(--pixel); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.sss-pbox { display: grid; place-items: center; min-height: 200px; border: 1.5px solid var(--ink); overflow: auto; }
@media (max-width: 760px) { .sss-grid { grid-template-columns: 1fr; } .sss-list { columns: 1; } }
.frames4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 1.2rem 0; }
.frames4 figure { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.frames4 img { width: 100%; height: auto; display: block; }
.frames4 figcaption { margin-top: 6px; font-size: 13px; color: var(--ink-2); } .frames4 figcaption b { display: block; font: 600 12px var(--mono); color: var(--ink); }
@media (max-width: 640px) { .frames4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ccalc-out { overflow-x: auto; } .ccalc-f input, .ccalc-f select { max-width: 40vw; }

/* ASE viewer */
.asev { margin: 1.2rem 0 2rem; padding: 16px; border: 1.5px solid var(--ink); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-px); }
.asev-drop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 22px 14px; border: 2px dashed var(--line-3); border-radius: var(--r); text-align: center; cursor: pointer; color: var(--ink-2); }
.asev-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.asev-err { color: var(--bad); margin: 10px 0 0; }
.asev-body { display: none; grid-template-columns: 1fr 280px; gap: 18px; margin-top: 14px; }
.asev.has-doc .asev-body { display: grid; }
.asev-stage { display: grid; place-items: center; min-height: 260px; max-height: 520px; overflow: auto; border: 1.5px solid var(--ink); padding: 10px; }
.asev-canvas { display: block; }
.asev-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.asev-controls input[type=range] { flex: 1; min-width: 120px; }
.asev-controls select { padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--raised); color: var(--ink); }
.asev-h { font: 700 11px var(--pixel); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 6px; }
.asev-side .asev-h + * { margin-bottom: 14px; }
.asev-info table { font-size: 13px; } .asev-info th { width: 34%; }
.asev-layers { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.asev-layers li { padding: 3px 0 3px calc(var(--lvl, 0) * 16px); border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .asev-body, .asev.has-doc .asev-body { grid-template-columns: 1fr; } }
/* two figures side by side; a centred single figure; a two-up frames row */
.shots-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 1.2rem 0; align-items: start; }
.shots-2 > * { margin: 0; min-width: 0; }
@media (max-width: 640px) { .shots-2 { grid-template-columns: 1fr; } }
figure.center { margin: 1.4rem auto; text-align: center; }
figure.center img { display: inline-block; max-width: 100%; height: auto; }
figure.center figcaption { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.frames4.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 440px; }
