/* =================================================================
   The book (index.html). Builds on app.css tokens and form styles.
   Direction: design/MASTER.md. One ink per chapter, set as --ch on the root:
   registered as a colour so the whole page glides from one ink to the next.
   ================================================================= */
@property --ch { syntax: '<color>'; inherits: true; initial-value: #5b2eff; }
:root {
  --ch: #5b2eff; --ch-on: #ffffff; --sheet: #ffffff; --spine: rgba(40, 20, 110, .13); --turn: 600ms;
  --ch-ui: color-mix(in srgb, var(--ch) 55%, var(--ink));
  transition: --ch 600ms var(--ease);
}
[data-theme="dark"] { --sheet: #19143a; --spine: rgba(0, 0, 0, .5); --ch-ui: color-mix(in srgb, var(--ch) 70%, #fff); }
body.book-body {
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  background:
    radial-gradient(1100px 620px at 100% -8%, color-mix(in srgb, var(--ch) 30%, transparent), transparent 62%),
    radial-gradient(900px 520px at -8% 108%, color-mix(in srgb, var(--pop) 16%, transparent), transparent 62%),
    color-mix(in srgb, var(--ch) 8%, var(--paper));
  background-attachment: fixed;
}
.ch-ink { color: var(--ch-ui); }
.chapter, .toc__item { --ch-ui: color-mix(in srgb, var(--ch) 55%, var(--ink)); }
[data-theme="dark"] .chapter, [data-theme="dark"] .toc__item { --ch-ui: color-mix(in srgb, var(--ch) 70%, #fff); }

.screen { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }
.btn--lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 10px; }
.btn--ch { background: var(--ch); border-color: var(--ch); color: var(--ch-on); font-weight: 700; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--ch) 80%, transparent); }
.btn--ch:hover { background: color-mix(in srgb, var(--ch) 86%, var(--ink)); border-color: color-mix(in srgb, var(--ch) 86%, var(--ink)); }
mark.hl { position: relative; isolation: isolate; background: none; color: inherit; padding: 0 .06em; }
mark.hl::before { content: ''; position: absolute; z-index: -1; inset: .16em -.1em .02em; border-radius: .18em; background: var(--sun); transform: skewX(-8deg) scaleX(var(--hl, 1)); transform-origin: left center; }

/* ---------- 3D scene (welcome only; js/scene.js) ---------- */
.scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 600ms var(--ease); }
.scene.is-on { opacity: 1; }
.scene.is-leaving { z-index: 50; }
.scene canvas { display: block; width: 100%; height: 100%; }
.welcome.is-3d .welcome__art svg { opacity: 0; transition: opacity 400ms var(--ease); }

