/* @fonts:begin (generated by tools/build_fonts.py) */
@font-face { font-family: "Rubik"; src: url("/fonts/web/Rubik-latin.woff2?v=5a1c07d1") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Rubik"; src: url("/fonts/web/Rubik-latin-ext.woff2?v=5a1c07d1") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Rubik"; src: url("/fonts/web/Rubik-cyrillic.woff2?v=5a1c07d1") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116, U+20B4; }
@font-face { font-family: "Alegreya"; src: url("/fonts/web/Alegreya-latin.woff2?v=5a1c07d1") format("woff2"); font-weight: 700 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Alegreya"; src: url("/fonts/web/Alegreya-latin-ext.woff2?v=5a1c07d1") format("woff2"); font-weight: 700 800; font-style: normal; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Alegreya"; src: url("/fonts/web/Alegreya-cyrillic.woff2?v=5a1c07d1") format("woff2"); font-weight: 700 800; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116, U+20B4; }
@font-face { font-family: "Caveat"; src: url("/fonts/web/Caveat-latin.woff2?v=5a1c07d1") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Caveat"; src: url("/fonts/web/Caveat-latin-ext.woff2?v=5a1c07d1") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Caveat"; src: url("/fonts/web/Caveat-cyrillic.woff2?v=5a1c07d1") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116, U+20B4; }
@font-face { font-family: "Literata"; src: url("/fonts/web/Literata-latin.woff2?v=5a1c07d1") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; src: url("/fonts/web/Literata-latin-ext.woff2?v=5a1c07d1") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; src: url("/fonts/web/Literata-cyrillic.woff2?v=5a1c07d1") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116, U+20B4; }
@font-face { font-family: "Literata"; src: url("/fonts/web/Literata-Italic-latin.woff2?v=5a1c07d1") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; src: url("/fonts/web/Literata-Italic-latin-ext.woff2?v=5a1c07d1") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; src: url("/fonts/web/Literata-Italic-cyrillic.woff2?v=5a1c07d1") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116, U+20B4; }
@font-face { font-family: "Alegreya Fallback"; src: local("Georgia"), local("Times New Roman"); ascent-override: 101.6%; descent-override: 34.5%; line-gap-override: 0.0%; size-adjust: 101.1%; }
@font-face { font-family: "Caveat Fallback"; src: local("Comic Sans MS"), local("Chalkboard SE"); ascent-override: 96.0%; descent-override: 30.0%; line-gap-override: 0.0%; size-adjust: 86.0%; }
/* @fonts:end */

/* ============================================================================
   TaleLamp — tl.css v2 · one design system for the whole site
   tokens → base → layout (shell) → components → pages · breakpoints 640 / 900
   Visual language: claude/design-system-v2.md. Paper is the page, night is the evening in the story
   (hero, book panel, footer, reading at night). Amber only where light is: the main CTA, the child's name,
   the firefly / the lamp glow, the focus ring.
   ============================================================================ */

