:root {
  color-scheme: light;
  --ink: #12213a;
  --ink-soft: #344159;
  --muted: #727b89;
  --paper: #f4f1e9;
  --paper-2: #ebe6da;
  --card: #fffdf8;
  --night: #091c3b;
  --night-2: #123664;
  --gold: #f3bd50;
  --gold-dark: #a66f13;
  --berry: #b85e57;
  --line: rgba(18, 33, 58, 0.12);
  --line-strong: rgba(18, 33, 58, 0.2);
  --success: #2f765f;
  --error: #a94442;
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 34px;
  --shadow: 0 24px 70px rgba(20, 31, 49, 0.12);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: var(--sans);
  --reading: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body.is-locked { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
img { max-width: 100%; display: block; }
svg { width: 1.15em; height: 1.15em; }
h1, h2, h3, p { margin-top: 0; }
[hidden] { display: none !important; }

.shell { width: min(1220px, calc(100% - 48px)); margin-inline: auto; }
.view { min-height: calc(100vh - 76px); }
.view:not(.is-active) { display: none; }

.app-header { position: relative; z-index: 20; border-bottom: 1px solid rgba(18, 33, 58, .07); background: rgba(244, 241, 233, .88); backdrop-filter: blur(20px); }
.header-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--gold); background: var(--night); box-shadow: 0 10px 24px rgba(9, 28, 59, .16); font-family: var(--serif); font-size: 1.45rem; }
.brand-mark img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.quiet-button, .back-home { display: inline-flex; align-items: center; gap: 8px; border: 0; color: var(--ink); background: transparent; font-weight: 720; }
.quiet-button { min-height: 40px; padding: 0 12px; border-radius: 999px; }
.quiet-button:hover { background: rgba(255, 255, 255, .7); }
.service-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, .52); font-size: .75rem; font-weight: 720; }
.service-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(243, 189, 80, .16); }
.service-pill.is-ready .service-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(39, 128, 92, .13); }
.service-pill.is-demo .service-dot { background: #a56a20; box-shadow: 0 0 0 4px rgba(165, 106, 32, .12); }

.eyebrow, .step-kicker, .story-label { margin-bottom: 12px; color: #8d651f; font-size: .74rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 20px; border: 0; border-radius: 999px; font-weight: 790; transition: transform 170ms ease, background-color 170ms ease, box-shadow 170ms ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, .quiet-button:focus-visible, .back-home:focus-visible, .choice-chip:focus-visible, .option-card:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .add-character:focus-visible, .text-button:focus-visible { outline: 3px solid rgba(243, 189, 80, .52); outline-offset: 3px; }
.button-primary { color: var(--night); background: var(--gold); box-shadow: 0 12px 28px rgba(184, 124, 21, .16); }
.button-primary:hover { background: #f8c965; }
.button-soft { color: var(--ink); background: rgba(255, 253, 248, .82); box-shadow: inset 0 0 0 1px var(--line); }
.button-dark-soft { color: #fff; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.button-large { min-height: 56px; padding-inline: 25px; }
.text-button { border: 0; color: var(--muted); background: transparent; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

.home-view { overflow: hidden; background: radial-gradient(circle at 8% 8%, rgba(243, 189, 80, .17), transparent 26rem), var(--paper); }
.home-hero { min-height: min(720px, calc(100vh - 76px)); display: grid; grid-template-columns: minmax(0, .95fr) minmax(420px, .72fr); align-items: center; gap: clamp(48px, 7vw, 100px); padding-block: 58px 72px; }
.hero-copy h1 { max-width: 690px; margin-bottom: 24px; font-family: var(--serif); font-size: clamp(3rem, 6vw, 5.55rem); line-height: .95; letter-spacing: -.028em; font-weight: 500; }
.hero-lead { max-width: 620px; margin-bottom: 30px; color: var(--ink-soft); font-size: 1.08rem; line-height: 1.72; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.trust-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px; margin-top: 34px; color: var(--muted); font-size: .78rem; }
.trust-row span { display: inline-flex; align-items: baseline; gap: 5px; }
.trust-row strong { color: var(--ink); font-size: .96rem; }
.trial-note { max-width: 620px; margin: 18px 0 0; padding: 11px 14px; border: 1px solid rgba(166, 111, 19, .2); border-radius: 13px; color: #6f511f; background: #fff7e4; font-size: .76rem; line-height: 1.45; }
.hero-book { min-height: 560px; position: relative; overflow: hidden; align-self: stretch; border-radius: 42px; color: #fff; background: var(--night); box-shadow: 0 35px 90px rgba(15, 28, 49, .2); }
.hero-book::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4, 16, 37, .92) 0%, rgba(4, 16, 37, .14) 62%, rgba(4, 16, 37, .04)); }
.hero-book img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: 54% center; }
.book-caption { position: absolute; z-index: 1; left: clamp(28px, 5vw, 50px); right: 28px; bottom: 38px; }
.book-kicker { display: block; margin-bottom: 10px; color: var(--gold); font-size: .75rem; font-weight: 830; letter-spacing: .1em; text-transform: uppercase; }
.book-caption h2 { max-width: 390px; margin-bottom: 12px; font-family: var(--serif); font-size: clamp(2.4rem, 4vw, 4rem); line-height: .98; font-weight: 500; letter-spacing: -.028em; }
.book-caption > span:last-child { color: rgba(255, 255, 255, .66); font-size: .82rem; }
.home-process { padding: 88px 0 110px; border-top: 1px solid var(--line); }
.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.section-intro h2 { margin-bottom: 0; font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.6rem); font-weight: 500; letter-spacing: -.028em; }
.process-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-strong); }
.process-list li { padding: 24px 40px 10px 0; border-right: 1px solid var(--line); }
.process-list li + li { padding-left: 32px; }
.process-list li:last-child { border-right: 0; }
.process-list li > span { display: block; margin-bottom: 36px; color: var(--gold-dark); font-size: .75rem; font-weight: 850; }
.process-list h3 { margin-bottom: 10px; font-family: var(--serif); font-size: 1.42rem; font-weight: 600; }
.process-list p { margin-bottom: 0; color: var(--muted); line-height: 1.55; font-size: .9rem; }