/* ---------- Welcome + intro ---------- */
.welcome {
  min-height: 100vh; min-height: 100dvh; max-width: 1240px; margin: 0 auto; padding: 48px 32px;
  display: grid; grid-template-columns: minmax(240px, 0.9fr) 1.1fr; align-items: center; gap: clamp(32px, 6vw, 96px);
}
.welcome__art { justify-self: center; width: min(100%, 340px); aspect-ratio: 230 / 320; }
.welcome__art svg { display: block; width: 100%; height: auto; overflow: visible; }
.welcome__art .sheet { fill: var(--sheet); stroke: var(--rule-strong); stroke-width: 1; }
.welcome__art .ln { stroke: var(--ink); stroke-linecap: round; fill: none; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: .78; }
.welcome__art .ln--soft { opacity: .28; }
.welcome__art .ink { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; fill: none; stroke-dasharray: 1; }
.welcome__art .sheet-wrap { filter: drop-shadow(0 18px 26px rgba(64, 30, 170, .25)); }
.welcome__brand { font-family: var(--f-display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.welcome__brand em { font-style: normal; color: var(--accent); }
.welcome__title { font-family: var(--f-display); font-weight: 800; font-size: clamp(56px, 8.2vw, 124px); line-height: .92; letter-spacing: -.045em; margin: 14px 0 22px; }
.welcome__title span { display: inline-block; }
.welcome__title span:last-child { color: var(--accent); }
.welcome__lead { font-size: 18px; color: var(--muted); max-width: 36ch; line-height: 1.55; }
.welcome__q { font-family: var(--f-display); font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; letter-spacing: -.02em; margin-top: 34px; }
.welcome__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.welcome__wait { min-height: 24px; margin-top: 14px; color: var(--ink); font-weight: 600; font-size: 15px; }
.skip-intro { position: fixed; right: 20px; bottom: 20px; z-index: 30; }

/* ---------- Choice ---------- */
.doc-choice { max-width: 1000px; margin: 0 auto; padding: 72px 24px 48px; }
.doc-choice__eyebrow { display: inline-block; font-family: var(--f-display); font-weight: 700; font-size: 15px; padding: 4px 12px; border-radius: 99px; background: var(--sun); color: #17123b; }
.doc-choice__title { font-family: var(--f-display); font-size: clamp(36px, 5.4vw, 60px); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; margin: 14px 0 34px; outline: none; }
.doc-choice__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.doc-card {
  --ch: #5b2eff; --ch-on: #fff; display: grid; grid-template-columns: 100px 1fr; gap: 22px; align-items: center; text-align: left;
  padding: 26px; border: 1.5px solid var(--rule-strong); border-radius: 16px; background: var(--sheet);
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.doc-card:hover { border-color: var(--ch); transform: translateY(-3px); box-shadow: 0 22px 40px -22px color-mix(in srgb, var(--ch) 75%, transparent); }
.doc-card--letter { --ch: #d9338a; }
.doc-card__sheet { aspect-ratio: 210 / 297; border: 1px solid var(--rule); background: #fff; border-radius: 3px; padding: 0 12% 12%; display: grid; align-content: start; gap: 7%; box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--ch) 60%, transparent); overflow: hidden; transform: rotate(-3deg); transition: transform var(--t) var(--ease); }
.doc-card:hover .doc-card__sheet { transform: rotate(0); }
.doc-card__sheet i { display: block; height: 4px; border-radius: 2px; background: #ddd8ee; }
.doc-card__sheet i:first-child { height: 26px; width: auto; margin: 0 -14% 4px; border-radius: 0; background: var(--ch); }
.doc-card__sheet i:nth-child(2) { width: 58%; height: 6px; background: #17123b; }
.doc-card__sheet i:nth-child(3n) { width: 70%; }
.doc-card__name { font-family: var(--f-display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.doc-card__desc { color: var(--muted); font-size: 15px; margin-top: 4px; }
.doc-card__resume { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--ch-ui); }
.doc-choice__more { margin-top: 28px; font-size: 14px; color: var(--muted); }
.doc-choice__more a { color: var(--accent); font-weight: 700; }

/* ---------- Book chrome ---------- */
.book-bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--ch) 8%, var(--paper)); border-bottom: 1px solid color-mix(in srgb, var(--ch) 18%, var(--rule)); }
.book-bar__inner { max-width: 1560px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 16px; }
.book-bar__brand { font-family: var(--f-display); font-size: 20px; font-weight: 800; letter-spacing: -.02em; background: none; border: 0; padding: 0; }
.book-bar__brand em { font-style: normal; color: var(--accent); }
.book-bar__progress { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.book-bar__track { flex: 0 1 240px; height: 6px; background: color-mix(in srgb, var(--ch) 16%, var(--surface-2)); border-radius: 99px; overflow: hidden; }
.book-bar__fill { height: 100%; width: 100%; border-radius: 99px; background: var(--ch); transform-origin: left; transform: scaleX(0); transition: transform 500ms cubic-bezier(.34, 1.4, .5, 1); }
.book-bar__actions { display: flex; align-items: center; gap: 4px; }
.book-bar a.btn { text-decoration: none; }

.book { max-width: 1560px; margin: 0 auto; padding: 22px 20px 40px; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; align-items: start; }
.toc { position: sticky; top: 80px; display: grid; gap: 2px; }
.toc__title { font-family: var(--f-display); font-size: 17px; font-weight: 800; letter-spacing: -.01em; padding: 0 10px 8px; }
.toc__item {
  display: grid; grid-template-columns: 26px 1fr 18px; align-items: center; gap: 8px; text-align: left; width: 100%;
  padding: 6px 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 14px;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
.toc__item:hover { background: color-mix(in srgb, var(--ch) 12%, transparent); color: var(--ink); }
.toc__item[aria-current="step"] { color: var(--ink); font-weight: 700; background: var(--sheet); box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--ch) 80%, transparent); }
.toc__n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); background: color-mix(in srgb, var(--ch) 22%, transparent); transition: background-color var(--t) var(--ease), color var(--t) var(--ease); }
.toc__item[aria-current="step"] .toc__n { background: var(--ch); color: var(--ch-on); }
.toc__done { position: relative; display: grid; place-items: center; color: var(--success); }
.toc__done svg.i { width: 16px; height: 16px; stroke-width: 2.6; }
.toc__ring { position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--mint); pointer-events: none; }

/* The open book: form on the left page, live document on the right page. */
.spread {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch;
  background: var(--sheet); border-radius: 16px 16px 10px 10px; min-height: calc(100vh - 124px); min-height: calc(100dvh - 124px);
  box-shadow: 0 1px 0 var(--rule-strong), 0 3px 0 -1px var(--sheet), 0 4px 0 -1px var(--rule-strong), 0 6px 0 -2px var(--sheet), 0 7px 0 -2px var(--rule-strong),
    0 34px 60px -32px color-mix(in srgb, var(--ch) 70%, transparent);
}
.spread::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 46px; transform: translateX(-50%); pointer-events: none; background: linear-gradient(90deg, transparent, var(--spine) 48%, var(--spine) 52%, transparent); }
.page { position: relative; min-width: 0; }
.page__inner { position: relative; height: calc(100vh - 124px); height: calc(100dvh - 124px); overflow-y: auto; container-type: inline-size; border-radius: 16px 0 0 10px; }
.page--right { border-left: 1px solid var(--rule); display: flex; flex-direction: column; height: calc(100vh - 124px); height: calc(100dvh - 124px); }
.page__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 26px 10px 34px; font-size: 13px; color: var(--muted); }
.page__head strong { font-family: var(--f-display); font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.page__stage { flex: 1; overflow: auto; padding: 6px 26px 30px 34px; }
.page__stage .preview__sizer { margin: 0 auto; }
#docPreview { box-shadow: 0 1px 3px rgba(23, 18, 59, .12), 0 18px 36px -18px color-mix(in srgb, var(--ch) 60%, rgba(23, 18, 59, .5)); }
.page-break { left: -10px; right: -10px; }
.flash { position: absolute; z-index: 3; pointer-events: none; border-radius: 4px; background: color-mix(in srgb, var(--ch) 18%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ch) 75%, transparent); }

/* The page that turns: a copy cut into hinged vertical strips, so it bends instead of pivoting flat. */
.turn { position: absolute; left: 0; right: 0; z-index: 5; pointer-events: none; perspective: 2400px; }
.turn--under { z-index: 4; background: var(--sheet); overflow: hidden; }
.turn__hinge { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; transform-origin: left center; }
.turn__face { position: absolute; inset: 0; overflow: hidden; background: var(--sheet); backface-visibility: hidden; }
.turn__face::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(23, 18, 59, 0), rgba(23, 18, 59, .2)); opacity: var(--shade, 0); }
.turn__content { position: absolute; top: 0; }