/* ---------- tokens ---------- */
:root {
  /* paper */
  --bg: #f5efe2; --surface: #fbf7ee; --surface-2: #efe7d6;
  --ink: #1c2242; --ink-2: #3d4363; --muted: #5e6275; --line: #e2d8c3; --line-2: #d3c7ad;
  --accent: #f2c14e; --accent-2: #e6b23a; --accent-ink: #2a1d05; --name: #b0761a;
  --success: #4f8a6f; --success-fill: #7fb29a; --error: #b8503c; --error-fill: #e48a76;
  /* night */
  --n-bg: #1b2447; --n-surface: #232d56; --n-surface-2: #141b37; --n-ink: #f3ecdc; --n-muted: #a9b0cc; --n-line: #33406f; --n-name: #f6cf6a;
  /* reader at night */
  --r-bg: #151b33; --r-ink: #efe3c8;
  /* legacy aliases (components written against v1) */
  --night: var(--n-bg); --paper: var(--surface); --paper-2: var(--surface-2); --moon: var(--accent); --moon-2: var(--accent-2);
  --font-display: "Alegreya", "Alegreya Fallback", Georgia, serif;
  --font-ui: "Rubik", "Segoe UI", system-ui, sans-serif;
  --font-read: "Literata", Georgia, serif;
  --font-name: "Caveat", "Caveat Fallback", cursive;
  --w-page: 1120px; --w-text: 720px; --w-read: 62ch; --gx: 20px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --sec: var(--sp-9);
  --fs-display: clamp(36px, 2.2rem + 1.6vw, 56px); --fs-h1: clamp(32px, 1.8rem + 1vw, 44px); --fs-h2: clamp(26px, 1.4rem + .6vw, 32px);
  --fs-h3: clamp(20px, 1.15rem + .2vw, 22px); --fs-lead: clamp(17px, 1rem + .15vw, 18px); --fs-body: 16px; --fs-read: clamp(19px, 1.05rem + .35vw, 22px);
  --fs-small: 13px; --fs-over: 12px;
  --ctl: 52px; --ctl-s: 44px; --ctl-xs: 36px;
  --r-page: 4px; --r-book: 2px 5px 5px 2px; --r-field: 12px; --r-btn: 12px; --r-chip: 8px;
  --sh-page: 0 1px 2px rgba(60,40,10,.06), 0 10px 30px -14px rgba(60,40,10,.20);
  --sh-book: 0 1px 1px rgba(28,34,66,.20), 0 14px 22px -10px rgba(28,34,66,.45);
  --sh-lift: 0 2px 2px rgba(28,34,66,.18), 0 22px 30px -12px rgba(28,34,66,.50);
  --glow: radial-gradient(circle, rgba(242,193,78,.28), transparent 65%);
  --ease: cubic-bezier(.2,.7,.2,1); --ease-lift: cubic-bezier(.2,.8,.2,1); --t-fast: 180ms; --t-name: 240ms; --t-lift: 220ms;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (max-width: 899px) { :root { --gx: 16px; --sec: var(--sp-8); } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font: 400 var(--fs-body) / 1.55 var(--font-ui); color: var(--ink); background: var(--grain), var(--bg); }
body > main { flex: 1 0 auto; }
body > * { position: relative; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); letter-spacing: -.005em; text-wrap: balance; margin: 0; font-weight: 800; }
h1 { font-size: var(--fs-h1); line-height: 1.1; }
h2 { font-size: var(--fs-h2); line-height: 1.15; }
h3 { font-size: var(--fs-h3); line-height: 1.25; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
.lead { font: 400 var(--fs-lead) / 1.55 var(--font-read); color: var(--ink-2); max-width: var(--w-text); }
.small { font-size: var(--fs-small); line-height: 1.45; color: var(--muted); }
.over { font: 600 var(--fs-over) var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nm { font-family: var(--font-name); font-weight: 700; font-size: 1.15em; color: var(--name); margin: 0 .06em; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.night { background: var(--n-bg); color: var(--n-ink); }
.night h1, .night h2, .night h3, .night h4 { color: var(--n-ink); }
.night .lead { color: rgba(243,236,220,.85); }
.night .small, .night .over { color: var(--n-muted); }
.night .nm { color: var(--n-name); }
.night a { color: var(--n-ink); text-decoration-color: var(--n-line); }
.night a:hover { text-decoration-color: var(--n-ink); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition-duration: 0ms !important; } }

/* ---------- layout: containers, sections ---------- */
.wrap { width: 100%; max-width: calc(var(--w-page) + 2 * var(--gx)); margin: 0 auto; padding: 0 var(--gx); }
main.wrap { padding-bottom: var(--sec); }
.wrap-text { width: 100%; max-width: calc(var(--w-text) + 2 * var(--gx)); margin: 0 auto; padding: 0 var(--gx); }
.sec { padding: var(--sec) 0; }
.sec.-flush { padding-top: 0; }
.sec-head { text-align: center; margin: 0 auto var(--sp-6); max-width: var(--w-text); }
.sec-head .orn { margin: 0 auto var(--sp-4); }
.sec-head .lead { margin: var(--sp-3) auto 0; }
.grid { display: grid; gap: var(--sp-6); }

/* ---------- layout: the shell (one header, one footer) ---------- */
.hdr { position: sticky; top: 0; z-index: 20; height: 64px; background: var(--n-bg); border-bottom: 1px solid var(--n-line); }
.hdr .wrap { height: 100%; display: flex; align-items: center; gap: var(--sp-5); }
.logo { display: inline-flex; align-items: flex-end; gap: 8px; text-decoration: none; color: var(--n-ink); margin-right: auto; }
.logo img { display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.logo .lg-d { width: auto; height: 56px; margin: -8px 0 -6px; }
.logo .lg-m { display: none; width: 32px; height: 32px; border-radius: 50%; }
.logo .wm { font: 800 26px / 1 var(--font-display); letter-spacing: -.01em; padding-bottom: 0; margin-bottom: -5px; color: var(--n-ink); }
.logo .wm .lamp { color: var(--accent); }
.nav { display: flex; gap: var(--sp-5); }
.nav a { color: var(--n-muted); text-decoration: none; font: 500 15px var(--font-ui); padding: 6px 0; border-bottom: 1.5px solid transparent; }
.nav a:hover, .nav a[aria-current=page] { color: var(--n-ink); border-bottom-color: var(--n-ink); }
.langs { display: flex; gap: var(--sp-1); }
.langs a { display: inline-flex; align-items: center; justify-content: center; min-width: var(--ctl-s); height: var(--ctl-s); padding: 0 10px; border-radius: var(--r-chip); font: 600 13px var(--font-ui); text-decoration: none; color: var(--n-muted); box-shadow: inset 0 0 0 1px var(--n-line); }
.langs a:hover { color: var(--n-ink); }
.langs a.on { background: var(--n-ink); color: var(--n-bg); box-shadow: none; }
.langs-m { display: none; position: relative; }
.langs-m summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: var(--ctl-s); padding: 0 12px; border-radius: var(--r-chip); font: 600 13px var(--font-ui); cursor: pointer; box-shadow: inset 0 0 0 1px var(--n-line); color: var(--n-ink); }
.langs-m summary::-webkit-details-marker { display: none; } .langs-m summary::after { content: "▾"; font-size: 11px; }
.langs-m ul { position: absolute; right: 0; top: 50px; z-index: 30; list-style: none; margin: 0; padding: 6px; background: var(--surface); border-radius: var(--r-field); box-shadow: var(--sh-lift); min-width: 170px; display: grid; gap: 2px; }
.langs-m a { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: var(--r-chip); color: var(--ink); font: 500 15px var(--font-ui); text-decoration: none; }
.langs-m a small { font: 600 12px var(--font-ui); color: var(--muted); min-width: 24px; }
.langs-m a.on, .langs-m a:hover { background: var(--surface-2); color: var(--ink); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font: 500 var(--fs-small) var(--font-ui); color: var(--muted); padding: var(--sp-4) 0 0; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--line-2); }
@media (max-width: 899px) { .crumbs .cur, .crumbs .sep:nth-last-child(2) { display: none; } }
.foot { background: var(--n-bg); color: var(--n-muted); padding: var(--sp-8) 0; text-align: center; border-top: 1px solid var(--n-line); }
.foot .tag { font: 700 var(--fs-h3) var(--font-display); color: var(--n-ink); margin: 0 0 var(--sp-4); }
.foot .links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2) var(--sp-4); font: 500 var(--fs-small) var(--font-ui); }
.foot .links a { color: var(--n-muted); text-decoration: none; padding: 10px 4px; display: inline-block; }
.foot .links a:hover { color: var(--n-ink); text-decoration: underline; }
.foot .ai { margin: var(--sp-4) auto 0; max-width: var(--w-text); font-size: 12px; color: rgba(169,176,204,.7); }
@media (max-width: 899px) {
  .hdr { height: 56px; }
  .logo { align-items: center; } .logo .lg-d { display: none; } .logo .lg-m { display: block; } .logo .wm { font-size: 22px; padding-bottom: 0; margin-bottom: 0; }
  .nav { gap: 0; } .nav a:not(:first-child) { display: none; } .nav a { font-size: 14px; }
  .langs { display: none; } .langs-m { display: block; }
}

