/* Heldenbüchlein – shop design system.
   One warm palette everywhere: cream paper, aubergine ink, "cape red" for actions, sun yellow for highlights,
   teal for trust/info. Display font Fredoka, body Nunito, book text Andika (school-friendly letter shapes). */
:root {
  --ink: #2a2346;
  --ink-soft: #5e5878;
  --cream: #fff8ef;
  --sand: #f7ecdd;
  --paper: #ffffff;
  --line: #ecdfcf;
  --red: #cf4a30;        /* primary action: white text 4.6:1 */
  --red-deep: #b13a23;
  --red-soft: #fde4dc;
  --sun: #ffc247;
  --sun-soft: #fff1cc;
  --teal: #23807b;
  --teal-soft: #dff1ee;
  --shadow: 0 14px 34px rgba(42, 35, 70, .12);
  --shadow-sm: 0 4px 14px rgba(42, 35, 70, .08);
  --radius: 22px;
  --display: "Fredoka", "Baloo 2", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --book: "Andika", "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.6 var(--body); }
img { max-width: 100%; }
a { color: var(--teal); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
.wrap { max-width: 1140px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- test strip (developer controls, deliberately small) ---------- */
.testnote { background: var(--sun-soft); color: var(--ink); font-size: .85rem; text-align: center; padding-block: 7px; border-bottom: 1px solid var(--line); }
.devstrip { background: var(--ink); color: #e9e5f7; font-size: .8rem; }
.devstrip .wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-block: 6px; }
.devstrip select { font: inherit; border-radius: 8px; border: 0; padding: 3px 6px; max-width: 250px; }
.devstrip a { color: #fff; }
.devstrip .sp { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; background: rgba(255,255,255,.12); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #999; }
.dot.on { background: #54d18f; } .dot.off { background: #ff8a7a; }

/* ---------- header ---------- */
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(255, 248, 239, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 20px; padding-block: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.logo svg { width: 40px; height: 40px; flex: none; }
.logo span { font-family: var(--display); font-weight: 600; font-size: 1.45rem; letter-spacing: .005em; }
.logo span b { color: var(--red); font-weight: 600; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem; padding: 8px 12px; border-radius: 12px; }
.nav a:hover { background: var(--sand); }
.nav a[aria-current="page"] { background: var(--sun-soft); }
.menu-btn { display: none; margin-left: auto; border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: 8px 12px; font: 700 .95rem var(--body); color: var(--ink); cursor: pointer; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 800 1rem var(--body); border: 0; border-radius: 16px; padding: 13px 22px; cursor: pointer; background: var(--red); color: #fff; text-decoration: none; box-shadow: 0 6px 0 var(--red-deep); transition: transform .12s, box-shadow .12s, background .12s; }
.btn:hover { background: var(--red-deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--red-deep); }
.btn.sun { background: var(--sun); color: var(--ink); box-shadow: 0 6px 0 #e3a420; }
.btn.sun:hover { background: #ffb726; }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: none; border: 2px solid var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: var(--paper); }
.btn.small { padding: 8px 14px; font-size: .9rem; border-radius: 12px; box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.nav .btn { margin-left: 8px; padding: 10px 18px; box-shadow: 0 4px 0 var(--red-deep); color: #fff; }
.nav .btn:hover { background: var(--red-deep); }

/* ---------- hero ---------- */
.hero { padding-block: 48px 36px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); background: var(--teal-soft); border-radius: 99px; padding: 4px 12px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
.hero h1 em { font-style: normal; color: var(--red); position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .22em; background: var(--sun); border-radius: 99px; z-index: -1; opacity: .8; }
.hero .lead { color: var(--ink-soft); max-width: 48ch; font-size: 1.12rem; margin: 18px 0 24px; }
.hero .ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.trust { display: flex; gap: 10px 20px; flex-wrap: wrap; margin-top: 26px; padding: 0; list-style: none; font-weight: 700; font-size: .92rem; }
.trust li { display: inline-flex; gap: 8px; align-items: center; }
.trust svg { width: 20px; height: 20px; flex: none; color: var(--teal); }
.trust svg.eu { width: 27px; height: 18px; border-radius: 3px; }
.made-eu { display: inline-flex; gap: 7px; align-items: center; }
.made-eu .eu { width: 24px; height: 16px; flex: none; border-radius: 2px; }
/* hero showcase: example books shuffle through, one style at a time (app.js: showcase) */
.showcase { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.stage { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1.36; }
.stage .card { position: absolute; left: 22%; top: 12%; width: 56%; aspect-ratio: 1; border-radius: 6px 14px 14px 6px; overflow: hidden;
  box-shadow: var(--shadow), inset 6px 0 0 rgba(0,0,0,.08); background: var(--sand); cursor: pointer;
  transition: transform .95s cubic-bezier(.2,.75,.25,1), opacity .8s ease; will-change: transform, opacity; }
.stage .card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 9px; background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(255,255,255,.15), rgba(0,0,0,0)); z-index: 1; }
.stage .card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage .card .ttl { position: absolute; left: 7%; right: 7%; top: 6%; background: rgba(255,255,255,.93); border-radius: 12px; padding: 6px 10px; font: 600 clamp(.8rem, 1.7vw, 1.1rem)/1.15 var(--display); color: var(--red); text-align: center; z-index: 2; }
.stage .card[data-pos="0"] { transform: rotate(-2deg); z-index: 3; }
.stage .card[data-pos="1"] { transform: translate(40%, -12%) rotate(7deg) scale(.84); z-index: 2; }
.stage .card[data-pos="2"] { transform: translate(-40%, -2%) rotate(-8deg) scale(.8); z-index: 1; }
.stage .card[data-pos="out"] { transform: translate(-22%, 16%) rotate(-10deg) scale(1.05); opacity: 0; z-index: 4; pointer-events: none; }
.stage .card[data-pos="wait"] { transform: translate(-40%, -2%) rotate(-8deg) scale(.66); opacity: 0; z-index: 0; pointer-events: none; }
.stage .star { position: absolute; color: var(--sun); width: 46px; right: 9%; bottom: 0; z-index: 5; }
.sc-cap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; text-align: center; min-height: 2.4em; }
.sc-cap .sc-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--ink-soft); }
.sc-cap b { font: 600 1.15rem var(--display); background: var(--ink); color: #fff; border-radius: 99px; padding: 4px 14px; }
.sc-cap b.swap { animation: capIn .6s ease; }
.sc-cap a { font-weight: 700; font-size: .92rem; }
@keyframes capIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sc-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.sc-dots button { width: 26px; height: 26px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.sc-dots button::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s; }
.sc-dots button[aria-pressed="true"]::after { background: var(--red); transform: scale(1.35); }
.sc-dots button:hover::after { background: var(--ink-soft); }

/* ---------- sections ---------- */
.section { padding-block: 56px; }
.section.alt { background: var(--sand); }
.section-head { max-width: 680px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; margin: 10px 0 0; }
.center { text-align: center; margin-inline: auto; }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: how; }
.how li { list-style: none; background: var(--paper); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); position: relative; }
.how li::before { counter-increment: how; content: counter(how); font: 600 1.3rem var(--display); width: 42px; height: 42px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; margin-bottom: 12px; }
.how h3 { font-size: 1.25rem; margin-bottom: 6px; }
.how p { margin: 0; color: var(--ink-soft); }
.how { padding: 0; margin: 0; }

.shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.bookcard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; background: none; border: 0; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.bookcard .cv { position: relative; aspect-ratio: 1; border-radius: 6px 14px 14px 6px; overflow: hidden; box-shadow: var(--shadow-sm), inset 6px 0 0 rgba(0,0,0,.08); background: var(--sand); transition: transform .2s, box-shadow .2s; }
.bookcard .cv::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(255,255,255,.15), rgba(0,0,0,0)); z-index: 1; }
.bookcard .cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bookcard .cv .ttl { position: absolute; left: 7%; right: 7%; top: 6%; background: rgba(255,255,255,.93); border-radius: 12px; padding: 6px 10px; font: 600 clamp(.85rem, 1.6vw, 1.05rem)/1.15 var(--display); color: var(--red); text-align: center; z-index: 2; }
.bookcard:hover .cv, .bookcard:focus-visible .cv { transform: translateY(-4px) rotate(-1deg); box-shadow: var(--shadow); }
.bookcard h3 { font-size: 1.08rem; }
.bookcard .sub { font-size: .88rem; color: var(--ink-soft); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; color: var(--ink); }
.tag.wish { background: var(--sun-soft); border-color: #f5dc9a; }
.tag.style { background: var(--teal-soft); border-color: #bfe2dc; }

.prices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.price-card { background: var(--paper); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; position: relative; }
.price-card .size { color: var(--ink-soft); font-size: .9rem; }
.price-card .amount { font: 600 1.9rem var(--display); font-variant-numeric: tabular-nums; margin-top: 4px; }
.price-card .mini-book { background: var(--sand); border-radius: 4px 8px 8px 4px; margin-bottom: 8px; box-shadow: inset 4px 0 0 rgba(0,0,0,.06); }
.price-card .flag { position: absolute; top: -10px; right: 16px; background: var(--red); color: #fff; font-weight: 800; font-size: .75rem; border-radius: 99px; padding: 3px 10px; }
.price-card.soon > :not(.flag) { opacity: .5; }
.price-card .flag.soon { background: var(--ink-soft); }

.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--paper); border-radius: 16px; padding: 16px 20px; box-shadow: var(--shadow-sm); }
.faq summary { font-weight: 800; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 600 1.3rem/1 var(--display); color: var(--red); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 10px 0 0; color: var(--ink-soft); }

/* ---------- configurator ---------- */
.builder { padding-block: 56px; background: linear-gradient(var(--sand), var(--cream) 220px); }
.step { background: var(--paper); border-radius: var(--radius); padding: 26px; margin-block: 20px; box-shadow: var(--shadow-sm); }
.step > header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.step > header .n { font-family: var(--display); background: var(--sun); color: var(--ink); width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: 1.15rem; flex: none; }
.step > header h2 { font-size: 1.55rem; }
.step > header p { margin: 0; color: var(--ink-soft); flex-basis: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 2px solid var(--line); background: var(--paper); border-radius: 99px; padding: 6px 14px; font: 700 .9rem var(--body); cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--ink-soft); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.story { text-align: left; border: 2px solid var(--line); background: var(--paper); border-radius: 18px; padding: 0; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s, transform .15s; }
.story:hover { border-color: var(--ink-soft); transform: translateY(-2px); }
.story[aria-checked="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.story .band { aspect-ratio: 16 / 9; display: flex; align-items: flex-end; padding: 10px 14px; position: relative; background: var(--sand); }
.story .band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.story .band .cat { position: relative; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; background: rgba(255,255,255,.92); border-radius: 99px; padding: 2px 9px; }
.story .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.story h3 { font-size: 1.12rem; }
.story p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.story .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.story .check { position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; display: none; place-items: center; font-weight: 900; }
.story[aria-checked="true"] .check { display: grid; }
.planned { opacity: .55; cursor: default; }
.planned:hover { transform: none; border-color: var(--line); }

.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px 26px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field > .lbl { font-weight: 800; font-size: .93rem; }
.field small { color: var(--ink-soft); }
.wide { grid-column: 1 / -1; }
input[type=text], input[type=email], select, textarea { font: inherit; border: 2px solid var(--line); border-radius: 14px; padding: 10px 13px; background: var(--paper); color: var(--ink); width: 100%; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; align-self: flex-start; }
.seg button { border: 0; background: var(--paper); padding: 9px 16px; font: 700 .95rem var(--body); cursor: pointer; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.sw { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; padding: 0; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.toggles { display: flex; gap: 18px; flex-wrap: wrap; }
.toggles label { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; }
.photo { border: 2px dashed var(--line); border-radius: 18px; padding: 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--cream); }
.photo img { width: 92px; height: 92px; object-fit: cover; border-radius: 14px; }
.note { background: var(--teal-soft); border-radius: 14px; padding: 10px 14px; font-size: .9rem; color: #17524f; }

.wishbox { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.wishbox textarea { min-height: 120px; }
.ideas { display: flex; flex-direction: column; gap: 8px; }
.ideas .lbl { font-weight: 800; font-size: .93rem; }
.idea { text-align: left; border: 2px dashed #f0cf86; background: var(--sun-soft); border-radius: 14px; padding: 8px 12px; font: 600 .92rem var(--body); color: var(--ink); cursor: pointer; }
.idea:hover { border-style: solid; }
.idea::before { content: "+ "; color: var(--red); font-weight: 900; }
.counter { font-size: .8rem; color: var(--ink-soft); text-align: right; }

.styles { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.style-opt { border: 2px solid var(--line); background: var(--paper); border-radius: 18px; padding: 8px; cursor: pointer; font: inherit; color: inherit; text-align: left; display: flex; flex-direction: column; gap: 4px; transition: transform .15s; }
.style-opt:hover { transform: translateY(-2px); }
.style-opt img, .style-opt .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; background: var(--sand); }
.style-opt b { font-family: var(--display); font-weight: 600; font-size: 1.02rem; padding: 4px 4px 0; }
.style-opt small { color: var(--ink-soft); padding: 0 4px 4px; line-height: 1.3; }
.style-opt[aria-checked="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.opts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.opt { border: 2px solid var(--line); border-radius: 18px; padding: 14px; background: var(--paper); text-align: left; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 4px; }
.opt[aria-checked="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.opt .price { font-family: var(--display); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.opt small { color: var(--ink-soft); }
.opt.soon { opacity: .55; cursor: not-allowed; background: var(--cream, #faf6ef); }
.soon-tag { display: inline-block; margin-left: 6px; font: 800 .7rem var(--body, inherit); color: var(--ink-soft); background: var(--line); border-radius: 99px; padding: 2px 8px; vertical-align: 2px; }

.cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.err { color: #b3261e; font-weight: 700; }

/* preview */
.progress { height: 14px; background: var(--sand); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sun), var(--red)); transition: width .4s; }
.status { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--ink-soft); margin: 8px 0 16px; flex-wrap: wrap; }
.preview { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.sheet { background: var(--cream); border-radius: 18px; padding: 10px; text-align: center; }
.sheet img { width: 100%; border-radius: 12px; display: block; background: #fff; }
.sheet .ph { aspect-ratio: 1; display: grid; place-items: center; color: var(--ink-soft); background: var(--sand); border-radius: 12px; }
.book { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
.page { flex: 0 0 min(340px, 78vw); scroll-snap-align: start; position: relative; aspect-ratio: 1; border-radius: 6px 12px 12px 6px; overflow: hidden; background: var(--sand); box-shadow: var(--shadow-sm); }
.page .wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-soft); font-size: .9rem; text-align: center; padding: 20px; }
.page .redo { position: absolute; right: 8px; top: 8px; border: 0; border-radius: 99px; background: rgba(42,35,70,.78); color: #fff; padding: 4px 11px; font: 700 .78rem var(--body); cursor: pointer; }
.page.cover .redo { top: auto; bottom: 8px; }
.wishnote { border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; font-size: .92rem; }
.wishnote.ok { background: var(--sun-soft); }
.wishnote.warn { background: var(--red-soft); }
.summary { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; background: var(--cream); border-radius: 16px; padding: 14px 18px; margin-top: 16px; }
.summary .total { font-family: var(--display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.done { background: var(--teal-soft); border-radius: 16px; padding: 14px 18px; }

/* ---------- examples page: reader ---------- */
.reader { position: fixed; inset: 0; z-index: 50; background: rgba(32, 26, 54, .78); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); }
.reader .panel { background: var(--cream); border-radius: 26px; width: min(1080px, 100%); max-height: 100%; overflow: auto; display: grid; grid-template-columns: 1fr 300px; gap: 0; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.reader .stage { padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.reader .spread { position: relative; aspect-ratio: 1; width: min(100%, 68vh); margin-inline: auto; border-radius: 8px 16px 16px 8px; overflow: hidden; box-shadow: var(--shadow); background: var(--sand); }
/* Book pages look exactly like the print (pdfbook.py): the container is the trimmed page, the picture's 3 mm bleed is
   cut off, and text box, cover title and fonts scale with the page width. printVars() (common.js) sets the format. */
.book, .reader .spread { --fs: 3.03cqw; --pad: 6.36cqw; --cx: 5.48cqw; --ct: 5.3cqw; --bl: 3cqw; }  /* mini format until printVars() runs */
.page, .reader .spread { container-type: inline-size; }
.page img, .reader .spread img { position: absolute; top: calc(-1 * var(--bl)); left: calc(-1 * var(--bl)); width: calc(100% + 2 * var(--bl)); height: calc(100% + 2 * var(--bl)); object-fit: cover; display: block; }
.page .txt, .reader .spread .txt { position: absolute; left: var(--pad); right: var(--pad); bottom: var(--pad); background: rgba(255,255,255,.9); border-radius: calc(var(--fs) * .8); padding: calc(var(--fs) * .55) var(--fs); font: 400 var(--fs)/1.32 "Andika", var(--book); text-align: center; color: #2b2945; }
.page.cover .txt, .reader .spread.cover .txt { left: var(--cx); right: var(--cx); top: var(--ct); bottom: auto; border-radius: calc(var(--fs) * .95); padding: calc(var(--fs) * .85) var(--fs); font: 800 calc(var(--fs) * 1.9)/1.15 "Sniglet", var(--display); color: #ed6b4a; background: rgba(255,255,255,.92); }
.page .brand, .reader .spread .brand { position: absolute; right: var(--ct); bottom: calc(var(--ct) * .7); font: 800 calc(var(--fs) * .9) "Sniglet", var(--display); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.25); }
.reader .spread .pno { position: absolute; left: 0; right: 0; bottom: calc(var(--fs) * .35); text-align: center; font: 400 calc(var(--fs) * .7) "Andika", var(--book); color: #fff; }
.reader .spread .end { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: calc(var(--fs) * 1.2); background: #fcf2e0; font: 400 var(--fs) "Andika", var(--book); color: #2b2945; }
.reader .spread .end b { font: 800 calc(var(--fs) * 2.4) "Sniglet", var(--display); color: #ed6b4a; }
.reader .controls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.reader .controls .count { font-weight: 800; min-width: 92px; text-align: center; font-variant-numeric: tabular-nums; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font: 600 1.4rem var(--display); cursor: pointer; display: grid; place-items: center; }
.round:disabled { opacity: .3; cursor: default; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.thumbs button { flex: 0 0 58px; height: 58px; padding: 0; border: 3px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--sand); }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button[aria-current="true"] { border-color: var(--red); }
.reader aside { background: var(--paper); padding: 22px; display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--line); }
.reader aside .hero-sheet { width: 120px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.reader aside h2 { font-size: 1.4rem; }
.reader aside dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .92rem; }
.reader aside dt { font-weight: 800; }
.reader aside dd { margin: 0; color: var(--ink-soft); }
.reader .close { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 10px; z-index: 60; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.reader .panel { position: relative; }

/* ---------- footer ---------- */
.site-foot { background: var(--ink); color: #d9d4ec; padding-block: 40px; font-size: .92rem; margin-top: 0; }
.site-foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-foot .logo span { color: #fff; }
.site-foot a { color: #fff; }
.site-foot h3 { font-size: 1rem; color: #fff; margin-bottom: 8px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-foot .fine { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px; font-size: .82rem; color: #b9b3d1; }

/* ---------- admin (shares the system) ---------- */
.top { background: var(--ink); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 10px; }
.brand { font-family: var(--display); font-size: 1.4rem; font-weight: 600; color: #fff; text-decoration: none; }
.brand b { color: var(--sun); font-weight: 600; }
.devbar { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.devbar a { color: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
.scroll { overflow-x: auto; }
.cmp { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cmp figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.cmp img { width: 100%; border-radius: 8px; display: block; }
.cmp figcaption { font-size: .85rem; margin-top: 6px; }
.ok { color: var(--teal); font-weight: 800; } .no { color: #b3261e; font-weight: 800; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .shelf, .prices { grid-template-columns: repeat(2, 1fr); }
  .reader .panel { grid-template-columns: 1fr; }
  .reader aside { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 820px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--cream); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; }
  .nav.open { display: flex; }
  .nav .btn { margin: 8px 0 0; }
  .menu-btn { display: inline-flex; }
  .hero .wrap { grid-template-columns: 1fr; }
  .stage { max-width: 460px; }
  .how { grid-template-columns: 1fr; }
  .wishbox { grid-template-columns: 1fr; }
  .preview { grid-template-columns: minmax(0, 1fr); }
  .sheet { max-width: 230px; }
  .site-foot .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .prices { grid-template-columns: 1fr; }
  .step { padding: 18px; }
  .styles { grid-template-columns: repeat(2, 1fr); }
  .devstrip .sp { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* preview: time estimate and e-mail */
.eta-box { margin-top: 18px; display: grid; gap: 12px; }
.eta-box .eta { margin: 0; background: var(--sun-soft); border-radius: 14px; padding: 10px 14px; }
.eta-box .eta small { color: var(--ink-soft); }
.eta-box .field small { color: var(--ink-soft); }
.pnote { margin: 8px 0 0; font-size: .92rem; color: var(--ink-soft); }