/* ---------- Chapter page ---------- */
.chapter { position: relative; padding: 0 34px 34px 38px; }
.chapter__band { height: 10px; margin: 0 -34px 0 -38px; background: var(--ch); }
.chapter__num { display: inline-flex; margin-top: 26px; padding: 4px 12px; border-radius: 99px; font-family: var(--f-display); font-size: 13px; font-weight: 800; letter-spacing: .01em; background: var(--ch); color: var(--ch-on); }
.chapter__title { font-family: var(--f-display); font-size: clamp(32px, 3.6vw, 48px); font-weight: 800; letter-spacing: -.035em; line-height: 1.04; margin-top: 12px; outline: none; }
.chapter__title .w { display: inline-block; white-space: nowrap; }
.chapter__title .c { display: inline-block; }
.chapter__lead { margin-top: 10px; color: var(--muted); font-size: 16px; max-width: 56ch; }
.chapter__grid { display: grid; gap: 18px; margin-top: 24px; }
@container (min-width: 760px) { .chapter__grid { grid-template-columns: minmax(0, 1fr) 250px; align-items: start; } .chapter__guide { grid-column: 2; grid-row: 1; position: sticky; top: 16px; } .chapter__form { grid-column: 1; grid-row: 1; } }
.chapter__form { display: grid; gap: 16px; min-width: 0; }
.chapter__guide .guide { border: 0; border-radius: 12px; border-left: 4px solid var(--ch); background: color-mix(in srgb, var(--ch) 9%, var(--sheet)); }
.chapter__guide .guide > summary { color: var(--ch-ui); }
.chapter__nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--rule); }
.chapter__nav .spacer { flex: 1; }
.chapter .item { background: color-mix(in srgb, var(--ch) 4%, var(--paper)); border-radius: 12px; }
.chapter .add-btn { justify-self: start; }
.chapter input:focus-visible, .chapter textarea:focus-visible, .chapter select:focus-visible { border-color: var(--ch); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ch) 28%, transparent); }
.chapter .field label { display: inline-flex; align-items: center; gap: 6px; }
.field__ok { display: none; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--mint); color: #0b3a2c; }
.field__ok svg.i { width: 11px; height: 11px; stroke-width: 3.2; }
.field.is-filled .field__ok { display: inline-grid; }
.subcard { border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); }
.subcard > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; font-weight: 700; }
.subcard > summary::-webkit-details-marker { display: none; }
.subcard > summary span { font-weight: 400; color: var(--muted); font-size: 13px; }
.subcard__body { padding: 0 14px 14px; display: grid; gap: 12px; }
.suggest-chips .verbs button:hover, .chapter .suggest button:hover { border-color: var(--ch); background: color-mix(in srgb, var(--ch) 12%, var(--surface)); }