/* ---------- components: buttons, fields, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--ctl); padding: 0 24px; border-radius: var(--r-btn); border: 0;
       background: var(--accent); color: var(--accent-ink); font: 600 15px / 1 var(--font-ui); text-decoration: none; cursor: pointer;
       transition: background var(--t-fast), transform var(--t-fast); }
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.night .btn { color: var(--accent-ink); }
.btn.-quiet { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.-quiet:hover { background: var(--surface-2); }
.btn.-ghost, .night .btn.-ghost { background: transparent; color: var(--n-ink); box-shadow: inset 0 0 0 1.5px var(--n-line); }
.btn.-s { min-height: var(--ctl-s); padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field label { font: 600 var(--fs-over) var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea { width: 100%; min-height: var(--ctl); padding: 0 16px; border: 0; border-radius: var(--r-field); background: var(--surface); color: var(--ink);
       box-shadow: inset 0 0 0 1px var(--line-2); font: 500 16px var(--font-ui); outline: none; transition: box-shadow var(--t-fast); }
.field input.-name { font: 700 26px / 1 var(--font-name); }
.field input::placeholder, .field textarea::placeholder { color: rgba(28,34,66,.38); font-weight: 400; }
.field input:focus, .field textarea:focus { box-shadow: inset 0 0 0 2px var(--accent), 0 0 12px 2px rgba(242,193,78,.25); outline: none; }
.night .field label { color: var(--n-muted); }
.night .field input { background: var(--n-surface); color: var(--n-ink); box-shadow: inset 0 0 0 1px var(--n-line); }
.night .field input::placeholder { color: rgba(243,236,220,.42); }
.night .field input:focus { box-shadow: inset 0 0 0 2px var(--accent), 0 0 14px 2px rgba(242,193,78,.25); }
.seg { display: inline-flex; width: max-content; min-height: var(--ctl); border-radius: var(--r-field); padding: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { min-height: calc(var(--ctl) - 8px); padding: 0 18px; border: 0; border-radius: var(--r-chip); background: transparent; color: var(--ink); font: 600 15px var(--font-ui); cursor: pointer; opacity: .8; }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--surface); opacity: 1; }
.night .seg { background: var(--n-surface); box-shadow: inset 0 0 0 1px var(--n-line); }
.night .seg button { color: var(--n-ink); }
.night .seg button[aria-pressed=true] { background: var(--n-ink); color: var(--n-bg); }
.row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: var(--ctl-s); padding: 0 12px; border-radius: var(--r-chip); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font: 500 14px var(--font-ui); text-decoration: none; }
.chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip img { width: 22px; height: 22px; object-fit: contain; }
.chip small { color: var(--muted); font-size: 12px; }
.chip.on { background: var(--ink); color: var(--surface); box-shadow: none; } .chip.on small { color: var(--n-muted); }
.meta { font: 500 var(--fs-small) var(--font-ui); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; }
.meta .personal { color: var(--success); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tags span { font: 500 12px var(--font-ui); padding: 4px 10px; border-radius: var(--r-chip); background: var(--surface-2); color: var(--ink-2); }
.hubs { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; }
@media (max-width: 639px) { .btn.-cta { width: 100%; } .seg { width: 100%; } .seg button { flex: 1; } .row > .seg + .btn { margin-top: var(--sp-1); } }

/* ---------- components: the book (a bound object, not a card) ---------- */
.bk { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--r-book); overflow: hidden; background: var(--n-bg); color: var(--n-ink);
      box-shadow: var(--sh-book); text-decoration: none; container-type: inline-size; transform: translateZ(0); }