.builder-view { padding: 25px 0 70px; background: linear-gradient(180deg, #f7f4ed, var(--paper)); }
.builder-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.back-home { padding: 9px 0; color: var(--muted); font-size: .84rem; }
.back-home:hover { color: var(--ink); }
.autosave-note { color: var(--muted); font-size: .75rem; }
.autosave-note::before { content: "✓"; margin-right: 6px; color: var(--success); }
.builder-layout { display: grid; grid-template-columns: 230px minmax(0, 820px); justify-content: center; gap: 46px; align-items: start; }
.progress-panel { position: sticky; top: 24px; padding: 22px 0; }
.progress-number { display: flex; align-items: baseline; gap: 5px; margin-bottom: 16px; }
.progress-number strong { font-family: var(--serif); font-size: 3rem; font-weight: 500; line-height: 1; }
.progress-number span { color: var(--muted); font-size: .9rem; font-weight: 760; }
.progress-track { height: 4px; overflow: hidden; margin-bottom: 28px; border-radius: 999px; background: rgba(18, 33, 58, .09); }
.progress-track span { width: 16.67%; height: 100%; display: block; border-radius: inherit; background: var(--gold); transition: width 260ms ease; }
.step-list { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: .8rem; }
.step-list li { position: relative; padding: 10px 0 10px 22px; transition: color 180ms ease; }
.step-list li::before { content: ""; position: absolute; left: 0; top: 17px; width: 6px; height: 6px; border-radius: 50%; background: rgba(18, 33, 58, .18); }
.step-list li.is-current { color: var(--ink); font-weight: 800; }
.step-list li.is-current::before { background: var(--gold); box-shadow: 0 0 0 5px rgba(243, 189, 80, .16); }
.step-list li.is-complete::before { background: var(--success); }
.builder-card { min-height: 650px; padding: clamp(28px, 5vw, 54px); border: 1px solid rgba(18, 33, 58, .07); border-radius: var(--radius-lg); background: rgba(255, 253, 248, .95); box-shadow: 0 22px 65px rgba(20, 31, 49, .08); }
.step-panel { animation: panel-in 260ms ease both; }
.step-panel h2 { max-width: 680px; margin-bottom: 12px; font-family: var(--serif); font-size: clamp(2.2rem, 4.5vw, 3.55rem); line-height: 1.02; font-weight: 500; letter-spacing: -.028em; }
.step-lead { max-width: 660px; margin-bottom: 32px; color: var(--muted); line-height: 1.6; }
.step-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.selection-counter { flex: 0 0 auto; margin-bottom: 12px; padding: 8px 11px; border-radius: 999px; color: #765311; background: #fff0cb; font-size: .76rem; font-weight: 800; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.field { margin-top: 24px; }
.field-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr); }
label, .field-label { display: block; margin-bottom: 9px; color: var(--ink); font-size: .8rem; font-weight: 800; }
label > span, .field-label > span { color: var(--berry); }
input, textarea, select { width: 100%; border: 1px solid rgba(18, 33, 58, .16); border-radius: var(--radius-sm); color: var(--ink); background: #fff; outline: 0; transition: border-color 170ms ease, box-shadow 170ms ease; }
input { height: 52px; padding: 0 15px; }
textarea { min-height: 116px; resize: vertical; padding: 14px 15px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #9da4ae; }
input:focus, textarea:focus, select:focus { border-color: rgba(166, 111, 19, .54); box-shadow: 0 0 0 4px rgba(243, 189, 80, .12); }
.field-help { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-top: 7px; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.field-error { min-height: 1em; display: block; margin-top: 7px; color: var(--error); font-size: .72rem; font-weight: 670; }
.field.is-invalid input, .field.is-invalid textarea { border-color: rgba(169, 68, 66, .72); }
.conditional-field { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.separated-field { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.priority-field { padding: 22px; border: 1px solid rgba(166, 111, 19, .2); border-radius: var(--radius-md); background: #fff9e9; }
.priority-field textarea { background: rgba(255, 255, 255, .82); }

.chip-row, .chip-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row.compact { gap: 6px; }
.choice-chip { min-height: 40px; padding: 0 14px; border: 1px solid rgba(18, 33, 58, .12); border-radius: 999px; color: var(--muted); background: #fff; font-size: .79rem; font-weight: 730; transition: all 160ms ease; }
.compact .choice-chip { min-width: 40px; padding-inline: 10px; }
.choice-chip:hover { color: var(--ink); border-color: rgba(18, 33, 58, .24); }
.choice-chip.is-selected { color: #704c0d; border-color: rgba(243, 189, 80, .65); background: #fff0c9; box-shadow: inset 0 0 0 1px rgba(243, 189, 80, .16); }
.chip-cloud { gap: 9px; }
.inline-notice { margin: 14px 0 0; padding: 11px 13px; border-radius: 12px; color: #70501b; background: #fff2d3; font-size: .76rem; font-weight: 680; }

.option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.option-card { min-height: 104px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px; border: 1px solid rgba(18, 33, 58, .12); border-radius: 18px; color: var(--ink); background: #fff; text-align: left; transition: border-color 160ms ease, transform 160ms ease, background 160ms ease; }
.option-card:hover { transform: translateY(-2px); border-color: rgba(18, 33, 58, .26); }
.option-card > span { color: var(--gold-dark); font-family: var(--serif); font-size: 1.4rem; }
.option-card strong { max-width: 150px; font-size: .79rem; line-height: 1.25; }
.option-card.is-selected { border-color: var(--gold); background: #fff7e4; box-shadow: inset 0 0 0 1px var(--gold); }
.compact-grid .option-card { min-height: 92px; }
.character-list { display: grid; gap: 12px; }
.character-row { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.character-row .personality { grid-column: 1 / -1; }
.character-row label { margin-bottom: 6px; font-size: .7rem; color: var(--muted); }
.character-row input, .character-row select { height: 46px; }
.character-row select { padding: 0 12px; }
.remove-character { position: absolute; top: 9px; right: 9px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: #f1eee7; font-size: 1.1rem; }
.add-character { min-height: 48px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 12px; border: 1px dashed rgba(18, 33, 58, .22); border-radius: 15px; color: var(--ink); background: transparent; font-weight: 760; }
.add-character span { font-size: 1.25rem; color: var(--gold-dark); }
.control-grid { display: grid; grid-template-columns: 1.25fr .9fr .9fr; gap: 14px; margin-top: 4px; }
.segmented { display: flex; padding: 4px; border-radius: 13px; background: #eeebe3; }
.segmented button { min-height: 36px; flex: 1; padding: 0 9px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: .72rem; font-weight: 760; }
.segmented button.is-selected { color: var(--ink); background: #fff; box-shadow: 0 4px 13px rgba(18, 33, 58, .1); }
.builder-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.form-announcer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.review-view { padding: 54px 0 90px; background: radial-gradient(circle at 82% 0%, rgba(243, 189, 80, .15), transparent 25rem), var(--paper); }
.review-shell { max-width: 980px; }
.review-heading { max-width: 680px; margin-bottom: 34px; }
.review-heading .back-home { margin-bottom: 42px; }
.review-heading h1 { margin-bottom: 13px; font-family: var(--serif); font-size: clamp(3rem, 6vw, 5rem); line-height: .98; font-weight: 500; letter-spacing: -.028em; }
.review-heading > p:last-child { color: var(--muted); line-height: 1.6; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.review-item { min-height: 140px; position: relative; padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 253, 248, .88); }
.review-item > span { display: block; margin-bottom: 10px; color: var(--muted); font-size: .69rem; font-weight: 820; letter-spacing: .09em; text-transform: uppercase; }
.review-item strong { display: block; padding-right: 40px; font-family: var(--serif); font-size: 1.35rem; line-height: 1.25; font-weight: 600; }
.review-item p { margin: 9px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.48; }
.review-edit { position: absolute; top: 17px; right: 17px; border: 0; color: var(--gold-dark); background: transparent; font-size: .7rem; font-weight: 800; }
.privacy-note { margin: 20px 0 0; padding: 15px 17px; border: 1px solid rgba(18, 33, 58, .09); border-radius: 15px; color: var(--muted); background: rgba(255, 253, 248, .7); font-size: .72rem; line-height: 1.58; }
.review-actions { display: flex; align-items: center; gap: 18px; margin-top: 25px; }
.review-actions > span { color: var(--muted); font-size: .75rem; }

.generating-view { display: grid; place-items: center; padding: 40px 24px; color: #fff; background: radial-gradient(circle at 50% 30%, rgba(33, 76, 125, .9), transparent 25rem), var(--night); }
.generation-stage { width: min(700px, 100%); text-align: center; }
.generation-stage .eyebrow { color: var(--gold); }
.generation-stage h1 { margin-bottom: 15px; font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1.02; font-weight: 500; letter-spacing: -.028em; }
.generation-stage > p { color: rgba(255, 255, 255, .62); }
.generation-orbit { width: 114px; height: 114px; position: relative; display: grid; place-items: center; margin: 0 auto 36px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 50%; animation: breathe 2.4s ease-in-out infinite; }
.generation-orbit::before, .generation-orbit::after { content: ""; position: absolute; border: 1px solid rgba(255, 255, 255, .09); border-radius: 50%; }
.generation-orbit::before { inset: -15px; }
.generation-orbit::after { inset: 14px; }
.generation-orbit span { color: var(--gold); font-family: var(--serif); font-size: 2.2rem; }
@keyframes breathe { 50% { transform: scale(1.04); box-shadow: 0 0 70px rgba(243, 189, 80, .16); } }
.generation-lines { width: 300px; max-width: 80%; display: grid; gap: 8px; margin: 34px auto 0; }
.generation-lines span { height: 4px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.generation-lines span::after { content: ""; width: 42%; height: 100%; display: block; border-radius: inherit; background: var(--gold); animation: loading-line 1.8s ease-in-out infinite; }
.generation-lines span:nth-child(2)::after { animation-delay: .3s; }
.generation-lines span:nth-child(3)::after { animation-delay: .6s; }
@keyframes loading-line { from { transform: translateX(-110%); } to { transform: translateX(350%); } }
.generation-error { margin-top: 36px; padding: 25px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 22px; background: rgba(255, 255, 255, .07); }
.generation-error h2 { margin-bottom: 8px; font-family: var(--serif); font-size: 1.8rem; }
.generation-error p { color: rgba(255, 255, 255, .62); }
.generation-error > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.generation-error .text-button { color: rgba(255, 255, 255, .7); }

.story-top { padding: 42px 0 62px; color: #fff; background: radial-gradient(circle at 82% 20%, rgba(243, 189, 80, .18), transparent 18rem), var(--night); }
.story-heading { position: relative; }
.light-back { margin-bottom: 50px; color: rgba(255, 255, 255, .66); }
.story-title-block { max-width: 820px; }
.story-label { color: var(--gold); }
.story-title-block h1 { margin-bottom: 18px; font-family: var(--serif); font-size: clamp(3rem, 7vw, 6rem); line-height: .94; font-weight: 500; letter-spacing: -.028em; }
.story-title-block > p:not(.story-label) { max-width: 720px; color: rgba(255, 255, 255, .69); font-size: 1rem; line-height: 1.65; }
.story-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; color: rgba(255, 255, 255, .57); font-size: .77rem; font-weight: 690; }
.story-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 31px; }
.reading-layout { display: grid; grid-template-columns: 240px minmax(0, 760px); justify-content: center; gap: clamp(35px, 7vw, 94px); padding-block: 64px 100px; }
.chapter-nav { position: sticky; top: 24px; align-self: start; }
.chapter-nav > p { margin-bottom: 16px; color: var(--muted); font-size: .7rem; font-weight: 840; letter-spacing: .1em; text-transform: uppercase; }
.chapter-nav ol { list-style: none; margin: 0 0 26px; padding: 0; border-top: 1px solid var(--line); }
.chapter-nav li { border-bottom: 1px solid var(--line); }
.chapter-nav button { width: 100%; display: flex; align-items: baseline; gap: 9px; padding: 12px 0; border: 0; color: var(--muted); background: transparent; text-align: left; font-size: .75rem; line-height: 1.35; }
.chapter-nav button span { flex: 0 0 auto; color: #a1a7af; font-size: .64rem; }
.chapter-nav button.is-current { color: var(--ink); font-weight: 820; }
.audio-card { padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: #fffdf8; }
.audio-status { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .73rem; }
.audio-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.audio-card p { margin-bottom: 12px; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.audio-card audio { width: 100%; height: 34px; display: none; }
.audio-card.has-audio audio { display: block; }
.speed-row { display: flex; gap: 5px; margin-top: 11px; }
.speed-row button { flex: 1; min-height: 28px; border: 0; border-radius: 8px; color: var(--muted); background: #eeebe3; font-size: .66rem; font-weight: 760; }
.speed-row button.is-selected { color: var(--ink); background: #ffedc1; }
.story-reader { min-width: 0; }
.chapter { padding-bottom: 50px; scroll-margin-top: 28px; }
.chapter + .chapter { padding-top: 48px; border-top: 1px solid var(--line); }
.chapter-number { display: block; margin-bottom: 10px; color: var(--gold-dark); font-size: .7rem; font-weight: 840; letter-spacing: .1em; text-transform: uppercase; }
.chapter h2 { margin-bottom: 24px; font-family: var(--serif); font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1.05; font-weight: 500; letter-spacing: -.028em; }
.chapter-content { color: #2a3550; font-family: var(--reading); font-size: 1.4rem; font-weight: 500; line-height: 1.7; }
.chapter-content p { margin-bottom: 1.25em; }
.closing-thought { margin-top: 20px; padding: 25px 28px; border-left: 3px solid var(--gold); color: var(--ink-soft); background: #fff8e7; font-family: var(--reading); font-size: 1.3rem; font-weight: 500; line-height: 1.6; }
.book-teaser { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 80px; padding: 38px 42px; border-radius: 28px; color: #fff; background: linear-gradient(130deg, #163b69, var(--night)); }
.book-teaser .eyebrow { color: var(--gold); }
.book-teaser h2 { margin-bottom: 9px; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1; font-weight: 500; letter-spacing: -.028em; }
.book-teaser p:last-child { margin-bottom: 0; color: rgba(255, 255, 255, .63); }

.library-dialog { width: min(680px, calc(100% - 28px)); max-height: 82vh; overflow-y: auto; padding: 30px; border: 0; border-radius: 28px; color: var(--ink); background: var(--card); box-shadow: 0 35px 100px rgba(4, 14, 31, .34); }
.library-dialog::backdrop { background: rgba(4, 14, 31, .65); backdrop-filter: blur(7px); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.dialog-head h2 { margin-bottom: 0; font-family: var(--serif); font-size: 2.3rem; font-weight: 500; }
.dialog-close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; font-size: 1.35rem; }
.saved-list { display: grid; gap: 10px; }
.saved-empty { padding: 42px 20px; border: 1px dashed var(--line-strong); border-radius: 18px; color: var(--muted); text-align: center; line-height: 1.55; }
.saved-story { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.saved-story h3 { margin: 0 0 5px; font-family: var(--serif); font-size: 1.2rem; }
.saved-story p { margin: 0; color: var(--muted); font-size: .72rem; }
.saved-story button { min-height: 36px; padding: 0 13px; border: 0; border-radius: 999px; color: var(--ink); background: #ffedc1; font-size: .72rem; font-weight: 760; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: calc(100% - 28px); transform: translate(-50%, 16px); padding: 12px 17px; border-radius: 999px; color: #fff; background: var(--night); box-shadow: 0 16px 40px rgba(8, 26, 56, .25); font-size: .78rem; font-weight: 720; opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.classic-view, .tale-view { padding: 25px 0 90px; background: radial-gradient(circle at 90% 0%, rgba(243, 189, 80, .14), transparent 24rem), var(--paper); }
.classic-heading { max-width: 720px; margin: 26px 0 30px; }
.classic-heading h1, .tale-shell h1 { margin-bottom: 14px; font-family: var(--serif); font-size: clamp(2.8rem, 6vw, 4.8rem); line-height: .98; font-weight: 500; letter-spacing: -.028em; }
.classic-heading > p:last-child { color: var(--muted); line-height: 1.65; }
.classic-tabs { display: inline-flex; padding: 4px; margin-bottom: 18px; border-radius: 999px; background: #eeebe3; }
.classic-tabs button { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-weight: 760; font-size: .84rem; }
.classic-tabs button[aria-selected="true"] { color: var(--ink); background: #fff; box-shadow: 0 4px 13px rgba(18, 33, 58, .1); }
.classic-tabs button span { color: var(--gold-dark); font-size: .7rem; }
.classic-tools { display: flex; gap: 10px; margin-bottom: 22px; max-width: 560px; }
.classic-tools select { width: auto; height: 52px; padding: 0 12px; }
.tale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tale-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.tale-cover { aspect-ratio: 16 / 9; display: grid; place-content: center; justify-items: center; gap: 9px; color: var(--gold); background: radial-gradient(circle at 50% 35%, rgba(243, 189, 80, .22), transparent 36%), linear-gradient(145deg, #17345f, var(--night)); }
.tale-cover svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.tale-cover span { color: rgba(255, 255, 255, .72); font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tale-card-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.tale-card h3 { margin: 0; font-family: var(--serif); font-size: 1.22rem; line-height: 1.25; font-weight: 600; }
.tale-card .tale-kind { color: var(--gold-dark); font-size: .66rem; font-weight: 840; letter-spacing: .1em; text-transform: uppercase; }
.tale-card p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.tale-card audio { width: 100%; height: 36px; margin-top: auto; }
.tale-card .button { margin-top: auto; min-height: 40px; font-size: .8rem; }
.tale-meta { color: var(--muted); font-size: .7rem; }
.classic-more { display: flex; justify-content: center; margin-top: 26px; }
.classic-empty { grid-column: 1 / -1; padding: 42px 20px; border: 1px dashed var(--line-strong); border-radius: 18px; color: var(--muted); text-align: center; }
.classic-credit { margin: 28px 0 0; padding: 15px 17px; border: 1px solid rgba(18, 33, 58, .09); border-radius: 15px; color: var(--muted); background: rgba(255, 253, 248, .7); font-size: .72rem; line-height: 1.58; }
.classic-credit a { color: var(--gold-dark); font-weight: 700; }
.tale-shell { max-width: 780px; }
.tale-shell .back-home { margin-bottom: 30px; }
.tale-body { margin-top: 26px; }

.photo-field .field-label em { color: var(--muted); font-style: normal; font-weight: 600; }
.photo-drop { display: flex; gap: 16px; align-items: center; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 18px; background: #fff; }
.photo-preview { flex: 0 0 auto; width: 88px; height: 88px; display: grid; place-items: center; overflow: hidden; border-radius: 16px; color: var(--muted); background: #f1eee7 center / cover no-repeat; }
.photo-preview svg { width: 34px; height: 34px; }
.photo-copy p { margin: 0 0 10px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.photo-actions { display: flex; align-items: center; gap: 14px; }
.photo-pick { min-height: 40px; font-size: .8rem; cursor: pointer; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-weight: 600; cursor: pointer; }
.consent-row input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--gold-dark); }

.pricing-view { padding: 25px 0 90px; background: radial-gradient(circle at 12% 0%, rgba(243, 189, 80, .14), transparent 24rem), var(--paper); }
.pricing-heading { max-width: 740px; margin: 26px 0 26px; }
.pricing-heading h1 { margin-bottom: 14px; font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1; font-weight: 600; letter-spacing: -.03em; }
.pricing-heading > p:last-child { color: var(--muted); line-height: 1.65; }
.billing-toggle { display: inline-flex; padding: 4px; margin-bottom: 22px; border-radius: 999px; background: #eeebe3; }
.billing-toggle button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-weight: 760; font-size: .82rem; }
.billing-toggle button[aria-pressed="true"] { color: var(--ink); background: #fff; box-shadow: 0 4px 13px rgba(18, 33, 58, .1); }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { position: relative; display: flex; flex-direction: column; padding: 28px 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); }
.plan-card.is-featured { color: #fff; border-color: transparent; background: linear-gradient(150deg, #163b69, var(--night)); box-shadow: var(--shadow); }
.plan-badge { position: absolute; top: 18px; right: 18px; padding: 5px 10px; border-radius: 999px; color: var(--night); background: var(--gold); font-size: .66rem; font-weight: 820; }
.plan-card h3 { margin: 0 0 4px; font-size: 1.4rem; font-weight: 700; }
.plan-card .plan-tag { min-height: 2.6em; margin: 0 0 18px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.plan-card.is-featured .plan-tag, .plan-card.is-featured li { color: rgba(255, 255, 255, .78); }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.plan-price strong { font-size: 2.3rem; font-weight: 750; letter-spacing: -.03em; }
.plan-price span { color: var(--muted); font-size: .8rem; }
.plan-card.is-featured .plan-price span { color: rgba(255, 255, 255, .65); }
.plan-sub { min-height: 1.3em; margin: 0 0 20px; color: var(--gold-dark); font-size: .74rem; font-weight: 700; }
.plan-card.is-featured .plan-sub { color: var(--gold); }
.plan-card ul { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 10px; }
.plan-card li { position: relative; padding-left: 22px; color: var(--ink-soft); font-size: .84rem; line-height: 1.45; }
.plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.plan-card.is-featured li::before { color: var(--gold); }
.plan-card li.is-off { opacity: .55; }
.plan-card li.is-off::before { content: "–"; color: var(--muted); }
.plan-card .button { margin-top: auto; }
.trial-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 16px 0 44px; padding: 20px 24px; border: 1px solid rgba(166, 111, 19, .25); border-radius: 20px; background: #fff9e9; }
.trial-strip strong { display: block; margin-bottom: 3px; }
.trial-strip span { color: var(--muted); font-size: .84rem; }
.pricing-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.pricing-columns h2 { margin-bottom: 14px; font-size: 1.4rem; font-weight: 700; }
.price-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.price-list li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.price-list li strong { flex: 0 0 auto; white-space: nowrap; }
.price-list li small { display: block; color: var(--muted); font-size: .72rem; }
.pricing-note { margin: 12px 0 0; color: var(--muted); font-size: .74rem; line-height: 1.55; }
.pricing-foot { margin-top: 34px; padding: 15px 17px; border: 1px solid rgba(18, 33, 58, .09); border-radius: 15px; background: rgba(255, 253, 248, .7); }

.home-samples { padding: 20px 0 70px; }
.sample-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.sample-book p { margin: 12px 4px 0; color: var(--muted); font-size: .8rem; }
.sample-cover { position: relative; aspect-ratio: 3 / 4; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 22px; overflow: hidden; border-radius: 6px 16px 16px 6px; color: #fff; background: linear-gradient(0deg, rgba(4, 16, 37, .92), rgba(4, 16, 37, .02) 64%), url("assets/sample-cover-1.webp") center / cover no-repeat; box-shadow: -5px 0 0 rgba(0, 0, 0, .18) inset, 0 24px 50px rgba(15, 28, 49, .18); }
.sample-cover.is-alt { background-image: linear-gradient(0deg, rgba(4, 16, 37, .92), rgba(4, 16, 37, .02) 64%), url("assets/sample-cover-2.webp"); }
.sample-cover.is-third { background-image: linear-gradient(0deg, rgba(4, 16, 37, .92), rgba(4, 16, 37, .02) 64%), url("assets/sample-cover-3.webp"); }
.sample-cover span { color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sample-cover strong { font-size: 1.55rem; line-height: 1.08; font-weight: 650; letter-spacing: -.02em; }
.sample-cover em { color: rgba(255, 255, 255, .75); font-style: normal; font-size: .8rem; }
.home-upsell { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 80px; padding: 38px 42px; border-radius: 28px; color: #fff; background: linear-gradient(130deg, #163b69, var(--night)); }
.home-upsell .eyebrow { color: var(--gold); }
.home-upsell h2 { max-width: 560px; margin-bottom: 9px; font-size: clamp(1.8rem, 3.4vw, 2.7rem); line-height: 1.08; font-weight: 600; letter-spacing: -.028em; }
.home-upsell p:last-child { margin: 0; max-width: 520px; color: rgba(255, 255, 255, .68); }

.result-tabs { display: flex; gap: 6px; padding-top: 26px; }
.result-tabs button { min-height: 42px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; font-weight: 760; font-size: .84rem; }
.result-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--gold); background: #fff7e4; }
.result-tabs + .reading-layout { padding-top: 34px; }
.illus-panel { padding: 30px 0 70px; }
.illus-controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; margin-bottom: 14px; }
.illus-controls .field { margin-top: 0; }
.illus-controls select { height: 52px; padding: 0 12px; }
.illus-note { min-height: 1.4em; margin: 0 0 18px; color: var(--muted); font-size: .8rem; }
.illus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.illus-card { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.illus-card img { width: 100%; height: auto; }
.illus-card figcaption { padding: 12px 14px; color: var(--muted); font-size: .76rem; }
.illus-card.is-loading { min-height: 220px; display: grid; place-items: center; color: var(--muted); font-size: .8rem; background: linear-gradient(90deg, #f1eee7, #fbf9f3, #f1eee7) 0 0 / 200% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.chapter-image { margin: 0 0 26px; }
.chapter-image img { width: 100%; border-radius: 16px; }
.chapter-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.chapter-menu { position: relative; flex: 0 0 auto; }
.chapter-menu summary { list-style: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-family: var(--sans); font-size: .7rem; font-weight: 760; cursor: pointer; }
.chapter-menu summary::-webkit-details-marker { display: none; }
.chapter-menu[open] summary { color: var(--ink); background: #fff7e4; border-color: var(--gold); }
.chapter-menu-list { position: absolute; z-index: 5; right: 0; top: calc(100% + 6px); width: 220px; display: grid; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.chapter-menu-list button { padding: 10px 12px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; font-family: var(--sans); font-size: .78rem; font-weight: 650; text-align: left; }
.chapter-menu-list button:hover { background: #fff7e4; }
.chapter.is-busy { opacity: .5; pointer-events: none; }

.order-dialog { width: min(820px, calc(100% - 28px)); }
.order-layout { display: grid; grid-template-columns: 220px 1fr; gap: 26px; align-items: start; }
.book-mock { display: grid; gap: 12px; }
.book-mock-cover { aspect-ratio: 3 / 4; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 18px; border-radius: 4px 12px 12px 4px; color: #fff; background: linear-gradient(0deg, rgba(4, 16, 37, .92), rgba(4, 16, 37, .08) 62%), url("assets/hero.webp") center / cover no-repeat; box-shadow: -5px 0 0 rgba(0, 0, 0, .2) inset, 0 20px 40px rgba(15, 28, 49, .2); }
.book-mock[data-format="A4_square"] .book-mock-cover { aspect-ratio: 1 / 1; }
.book-mock[data-cover="softcover"] .book-mock-cover { border-radius: 2px 6px 6px 2px; }
.book-mock-cover span { color: var(--gold); font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.book-mock-cover strong { font-size: 1.15rem; line-height: 1.1; font-weight: 650; }
.book-mock-cover em { color: rgba(255, 255, 255, .75); font-style: normal; font-size: .72rem; }
.book-mock-dedication { margin: 0; color: var(--muted); font-size: .74rem; font-style: italic; line-height: 1.45; }
.order-fields .field:first-child { margin-top: 0; }
.order-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.order-success { padding: 26px 0 6px; text-align: center; }
.order-success h3 { margin-bottom: 8px; font-size: 1.6rem; }
.order-success p { color: var(--muted); line-height: 1.6; }
.saved-story-actions { display: flex; gap: 6px; }
.world-card { margin-bottom: 16px; padding: 18px; border: 1px solid rgba(166, 111, 19, .25); border-radius: 18px; background: #fff9e9; }
.world-card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.world-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: .78rem; }
.world-card dt { color: var(--muted); font-weight: 700; }
.world-card dd { margin: 0; }
.world-card .button { min-height: 40px; font-size: .8rem; }

@media print {
  body > *:not(main), .app-header, .story-top, .result-tabs, .illus-panel, .chapter-nav, .book-teaser, .chapter-menu, .toast { display: none !important; }
  .view:not(.result-view) { display: none !important; }
  .result-view, .reading-layout { display: block !important; padding: 0 !important; }
  .result-view::before { content: attr(data-print-title); display: block; margin-bottom: 24px; font: 700 28pt var(--sans); }
  .chapter-content { font-size: 13pt; color: #000; }
  .chapter { break-inside: avoid-page; }
  .chapter-image img { max-height: 9cm; width: auto; }
}

.auth-dialog { width: min(460px, calc(100% - 28px)); }
.auth-lead { margin: 0 0 20px; color: var(--muted); line-height: 1.6; font-size: .9rem; }
.auth-google { width: 100%; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: .75rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-dialog form .button { width: 100%; margin-top: 14px; }
.auth-dialog .field { margin-top: 0; }
.auth-status { min-height: 1.4em; margin: 14px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }

.trial-note { margin: 14px 0 0; padding: 12px 15px; border-radius: 14px; color: #70501b; background: #fff2d3; font-size: .8rem; font-weight: 650; line-height: 1.5; }
.segmented button:disabled { opacity: .4; cursor: not-allowed; }
.site-footer { display: flex; gap: 22px; padding: 22px 0 34px; border-top: 1px solid var(--line); font-size: .78rem; }
.site-footer a { color: var(--muted); }
@media (max-width: 980px) {
  .home-hero { grid-template-columns: 1fr; min-height: auto; padding-top: 65px; }
  .hero-copy { max-width: 780px; }
  .hero-book { min-height: 520px; }
  .builder-layout { grid-template-columns: 1fr; gap: 16px; }
  .progress-panel { position: static; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 18px; padding: 0; }
  .progress-number { margin-bottom: 0; }
  .progress-track { margin-bottom: 0; }
  .step-list { display: none; }
  .control-grid { grid-template-columns: 1fr; }
  .reading-layout { grid-template-columns: 1fr; }
  .chapter-nav { position: static; }
  .chapter-nav ol { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 5px; border: 0; }
  .chapter-nav li { flex: 0 0 auto; border: 0; }
  .chapter-nav button { width: auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
  .audio-card { max-width: 430px; }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 28px, 1220px); }
  .header-inner { height: 68px; }
  .brand { font-size: 1.12rem; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .quiet-button span, .service-pill { display: none; }
  .quiet-button { width: 40px; padding: 0; justify-content: center; }
  .view { min-height: calc(100vh - 68px); }
  .home-hero { gap: 38px; padding-block: 45px 56px; }
  .hero-copy h1 { font-size: clamp(3rem, 15vw, 4.6rem); }
  .hero-lead { font-size: .96rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .trust-row { gap: 10px 17px; }
  .hero-book { min-height: 470px; border-radius: 28px; }
  .book-caption { left: 24px; bottom: 28px; }
  .home-process { padding: 62px 0 75px; }
  .process-list { grid-template-columns: 1fr; border-top: 0; }
  .process-list li, .process-list li + li { padding: 22px 0; border-right: 0; border-top: 1px solid var(--line); }
  .process-list li > span { margin-bottom: 16px; }
  .builder-view { padding-top: 17px; }
  .builder-topline { margin-bottom: 12px; }
  .builder-card { min-height: 600px; padding: 28px 20px 22px; border-radius: 24px; }
  .progress-number strong { font-size: 2.25rem; }
  .step-panel h2 { font-size: 2.45rem; }
  .two-columns, .option-grid, .review-grid { grid-template-columns: 1fr; }
  .compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .option-card { min-height: 86px; }
  .option-card strong { max-width: none; }
  .character-row { grid-template-columns: 1fr; padding-top: 28px; }
  .character-row .personality { grid-column: auto; }
  .builder-footer { position: sticky; z-index: 5; bottom: 0; margin: 32px -20px -22px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: rgba(255, 253, 248, .94); backdrop-filter: blur(14px); }
  .builder-footer .button { min-width: 112px; }
  .review-view { padding-top: 28px; }
  .review-heading .back-home { margin-bottom: 30px; }
  .review-actions { align-items: stretch; flex-direction: column; }
  .review-actions .button { width: 100%; }
  .story-top { padding-top: 28px; }
  .light-back { margin-bottom: 36px; }
  .story-title-block h1 { font-size: clamp(3rem, 15vw, 4.8rem); }
  .story-actions { flex-direction: column; }
  .story-actions .button { width: 100%; }
  .reading-layout { padding-block: 42px 70px; }
  .chapter-content { font-size: 1.27rem; line-height: 1.65; }
  .book-teaser { align-items: stretch; flex-direction: column; padding: 28px 24px; border-radius: 22px; }
  .library-dialog { padding: 24px 20px; border-radius: 23px; }
  .plan-grid, .pricing-columns, .sample-grid, .illus-controls, .order-layout, .order-contact { grid-template-columns: 1fr; }
  .home-upsell { align-items: stretch; flex-direction: column; padding: 28px 24px; border-radius: 22px; }
  .book-mock { max-width: 220px; }
  .pricing-columns { gap: 28px; }
  .trial-strip { flex-direction: column; align-items: stretch; }
  .photo-drop { align-items: flex-start; }
  .classic-tools { max-width: none; }
  .classic-tabs { display: flex; }
  .classic-tabs button { flex: 1; justify-content: center; padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Mobile app shell */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.bottom-tabs { display: none; }
.home-mobile-metrics, .mobile-chapters-button { display: none; }
.bottom-tabs svg, .option-icon svg, .world-quick-actions svg, .profile-link svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-actions .quiet-button svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.option-copy { display: grid; gap: 5px; }
.option-copy small { max-width: 190px; color: var(--muted); font-size: .68rem; line-height: 1.35; font-weight: 520; }
.option-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--gold-dark); background: #fff7e4; }
.option-icon svg { width: 20px; height: 20px; }

.app-page-shell { max-width: 960px; padding-block: 70px 100px; }
.app-page-heading { max-width: 680px; margin-bottom: 30px; }
.app-page-heading h1, .profile-card h1 { margin-bottom: 12px; font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 1; letter-spacing: -.035em; }
.app-page-heading > p:last-child, .profile-card p { color: var(--muted); line-height: 1.6; }
.world-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.world-saved-list { gap: 12px; }
.empty-art { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 24px; color: var(--gold-dark); background: #fff0c9; }
.empty-art svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty-illustration { width: 180px; height: 180px; object-fit: cover; display: block; margin: -18px auto -4px; mix-blend-mode: multiply; }
.classic-empty .empty-illustration { width: 150px; height: 150px; margin-top: -24px; }
.saved-empty h3 { margin-bottom: 7px; color: var(--ink); font-size: 1.15rem; }
.saved-empty p { margin-bottom: 18px; }
.profile-shell { max-width: 760px; }
.profile-card { display: flex; align-items: center; gap: 22px; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); }
.profile-card .eyebrow { margin-bottom: 8px; }
.profile-card h1 { font-size: 2rem; }
.profile-card p { margin-bottom: 0; }
.profile-avatar { width: 76px; height: 76px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 24px; color: var(--gold); background: var(--night); font-size: 1.7rem; font-weight: 800; box-shadow: 0 14px 32px rgba(9, 28, 59, .16); }
.profile-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.profile-status { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 18px; border: 1px solid rgba(47, 118, 95, .2); border-radius: 18px; background: rgba(255, 253, 248, .82); }
.profile-status-dot { width: 9px; height: 9px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(47, 118, 95, .1); }
.profile-status strong { display: block; margin-bottom: 4px; font-size: .82rem; }
.profile-status p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.profile-actions { display: grid; gap: 8px; margin-top: 20px; }
.profile-link { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 18px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: #fff; text-align: left; }
.profile-link > span { display: flex; align-items: center; gap: 12px; }
.profile-link svg { width: 20px; height: 20px; color: var(--gold-dark); }
.profile-link > svg { width: 16px; color: var(--muted); }
.profile-legal { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 24px; padding-inline: 4px; }
.profile-legal a { color: var(--muted); font-size: .78rem; }
.chapter-sheet-list { list-style: none; display: grid; gap: 7px; margin: 0; padding: 0; }
.chapter-sheet-list button { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; text-align: left; font-weight: 700; }
.chapter-sheet-list button span { color: var(--gold-dark); font-size: .7rem; }
.chapter-sheet-list button.is-current { border-color: var(--gold); background: #fff7e4; }
.tale-card-skeleton { min-height: 260px; padding: 18px; background: linear-gradient(100deg, #eeeae0 25%, #faf8f2 38%, #eeeae0 52%) 0 0 / 220% 100%; animation: shimmer 1.6s linear infinite; }
.tale-card-skeleton span { height: 130px; margin: -18px -18px 22px; border-radius: 0; background: rgba(18, 33, 58, .06); }
.tale-card-skeleton i { height: 12px; display: block; margin-top: 10px; border-radius: 999px; background: rgba(18, 33, 58, .08); }
.tale-card-skeleton i:nth-child(3) { width: 82%; }
.tale-card-skeleton i:nth-child(4) { width: 58%; }
.classic-empty h3 { margin: 0 0 7px; color: var(--ink); font-size: 1.08rem; }
.classic-empty p { margin: 0; }

@media (max-width: 899px) {
  html { scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body[data-view="generating"] { padding-bottom: 0; }
  .shell { width: min(100% - 32px, 760px); }
  .app-header { position: sticky; top: 0; z-index: 40; background: rgba(244, 241, 233, .9); }
  .header-inner { height: 64px; }
  .header-actions { display: none; }
  .brand { font-size: 1.05rem; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .view { min-height: calc(100svh - 64px); padding-bottom: calc(30px + env(safe-area-inset-bottom)); animation: app-view-in 180ms ease both; }
  .bottom-tabs {
    height: calc(64px + env(safe-area-inset-bottom));
    position: fixed;
    z-index: 50;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px 6px env(safe-area-inset-bottom);
    border-top: 1px solid rgba(18, 33, 58, .1);
    background: rgba(255, 253, 248, .92);
    box-shadow: 0 -10px 30px rgba(18, 33, 58, .05);
    backdrop-filter: blur(18px);
  }
  body[data-view="generating"] .bottom-tabs { display: none; }
  .bottom-tab {
    min-width: 0;
    min-height: 54px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 2px;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    line-height: 1.05;
    font-weight: 650;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-tab::after { content: ""; width: 4px; height: 4px; position: absolute; bottom: 2px; border-radius: 50%; background: transparent; }
  .bottom-tab:active { transform: scale(.96); }
  .bottom-tab:focus-visible { outline: 3px solid rgba(243, 189, 80, .55); outline-offset: -3px; border-radius: 14px; }
  .bottom-tab.is-active { color: var(--night); }
  .bottom-tab.is-active::after { background: var(--gold); }
  .bottom-tab-icon { height: 25px; display: grid; place-items: center; }
  .bottom-tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-tab-create { padding-top: 1px; }
  .create-orb { width: 56px; height: 56px; position: absolute; top: -28px; display: grid; place-items: center; border: 5px solid rgba(255, 253, 248, .96); border-radius: 50%; color: var(--night); background: var(--gold); box-shadow: 0 10px 24px rgba(166, 111, 19, .25); }
  .create-orb svg { width: 24px; height: 24px; }
  .bottom-tab-create > span:last-child { margin-top: 26px; }
  .bottom-tab-create::after { bottom: 2px; }
  .builder-footer { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .site-footer { display: none; }
  .app-page-shell { padding-block: 34px 40px; }
  .app-page-heading { margin-bottom: 22px; }
  .app-page-heading h1 { font-size: clamp(2.4rem, 12vw, 3.6rem); }
  .world-quick-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .world-quick-actions .button { min-width: 0; padding-inline: 12px; font-size: .78rem; }
  .world-saved-list .saved-story { grid-template-columns: 1fr; }
  .saved-story-actions { justify-content: flex-start; }
  .saved-story button { min-height: 44px; }
  .saved-empty { padding: 36px 18px; background: var(--card); }
  .profile-card { align-items: flex-start; gap: 16px; padding: 21px 18px; }
  .profile-avatar { width: 60px; height: 60px; border-radius: 19px; }
  .profile-card h1 { font-size: 1.45rem; }
  .profile-card .eyebrow { font-size: .65rem; }
  .profile-card p { font-size: .78rem; }
  .profile-link { min-height: 60px; }
  .option-card { min-height: 112px; }
  .option-copy small { display: block; }

  .home-hero { min-height: auto; display: flex; flex-direction: column; gap: 24px; padding-block: 28px 42px; }
  .hero-copy { max-width: none; }
  .hero-copy h1 { max-width: 620px; margin-bottom: 18px; font-size: clamp(2.75rem, 12vw, 4.2rem); line-height: .96; letter-spacing: -.045em; }
  .hero-lead { margin-bottom: 22px; font-size: .94rem; line-height: 1.58; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .hero-actions .button { width: 100%; min-width: 0; min-height: 52px; padding-inline: 14px; font-size: .86rem; }
  .hero-actions #hero-classic { display: none; }
  .trust-row { display: none; }
  .hero-book { width: 100%; min-height: 390px; align-self: auto; border-radius: 26px; }
  .book-caption { left: 24px; right: 22px; bottom: 24px; }
  .book-caption h2 { max-width: 310px; margin-bottom: 8px; font-size: 2.35rem; }
  .home-mobile-metrics { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .home-mobile-metrics span { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 13px 8px; border: 1px solid var(--line); border-radius: 16px; color: var(--muted); background: rgba(255, 253, 248, .72); font-size: .66rem; text-align: center; }
  .home-mobile-metrics strong { color: var(--ink); font-size: .9rem; }
  .home-process { padding: 50px 0 58px; }
  .section-intro { margin-bottom: 24px; }
  .section-intro h2 { font-size: 2.25rem; }
  .process-list { grid-template-columns: 1fr; border-top: 0; }
  .process-list li, .process-list li + li { display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; padding: 18px 0; border-top: 1px solid var(--line); border-right: 0; }
  .process-list li > span { grid-row: 1 / 3; margin: 2px 0 0; }
  .process-list h3 { margin-bottom: 5px; font-size: 1.12rem; }
  .process-list p { font-size: .8rem; }
  .home-samples { width: 100%; padding: 10px 0 56px; }
  .home-samples .section-intro { width: min(100% - 32px, 760px); margin-inline: auto; }
  .sample-grid { display: flex; gap: 14px; overflow-x: auto; padding: 0 16px 20px; scroll-padding-inline: 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .sample-grid::-webkit-scrollbar { display: none; }
  .sample-book { flex: 0 0 min(68vw, 270px); scroll-snap-align: start; }
  .sample-cover { border-radius: 8px 18px 18px 8px; }
  .sample-cover strong { font-size: 1.3rem; }
  .home-upsell { margin-bottom: 28px; padding: 27px 22px; border-radius: 22px; }
  .home-upsell h2 { font-size: 1.7rem; }
  .home-upsell p { font-size: .83rem; line-height: 1.55; }

  .builder-view { padding: 12px 0 0; }
  .builder-topline { margin-bottom: 10px; }
  .builder-layout { gap: 12px; }
  .progress-panel { grid-template-columns: auto 1fr; gap: 10px 14px; }
  .progress-number strong { font-size: 2.1rem; }
  .progress-track { height: 3px; }
  .builder-card { min-height: calc(100svh - 175px); padding: 27px 20px 118px; border-radius: 24px 24px 0 0; box-shadow: 0 -8px 32px rgba(20, 31, 49, .045); }
  .step-panel h2 { font-size: clamp(2rem, 9vw, 2.75rem); line-height: 1; }
  .step-lead { margin-bottom: 26px; font-size: .9rem; }
  .field { margin-top: 22px; }
  input { height: 54px; }
  .choice-chip { min-height: 44px; }
  .option-grid, .compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .option-card { min-height: 136px; padding: 14px; border-radius: 18px; }
  .option-card:active, .choice-chip:active { transform: scale(.98); }
  .option-card strong { max-width: none; font-size: .78rem; }
  .option-copy small { font-size: .64rem; }
  .builder-footer { margin: 30px -20px -118px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .builder-footer .button { min-height: 48px; }

  .review-view { padding: 28px 0 0; }
  .review-heading { margin-bottom: 24px; }
  .review-heading .back-home { margin-bottom: 25px; }
  .review-heading h1 { font-size: 2.8rem; }
  .review-grid { grid-template-columns: 1fr; }
  .review-item { min-height: 0; padding: 19px; }
  .review-actions { position: sticky; z-index: 6; bottom: calc(64px + env(safe-area-inset-bottom)); margin: 24px -16px 0; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(244, 241, 233, .94); backdrop-filter: blur(16px); }
  .review-actions > span { display: none; }
  .privacy-note { font-size: .7rem; }

  body[data-view="generating"] .app-header { display: none; }
  .generating-view { min-height: 100svh; padding: 32px 20px; }
  .generation-orbit { width: 96px; height: 96px; margin-bottom: 30px; }
  .generation-stage h1 { font-size: clamp(2.15rem, 10vw, 3.4rem); }
  .generation-error { padding: 20px 16px; }

  .story-top { padding: 24px 0 32px; }
  .light-back { margin-bottom: 30px; }
  .story-title-block h1 { font-size: clamp(2.8rem, 13vw, 4.5rem); }
  .story-title-block > p:not(.story-label) { font-size: .9rem; }
  .story-meta { gap: 7px 14px; }
  .story-actions { flex-direction: row; flex-wrap: nowrap; gap: 8px; margin: 25px -16px 0; padding: 0 16px 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .story-actions::-webkit-scrollbar { display: none; }
  .story-actions .button { width: auto; min-height: 44px; flex: 0 0 auto; padding-inline: 16px; scroll-snap-align: start; font-size: .76rem; }
  .story-actions svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-chapters-button { display: inline-flex; }
  .result-tabs { position: sticky; z-index: 8; top: 64px; gap: 5px; padding-block: 12px; background: rgba(244, 241, 233, .94); backdrop-filter: blur(14px); }
  .result-tabs button { flex: 1; min-height: 44px; }
  .reading-layout { display: block; padding-block: 22px 56px; }
  .chapter-nav > p, .chapter-nav > ol { display: none; }
  .audio-card { max-width: none; position: sticky; z-index: 7; bottom: calc(72px + env(safe-area-inset-bottom)); margin-bottom: 32px; padding: 14px 16px; border-radius: 18px; box-shadow: 0 16px 38px rgba(18, 33, 58, .13); }
  .chapter { padding-bottom: 38px; }
  .chapter + .chapter { padding-top: 38px; }
  .chapter h2 { font-size: 2rem; }
  .chapter-content { font-size: 1.24rem; line-height: 1.66; }
  .chapter-head { gap: 9px; }
  .chapter-menu summary { padding: 8px 10px; }
  .chapter-menu-list { position: fixed; z-index: 60; left: 16px; right: 16px; top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; }
  .book-teaser { margin-bottom: 28px; }
  .illus-panel { padding: 20px 0 54px; }
  .illus-controls { grid-template-columns: 1fr 1fr; }
  .illus-controls .button { grid-column: 1 / -1; }
  .illus-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .illus-card { border-radius: 15px; }
  .illus-card.is-loading { min-height: 160px; }

  .classic-view, .tale-view, .pricing-view { padding-top: 18px; }
  .classic-shell > .back-home, .pricing-shell > .back-home { display: none; }
  .classic-heading, .pricing-heading { margin-top: 14px; }
  .classic-heading h1, .tale-shell h1, .pricing-heading h1 { font-size: clamp(2.5rem, 11vw, 3.6rem); }
  .classic-heading > p:last-child, .pricing-heading > p:last-child { font-size: .86rem; }
  .classic-tabs { width: 100%; display: flex; }
  .classic-tabs button { min-width: 0; flex: 1; justify-content: center; padding-inline: 8px; font-size: .78rem; }
  .classic-tools { display: grid; grid-template-columns: 1fr; max-width: none; }
  .classic-tools select { width: 100%; }
  .tale-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tale-card { border-radius: 18px; }
  .tale-card-body { padding: 14px; }
  .tale-card h3 { font-size: 1.05rem; }
  .tale-card p { font-size: .74rem; }
  .classic-empty { padding: 36px 18px; }
  .classic-credit { margin-bottom: 12px; }
  .tale-shell .back-home { margin-bottom: 24px; }

  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { padding: 25px 21px; }
  .plan-price strong { font-size: 2rem; }
  .trial-strip { margin-bottom: 34px; }
  .pricing-columns { grid-template-columns: 1fr; }
  .order-layout, .order-contact { grid-template-columns: 1fr; }
  .order-dialog .book-mock { max-width: 190px; margin-inline: auto; }
  .order-dialog .review-actions { position: static; margin: 20px 0 0; padding: 0; border: 0; background: transparent; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }

  .library-dialog {
    width: 100%;
    max-width: none;
    max-height: min(88svh, 820px);
    position: fixed;
    inset: auto 0 0;
    margin: auto 0 0;
    padding: 30px 20px calc(22px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0;
    overflow-y: auto;
  }
  .library-dialog::before { content: ""; width: 42px; height: 4px; position: absolute; top: 10px; left: 50%; border-radius: 999px; background: rgba(18, 33, 58, .18); transform: translateX(-50%); }
  .library-dialog[open] { animation: sheet-up 220ms ease-out both; }
  .library-dialog::backdrop { background: rgba(4, 14, 31, .58); animation: backdrop-in 180ms ease both; }
  .order-dialog { width: 100%; }
}

@media (max-width: 540px) {
  .tale-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: clamp(2.65rem, 13vw, 3.45rem); }
}

@keyframes app-view-in { from { opacity: .2; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { opacity: .75; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes backdrop-in { from { background: rgba(4, 14, 31, 0); } to { background: rgba(4, 14, 31, .58); } }

/* ---- Әже chat ---- */
body[data-view="chat"] { padding-bottom: 0; overflow: hidden; }
body[data-view="chat"] .app-header, body[data-view="chat"] .bottom-tabs, body[data-view="chat"] .site-footer { display: none; }
.chat-view { min-height: 100dvh; padding: 0; background: radial-gradient(circle at 15% 0%, rgba(243, 189, 80, .14), transparent 22rem), var(--paper); }
.chat-shell { height: 100dvh; max-width: 760px; margin-inline: auto; display: flex; flex-direction: column; }
.chat-head { flex: 0 0 auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); background: rgba(255, 253, 248, .9); backdrop-filter: blur(16px); }
.chat-close { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--ink); background: transparent; }
.chat-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-title img { width: 40px; height: 40px; border-radius: 13px; object-fit: cover; box-shadow: 0 6px 16px rgba(9, 28, 59, .14); }
.chat-title strong { display: block; font-size: 1rem; font-weight: 750; line-height: 1.1; }
.chat-title span { display: block; color: var(--muted); font-size: .72rem; }
.chat-progress { display: grid; justify-items: end; gap: 5px; min-width: 64px; font-size: .72rem; font-weight: 750; color: var(--muted); }
.chat-progress i { display: block; width: 64px; height: 4px; overflow: hidden; border-radius: 999px; background: rgba(18, 33, 58, .1); }
.chat-progress b { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--gold); transition: width 260ms ease; }
.chat-log { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { display: flex; gap: 9px; max-width: 100%; animation: msg-in 220ms ease both; }
.msg.bot { align-items: flex-end; }
.msg.bot img { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; object-fit: cover; }
.msg.user { justify-content: flex-end; }
.bubble { position: relative; max-width: min(86%, 560px); padding: 12px 15px; border-radius: 20px; font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.msg.bot .bubble { border-bottom-left-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.msg.user .bubble { border-bottom-right-radius: 6px; background: #ffedc1; color: #4a3308; font-weight: 600; padding-right: 40px; }
.bubble-edit { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #8d651f; background: rgba(255, 255, 255, .6); }
.bubble-edit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: typing 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.chat-dock { flex: 0 0 auto; max-height: 58dvh; overflow-y: auto; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255, 253, 248, .96); box-shadow: 0 -14px 40px rgba(20, 31, 49, .06); }
.chat-dock:empty { display: none; }
.dock-meta { display: flex; gap: 8px; margin-bottom: 8px; }
.dock-tag { color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .04em; }
.dock-tag.is-required { color: var(--berry); }
.dock-error { margin: 0 0 8px; color: var(--error); font-size: .78rem; font-weight: 650; }
.dock-error[hidden] { display: none; }
.dock-text { display: flex; align-items: flex-end; gap: 8px; }
.dock-text textarea { flex: 1; min-height: 46px; max-height: 160px; padding: 12px 14px; resize: none; border-radius: 22px; line-height: 1.4; }
.round-btn { flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--ink); background: #eeebe3; }
.round-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.send-btn { color: var(--night); background: var(--gold); }
.mic-btn.is-recording { color: #fff; background: var(--berry); animation: pulse-rec 1.2s infinite; }
@keyframes pulse-rec { 50% { box-shadow: 0 0 0 9px rgba(184, 94, 87, .18); } }
.dock-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.dock-chips.is-cloud { max-height: 34dvh; overflow-y: auto; }
.dock-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: 40dvh; overflow-y: auto; padding: 2px; }
.dock-cards .option-card { min-height: 0; padding: 13px; flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 10px; }
.dock-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.dock-actions.is-stack { flex-direction: column; align-items: stretch; margin-top: 0; }
.dock-count { color: var(--muted); font-size: .78rem; font-weight: 700; }
.dock-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.dock-skip { padding: 8px 4px; border: 0; color: var(--muted); background: transparent; font-size: .78rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.dock-voice-cta { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 10px; border: 1px dashed rgba(166, 111, 19, .5); border-radius: 999px; color: #704c0d; background: #fff9e9; font-weight: 750; font-size: .84rem; }
.dock-voice-cta svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock-voice { display: grid; justify-items: center; gap: 12px; text-align: center; }
.dock-voice .dock-text { width: 100%; }
.dock-voice-hint { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.voice-orb { width: 82px; height: 82px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--night); background: var(--gold); box-shadow: 0 12px 30px rgba(184, 124, 21, .25); }
.voice-orb svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.voice-orb.is-recording { color: #fff; background: var(--berry); animation: pulse-rec 1.2s infinite; }
.voice-status { min-height: 1.3em; margin: 0; color: var(--muted); font-size: .82rem; }
.dock-char { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: .84rem; }
.dock-char button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f1eee7; color: var(--muted); }
.dock-char button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.dock-char-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.dock-char-form input, .dock-char-form select { height: 44px; padding: 0 12px; }
.dock-char-form input[name="personality"] { grid-column: 1 / -1; }
.dock-char-form .button { grid-column: 1 / -1; min-height: 42px; }
.dock-photo { display: flex; gap: 14px; align-items: center; }
.dock-photo-preview { flex: 0 0 auto; width: 92px; height: 92px; display: grid; place-items: center; border-radius: 18px; background: #f1eee7 center / cover no-repeat; color: var(--muted); }
.dock-photo-preview svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.dock-photo-copy ul { margin: 0 0 10px; padding-left: 18px; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.dock-note { margin: 8px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.parent-wish { margin: 26px 0 0; padding: 22px 24px; border-radius: 22px; background: linear-gradient(135deg, #fff6df, #fff0c9); border: 1px solid rgba(166, 111, 19, .25); }
.parent-wish span { display: block; margin-bottom: 8px; color: var(--gold-dark); font-family: var(--sans); font-size: .68rem; font-weight: 850; letter-spacing: .12em; }
.parent-wish p { margin: 0; font-family: var(--reading); font-size: 1.45rem; line-height: 1.5; font-weight: 600; color: #3a2a08; white-space: pre-wrap; }
@media (min-width: 900px) { .chat-shell { height: calc(100dvh - 24px); margin-block: 12px; border: 1px solid var(--line); border-radius: 30px; overflow: hidden; background: rgba(255, 253, 248, .6); } .chat-head { padding-top: 10px; } }
@media (prefers-reduced-motion: reduce) { .msg, .typing i, .mic-btn.is-recording, .voice-orb.is-recording { animation: none !important; } }

.home-classic-card { width: 100%; display: flex; align-items: center; gap: 13px; margin-top: 12px; padding: 14px 16px; border: 1px solid rgba(166, 111, 19, .28); border-radius: 20px; color: var(--ink); background: linear-gradient(135deg, #fff9e9, #fff3d2); text-align: left; }
.home-classic-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--gold-dark); background: #fff; }
.home-classic-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-classic-copy { min-width: 0; display: grid; gap: 3px; }
.home-classic-copy strong { font-size: .95rem; font-weight: 750; }
.home-classic-copy small { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.home-classic-arrow { flex: 0 0 auto; width: 18px; height: 18px; margin-left: auto; fill: none; stroke: var(--gold-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 900px) { .home-classic-card { display: none; } }