/* Photo chapter */
.photo-drop { display: grid; justify-items: center; gap: 14px; padding: 30px 18px; border: 2px dashed color-mix(in srgb, var(--ch) 45%, var(--rule-strong)); border-radius: 16px; text-align: center; background: color-mix(in srgb, var(--ch) 6%, var(--paper)); }
.photo-drop__frame { width: 150px; height: 150px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--ch) 16%, var(--surface)); color: var(--ch-ui); border: 5px solid var(--sheet); box-shadow: 0 0 0 2px var(--ch); }
.photo-drop__frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-drop__frame svg.i { width: 44px; height: 44px; stroke-width: 1.4; }
.photo-drop__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* Final chapter */
.done-hero { display: grid; gap: 14px; padding: 24px; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--ch) 14%, var(--sheet)), color-mix(in srgb, var(--pop) 12%, var(--sheet))); border: 1.5px solid color-mix(in srgb, var(--ch) 30%, var(--rule)); }
.done-hero strong { font-family: var(--f-display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.done-hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.done-hero .help { font-size: 13px; }
.fixes { display: grid; gap: 8px; }
.fix { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); font-size: 14px; }
.photo-later { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px; border: 2px dashed var(--rule-strong); border-radius: 12px; }
.more-links { display: flex; gap: 10px; flex-wrap: wrap; }
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: 0; left: 0; width: 9px; height: 14px; border-radius: 2px; }

/* Finishing chapter */
.finish-row { display: grid; gap: 10px; }
.finish-row .label { font-weight: 700; color: var(--ink); font-size: 14px; }
.fit-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.chapter .segmented button[aria-pressed="true"] { background: var(--ch); color: var(--ch-on); }
.chapter .choice[aria-pressed="true"] { border-color: var(--ch); background: color-mix(in srgb, var(--ch) 12%, var(--surface)); }