.bk img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity var(--t-name) var(--ease), filter var(--t-name) var(--ease); }
.bk img.fade { opacity: 0; filter: blur(2px); }
.bk::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40%; z-index: 1; background: linear-gradient(to bottom, var(--n-bg) 0%, var(--n-bg) 42%, rgba(27,36,71,.85) 62%, rgba(27,36,71,0) 100%); }
.bk::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
             background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(255,255,255,.10) 3px, transparent 9px), linear-gradient(270deg, var(--surface-2) 0 3px, var(--line) 3px 4px, transparent 4px); }
.bk .bk-stars { position: absolute; inset: 0; height: 30%; z-index: 1; pointer-events: none; opacity: .5; background-image: radial-gradient(circle, rgba(243,236,220,.9) 0 1px, transparent 1.5px), radial-gradient(circle, rgba(243,236,220,.6) 0 1px, transparent 1.5px); background-size: 97px 61px, 143px 89px; background-position: 12px 8px, 60px 22px; mask-image: linear-gradient(#000 60%, transparent); -webkit-mask-image: linear-gradient(#000 60%, transparent); }
.bk .bk-txt { position: absolute; left: 8%; right: 6%; top: 3.5%; z-index: 2; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.bk .bk-name { display: block; font: 700 clamp(22px, 15cqw, 46px) / .95 var(--font-name); color: var(--n-name); text-shadow: 0 0 14px rgba(242,193,78,.45), 0 1px 2px rgba(0,0,0,.4); transition: opacity var(--t-name) var(--ease), filter var(--t-name) var(--ease); }
.bk .bk-name.ghost { opacity: .72; }
.bk .bk-name.pulse { animation: namein var(--t-name) var(--ease) 1; }
@keyframes namein { from { opacity: .2; filter: blur(2px); } to { opacity: 1; filter: blur(0); } }
.bk .bk-title { display: block; margin-top: .3em; font: 800 clamp(11px, 6.4cqw, 21px) / 1.12 var(--font-display); color: var(--n-ink); text-wrap: balance; }
.bk .bk-title.inline { margin-top: 0; font-size: clamp(13px, 7cqw, 22px); }
.bk .bk-mark { position: absolute; right: 7%; bottom: 3%; z-index: 2; font: 700 11px var(--font-display); color: rgba(243,236,220,.9); }
.bk .bk-mark { display: inline-flex; align-items: center; gap: 5px; }
.bk .bk-mark::before { content: ""; display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: url("/static/brand/logo-badge-40.png") center / cover no-repeat; box-shadow: 0 0 0 1px rgba(243,236,220,.35); }
.shelf .bk-mark, .picks .bk-mark, .fan6 .bk-mark, .fan .bk-mark { display: none; }  /* the mark stays on the hero book and in the PDF */
.book { display: block; text-decoration: none; color: inherit; transition: transform var(--t-lift) var(--ease-lift); }
.book:hover, .book:focus-visible { transform: translateY(-6px) rotate(-.6deg); }
.book:hover .bk, .book:focus-visible .bk { box-shadow: var(--sh-lift); }
.book-3d { position: relative; isolation: isolate; }
.book-3d::before { content: ""; position: absolute; inset: -18% -22% -12% -22%; z-index: -1; background: var(--glow); pointer-events: none; }
.book-3d .bk { transform: rotate(-3deg); box-shadow: var(--sh-lift); }
.book-3d .pages { display: none; }
.book-3d .ff { position: absolute; top: -14px; left: 12%; width: 28px; height: auto; z-index: 4; animation: breathe 3.2s ease-in-out 3; }
@keyframes breathe { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: .9; transform: scale(1.04); } }

/* ---------- components: shelf, index nav, ornaments, stars ---------- */
.shelf { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-3); padding: 0 0 var(--sp-4); margin: 0; list-style: none; }
.shelf .book::after, .pair .book::after { content: ""; display: block; height: 2px; margin: 12px -6px 0; background: var(--line-2); box-shadow: 0 8px 12px -6px rgba(60,40,10,.25); }
.night .pair .book::after { background: var(--n-line); box-shadow: none; }
.shelf li { display: flex; flex-direction: column; gap: var(--sp-2); }
.shelf .meta { margin-top: auto; }
.shelf h3 { font: 700 17px / 1.25 var(--font-display); min-height: 2.5em; margin: var(--sp-2) 0 0; }
.shelf h3 a { color: var(--ink); text-decoration: none; }
.shelf h3 a:hover { text-decoration: underline; text-decoration-color: var(--line-2); }
@media (min-width: 640px) { .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-6) var(--sp-4); } }
@media (min-width: 900px) { .shelf { grid-template-columns: repeat(5, minmax(0, 1fr)); } .shelf.-four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 899px) { .shelf.-four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.index-nav { display: grid; gap: var(--sp-4); margin: 0 0 var(--sp-6); }
.index-nav h2 { font: 600 var(--fs-over) var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--sp-2); }
.index-nav ul { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .index-nav { grid-template-columns: repeat(2, 1fr); gap: var(--sp-4) var(--sp-6); } }
@media (max-width: 639px) { .index-nav ul { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; } .index-nav ul::-webkit-scrollbar { display: none; } .index-nav .chip { white-space: nowrap; } }
.orn { display: block; height: 34px; width: auto; }
.orn.-ff { height: 96px; }
.num-img { display: block; height: 64px; width: auto; margin: 0 0 var(--sp-2); }
.stars { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--n-ink); opacity: .5; }
.stars i:nth-child(1) { left: 8%; top: 22%; } .stars i:nth-child(2) { left: 31%; top: 12%; width: 2px; height: 2px; } .stars i:nth-child(3) { left: 57%; top: 18%; }
.stars i:nth-child(4) { left: 78%; top: 8%; width: 2px; height: 2px; } .stars i:nth-child(5) { left: 92%; top: 30%; }
@media (max-width: 899px) { .stars { display: none; } }
.empty { text-align: center; padding: var(--sp-7) 0; color: var(--muted); font: italic 400 var(--fs-lead) var(--font-display); }
.empty .orn { margin: 0 auto var(--sp-3); }

/* ---------- components: text cards, panels, audio ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); margin: 0 0 var(--sp-6); padding: 0; list-style: none; }
.card { padding: var(--sp-5); border-radius: var(--r-field); background: var(--surface); box-shadow: var(--sh-page); display: flex; flex-direction: column; gap: var(--sp-2); }
.card h3 { font-size: 20px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card p { color: var(--ink-2); }
.panel { padding: var(--sp-6); border-radius: var(--r-field); margin: var(--sp-7) 0 0; }
.panel h2 { margin-bottom: var(--sp-3); }
.panel .lead { margin-bottom: var(--sp-5); }
.panel .weekly { display: block; margin-top: var(--sp-4); font-size: var(--fs-small); }
.audio { margin: 0 auto var(--sp-5); max-width: var(--w-read); padding: var(--sp-4); border-radius: var(--r-field); background: var(--surface); box-shadow: var(--sh-page); }
.audio b { display: block; margin-bottom: var(--sp-2); }
.audio audio { width: 100%; }
.cta-book { display: grid; gap: var(--sp-5); align-items: center; padding: var(--sp-6); margin-top: var(--sp-7); border-radius: var(--r-field); background: var(--n-bg); color: var(--n-ink); }
.cta-book .fan { position: relative; height: 150px; width: 210px; margin: 0 auto; }
.cta-book .fan .bk { position: absolute; width: 96px; top: 10px; left: 50%; margin-left: -48px; transform-origin: bottom center; box-shadow: var(--sh-book); }
.cta-book .fan .bk:nth-child(1) { transform: rotate(-9deg) translateX(-38px); } .cta-book .fan .bk:nth-child(3) { transform: rotate(9deg) translateX(38px); } .cta-book .fan .bk:nth-child(2) { z-index: 2; transform: translateY(-6px); }
.cta-book h2 { font-size: var(--fs-h3); margin: 0 0 var(--sp-2); color: var(--n-ink); }
.cta-book p { margin: 0 0 var(--sp-4); color: var(--n-muted); }
@media (min-width: 640px) { .cta-book { grid-template-columns: 220px 1fr; } }

/* ---------- page: home ---------- */
.hero { position: relative; padding: var(--sec) 0; overflow: hidden; }
.hero .grid { position: relative; z-index: 1; }
.hero .over { margin-bottom: var(--sp-3); }
.hero h1 { font-size: var(--fs-display); line-height: 1.05; margin-bottom: var(--sp-4); }
.hero .lead { margin-bottom: var(--sp-5); }
.hero form { display: grid; gap: var(--sp-3); max-width: 480px; }
.hero .trust { margin-top: var(--sp-2); }
.hero .book-live { width: min(64vw, 250px); margin: 0 auto; }
.hero .cap { text-align: center; margin-top: var(--sp-5); }
@media (min-width: 900px) { .hero .grid { grid-template-columns: 7fr 5fr; align-items: start; } .hero .book-live { width: 340px; margin: 0; justify-self: end; } }
@media (max-width: 899px) { .hero { padding-top: var(--sp-7); } }
.chapters { display: grid; gap: var(--sp-6); }
.chapters h3 { margin: 0 0 var(--sp-2); }
.chapters p { font: 400 var(--fs-lead) / 1.55 var(--font-read); color: var(--ink-2); }
@media (min-width: 640px) { .chapters { grid-template-columns: repeat(3, 1fr); } }
.pair-sec { display: grid; gap: var(--sp-6); align-items: center; }
.pair-sec .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); width: 100%; max-width: 460px; margin: 0 auto; }
.pair-sec .txt > * + * { margin-top: var(--sp-3); }
.pair-sec .txt .over { margin-bottom: var(--sp-3); }
.pair-sec .txt p:not(.over) { font: 400 var(--fs-lead) / 1.6 var(--font-read); color: var(--ink-2); max-width: 60ch; }
@media (min-width: 900px) { .pair-sec { grid-template-columns: 5fr 7fr; gap: var(--sp-8); } .pair-sec .pair { margin: 0; } }
.book12 { position: relative; overflow: hidden; }
.book12 .grid { align-items: center; position: relative; z-index: 1; }
.book12 .fan6 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); width: 100%; max-width: 520px; margin: 0 auto; }
@media (max-width: 639px) { .book12 .fan6 .bk:nth-child(n+5) { display: none; } }
@media (min-width: 640px) { .book12 .fan6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.book12 .txt .over { margin-bottom: var(--sp-3); }
.book12 h2 { margin-bottom: var(--sp-5); }
.book12 ul { margin: 0 0 var(--sp-5); padding: 0; list-style: none; display: grid; gap: var(--sp-3); }
.book12 li { padding-left: 20px; position: relative; font: 400 var(--fs-lead) / 1.5 var(--font-read); color: rgba(243,236,220,.9); }
.book12 li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--n-muted); }
.book12 .price { font: 700 var(--fs-h2) var(--font-display); color: var(--n-ink); margin: 0 0 var(--sp-4); }
.book12 .price small { font: 500 15px var(--font-ui); color: var(--n-muted); margin-left: 10px; }
.book12 .ded { font: 700 22px / 1.3 var(--font-name); color: rgba(243,236,220,.85); margin-top: var(--sp-5); }
@media (min-width: 900px) { .book12 .grid { grid-template-columns: 6fr 6fr; } }
.faq { max-width: var(--w-text); margin: 0 auto; }
.faq details { border-top: 1px solid var(--line); padding: var(--sp-4) 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; font: 700 var(--fs-h3) var(--font-display); color: var(--ink); display: flex; gap: 14px; align-items: baseline; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; font: 700 24px / 1 var(--font-display); color: var(--muted); }
.faq details[open] summary::before { color: var(--ink); }
.faq p { margin: var(--sp-3) 0 0 38px; font: 400 var(--fs-lead) / 1.6 var(--font-read); color: var(--ink-2); }
.hero.soon .row { margin-bottom: var(--sp-4); }