/* ---------- Matchbox template picker (CSS 3D) ---------- */
.mbx { position: relative; isolation: isolate; z-index: 0; outline: none; border-radius: 10px; background: color-mix(in srgb, var(--ch) 16%, var(--paper)); overflow: hidden; touch-action: pan-y; user-select: none; }
.mbx:focus-visible { box-shadow: 0 0 0 3px var(--ring); }
.mbx__stage { position: relative; height: var(--stage-h, 420px); perspective: 1500px; perspective-origin: 50% 10%; }
.mbx__table { position: absolute; left: 50%; top: 26px; width: 0; height: 0; transform-style: preserve-3d; transform: rotateX(24deg); }
.mbx__box {
  position: absolute; left: 0; top: 0; width: var(--bw); height: var(--bh); transform-style: preserve-3d;
  transition: transform 380ms cubic-bezier(.45, 0, .25, 1), opacity 300ms ease; cursor: pointer;
}
.mbx__box.is-jump { transition: none; }
.mbx__box.is-active { cursor: default; }
.mbx__shadow { position: absolute; inset: 4% -4% -6% -4%; border-radius: 6px; background: rgba(48, 32, 18, .3); filter: blur(12px); transform: translateZ(0); transition: inset 420ms ease; }
.mbx__box.is-open .mbx__shadow { inset: 4% -4% calc(-6% - var(--out)) -4%; }
.mbx__tray { position: absolute; inset: 3%; transform: translateZ(2px); transition: transform 220ms cubic-bezier(.4, 0, 1, 1); background: #efe7d8; border-radius: 2px; box-shadow: inset 0 0 0 3px #e3d8c4, inset 0 10px 14px -10px rgba(60, 40, 20, .45); }
.mbx__box.is-open .mbx__tray { transform: translateZ(2px) translateY(var(--out)); transition: transform 420ms cubic-bezier(.2, .7, .2, 1); }
.mbx__pic { position: absolute; inset: 5%; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(60, 40, 20, .25); }
.mbx__page { position: absolute; top: 0; left: 0; width: 210mm; transform-origin: top left; pointer-events: none; }
.mbx__sleeve {
  position: absolute; inset: 0; transform: translateZ(14px); border-radius: 3px; padding: 10%; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tint) 88%, #fff), var(--tint) 45%, color-mix(in srgb, var(--tint) 90%, #000));
  color: var(--ink-on); display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px rgba(0, 0, 0, .08);
}
.mbx__sleeve::before { content: ''; position: absolute; inset: 5%; border: 1px solid currentColor; opacity: .35; border-radius: 2px; }
.mbx__sleeve::after { content: ''; position: absolute; right: 0; top: 8%; bottom: 8%; width: 6%; background: #5a4232; background-image: radial-gradient(rgba(255, 255, 255, .2) .6px, transparent .8px); background-size: 3px 3px; opacity: .9; }
.mbx__top { position: relative; display: flex; justify-content: space-between; align-items: center; font-size: calc(var(--bw) * .055); letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.mbx__mark { width: calc(var(--bw) * .17); height: calc(var(--bw) * .17); border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; font-family: var(--f-display); letter-spacing: 0; font-size: calc(var(--bw) * .08); }
.mbx__name { position: relative; font-family: var(--f-display); font-weight: 800; line-height: 1; letter-spacing: -.01em; font-size: calc(var(--bw) * .15); }
.mbx__detail { position: relative; font-size: calc(var(--bw) * .058); opacity: .8; line-height: 1.3; }
.mbx__controls { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 0 16px; }
.mbx__count { font-size: 13px; font-variant-numeric: tabular-nums; margin-right: 6px; }
.mbx__btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--ink); background: transparent; display: grid; place-items: center; opacity: .8; transition: opacity var(--t) var(--ease), background-color var(--t) var(--ease); }
.mbx__btn:hover { opacity: 1; background: var(--sheet); }
.mbx__btn svg.i { width: 16px; height: 16px; }
.mbx-info { display: grid; gap: 4px; }
.mbx-info strong { font-family: var(--f-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.mbx-info span { color: var(--muted); font-size: 14px; }

/* ---------- Mobile: one page at a time, the document opens on demand ---------- */
.peek-btn, .toc-btn, .peek-close { display: none; }
@media (max-width: 1100px) {
  .book { grid-template-columns: 1fr; padding: 12px 12px 90px; }
  .toc { display: none; }
  body.toc-open .toc { display: grid; position: fixed; inset: 58px 0 0 0; z-index: 25; background: var(--paper); padding: 16px; overflow-y: auto; align-content: start; }
  .toc-btn { display: inline-flex; }
  .spread { grid-template-columns: 1fr; min-height: 0; }
  .spread::after { display: none; }
  .page__inner { height: auto; min-height: calc(100dvh - 160px); overflow: visible; }
  .page--right { display: none; }
  body.peek .page--right { display: flex; position: fixed; inset: 0; z-index: 40; background: var(--paper); height: 100dvh; border: 0; }
  .peek-btn { display: inline-flex; position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .45); }
  .peek-close { display: inline-flex; }
  .chapter { padding: 0 18px 24px; }
  .chapter__band { margin: 0 -18px; }
  .page__head, .page__stage { padding-left: 16px; padding-right: 16px; }
  .book-bar__track { display: none; }
}
@media (max-width: 760px) {
  .welcome { grid-template-columns: 1fr; padding: 32px 20px; gap: 18px; align-content: center; }
  .welcome__art { justify-self: start; width: 150px; }
  .welcome.is-3d .welcome__art { width: 100%; height: 30vh; aspect-ratio: auto; }
  .doc-choice { padding-top: 40px; }
  .doc-choice__grid { grid-template-columns: 1fr; }
  .doc-card { grid-template-columns: 70px 1fr; padding: 18px; }
  .book-bar__brand { font-size: 16px; }
  .book-bar__progress { visibility: hidden; flex: 1 1 0; width: 0; overflow: hidden; }
  .book-bar #saveStatus { display: none; }
  .book-bar__inner { gap: 8px; padding: 0 12px; }
  .book-bar__actions .lbl { display: none; }
  .chapter__nav .btn { flex: 1; }
  .chapter__nav .spacer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mbx__box, .mbx__tray, .mbx__shadow, .book-bar__fill { transition: none !important; }
  :root { transition: none; }
}