/* ---------- page: library index / hub ---------- */
.lib-head { padding: var(--sp-6) 0 var(--sp-5); }
.lib-head h1 { margin-bottom: var(--sp-3); }
.lib-head .small { margin-top: var(--sp-3); }
.shelf-head { display: flex; gap: 10px; align-items: center; margin: var(--sp-7) 0 var(--sp-4); font: 600 var(--fs-over) var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.shelf-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- page: the story ---------- */
.title-page { display: grid; gap: var(--sp-5); padding: var(--sp-5) 0 var(--sp-6); }
.title-page .book { width: min(100%, 300px); margin: 0 auto; }
.title-page h1 { margin-bottom: var(--sp-3); }
.title-page .for { font: 700 22px / 1.2 var(--font-name); color: var(--ink-2); min-height: 1.5em; margin-bottom: var(--sp-3); }
.title-page .for .nm { font-size: 1em; }
.title-page .meta { margin-bottom: var(--sp-4); }
.title-page .hubs { margin-bottom: var(--sp-5); }
@media (min-width: 900px) { .title-page { grid-template-columns: 5fr 7fr; gap: var(--sp-8); align-items: start; } .title-page .book { width: 100%; max-width: 340px; margin: 0; } }
.tale-head { max-width: var(--w-read); margin: 0 auto; padding: var(--sp-5) 0 var(--sp-6); }
.tale-head h1 { margin-bottom: var(--sp-3); }
.tale-head .meta, .tale-head .tags, .tale-head .hubs { margin-bottom: var(--sp-4); }
.name-sheet { margin-top: var(--sp-5); padding: var(--sp-5); border-radius: var(--r-field); background: var(--surface); box-shadow: var(--sh-page); }
.name-sheet h2 { font-size: var(--fs-h3); margin-bottom: var(--sp-3); }
.name-sheet form { display: grid; gap: var(--sp-3); }
.name-sheet .small { margin-top: var(--sp-1); }
.read { position: relative; max-width: calc(var(--w-read) + 2 * var(--sp-7)); margin: 0 auto; padding: 0 var(--sp-7) var(--sp-7); background: var(--surface); border-radius: var(--r-page); box-shadow: var(--sh-page); }
.read .cnr { position: absolute; width: 96px; height: auto; left: -26px; top: -22px; z-index: 6; pointer-events: none; }
.rh { position: sticky; top: 64px; z-index: 5; background: var(--surface); display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); margin-bottom: var(--sp-5); }
.rh img { height: 26px; width: auto; }
.rh .t { font: 600 var(--fs-over) var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh .n { font: 700 18px var(--font-name); color: var(--name); margin-left: auto; white-space: nowrap; }
.rh button { flex: 0 0 auto; border: 0; background: transparent; color: var(--ink-2); font: 600 13px var(--font-ui); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: var(--ctl-xs); padding: 0 10px; border-radius: var(--r-chip); }
.rh button:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 899px) { .rh { top: 56px; } .rh .t { display: none; } .rh button { min-height: var(--ctl-s); } .read { padding: 0 var(--sp-4) var(--sp-6); } .read .cnr { display: none; } }
.story { font: 400 var(--fs-read) / 1.75 var(--font-read); color: var(--ink); hyphens: auto; }
.story p { margin: 0 0 1.05em; }
.story p:first-child::first-letter { float: left; font-size: 3.3em; line-height: .9; padding: .06em .08em 0 0; color: var(--ink); font-family: var(--font-display); }
.credit { font: 400 var(--fs-small) / 1.5 var(--font-ui); color: var(--muted); max-width: var(--w-read); margin: var(--sp-4) auto 0; text-align: center; }
.goodnight { text-align: center; margin: var(--sp-7) 0 0; position: relative; }
.goodnight img { height: 96px; width: auto; display: block; margin: 0 auto var(--sp-2); transition: filter 1200ms ease-in, opacity 1200ms ease-in; }
.goodnight.-off img { filter: saturate(.6) brightness(.85); opacity: .8; }
.goodnight p { font: 700 30px / 1.2 var(--font-name); color: var(--ink); }
.more { padding: var(--sp-6) 0 0; max-width: 900px; margin: 0 auto; }
.more .shelf-head { margin-top: 0; }
.series-nav { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; max-width: var(--w-read); margin: var(--sp-6) auto 0; }
.also { max-width: var(--w-read); margin: var(--sp-5) auto 0; }
.also a { margin-right: 10px; }
.more-box { max-width: var(--w-read); margin: var(--sp-5) auto; padding: var(--sp-5); border: 1px dashed var(--line-2); border-radius: var(--r-field); text-align: center; }
.more-box p { margin: 0 0 var(--sp-4); font: 400 var(--fs-lead) / 1.5 var(--font-read); }
[data-theme=night] body { background: var(--r-bg); color: var(--r-ink); }
[data-theme=night] .read, [data-theme=night] .rh, [data-theme=night] .name-sheet, [data-theme=night] .card, [data-theme=night] .audio { background: var(--n-surface-2); box-shadow: none; }
[data-theme=night] .rh { border-bottom-color: var(--n-line); }
[data-theme=night] .rh .n { color: var(--n-name); } [data-theme=night] .rh button { color: var(--n-muted); }
[data-theme=night] .story, [data-theme=night] .story p:first-child::first-letter, [data-theme=night] h1, [data-theme=night] h2, [data-theme=night] h3, [data-theme=night] .shelf h3 a, [data-theme=night] .goodnight p, [data-theme=night] .card h3 a { color: var(--r-ink); }
[data-theme=night] .lead, [data-theme=night] .credit, [data-theme=night] .meta, [data-theme=night] .small, [data-theme=night] .card p, [data-theme=night] .crumbs a { color: var(--n-muted); }
[data-theme=night] .title-page .for { color: var(--n-name); }
[data-theme=night] .field input { background: var(--n-surface); color: var(--n-ink); box-shadow: inset 0 0 0 1px var(--n-line); }
[data-theme=night] .chip { background: var(--n-surface); color: var(--n-ink); box-shadow: inset 0 0 0 1px var(--n-line); }
[data-theme=night] .shelf::after { background: var(--n-line); }

/* ---------- page: book builder ---------- */
.bb-head { display: grid; gap: var(--sp-5); padding: var(--sp-5) 0 var(--sp-6); }
.bb-head h1 { margin-bottom: var(--sp-3); }
.bb-head form { display: grid; gap: var(--sp-3); max-width: 480px; margin-top: var(--sp-5); }
.bb-head .book { width: min(60vw, 240px); margin: 0 auto; }
@media (min-width: 900px) { .bb-head { grid-template-columns: 7fr 5fr; align-items: start; } .bb-head .book { width: 280px; margin: 0; justify-self: end; } }
.spread { position: relative; padding: var(--sp-5) var(--sp-5) var(--sp-6); background: var(--surface); border-radius: var(--r-page); box-shadow: var(--sh-page); }
.spread::before { content: ""; position: absolute; top: 64px; bottom: 60px; left: 50%; width: 1px; background: rgba(28,34,66,.10); box-shadow: 0 0 40px 18px rgba(28,34,66,.05); }
@media (max-width: 639px) { .spread::before { display: none; } .spread { padding: var(--sp-4) var(--sp-4) var(--sp-5); } }
.spread .shelf-head { margin: 0 0 var(--sp-4); }
.picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-3); list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px) { .picks { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .picks { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-4); } }
.picks li { display: flex; flex-direction: column; gap: var(--sp-2); }
.picks .bk.slot { background: var(--surface-2); box-shadow: none; border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); font: italic 400 14px var(--font-display); }
.picks .bk.slot::before, .picks .bk.slot::after { display: none; }
.picks h4 { margin: 0; font: 700 14px / 1.3 var(--font-display); color: var(--ink); text-align: center; min-height: 3.9em; }
.picks .tag { text-align: center; }
.picks .swap { align-self: center; margin-top: auto; min-height: var(--ctl-s); padding: 0 12px; border: 0; background: transparent; color: var(--ink-2); font: 500 13px var(--font-ui); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.picks .swap:hover { color: var(--ink); text-decoration-color: var(--ink); }
.soon-note { margin-top: var(--sp-4); position: relative; z-index: 1; }
.checkout { display: grid; gap: var(--sp-6); margin-top: var(--sp-7); }
@media (min-width: 900px) { .checkout { grid-template-columns: 1fr 380px; align-items: start; } }
.ded-sheet { padding: var(--sp-5); background: var(--surface); border-radius: var(--r-page); box-shadow: var(--sh-page); position: relative; }
.ded-sheet .cnr { position: absolute; width: 80px; left: -18px; top: -16px; pointer-events: none; }
@media (max-width: 639px) { .ded-sheet .cnr, .read .cnr { display: none; } }
.ded-sheet h2 { font-size: var(--fs-h3); margin-bottom: var(--sp-3); }
textarea.ded { width: 100%; min-height: 84px; padding: 0 4px; border: 0; background: repeating-linear-gradient(transparent 0 37px, var(--line-2) 37px 38px); background-position: 0 -4px; font: 700 26px / 38px var(--font-name); color: var(--ink); resize: none; outline: none; display: block; }
textarea.ded::placeholder { color: rgba(28,34,66,.35); }
textarea.ded:focus { box-shadow: none; }
.ded-note { display: flex; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-2); }
.ded-note span:last-child { white-space: nowrap; }
.receipt { padding: var(--sp-5); background: var(--surface); border-radius: var(--r-page); box-shadow: var(--sh-page); font-family: var(--font-read); }
.receipt h2 { font-size: var(--fs-h3); margin-bottom: var(--sp-3); }
.receipt .line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dotted var(--line-2); font-size: 15px; }
.receipt .line span:last-child { color: var(--muted); }
.receipt .total { display: flex; justify-content: space-between; align-items: baseline; padding: var(--sp-4) 0 0; }
.receipt .total b { font: 700 32px var(--font-display); color: var(--ink); }
.receipt .total small { color: var(--muted); font: 500 12px var(--font-ui); margin-left: 8px; }
.receipt .field { margin: var(--sp-5) 0 var(--sp-4); }
.receipt .btn { width: 100%; }
.receipt .note { margin-top: var(--sp-3); }
.receipt .note .nm { font-size: 1.1em; }
.receipt .status { display: block; min-height: 20px; margin-top: var(--sp-3); font: 600 var(--fs-small) var(--font-ui); color: var(--success); }
.receipt .status.err { color: var(--error); }
dialog.swapper { border: 0; border-radius: var(--r-field); padding: var(--sp-5); max-width: min(92vw, 720px); width: 100%; box-shadow: var(--sh-lift); background: var(--surface); color: var(--ink); }
dialog.swapper::backdrop { background: rgba(21,27,51,.6); }
dialog.swapper h3 { margin: 0 0 var(--sp-4); }
dialog.swapper ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-3); list-style: none; margin: 0; padding: 0; }
dialog.swapper .pick { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: center; font: 700 13px / 1.3 var(--font-display); color: var(--ink); }
dialog.swapper .pick .bk { margin-bottom: 6px; }
dialog.swapper .close { margin-top: var(--sp-4); }

/* ---------- page: documents ---------- */
.doc-nav { max-width: var(--w-text); margin: var(--sp-4) auto var(--sp-6); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.doc-nav .chip { white-space: nowrap; }
.doc { max-width: var(--w-text); margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-7); background: var(--surface); border-radius: var(--r-page); box-shadow: var(--sh-page); font: 400 var(--fs-body) / 1.6 var(--font-ui); color: var(--ink); }
.doc h1 { margin-bottom: var(--sp-5); }
.doc h2 { font-size: var(--fs-h3); margin: var(--sp-6) 0 var(--sp-3); }
.doc h3 { font-size: 18px; margin: var(--sp-5) 0 var(--sp-2); }
.doc p, .doc li { margin: 0 0 var(--sp-3); }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 var(--sp-3); }
.doc table { border-collapse: collapse; width: 100%; font-size: var(--fs-small); margin: 0 0 var(--sp-4); }
.doc td, .doc th { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc .meta { color: var(--muted); font-size: var(--fs-small); }
@media (max-width: 639px) { .doc { padding: var(--sp-5) var(--sp-4) var(--sp-6); } }
@media print { .hdr, .foot, .cta-book, .panel, .audio, .crumbs, .series-nav, .rh button, .name-sheet, .more-box, .more, .cnr { display: none !important; } .story { font-size: 14pt; } .read { box-shadow: none; } }
