/* Tsitsig atelier · local prototype. Brand tokens from tsitsig.com, 30 October 2026. */
:root {
  color-scheme: light;
  --paper: #fffdf8;
  --white: #ffffff;
  --ink: #082c51;
  --muted: #355370;
  --accent: #dc3044;
  --accent-hover: #c62439;
  --coral: #ff4654;
  --line: #eae5db;
  --peach: #f8efe4;
  --rose: #fff0ec;
  --blue-wash: #edf4f7;
  --green: #286248;
  --green-wash: #edf5ec;
  --radius: 24px;
  --heading-font: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body-font: "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-family: var(--body-font);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; scroll-padding: 24px 0 130px; }
body { margin: 0; min-width: 320px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, summary, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a { touch-action: manipulation; }
/* Keep keyboard focus functional without a visible focus outline. */
:focus, :focus-visible { outline: none; box-shadow: none; }
button:disabled { opacity: .48; }
button:disabled:hover { transform: none; }
button:not([class]) { min-height: 44px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
a { color: inherit; text-underline-offset: 4px; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
main { display: block; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--heading-font); font-weight: 800; letter-spacing: -.045em; text-wrap: balance; }
h1, h2 { line-height: 1.08; }
h3 { line-height: 1.24; letter-spacing: -.025em; }
p { line-height: 1.65; }
strong { font-weight: 700; }
small { font-size: .8125rem; }
::selection { background: #ffd7ce; color: var(--ink); }

.icon { width: 22px; height: 22px; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 16px; z-index: 100; padding: 12px 20px; color: white; background: var(--ink); border-radius: 12px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* Quiet, consistent chrome. */
.site-header { max-width: 1200px; min-height: 102px; margin: 0 auto; padding: 22px 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; border: 0; background: transparent; padding: 7px 0; text-decoration: none; }
.brand img { width: 104px; max-height: 40px; object-fit: contain; }
.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
/* The drawing choice is a focused first task, not a dashboard. */
body.upload-focus .site-header .header-right > :not(.guide-companion) { display: none; }
.prototype-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: .6875rem; letter-spacing: .045em; color: var(--muted); background: transparent; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 1px solid transparent; border-radius: 50%; color: var(--ink); background: transparent; }
.icon-button:hover { background: var(--peach); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; max-width: 100%; padding: 14px 25px; border: 1px solid transparent; border-radius: 99px; text-align: center; text-decoration: none; font-weight: 700; font-size: .9375rem; line-height: 1.35; transition: background-color .16s, border-color .16s, box-shadow .16s; }
.btn .icon { width: 20px; height: 20px; }
.btn-primary { color: var(--white); background: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 4px 14px #dc304416; }
.btn-secondary { color: var(--ink); background: var(--white); border-color: #d7d9d6; }
.btn-secondary:hover:not(:disabled) { border-color: #758b99; background: #f8faf9; }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--peach); color: var(--ink); }
.btn-small { min-height: 44px; padding: 10px 17px; font-size: .8125rem; }
.text-button, .details-link, .back-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border: 0; padding: 8px 2px; background: transparent; font-weight: 700; font-size: .875rem; text-decoration: none; color: var(--muted); }
.text-button:hover, .details-link:hover, .back-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.text-button .icon, .back-link .icon, .details-link .icon { width: 18px; height: 18px; }
.inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.shell { width: min(100% - 72px, 1128px); margin: 0 auto; }
.footer-note { margin: 40px auto 24px; color: var(--muted); text-align: center; font-size: .75rem; line-height: 1.6; }

/* The invitation leads with the drawing, then gets out of the way. */
.home { padding-top: 24px; padding-bottom: 48px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 42px; min-height: 430px; padding: 34px 0 54px; }
.hero-copy { max-width: 540px; position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; letter-spacing: .1em; font-weight: 700; text-transform: uppercase; margin-bottom: 22px; }
.eyebrow .icon { width: 18px; height: 18px; color: var(--accent); }
.hero-copy h1 { font-size: clamp(2.5rem, 5.1vw, 4.5rem); max-width: 600px; }
.hero-copy h1 em { color: var(--accent); font-style: normal; }
.hero-copy > p { color: var(--muted); max-width: 380px; margin-top: 24px; font-size: 1.0625rem; line-height: 1.7; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 29px; }
.hero-actions .btn-primary { min-height: 58px; padding-inline: 26px; }
.trust-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .75rem; margin-top: 18px; }
.trust-note .icon { width: 15px; height: 15px; }
.hero-art { position: relative; display: grid; place-items: center; min-width: 0; isolation: isolate; }
.hero-illustration { width: 100%; max-width: 520px; aspect-ratio: 1.1; object-fit: contain; }
.hero-art > svg { width: 100%; max-height: 430px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 30px; margin-bottom: 20px; border-top: 1px solid var(--line); }
.section-heading h2 { font-size: 1.65rem; }
.section-heading p { color: var(--muted); font-size: .8125rem; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project-card { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--white); min-width: 0; transition: border-color .16s, box-shadow .16s; }
.project-card:hover { border-color: #c8d2d6; box-shadow: 0 8px 26px #082c5107; }
.project-cover { aspect-ratio: 1.8; overflow: hidden; background: var(--peach); }
.project-cover img, .project-cover svg { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 20px 22px; }
.project-body h3 { font-size: 1.2rem; margin: 11px 0 7px; }
.project-body p { color: var(--muted); font-size: .8125rem; }
.project-body > .btn { width: 100%; margin-top: 18px; }
.project-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .6875rem; color: var(--muted); }
.status-pill, .saved-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 5px 9px; font-size: .6875rem; font-weight: 700; line-height: 1.35; background: var(--blue-wash); color: var(--muted); }
.status-pill.done, .saved-badge { color: var(--green); background: var(--green-wash); }
.status-pill .icon, .saved-badge .icon { width: 13px; height: 13px; }
.empty-state { display: grid; justify-items: center; gap: 13px; padding: 40px 24px; border: 1px dashed #d5d9d6; border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty-state .icon { width: 34px; height: 34px; }

/* Stable phase navigation; the current task carries the detail. */
.workspace { max-width: 880px; padding-bottom: 40px; }
.journey { display: flex; align-items: center; justify-content: center; list-style: none; padding: 0; margin: 14px 0 30px; gap: 0; }
.journey ol { display: flex; align-items: center; justify-content: center; list-style: none; padding: 0; margin: 0; width: 100%; }
.journey li { position: relative; display: flex; align-items: center; gap: 8px; color: #5b6d7b; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.journey li:not(:last-child)::after { content: ""; display: block; width: clamp(22px, 6vw, 68px); height: 1px; background: #dcded7; margin: 0 14px 0 7px; }
.journey-number { display: inline-flex; justify-content: center; align-items: center; flex: 0 0 26px; width: 26px; height: 26px; border: 1px solid #d5dbdc; border-radius: 50%; color: #5b6d7b; font-size: .6875rem; }
.journey-number .icon { width: 14px; height: 14px; }
.journey-number .progress-lock-art { width: 16px; height: 16px; }
.journey .current { color: var(--ink); }
.journey .current .journey-number { color: var(--white); background: var(--ink); border-color: var(--ink); }
.journey .done { color: var(--green); }
.journey .done .journey-number { color: var(--green); background: var(--green-wash); border-color: transparent; }
.journey .locked { color: var(--ink); }
.journey .locked .journey-number { color: #704b35; background: #f4dfcd; border-color: transparent; }
.journey-label { display: inline-flex; flex-direction: column; gap: 2px; }
.journey-label small { color: #88766c; font-size: .625rem; font-weight: 400; }
.journey .done:not(:last-child)::after { background: #a7c4af; }
.journey button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: none; background: transparent; color: inherit; font: inherit; }
.workspace-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 27px; }
.save-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .6875rem; line-height: 1.4; }
.save-state .icon { width: 14px; height: 14px; }
.stage-header { margin: 0 auto 32px; max-width: 680px; text-align: center; }
.stage-kicker { display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 12px; color: var(--muted); font-size: .75rem; letter-spacing: .03em; }
.stage-kicker .icon { width: 17px; height: 17px; color: var(--accent); }
.stage-title, .stage-header h1 { font-size: clamp(1.9rem, 4.1vw, 2.85rem); }
.stage-description { color: var(--muted); font-size: .9375rem; max-width: 480px; margin: 16px auto 0; line-height: 1.6; text-wrap: pretty; }
.stage-body { min-width: 0; }

.narrow { width: 100%; max-width: 560px; margin-inline: auto; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.preview-panel { min-width: 0; }
.drawing-preview { display: grid; place-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 24px; padding: 20px; background: var(--white); overflow: hidden; }
.drawing-preview img, .drawing-preview svg { max-height: 360px; width: 100%; object-fit: contain; }
.preview-panel .details-link { display: flex; width: fit-content; margin: 10px auto 0; }
.reading-panel { padding: 15px 0; min-width: 0; }
.reading-panel h2, .reading-panel h3 { margin-bottom: 17px; font-size: 1.4rem; }
.reading-panel > p { font-size: 1rem; line-height: 1.8; }
.facts-list { list-style: none; display: grid; gap: 16px; padding: 0; margin: 0; }
.fact { display: flex; align-items: flex-start; gap: 12px; font-size: 1rem; line-height: 1.6; }
.fact .icon { width: 21px; height: 21px; color: var(--green); margin-top: 3px; }
.actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px 20px; position: sticky; z-index: 6; bottom: 0; margin: 32px auto 0; padding: 17px 0 max(17px, env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
/* Keep the drawing steps in normal flow during mobile browser toolbar changes. */
body.upload-focus .actions { position: static; }
.actions > .btn-primary { order: 2; min-width: 230px; margin-left: auto; }
.actions > .btn-secondary, .actions > .btn-ghost, .actions > .text-button { order: 1; }
.actions .helper { width: 100%; text-align: right; order: 3; margin: 0; }
.helper { font-size: .8125rem; color: var(--muted); line-height: 1.6; margin-top: 12px; }
.helper .icon { width: 16px; height: 16px; display: inline-block; vertical-align: -.18em; margin-right: 4px; }
.error, .notice { border-radius: 14px; padding: 13px 16px; margin: 16px 0; line-height: 1.6; font-size: .875rem; }
.error { background: #fff0ec; border: 1px solid #f2c2bb; color: #9d2735; }
.notice { background: var(--blue-wash); color: var(--ink); border: 1px solid #dce7ec; }
.error:empty, .notice:empty { display: none; }
.error .btn, .notice .btn { margin-top: 10px; }

/* Choice surfaces are calm; selected choices are unmistakable. */
.upload-zone, .upload-target { display: grid; place-items: center; justify-items: center; gap: 14px; width: 100%; min-height: 265px; padding: 32px 24px; border: 1.5px dashed #b4c1c8; border-radius: 25px; background: var(--white); text-align: center; color: var(--ink); cursor: pointer; transition: border-color .16s, background .16s; }
.upload-zone:hover, .upload-target:hover, .upload-zone.dragover { background: #fff8f3; border-color: var(--accent); }
.upload-zone > .icon, .upload-target > .icon { width: 38px; height: 38px; padding: 10px; box-sizing: content-box; border-radius: 20px; background: var(--peach); }
.upload-zone strong, .upload-target strong { font-size: 1.0625rem; }
.upload-zone span, .upload-target span { color: var(--muted); font-size: .875rem; }
.change-drawing { display: flex; width: fit-content; margin: 14px auto 0; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label, .field-label { font-size: .875rem; font-weight: 700; }
.field label small, .field-label small { color: var(--muted); font-size: .75rem; font-weight: 400; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select { width: 100%; max-width: 100%; min-height: 52px; padding: 13px 16px; border: 1px solid #bac7ce; border-radius: 13px; background: var(--white); line-height: 1.6; }
textarea { display: block; min-height: 120px; resize: vertical; }
textarea::placeholder, input::placeholder { color: #627180; opacity: 1; }
input[type="file"] { max-width: 100%; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.option-card { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 19px 12px; min-height: 120px; min-width: 0; border: 1px solid #d9dfdf; border-radius: 18px; background: var(--white); text-align: center; transition: border-color .16s, background .16s; }
.option-card:hover { border-color: #7995a8; }
.option-card[aria-checked="true"], .option-card[aria-pressed="true"], .option-card.selected, .style-card[aria-checked="true"], .style-card[aria-pressed="true"], .style-card.selected { border-color: var(--ink); background: #f1f6f7; box-shadow: inset 0 0 0 1px var(--ink); }
.option-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink); background: var(--peach); }
.option-icon .icon { width: 23px; height: 23px; }
.option-label { font-weight: 700; font-size: .875rem; }
.option-description { color: var(--muted); font-size: .75rem; line-height: 1.5; font-weight: 400; }
.mini-choice { display: inline-flex; justify-content: center; align-items: center; min-width: 48px; min-height: 48px; padding: 9px 15px; border: 1px solid #d2dbde; border-radius: 13px; background: var(--white); font-size: .9375rem; font-weight: 700; }
.mini-choice:hover { background: var(--peach); }
.mini-choice[aria-checked="true"], .mini-choice[aria-pressed="true"], .mini-choice.selected { background: var(--ink); border-color: var(--ink); color: white; }
.age-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.settings-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding: 17px 20px; border-radius: 16px; background: var(--peach); font-size: .875rem; }
.settings-summary p { line-height: 1.55; }
.settings-summary small { color: var(--muted); }
.personalize { margin-top: 21px; }
details { margin-block: 16px; }
summary { min-height: 44px; cursor: pointer; color: var(--muted); font-weight: 700; font-size: .875rem; padding: 10px 0; }
details[open] > summary { margin-bottom: 10px; }
.style-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.style-card { min-width: 0; display: flex; flex-direction: column; gap: 10px; border: 1px solid #d9dfdf; border-radius: 16px; padding: 8px 8px 12px; background: var(--white); font-size: .75rem; font-weight: 700; text-align: center; }
.style-thumb { aspect-ratio: 1.15; overflow: hidden; border-radius: 10px; background: var(--peach); }
.style-thumb img, .style-thumb svg { width: 100%; height: 100%; object-fit: cover; }
.character-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.character-card { text-align: center; min-width: 0; }
.character-art { border: 1px solid var(--line); padding: 14px; border-radius: 24px; background: white; overflow: hidden; aspect-ratio: 1.2; margin-bottom: 15px; }
.character-art img, .character-art svg { width: 100%; height: 100%; object-fit: contain; }
.character-card h3 { font-size: 1.125rem; margin-bottom: 4px; }
.character-card p { font-size: .8125rem; color: var(--muted); }
.character-card details img, .character-card details svg { max-height: 200px; width: 100%; object-fit: contain; }
.edit-panel { padding: 22px; background: var(--white); border: 1px solid #ccd7dc; border-radius: 20px; margin-top: 20px; }
.edit-panel h2, .edit-panel h3 { font-size: 1.25rem; margin-bottom: 17px; }
.edit-panel .field:last-of-type { margin-bottom: 16px; }
.edit-panel .inline-actions { justify-content: flex-end; }

/* A page is a page to read, not a form to repair. */
.page-sheet { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: var(--white); box-shadow: 0 10px 35px #082c5106; }
.page-art { min-width: 0; background: var(--peach); min-height: 320px; display: grid; place-items: center; overflow: hidden; }
.page-art > img, .page-art > svg { width: 100%; height: 100%; max-height: 430px; object-fit: cover; }
.page-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 36px; }
.page-number { font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.page-title { font-size: 1.5rem; margin-bottom: 19px; }
.book-text { font-size: 1.1875rem; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.page-copy .book-text { font-size: 1.125rem; }
.page-tools { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.result-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); align-items: center; gap: 52px; padding-block: 12px 30px; }
.book-cover { position: relative; display: grid; justify-items: center; gap: 12px; overflow: hidden; max-width: 300px; width: 100%; min-height: 340px; margin: 0 auto; padding: 27px 22px; border-radius: 5px 18px 18px 5px; border-left: 10px solid #173c57; background: var(--ink); color: var(--white); box-shadow: 12px 17px 30px #082c5118, 4px 3px 0 #e4dfd4; transform: rotate(-3deg); text-align: center; }
.book-cover h2, .book-cover h3 { color: white; font-size: 1.65rem; }
.book-cover img, .book-cover svg { width: 100%; max-height: 230px; border-radius: 9px; object-fit: contain; background: var(--paper); }
.book-cover small { font-size: .6875rem; opacity: .85; }
.result-copy { min-width: 0; }
.result-copy h2, .result-copy h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.result-copy > p { margin-top: 18px; color: var(--muted); }
.result-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 27px; }
.result-actions .btn { min-width: 245px; }
.celebration-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--green); background: var(--green-wash); margin-bottom: 21px; }
.celebration-mark .icon { width: 25px; height: 25px; }
.result-layout video { width: 100%; max-height: 430px; background: var(--ink); border-radius: 20px; }

/* One phrase, one action, then the next phrase. */
.voice-grid { display: grid; gap: 12px; max-width: 560px; margin-inline: auto; }
.voice-card { display: flex; align-items: center; gap: 16px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); }
.voice-card.selected, .voice-card[aria-checked="true"] { border-color: var(--ink); background: #f3f7f8; box-shadow: inset 0 0 0 1px var(--ink); }
.voice-avatar { width: 50px; height: 50px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--peach); color: var(--ink); font-family: var(--heading-font); font-weight: 800; font-size: 1.125rem; }
.voice-card:nth-child(2) .voice-avatar { background: #e9f1f3; }
.voice-card:nth-child(3) .voice-avatar { background: #f9e9e6; }
.voice-avatar svg, .voice-avatar img { width: 100%; height: 100%; }
.voice-meta { flex: 1; min-width: 0; }
.voice-meta strong { display: block; font-size: 1rem; }
.voice-meta small, .voice-meta p { display: block; color: var(--muted); font-size: .75rem; line-height: 1.55; margin-top: 3px; }
.voice-actions { display: flex; align-items: center; gap: 5px; }
.voice-actions .icon-button { border-color: #d3dde2; background: var(--white); }
.voice-actions .icon-button:hover { border-color: var(--ink); }
.record-card { max-width: 600px; margin: 0 auto; padding: 27px 32px; border: 1px solid var(--line); border-radius: 26px; background: var(--white); text-align: center; }
.record-illustration { width: 100%; height: 150px; border-radius: 16px; overflow: hidden; background: var(--peach); margin-bottom: 24px; }
.record-illustration img, .record-illustration svg { width: 100%; height: 100%; object-fit: cover; }
.record-text { font-size: 1.375rem; line-height: 1.7; text-wrap: pretty; margin: 0 auto 26px; max-width: 480px; }
.mic-button { width: 72px; height: 72px; display: inline-grid; place-items: center; padding: 18px; border-radius: 50%; border: 0; color: white; background: var(--accent); box-shadow: 0 0 0 8px var(--rose); }
.mic-button:hover:not(:disabled) { background: var(--accent-hover); }
.mic-button .icon { width: 29px; height: 29px; }
.mic-button.recording { background: var(--ink); box-shadow: 0 0 0 8px var(--blue-wash); }
.record-timer { display: block; font-variant-numeric: tabular-nums; font-size: .875rem; color: var(--muted); margin: 16px 0 0; }
.record-timer.recording { color: var(--accent); font-weight: 700; }
.audio-player { width: 100%; max-width: 440px; display: block; margin: 20px auto 0; }
.audio-player audio, audio.audio-player { width: 100%; max-width: 100%; height: 48px; }
.take-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 22px; }
.record-card .helper { max-width: 400px; margin: 18px auto 0; }
.clip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.clip-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); text-align: left; font-size: .875rem; }
.clip-row:hover { border-color: #9db2be; }
.clip-row > .icon { color: var(--green); width: 20px; height: 20px; }
.clip-row > span:not(.clip-status):not(.journey-number) { flex: 1; }
.clip-row strong { display: block; }
.clip-row p { color: var(--muted); font-size: .8125rem; margin-top: 3px; }
.clip-status { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; flex-shrink: 0; font-size: .6875rem; color: var(--muted); }
.clip-status.saved { color: var(--green); }
.clip-status .icon { width: 15px; height: 15px; }
.loading { display: grid; justify-items: center; gap: 22px; text-align: center; min-height: 280px; align-content: center; padding: 30px 15px; }
.loading h2 { font-size: 1.8rem; }
.loading p { color: var(--muted); max-width: 380px; font-size: .9375rem; }
.writing-art { display: block; width: 170px; height: 170px; overflow: visible; }
.writing-book, .writing-fox, .writing-pencil, .writing-spark { transform-box: fill-box; transform-origin: center; }
.writing-book { animation: writing-float 2.6s ease-in-out infinite; }
.writing-fox { animation: writing-fox-bob 2.6s ease-in-out infinite; }
.writing-pencil { animation: writing-pencil 2.6s ease-in-out infinite; }
.writing-words path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: writing-line 2.6s ease-in-out infinite; }
.writing-words path:nth-child(2) { animation-delay: .32s; }
.writing-words path:nth-child(3) { animation-delay: .64s; }
.writing-spark-one { animation: generation-twinkle 1.1s ease-in-out infinite; }
.writing-spark-two { animation: generation-twinkle 1.1s .4s ease-in-out infinite; }
@keyframes writing-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes writing-fox-bob { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(1px); } }
@keyframes writing-pencil { 0%, 100% { transform: translate(-5px,-3px) rotate(-8deg); } 40% { transform: translate(3px,1px) rotate(3deg); } 70% { transform: translate(-3px,6px) rotate(-4deg); } }
@keyframes writing-line { 0%, 10% { stroke-dashoffset: 40; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 40; } }
@media (prefers-reduced-motion: reduce) { .writing-art * { animation: none; } .writing-words path { stroke-dashoffset: 0; } }
.spinner { width: 34px; height: 34px; border: 3px solid #f0d7d5; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.loading-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--muted); font-size: .8125rem; }
.loading-steps li { display: flex; align-items: center; justify-content: center; gap: 8px; }
.loading-steps .icon { width: 17px; height: 17px; color: var(--green); }
.progress-track { width: min(100%, 300px); height: 5px; border-radius: 8px; background: #e7e9e4; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--ink); transition: width .2s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Native dialog handles containment; typography stays consistent with the task. */
@media (prefers-reduced-motion: no-preference) {
  :is(.guide-panel, .modal)[open].modal-entering { animation: modal-rise .32s cubic-bezier(.2, .75, .3, 1) backwards; }
  .guide-panel.sheet-dragging { animation: none; }
  @keyframes modal-rise { from { transform: translateY(100vh); } to { transform: translateY(0); } }
}
.modal { width: min(580px, calc(100% - 32px)); max-height: min(84dvh, 850px); margin: auto; padding: 28px; border: 1px solid var(--line); border-radius: 26px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 90px #082c5129; overscroll-behavior: contain; }
.modal::backdrop { background: #082c5166; backdrop-filter: blur(3px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.7rem; padding-top: 5px; }
.modal-header .icon-button { margin: -5px -7px 0 0; flex-shrink: 0; }
.modal-body { font-size: .9375rem; }
.modal-body > p + p { margin-top: 13px; }
.modal-body .helper { margin-top: 15px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.version-list { list-style: none; display: grid; gap: 12px; margin: 0; padding: 0; }
.version-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.version-row strong { font-size: .875rem; }
.version-row p, .version-row small { color: var(--muted); font-size: .75rem; margin-top: 4px; }
.version-row > .btn { flex-shrink: 0; }

@media (min-width: 1200px) {
  .workspace { padding-top: 10px; }
  .stage-header { margin-bottom: 38px; }
}
@media (max-width: 900px) {
  .hero-grid { gap: 18px; min-height: 390px; }
  .hero-copy h1 { font-size: 3.5rem; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 3px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-copy { padding: 25px; }
  .result-layout { gap: 30px; }
  .workspace { max-width: 780px; }
}
@media (max-width: 680px) {
  html { scroll-padding-bottom: 160px; }
  .site-header { min-height: 80px; padding: 18px 22px; gap: 12px; }
  .brand img { width: 88px; max-height: 36px; }
  .header-right { gap: 8px; }
  .header-right .btn-small { padding: 9px 12px; font-size: .75rem; }
  .prototype-tag { padding: 5px 7px; font-size: .625rem; }
  .shell { width: calc(100% - 44px); }
  .home { padding-top: 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 20px; padding: 24px 0 30px; min-height: auto; }
  .hero-copy { max-width: 510px; text-align: center; margin: 0 auto; }
  .eyebrow { font-size: .6875rem; margin-bottom: 18px; }
  .hero-copy h1 { font-size: clamp(2.7rem, 10vw, 3.7rem); }
  .hero-copy > p { font-size: .9375rem; max-width: 330px; margin: 19px auto 0; }
  .hero-actions { align-items: center; gap: 3px; margin-top: 22px; }
  .hero-actions .btn-primary { min-height: 55px; }
  .trust-note { justify-content: center; margin-top: 12px; font-size: .6875rem; }
  .hero-art { max-width: 340px; width: 90%; margin: 0 auto; }
  .hero-illustration { max-height: 265px; aspect-ratio: 1.3; }
  .section-heading { padding-top: 24px; margin-bottom: 17px; }
  .section-heading h2 { font-size: 1.45rem; }
  .section-heading p { display: none; }
  .project-body { padding: 17px; }
  .project-body h3 { font-size: 1.1rem; }
  .workspace { padding-top: 5px; padding-bottom: max(48px, env(safe-area-inset-bottom, 0px)); }
  .journey { margin-top: 3px; margin-bottom: 17px; }
  .journey li { font-size: .6875rem; gap: 5px; }
  .journey li:not(:last-child)::after { width: 20px; margin: 0 8px 0 3px; }
  .journey-number { width: 23px; height: 23px; flex-basis: 23px; font-size: .625rem; }
  .journey button { gap: 5px; }
  .workspace-top { margin-bottom: 20px; }
  .save-state { font-size: .625rem; max-width: 150px; text-align: right; }
  .stage-header { margin-bottom: 25px; }
  .stage-title, .stage-header h1 { font-size: clamp(1.8rem, 7vw, 2.3rem); }
  .stage-kicker { font-size: .6875rem; margin-bottom: 10px; }
  .stage-description { font-size: .875rem; margin-top: 13px; max-width: 340px; }
  .split { grid-template-columns: 1fr; gap: 20px; }
  .drawing-preview { padding: 14px; border-radius: 21px; }
  .drawing-preview img, .drawing-preview svg { max-height: 230px; }
  .reading-panel { padding: 0; }
  .reading-panel h2, .reading-panel h3 { font-size: 1.2rem; }
  .facts-list { gap: 13px; }
  .fact { font-size: .9375rem; }
  .actions { flex-direction: column; gap: 3px; margin-top: 25px; padding: 12px 0 max(48px, env(safe-area-inset-bottom, 0px)); }
  .actions > .btn-primary { order: 0; width: 100%; min-width: 0; margin-left: 0; }
  .actions > .btn-ghost, .actions > .text-button, .actions > .btn-secondary { order: 1; min-height: 44px; }
  .actions .helper { text-align: center; }
  .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .option-card { min-height: 107px; padding: 15px 10px; border-radius: 16px; }
  .settings-summary { padding: 15px; font-size: .8125rem; gap: 12px; }
  .style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .character-grid { gap: 13px; }
  .character-art { padding: 6px; border-radius: 18px; }
  .character-card h3 { font-size: 1rem; }
  .character-card p { font-size: .75rem; }
  .edit-panel { padding: 18px; }
  .page-sheet { grid-template-columns: 1fr; border-radius: 22px; }
  .page-art { min-height: 0; aspect-ratio: 1.55; }
  .page-art > img, .page-art > svg { width: 100%; height: 100%; max-height: none; }
  .page-copy { padding: 24px; }
  .page-number { margin-bottom: 10px; }
  .page-title { font-size: 1.35rem; margin-bottom: 13px; }
  .page-copy .book-text { font-size: 1.125rem; line-height: 1.75; }
  .page-tools { justify-content: center; gap: 8px; }
  .result-layout { grid-template-columns: 1fr; gap: 34px; padding-top: 5px; }
  .book-cover { max-width: 230px; min-height: 270px; padding: 20px 16px; border-left-width: 7px; }
  .book-cover h2, .book-cover h3 { font-size: 1.35rem; }
  .book-cover img, .book-cover svg { max-height: 180px; }
  .result-copy { text-align: center; }
  .result-copy h2, .result-copy h1 { font-size: 2rem; }
  .celebration-mark { margin: 0 auto 16px; }
  .result-actions { align-items: center; margin-top: 23px; }
  .result-actions .btn { width: 100%; min-width: 0; max-width: 340px; }
  .result-copy > p { font-size: .9375rem; margin-top: 14px; }
  .voice-card { gap: 11px; padding: 14px; border-radius: 17px; }
  .voice-avatar { width: 42px; height: 42px; }
  .voice-meta strong { font-size: .9375rem; }
  .voice-actions { gap: 2px; }
  .voice-actions .btn-small { padding-inline: 12px; }
  .record-card { padding: 20px; border-radius: 22px; }
  .record-illustration { height: 100px; margin-bottom: 21px; }
  .record-text { font-size: 1.1875rem; line-height: 1.7; margin-bottom: 24px; }
  .record-card .helper { font-size: .75rem; }
  .clip-row { padding: 13px; gap: 10px; }
  .clip-status { font-size: .625rem; }
  .modal { padding: 23px; border-radius: 23px; }
  .modal-header h2 { font-size: 1.5rem; }
  .modal-actions { flex-direction: column-reverse; gap: 7px; }
  .modal-actions .btn { width: 100%; }
  .version-row { flex-wrap: wrap; padding: 14px; }
}
@media (max-width: 390px) {
  .site-header { padding: 15px 16px; }
  .shell { width: calc(100% - 32px); }
  .header-right { gap: 3px; }
  .header-right .prototype-tag { padding-inline: 5px; font-size: .5625rem; }
  .journey li:not(:last-child)::after { width: 10px; margin: 0 6px 0 2px; }
  .journey li { font-size: .625rem; gap: 4px; }
  .journey-number { flex-basis: 21px; width: 21px; height: 21px; }
  .hero-copy h1 { font-size: 2.65rem; }
  .project-grid { grid-template-columns: 1fr; }
  .age-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .save-state { max-width: 130px; }
  .voice-card { gap: 9px; padding: 12px; }
  .voice-avatar { width: 36px; height: 36px; }
  .voice-meta small, .voice-meta p { font-size: .6875rem; }
  .voice-actions .btn-small { font-size: .75rem; padding-inline: 10px; }
  .page-copy { padding: 21px; }
  .record-card { padding: 18px; }
  .settings-summary { flex-wrap: wrap; }
}

/* Integration with the live template: keep semantic groups visually quiet. */
fieldset { min-width: 0; margin: 24px 0 0; padding: 0; border: 0; }
legend { display: block; width: 100%; margin-bottom: 12px; padding: 0; font-size: .875rem; font-weight: 700; }
.hero-copy h1 > span { color: var(--accent); }
.hero-copy > .trust-note { max-width: none; font-size: .75rem; margin-top: 17px; }
.project-cover { display: block; }
.section-heading > span { font-size: .75rem; color: var(--muted); }
.journey li > span { display: inline-flex; align-items: center; gap: 8px; }
.voice-journey { justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding: 0 0 18px; margin-bottom: 29px; }
.voice-journey > span { display: inline-flex; align-items: center; gap: 7px; font-size: .75rem; color: var(--muted); }
.voice-journey > span:first-child { font-weight: 700; color: var(--ink); }
.voice-journey .icon { width: 17px; height: 17px; color: var(--accent); }
.upload-zone { gap: 10px; padding-top: 22px; padding-bottom: 24px; }
.upload-zone > img { width: 112px; height: 112px; object-fit: contain; margin-bottom: 1px; }
.upload-zone > .icon { margin-top: 10px; width: 19px; height: 19px; padding: 12px; border-radius: 50%; color: var(--accent); background: var(--rose); }
input[type="file"]:not(.sr-only) { display: block; width: 100%; margin-top: 16px; font-size: .8125rem; color: var(--muted); }
input[type="file"]::file-selector-button { min-height: 44px; margin-right: 10px; padding: 10px 15px; border: 1px solid #ccd6dc; border-radius: 99px; background: var(--white); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
img.drawing-preview { display: block; padding: 0; border: 0; border-radius: 11px; }
.field label > span { color: var(--muted); font-size: .75rem; font-weight: 400; }
.field > .helper { margin-top: 0; }
.settings-summary > .icon { color: var(--accent); }
.settings-summary > div { display: grid; gap: 4px; flex: 1; }
.settings-summary > div > span { font-size: .75rem; color: var(--muted); }
.personalize > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; list-style: none; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.personalize > summary::-webkit-details-marker { display: none; }
.personalize > summary .icon { width: 17px; height: 17px; transition: transform .16s; }
.personalize[open] > summary .icon { transform: rotate(45deg); }
.personalize > p { font-size: .875rem; color: var(--muted); margin-bottom: 15px; }
.option-card > .icon:last-child { position: absolute; top: 10px; right: 10px; width: 15px; height: 15px; }
.style-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.style-thumb { display: block; width: 100%; }
.style-card > span:last-child { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; }
.style-card > span:last-child .icon { width: 14px; height: 14px; }
.style-0 { background: #f5eee4; }
.style-0 svg { opacity: .9; filter: saturate(.72); }
.style-1 { background: #fbf5e7; }
.style-1 svg { filter: saturate(.52) contrast(.92); }
.style-1 svg :is(path, ellipse, circle) { stroke: #8e785f; stroke-opacity: .45; stroke-width: .85px; }
.style-2 { background: #e7eeeb; }
.style-2 svg { filter: saturate(1.25) contrast(1.05); }
.style-2 svg :is(path, ellipse, circle) { stroke: none; }
.character-card h2 { font-size: 1.2rem; margin-bottom: 7px; }
.character-card > svg { max-width: 100%; width: 100%; max-height: 200px; margin-top: 15px; border-radius: 18px; }
.character-card > span { display: block; margin-top: 9px; font-size: .8125rem; color: var(--muted); }
.character-art > svg { display: block; width: 100%; height: 100%; max-height: 320px; }
.edit-panel > .btn { margin: 5px 5px 0 0; }
.edit-panel.field > .btn { width: fit-content; margin: 0; }
.page-art > svg { display: block; overflow: hidden; }
.book-cover { display: flex; flex-direction: column; align-items: stretch; gap: 17px; padding: 25px 21px 20px; }
.book-cover > div { display: contents; }
.book-cover > div > span:first-child { order: -2; color: #e6edf2; font-size: .625rem; text-transform: uppercase; letter-spacing: .08em; }
.book-cover h2 { order: -1; font-size: 1.6rem; line-height: 1.15; }
.book-cover > svg { order: 0; width: 100%; height: 170px; min-height: 150px; flex: 1; border-radius: 9px; }
.book-cover > div > span:last-child { order: 1; font-family: var(--heading-font); font-weight: 800; font-size: 1rem; letter-spacing: -.04em; }
.result-copy .stage-header { text-align: left; margin: 0 0 21px; }
.result-copy .stage-description { margin-left: 0; }
.voice-meta > span { display: block; color: var(--muted); font-size: .75rem; line-height: 1.55; margin-top: 3px; }
.voice-avatar > .icon { width: 23px; height: 23px; }
.record-card .record-text { margin-bottom: 0; }
.record-card + .record-timer { text-align: center; color: var(--accent); font-weight: 700; margin-top: 20px; }
.audio-player { text-align: center; max-width: none; }
.audio-player > strong { display: block; font-size: .8125rem; margin-bottom: 11px; }
.audio-player > audio { display: block; max-width: 440px; margin: 0 auto; }
.progress-track + .clip-list { margin-top: 22px; }
.clip-row > .clip-status { display: grid; place-items: center; flex: 0 0 29px; width: 29px; height: 29px; border: 1px solid #c9d5db; border-radius: 50%; margin-left: 0; font-size: .75rem; }
.clip-row > .clip-status.saved { background: var(--green-wash); border-color: transparent; }
.clip-row > span:nth-child(2) { min-width: 0; }
.clip-row > span:nth-child(2) > span { display: block; margin-top: 4px; color: var(--muted); font-size: .8125rem; font-weight: 400; line-height: 1.55; }
.clip-row > span:nth-child(2) > small { display: block; font-size: .6875rem; color: var(--muted); margin-top: 6px; }
.clip-row > .icon:last-child { margin-left: 3px; color: var(--muted); width: 17px; height: 17px; }
.version-row { width: 100%; text-align: left; }
.version-row > span { min-width: 0; }
.version-row > span:has(> svg:not(.icon)) { flex: 0 0 92px; width: 92px; height: 68px; overflow: hidden; border-radius: 9px; background: var(--peach); }
.version-row > span > svg:not(.icon) { width: 100%; height: 100%; }
.version-row > span > small { display: block; line-height: 1.5; }
.version-row > span:has(> svg:not(.icon)) + span { flex: 1; }
.version-row > .icon { width: 19px; height: 19px; color: var(--muted); flex-shrink: 0; }
.video-preview { width: 100%; max-height: 440px; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 22px; background: var(--ink); object-fit: contain; }
.video-result { width: 100%; max-width: 560px; margin: 0 auto; text-align: center; }
.video-result-player { padding: 8px; border-radius: 28px; background: var(--peach); }
.video-result-player .video-preview { display: block; border: 0; border-radius: 20px; }
.video-result-download { width: 100%; margin-top: 24px; }
.video-result-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 12px; margin-top: 10px; }
.video-result-actions .btn { min-height: 44px; padding: 9px 10px; font-size: .8125rem; }

/* The signed-in atelier puts existing stories and the next creation first. */
body.atelier-home-focus .site-header { min-height: 80px; padding-block: 16px; }
body.atelier-home-focus .brand { height: 48px; padding: 0; }
body.atelier-home-focus .brand img { width: 104px; max-height: 40px; }
.atelier-profile { width: auto; min-width: 74px; height: 44px; gap: 6px; padding: 5px 12px 5px 5px; border: 1px solid #e8ded3; border-radius: 999px; background: var(--white); color: var(--ink); }
.atelier-profile:hover { border-color: #e8ded3; background: var(--white); }
.atelier-profile .profile-mark { display: grid; flex: 0 0 32px; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--peach); color: #b27c68; }
.atelier-profile .profile-mark svg { width: 22px; height: 22px; }
.atelier-profile .profile-label { font-size: .75rem; font-weight: 700; }
.atelier-create { display: none; }
body.atelier-home-focus .atelier-create { display: inline-flex; min-height: 40px; padding: 8px 13px; gap: 5px; }
.atelier-create .icon { width: 17px; height: 17px; }
.atelier-home { max-width: 960px; margin: 0 auto; padding: 24px 0 max(48px, env(safe-area-inset-bottom, 0px)); }
.atelier-home-heading { margin-bottom: 18px; }
.atelier-home-heading h1 { font-size: clamp(1.45rem, 2.4vw, 1.75rem); }
.story-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 26px; }
.story-filters button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 8px 12px; border: 1px solid #eee2d6; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: .75rem; font-weight: 700; }
.story-filters button .icon { width: 15px; height: 15px; }
.story-filters button[aria-pressed="true"] { border-color: #e5c7b3; background: #f9ebe0; color: var(--ink); }
.story-filter-empty { padding: 34px 12px; color: var(--muted); font-size: .875rem; text-align: center; }
.atelier-home .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 32px; }
.atelier-home .project-card { --story-cover: #fff3e8; --story-spine: #e8c8b6; --story-tint: #f8e6d8; position: relative; width: 94%; justify-self: center; border-color: #eadbce; border-radius: 9px 22px 22px 9px; background: var(--story-cover); box-shadow: 3px 3px 0 #fffdf8, 5px 5px 0 #e7d9cb; }
.atelier-home .story-book--1 { --story-cover: #f1f5e9; --story-spine: #cbdcc5; --story-tint: #e5eedf; }
.atelier-home .story-book--2 { --story-cover: #f8f0ed; --story-spine: #e4c6c3; --story-tint: #f3e1dc; }
.atelier-home .story-book:nth-child(4n+1) { transform: translateY(3px) rotate(-1.4deg); }
.atelier-home .story-book:nth-child(4n+2) { transform: translateY(8px) rotate(1.5deg); }
.atelier-home .story-book:nth-child(4n+3) { transform: translateY(6px) rotate(.9deg); }
.atelier-home .story-book:nth-child(4n+4) { transform: translateY(2px) rotate(-1.6deg); }
.atelier-home .project-card:hover { border-color: #d9c4b4; box-shadow: 3px 3px 0 #fffdf8, 5px 5px 0 #e7d9cb, 0 9px 22px #76534414; }
.project-card-link { position: relative; display: flex; height: 100%; flex-direction: column; padding-left: 10px; color: inherit; text-decoration: none; }
.project-card-link::before { content: ''; position: absolute; z-index: 2; top: 0; bottom: 0; left: 0; width: 10px; background: linear-gradient(90deg, var(--story-spine), var(--story-cover)); border-right: 1px solid #b887702e; pointer-events: none; }
.project-card-link::after { content: ''; position: absolute; top: 10px; right: 2px; bottom: 10px; width: 2px; border-radius: 2px; background: #fffdf899; pointer-events: none; }
.atelier-home .project-cover { display: grid; place-items: center; aspect-ratio: 1.8; background: var(--story-cover); }
.story-bouquet { position: relative; width: 100%; height: 100%; overflow: hidden; background: radial-gradient(ellipse at 50% 55%, #fffaf4 0, var(--story-cover) 60%, var(--story-tint) 100%); }
.story-bouquet-frame { position: absolute; top: 20%; left: 50%; display: grid; place-items: center; width: 42%; aspect-ratio: 1.32; overflow: hidden; border: 5px solid #fffdf8; border-radius: 12px; background: #fff9f1; box-shadow: 0 8px 20px #76534424; transform: translateX(-50%); }
.story-bouquet-frame > img, .story-bouquet-frame > svg { width: 100%; height: 100%; object-fit: contain; }
.story-bouquet-frame > .project-cover-empty { width: 65%; height: 65%; object-fit: contain; }
.story-bouquet--1 .story-bouquet-frame { top: 12%; width: 55%; transform: translateX(-50%) rotate(-3deg); }
.story-bouquet--2 .story-bouquet-frame--1, .story-bouquet--3 .story-bouquet-frame--1 { left: 32%; top: 25%; transform: translateX(-50%) rotate(-10deg); }
.story-bouquet--2 .story-bouquet-frame--2 { left: 68%; top: 18%; transform: translateX(-50%) rotate(8deg); }
.story-bouquet--3 .story-bouquet-frame--2 { z-index: 2; left: 50%; top: 14%; transform: translateX(-50%) rotate(-2deg); }
.story-bouquet--3 .story-bouquet-frame--3 { left: 70%; top: 25%; transform: translateX(-50%) rotate(10deg); }
.story-bouquet-sparkle { position: absolute; top: 14%; right: 13%; color: #d9aa75; font-size: 1.1rem; }
.story-bouquet-dot { position: absolute; bottom: 18%; left: 12%; width: 7px; height: 7px; border-radius: 50%; background: #e6b5a0; }
.atelier-home .story-book:not(.is-finished) { overflow: visible; isolation: isolate; border: 1px dashed #d6c9bc; border-radius: 14px; background: #faf7f2; box-shadow: none; }
.story-paper-stack { position: absolute; z-index: 0; right: 6px; bottom: -7px; left: 6px; height: 8px; pointer-events: none; }
.story-paper-stack > span { position: absolute; left: 0; right: 0; height: 4px; border: 1px solid #ded3c7; border-radius: 0 0 4px 4px; background: #fffdf8; }
.story-paper-stack > span:nth-child(1) { top: 0; }
.story-paper-stack > span:nth-child(2) { top: 4px; right: 3px; left: 2px; background: #f8f4ee; }
.atelier-home .story-book:not(.is-finished):hover { border-color: #c5b3a4; box-shadow: none; }
.story-book:not(.is-finished) .project-card-link { z-index: 1; padding-left: 0; }
.story-book:not(.is-finished) .project-card-link::before, .story-book:not(.is-finished) .project-card-link::after { display: none; }
.atelier-home .story-book:not(.is-finished) .project-cover { overflow: hidden; border-radius: 13px 13px 0 0; background: #f4f0e9; }
.story-book:not(.is-finished) .story-bouquet { background: #f4f0e9; }
.story-book:not(.is-finished) .story-bouquet-frame { z-index: 1; border: 1.5px dashed #cdbfb2; border-radius: 5px; background: #f9f6f1; box-shadow: none; filter: grayscale(.65) saturate(.65); }
.story-book:not(.is-finished) .story-bouquet-frame--2 { z-index: 2; }
.story-book:not(.is-finished) :is(.story-bouquet-sparkle, .story-bouquet-dot) { display: none; }
.atelier-home .project-body { display: flex; flex: 1; flex-direction: column; align-items: stretch; padding: 18px; }
.atelier-home .project-body h2 { margin: 0 0 12px; color: #705044; font-family: Georgia, 'Times New Roman', serif; font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; overflow-wrap: anywhere; }
.atelier-home .project-body p { color: var(--muted); font-size: .8125rem; }
.story-card-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.story-book:not(.is-finished) .status-pill { padding: 0; background: transparent; color: #a77962; font-size: .6875rem; font-style: italic; }
.story-voice-status { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: .6875rem; font-weight: 700; }
.story-voice-status .icon { width: 14px; height: 14px; }
.atelier-home .story-book.is-finished .project-body { justify-content: center; text-align: center; }
.atelier-home .story-book.is-finished .project-body h2 { margin-bottom: 10px; color: #705044; font-family: Georgia, 'Times New Roman', serif; font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.story-book.is-finished .story-card-status { justify-content: center; gap: 5px 10px; }
.story-book.is-finished .status-pill, .story-book.is-finished .story-voice-status { padding: 0; background: transparent; color: #987769; font-size: .6875rem; font-weight: 700; }
.story-book.is-finished .story-voice-status .icon { color: #b08775; }
.project-card-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 16px; color: var(--ink); font-size: .8125rem; font-weight: 700; }
.project-card-action .icon { width: 17px; height: 17px; color: #b7836d; }
.atelier-empty { display: grid; justify-items: center; padding: 52px 24px; border-radius: 26px; background: #fff8f1; text-align: center; }
.atelier-empty img { width: 112px; height: 112px; object-fit: contain; }
.atelier-empty h2 { max-width: 24ch; margin: 18px 0 7px; font-size: 1.3rem; line-height: 1.25; }
.atelier-empty p { color: var(--muted); font-size: .875rem; }
@media (max-width: 680px) {
  body.atelier-home-focus .site-header { min-height: 68px; padding-block: 12px; }
  body.atelier-home-focus .brand { height: 44px; }
  body.atelier-home-focus .brand img { width: 88px; max-height: 36px; }
  .atelier-home { padding-top: 18px; }
  .atelier-home-heading { margin-bottom: 16px; }
  .atelier-home .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 26px; }
  .atelier-home .project-card-link { display: flex; }
  .atelier-home .project-cover { width: 100%; height: auto; min-height: 0; aspect-ratio: 1.4; }
  .story-bouquet-frame { border-width: 3px; border-radius: 9px; }
  .atelier-home .project-body { padding: 12px; }
  .atelier-home .project-body h2 { font-size: 1rem; }
  .atelier-home .story-book.is-finished .project-body h2 { font-size: 1rem; }
  .project-card-action { padding-top: 10px; font-size: .75rem; }
  .atelier-empty { padding: 38px 20px; }
}
.footer-note > .btn { min-height: 44px; }
.stage-body :is(button, a, input, textarea, select, [tabindex]) { scroll-margin-block: 24px 180px; }
.stage-body:has(textarea:focus) .actions, .stage-body:has(input:focus) .actions, .stage-body:has(select:focus) .actions { position: static; }

@media (max-width: 680px) {
  .journey li > span { gap: 5px; }
  .voice-journey { gap: 12px; margin-bottom: 24px; }
  .voice-journey > span { font-size: .6875rem; }
  .voice-journey > span:last-child { text-align: right; }
  .hero-copy > .trust-note { font-size: .6875rem; }
  .section-heading > span { font-size: .625rem; }
  .result-copy .stage-header { text-align: center; }
  .result-copy .stage-description { margin-inline: auto; }
  .book-cover { gap: 13px; padding: 20px 16px 17px; }
  .book-cover h2 { font-size: 1.4rem; }
  .book-cover > svg { height: 130px; min-height: 130px; }
  .style-card { font-size: .6875rem; padding: 6px 6px 11px; }
  .style-grid { gap: 8px; }
  .character-card h2 { font-size: 1.125rem; }
  .character-art > svg { max-height: 210px; }
  .voice-meta > span { font-size: .6875rem; }
  .version-row > span:has(> svg:not(.icon)) { flex-basis: 66px; width: 66px; height: 53px; }
  .version-row:has(> span > svg:not(.icon)) { flex-wrap: nowrap; }
  .record-illustration { aspect-ratio: auto; height: 110px; }
}
@media (max-width: 390px) {
  .journey li > span { gap: 4px; }
  .voice-journey { flex-wrap: wrap; justify-content: center; gap: 5px; }
  .voice-journey > span { justify-content: center; width: 100%; }
  .voice-journey > span:last-child { font-size: .625rem; }
  .section-heading > span { max-width: 90px; text-align: right; }
  .style-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .voice-actions .btn-small { min-width: 61px; }
}
@media (max-height: 600px) {
  .actions { position: static; }
  .modal { max-height: 90dvh; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: white; }
  .site-header, .journey, .workspace-top, .actions, .page-tools, .footer-note, .prototype-tag { display: none !important; }
  .shell, .workspace { width: 100%; max-width: none; padding: 0; }
  .page-sheet { break-inside: avoid; border: 0; box-shadow: none; }
  .stage-header { margin: 0 0 20px; }
}

/* Received voice message, integrated with the current instruction. */
.guide-companion { width: 100%; max-width: 480px; margin: 22px auto 0; text-align: left; }
.guide-launcher { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 80px; padding: 14px 16px; border: 1px solid #e8d8c7; border-radius: 21px; background: var(--peach); color: var(--ink); text-align: left; box-shadow: 0 3px 10px #082c5105; }
.guide-launcher:hover { border-color: #c9ac90; background: #f5e8d9; }
.guide-message-icon { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 16px; background: #fffaf4; color: var(--accent); }
.guide-message-icon svg { width: 36px; height: 29px; }
.guide-notification-copy { flex: 1; min-width: 0; }
.guide-notification-title { display: block; font-size: .875rem; line-height: 1.4; }
.guide-notification-copy > span { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.guide-badge { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--white); }
.guide-badge svg { width: 17px; height: 17px; transform-origin: 50% 15%; }
.guide-badge[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .guide-badge:not([hidden]) svg { animation: guide-bell-ring 9s ease-in-out infinite; }
  @keyframes guide-bell-ring {
    0%, 11%, 100% { transform: rotate(0); }
    2% { transform: rotate(20deg); }
    4% { transform: rotate(-18deg); }
    6% { transform: rotate(13deg); }
    8% { transform: rotate(-8deg); }
    10% { transform: rotate(3deg); }
  }
}
.guide-notification-chevron { flex: 0 0 16px; width: 16px; height: 16px; color: var(--muted); }
body.guide-modal-open { overflow: hidden; }
body.scene-scroll-locked { position: fixed; top: var(--scene-scroll-top, 0px); left: 0; right: 0; width: 100%; overflow: hidden; }
.guide-panel { position: fixed; inset: 0; width: min(420px, calc(100vw - 40px)); max-height: min(640px, calc(100dvh - 48px)); margin: auto; overflow-y: auto; overscroll-behavior: contain; padding: 22px; border: 1px solid #e8d8c7; border-radius: 26px; background: var(--paper); color: var(--ink); text-align: left; box-shadow: 0 18px 64px #082c512e; }
.guide-panel::backdrop { background: rgba(255, 255, 255, .38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.guide-sheet-handle { display: none; }
.guide-panel-heading #guide-description { display: block; margin-top: 5px; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.guide-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.guide-panel-heading strong { font-size: .875rem; }
.guide-panel-heading .icon-button { flex: 0 0 44px; margin: -6px -8px -2px 0; }
.guide-text { margin: 12px 2px 0; color: var(--muted); font-size: .8125rem; line-height: 1.55; }
.guide-message-label { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; }
.guide-message-label .icon { width: 16px; height: 16px; color: var(--accent); }
.guide-voice-bubble { display: flex; align-items: center; gap: 11px; padding: 8px 12px 8px 8px; margin-top: 12px; border-radius: 18px; background: #f9f1e9; }
.guide-play { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--white); cursor: pointer; }
.guide-play:hover { background: var(--accent-hover); }
.guide-play .icon { width: 21px; height: 21px; stroke-width: 2; }
.guide-voice-content { min-width: 0; flex: 1; }
.guide-waveform { --played: 0%; position: relative; height: 25px; }
.guide-waveform > span { display: flex; align-items: center; justify-content: space-between; gap: 3px; height: 25px; }
.guide-waveform i { display: block; flex: 1; min-width: 2px; max-width: 3px; max-height: 24px; border-radius: 99px; background: #d9bbb4; }
.guide-waveform .guide-waveform-played { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--played)) 0 0); }
.guide-waveform-played i { background: var(--accent); }
.guide-voice-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; color: var(--muted); font-size: .625rem; line-height: 1.4; }
.guide-duration { font-variant-numeric: tabular-nums; white-space: nowrap; }
.guide-audio-error { margin: 10px 2px 0; color: var(--accent-hover); font-size: .75rem; line-height: 1.45; }
@media (max-width: 680px) {
  .guide-companion { margin-top: 20px; }
  .guide-launcher { gap: 10px; padding: 13px; border-radius: 20px; }
  .guide-panel { inset: auto 0 0; width: 100%; max-width: none; max-height: calc(100dvh - max(24px, env(safe-area-inset-top))); margin: 0; padding: 10px 22px calc(24px + env(safe-area-inset-bottom)); border: 0; border-radius: 28px 28px 0 0; }
  .guide-sheet-handle { display: block; width: 36px; height: 4px; margin: 0 auto 18px; border-radius: 8px; background: #d0c9c1; }
  .guide-panel-heading strong { font-size: 1rem; }
  .guide-text { margin-top: 16px; font-size: .875rem; }
}
@media (max-width: 360px) {
  .guide-notification-title { font-size: .8125rem; }
  .guide-notification-copy > span { font-size: .6875rem; }
  .guide-notification-chevron { display: none; }
}
@media print { .guide-companion { display: none !important; } }

@keyframes guide-arrival {
  0% { transform: translate3d(0,0,0) scale(1); animation-timing-function: cubic-bezier(.2,.75,.25,1); }
  32% { transform: translate3d(0,-5px,0) scale(1.065); animation-timing-function: cubic-bezier(.55,0,.8,.35); }
  56% { transform: translate3d(0,1px,0) scale(.985); animation-timing-function: cubic-bezier(.2,.75,.3,1); }
  78% { transform: translate3d(0,-1px,0) scale(1.012); animation-timing-function: cubic-bezier(.3,0,.2,1); }
  100% { transform: translate3d(0,0,0) scale(1); }
}
.guide-message-icon.guide-arrival { transform-origin: 50% 65%; animation: guide-arrival 500ms 1 both; }
@media (prefers-reduced-motion: reduce) {
  .guide-message-icon.guide-arrival { animation: none; }
}

/* The upload screen needs the full content area: keep its voice message in the
   familiar top bar as a compact, accessible control. */
.guide-companion-header { width: auto; margin: 0; text-align: initial; }
.guide-companion-header .guide-launcher { position: relative; display: grid; place-items: center; width: 48px; min-height: 48px; padding: 5px; border-radius: 50%; background: var(--white); box-shadow: none; }
.guide-companion-header .guide-launcher:hover { background: #fffaf4; }
.guide-companion-header .guide-message-icon { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 12px; background: var(--peach); }
.guide-companion-header .guide-message-icon svg { width: 26px; height: 22px; }
.guide-companion-header .guide-notification-copy,
.guide-companion-header .guide-notification-chevron { display: none; }
.guide-companion-header .guide-badge { position: absolute; top: -6px; right: -2px; border: 2px solid var(--paper); }
/* A new message stands out; after listening, the same control becomes quiet. */
.guide-companion-header[data-unread="true"] .guide-launcher { border-color: #ebc6bd; background: #fff0ec; box-shadow: 0 2px 8px #dc30441c; }
.guide-companion-header[data-unread="true"] .guide-message-icon { background: transparent; color: var(--accent); }
.guide-companion-header[data-unread="true"] .guide-badge { background: var(--accent); border-color: var(--paper); }
.guide-companion-header[data-unread="false"] .guide-launcher { border-color: var(--line); background: var(--white); }
.guide-companion-header[data-unread="false"] .guide-message-icon { background: transparent; color: var(--muted); }
.guide-companion:not(.guide-companion-header)[data-unread="false"] .guide-launcher { border-color: var(--line); background: var(--white); box-shadow: none; }
.guide-companion:not(.guide-companion-header)[data-unread="false"] .guide-message-icon { background: var(--blue-wash); color: var(--muted); }
@media (max-width: 680px) {
  .guide-companion-header .guide-launcher { width: 44px; min-height: 44px; }
  .guide-companion-header .guide-message-icon { flex-basis: 32px; width: 32px; height: 32px; }
}

/* The sender and the voice symbol share the same message control. */
.guide-avatar { display: block; flex: 0 0 40px; width: 40px; height: 40px; object-fit: cover; border-radius: 50%; }
.guide-panel-heading .guide-panel-sender { flex: 1; min-width: 0; }
.guide-companion-header .guide-launcher { display: flex; justify-content: center; gap: 3px; width: auto; min-width: 79px; padding: 5px 8px 5px 5px; border-radius: 999px; }
.guide-companion-header .guide-avatar { flex-basis: 32px; width: 32px; height: 32px; }
.guide-companion-header .guide-message-icon { flex-basis: 27px; width: 27px; height: 32px; }
.guide-companion-header .guide-message-icon svg { width: 24px; height: 20px; }
@media (max-width: 680px) {
  .guide-companion-header .guide-launcher { min-width: 75px; }
  .guide-companion-header .guide-avatar { flex-basis: 30px; width: 30px; height: 30px; }
  .guide-companion-header .guide-message-icon { flex-basis: 26px; width: 26px; height: 30px; }
}

/* A focused drawing review, with only the image and its description. */
.drawing-review { display: grid; grid-template-columns: 1fr; gap: 0; align-items: start; max-width: 560px; margin: 0 auto; }
.review-image { position: relative; width: 100%; max-width: 330px; min-width: 0; margin-inline: auto; text-align: left; }
.review-image > .drawing-preview { position: relative; isolation: isolate; display: flex; justify-content: center; width: fit-content; max-width: 100%; margin-inline: auto; padding: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.review-image > .drawing-preview::before, .upload-preview::before { content: ""; position: absolute; z-index: -1; inset: 8px -7px -8px 7px; border-radius: 18px 27px 15px 24px; background: #f6dfd5; transform: rotate(2deg); }
.review-image > .drawing-preview > img, .review-image > .drawing-preview > svg { width: auto; height: auto; max-width: 100%; max-height: 250px; border-radius: 8px; }
.review-image-actions { position: absolute; top: 4px; right: 4px; z-index: 1; }
.review-image-actions .btn { min-height: 44px; padding: 8px 10px; border: 0; background: rgba(255, 253, 248, .94); color: var(--muted); font-size: .8125rem; box-shadow: none; }
.review-image-actions .btn:hover { background: var(--white); color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.reading-panel .review-heading { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 16px; font-size: 1rem; }
.drawing-analysis-result .review-heading { position: relative; }
.drawing-writing-indicator { position: absolute; right: 0; display: block; width: 38px; height: 38px; }
.drawing-writing-indicator .writing-art { width: 100%; height: 100%; }
.review-connection { position: relative; display: flex; flex-direction: column; align-items: center; color: var(--muted); }
.review-connection::before, .review-connection::after { content: ""; display: block; width: 1px; height: 18px; background: #dccfc6; }
.review-connection-label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid #ecddd7; border-radius: 999px; background: #fff8f5; font-size: .75rem; font-weight: 700; }
.review-connection-label .icon { width: 17px; height: 17px; color: var(--accent); }
.drawing-review .reading-panel { width: 100%; max-width: 500px; margin-inline: auto; padding: 22px 24px; border: 1px solid #eee5dd; border-radius: 20px; background: #fffaf6; text-align: center; }
.drawing-review .drawing-description { width: 100%; max-width: 48ch; height: 168px; margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; scrollbar-width: thin; -webkit-overflow-scrolling: touch; color: var(--ink); line-height: 1.7; text-align: left; white-space: pre-line; text-wrap: wrap; }
.drawing-description-scroll-hint { min-height: 18px; margin: 4px 0 0; color: var(--muted); font-size: .6875rem; text-align: right; visibility: hidden; }
.drawing-description-scroll-hint.is-visible { visibility: visible; }
.drawing-description-pending { color: var(--muted); }
/* A soft scan stays on the drawing while the description is prepared. */
.drawing-analysis-result { min-width: 0; margin-top: 24px; }
.drawing-analysis-result.is-pending, .drawing-analysis-pending { visibility: hidden; }
.drawing-analysis-overlay { position: absolute; z-index: 1; inset: 0; display: block; container-type: inline-size; pointer-events: none; }
.drawing-analysis-effects { position: absolute; inset: 0; overflow: hidden; border-radius: 8px; }
.drawing-analysis-wash { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255, 228, 211, .26), rgba(246, 218, 225, .14), rgba(255, 244, 215, .3)); }
.drawing-analysis-sweep { position: absolute; inset: 0 0 auto; height: 25%; background: linear-gradient(180deg, transparent, rgba(255, 250, 237, .55), transparent); transform: translateY(-100%); }
.drawing-analysis-loupe { position: absolute; z-index: 2; top: -15%; left: -15%; width: 78%; max-width: 158px; aspect-ratio: 1; filter: drop-shadow(0 3px 4px rgba(112, 75, 53, .18)); }
.drawing-analysis-loupe > svg { position: relative; width: 100%; height: 100%; }
.drawing-analysis-lens { position: absolute; top: 11.1%; left: 12.5%; width: 55.6%; aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: #fffaf4; }
.drawing-analysis-lens > img, .drawing-analysis-lens > svg { position: absolute; top: 0; left: 0; max-width: none; max-height: none; padding: 0; border: 0; border-radius: 0; transform-origin: top left; }
.drawing-analysis-sparkles { position: absolute; top: 20%; left: 14%; color: #fffaf3; font-size: 1.1rem; text-shadow: 0 1px 6px #b77c6a; letter-spacing: 1.1rem; }
.drawing-analysis-sparkles span { font-size: .8em; }
@media (prefers-reduced-motion: no-preference) {
  .drawing-analysis-sweep { animation: drawing-scan 1.8s ease-in-out infinite; }
  .drawing-analysis-sparkles { animation: drawing-sparkle 1.5s ease-in-out infinite alternate; }
  .drawing-analysis-loupe { animation: drawing-loupe-search 3.6s cubic-bezier(.4, 0, .2, 1) infinite; }
  @keyframes drawing-scan { from { transform: translateY(-100%); } to { transform: translateY(400%); } }
  @keyframes drawing-sparkle { from { opacity: .45; transform: scale(.92); } to { opacity: 1; transform: scale(1.1); } }
  @keyframes drawing-loupe-search { 0%, 100% { left: -15%; top: -15%; } 25% { left: 48%; top: -15%; } 50% { left: 48%; top: calc(115% - 158px); top: calc(115% - min(78cqw, 158px)); } 75% { left: -15%; top: calc(115% - 158px); top: calc(115% - min(78cqw, 158px)); } }
}
.drawing-locked-note { margin: 16px auto 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; text-align: center; }
.drawing-review .edit-panel { text-align: left; }
.drawing-review .reading-panel > .btn { margin-top: 14px; }
@media (max-width: 680px) {
  .drawing-review { grid-template-columns: 1fr; gap: 0; max-width: 560px; }
  .drawing-review .reading-panel { padding: 20px; }
  .review-image { width: 100%; max-width: 290px; margin-inline: auto; }
  .review-image > .drawing-preview > img, .review-image > .drawing-preview > svg { max-height: 220px; }
}

/* Keep the first action clear and the drawing area generous. */
.preview-panel:has(> .upload-zone) { width: min(85%, 480px); margin-inline: auto; }
.upload-zone { aspect-ratio: 1; min-height: 0; align-content: center; gap: 14px; }
.upload-zone > .icon { margin-top: 0; width: 24px; height: 24px; padding: 16px; }
.upload-preview { position: relative; isolation: isolate; display: flex; justify-content: center; width: fit-content; max-width: min(100%, 400px); margin-inline: auto; aspect-ratio: auto; padding: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.upload-preview > img, .upload-preview > svg { width: auto; height: auto; max-width: 100%; max-height: 420px; border-radius: 8px; }
@media (max-width: 680px) {
  .upload-preview { max-width: min(100%, 340px); }
  .upload-preview > img, .upload-preview > svg { max-height: 300px; }
}

/* Keep both drawing steps consistent without crowding their content. */
.drawing-step-heading { max-width: 560px; margin-bottom: 28px; text-align: center; }
.drawing-step-heading .stage-title { max-width: 25ch; margin-inline: auto; font-size: clamp(1.5rem, 4vw, 1.85rem); line-height: 1.3; text-wrap: balance; }
@media (max-width: 680px) {
  .drawing-step-heading { margin-bottom: 26px; }
}

.drawing-feedback { width: 100%; max-width: 500px; margin: 20px auto 0; text-align: left; }

/* The two answers stay equally accessible on small screens. */
.drawing-review-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 88px; align-items: end; gap: 10px; max-width: 500px; }
.drawing-review-actions > .btn { width: 100%; height: 52px; min-width: 0; min-height: 0; margin: 0; padding: 8px; overflow: hidden; text-align: center; line-height: 1.25; transition: height .28s ease, border-radius .28s ease, background-color .2s ease; }
.drawing-review-actions > .btn .icon { flex: 0 0 18px; width: 18px; height: 18px; }
.drawing-review-actions > .drawing-confirm-button.is-confirming { height: 88px; flex-direction: column; gap: 4px; border-radius: 24px; }
.drawing-review-actions > .drawing-confirm-button.is-confirming .icon { flex-basis: 20px; width: 20px; height: 20px; stroke-width: 2.5; }
.drawing-confirm-copy { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 3px; }
.drawing-confirm-copy strong { font-size: .75rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; white-space: nowrap; }
.drawing-confirm-copy > span { font-size: .6875rem; font-weight: 700; line-height: 1.2; }
@media (max-width: 680px) {
  .drawing-review-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .drawing-review-actions > .btn { font-size: .8125rem; }
  .drawing-review-actions > .btn-secondary { order: 0; }
  .drawing-review-actions > .btn-primary { order: 1; }
}

.drawing-feedback-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

.drawing-feedback-error { margin: 4px 0 0; color: var(--accent-hover); font-size: .8125rem; }

/* Keep sheet controls clear of mobile browser and device edges. */
@media (max-width: 680px) {
  .guide-panel[open] { display: flex; flex-direction: column; min-height: 60dvh; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .guide-panel-heading { margin-top: 0; }
  .guide-panel .guide-text, .guide-panel .drawing-feedback { margin-bottom: auto; }
}

.guide-panel > .sheet-close { position: absolute; top: 12px; right: 12px; z-index: 1; }
.guide-panel .guide-panel-heading { padding-right: 46px; }
@media (max-width: 680px) {
  .guide-panel > .sheet-close { top: 10px; right: 12px; }
}


.guide-panel > .sheet-close { background: var(--peach); color: var(--ink); }
.guide-panel > .sheet-close:hover { background: #f0e2d3; }

.guide-panel > .sheet-close { top: 18px; right: 18px; border: 0; background: transparent; color: #526b80; }
.guide-panel > .sheet-close .icon { width: 19px; height: 19px; stroke-width: 1.6; }
.guide-panel > .sheet-close:hover { background: transparent; color: var(--accent); }
@media (max-width: 680px) {
  .guide-panel > .sheet-close { top: 16px; right: 18px; }
}

@media (max-width: 680px) {
  .guide-panel[open] { transition: transform .25s cubic-bezier(.32, .72, .35, 1); }
  .guide-panel.sheet-dragging { transition: none; }
}

/* Extend the sheet behind Safari's bottom safe area without lowering its controls. */
@media (max-width: 680px) {
  .guide-panel[open] {
    bottom: calc(-48px - env(safe-area-inset-bottom, 0px));
    min-height: calc(60dvh + 48px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - max(24px, env(safe-area-inset-top, 0px)) + 48px + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px) + max(48px, env(safe-area-inset-bottom, 0px)));
  }
}

/* Keep Safari's bottom toolbar area aligned with the sheet's background. */
@media (max-width: 680px) {
  body.guide-modal-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    background: rgba(255, 255, 255, .38);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }
  .guide-panel::backdrop { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Keep the voice control in the same place before and after listening. */
.guide-companion-header {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  right: max(16px, calc((100vw - 1200px) / 2 + 36px));
  z-index: 20;
}
@media (max-width: 680px) {
  .guide-companion-header {
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
  }
}

/* Keep the smaller logo aligned with the voice message at the top of the page. */
body.upload-focus .site-header { min-height: 80px; padding-block: 16px; }
body.upload-focus .brand { height: 48px; padding: 0; }
body.upload-focus .brand img { width: 104px; max-height: 40px; }
@media (max-width: 680px) {
  body.upload-focus .site-header { min-height: 68px; padding-block: 12px; }
  body.upload-focus .brand { height: 44px; }
  body.upload-focus .brand img { width: 88px; max-height: 36px; }
}

/* A single, quick age choice for the next step. */
.age-step { width: 100%; max-width: 460px; margin-inline: auto; }
.age-step .age-choices { margin: 0; }
.age-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.age-choice label { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; min-height: 58px; padding: 8px 4px; border: 1px solid #e8ded3; border-radius: 16px; background: #fffaf5; color: var(--ink); font-weight: 700; cursor: pointer; }
.age-choice label::after { content: ''; position: absolute; top: 11px; right: 11px; width: 5px; height: 5px; border-radius: 50%; background: #e8b8a9; box-shadow: -7px 4px 0 -1px #e8b8a9; }
.age-choice input:checked + label { border-color: #678fa3; background: var(--blue-wash); color: var(--ink); }
.age-choice label:hover { border-color: #cba99e; }
.age-step .actions { margin-top: 26px; }
.author-name-step { max-width: 380px; }
.author-age-back { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: .875rem; font-weight: 700; cursor: pointer; }
.author-age-back .icon { width: 17px; height: 17px; }
.author-name-input { display: block; width: 100%; min-height: 60px; margin-top: 12px; padding: 14px 18px; border: 1px solid #e8ded3; border-radius: 16px; background: #fffaf5; color: var(--ink); font: inherit; font-size: 16px; }
.author-name-input::placeholder { color: #9eaaa9; }
@media (prefers-reduced-motion: no-preference) {
  .author-question { animation: author-question-enter .36s cubic-bezier(.2,.75,.3,1) both; }
  .age-choice label { transition: transform .16s ease, background-color .2s ease, border-color .2s ease; }
  .age-choice label:active { transform: scale(.96); }
  .age-choice input:checked + label { animation: age-select .24s cubic-bezier(.2, .75, .3, 1); }
  @media (hover: hover) { .age-choice label:hover { transform: translateY(-2px); } }
}
@keyframes age-select { 0% { transform: scale(.95); } 65% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes author-question-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 360px) {
  .age-options { gap: 8px; }
  .age-choice label { min-height: 52px; font-size: .875rem; }
}

/* Previous steps act as a compact path back through the drawing flow. */
.drawing-progress { max-width: 720px; margin: 0 auto 26px; padding-bottom: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.drawing-progress::-webkit-scrollbar { display: none; }
.drawing-progress ol { display: flex; justify-content: center; align-items: flex-start; width: max-content; min-width: 100%; list-style: none; padding: 0; margin: 0; }
.drawing-progress li { position: relative; flex: 0 0 108px; width: 108px; color: var(--muted); }
.drawing-progress button, .drawing-progress .progress-current { display: flex; width: 100%; min-height: 98px; flex-direction: column; align-items: center; gap: 3px; padding: 2px 3px 4px; text-align: center; }
.drawing-progress button { border: 0; background: transparent; color: var(--muted); text-decoration: none; }
.drawing-progress button:hover { color: var(--ink); }
.drawing-progress [aria-current="step"] { color: var(--ink); }
.progress-connector { position: absolute; top: 17px; left: -8px; display: grid; place-items: center; width: 16px; height: 16px; color: #c7a694; pointer-events: none; }
.progress-connector .icon { width: 14px; height: 14px; stroke-width: 2; }
.progress-mark { position: relative; display: grid; flex: 0 0 48px; place-items: center; width: 48px; height: 48px; margin-bottom: 4px; border-radius: 50%; background: #faf0e5; }
.progress-mark .progress-art { width: 44px; height: 44px; }
.progress-done { background: #dfeedd; }
.progress-active { background: #f8d5a3; }
.progress-state { position: absolute; right: -2px; bottom: -1px; display: grid; place-items: center; width: 17px; height: 17px; border: 2px solid var(--paper); border-radius: 50%; background: #fff9f2; color: #a77a67; }
.drawing-progress:not(.narration-progress) .progress-state:not(.is-locked) { width: 23px; height: 23px; }
.drawing-progress:not(.narration-progress) .progress-state:not(.is-locked) .icon { width: 12px; height: 12px; }
.progress-state .icon { width: 10px; height: 10px; stroke-width: 3; }
.progress-state.is-locked { right: -3px; bottom: -3px; width: 26px; height: 26px; background: #fff9f2; }
.progress-state.is-locked .progress-lock-art { width: 15px; height: 15px; }
.progress-label { font-size: .8125rem; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.progress-caption { color: #88766c; font-size: .6875rem; font-weight: 400; line-height: 1.3; white-space: nowrap; }
.progress-current .progress-caption { color: #895b4c; }
.drawing-progress button:disabled { color: #8c8b84; text-decoration: none; }
.drawing-progress button.is-locked:disabled { opacity: 1; color: var(--ink); }
.progress-burst { position: absolute; z-index: 3; width: 0; height: 0; pointer-events: none; }
.progress-burst > span { position: absolute; top: -4px; left: -3px; width: 6px; height: 9px; border-radius: 2px; background: var(--c); opacity: 0; animation: progress-confetti .78s cubic-bezier(.16,.7,.3,1) var(--delay) both; }
.progress-burst > span:nth-child(3n) { width: 6px; height: 6px; border-radius: 50%; }
@keyframes progress-confetti { 0% { opacity: 0; transform: translate(0,0) scale(.3) rotate(0); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x),var(--y)) scale(.8) rotate(var(--r)); } }
@media (max-width: 680px) {
  .drawing-progress { margin-bottom: 22px; padding-bottom: 12px; }
  .drawing-progress li { flex-basis: 94px; width: 94px; }
  .progress-label { font-size: .75rem; }
  .progress-caption { font-size: .625rem; }
}

/* Match the story review to the preceding focused steps. */
.story-step { width: 100%; max-width: 500px; margin-inline: auto; }
.story-review { width: 100%; padding: 22px 24px; border: 1px solid #eee5dd; border-radius: 20px; background: #fffaf6; text-align: center; }
.story-review .story-description { max-width: 48ch; margin: 0 auto; color: var(--ink); line-height: 1.7; text-align: left; white-space: pre-line; text-wrap: pretty; }
.story-writing-area { position: relative; min-height: 150px; }
.story-writing-area.is-writing .story-description { visibility: hidden; }
.story-writing-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: .8125rem; }
.story-writing-wait .writing-art { width: 108px; height: 108px; }
.inline-writing-wait { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px auto 0; color: var(--muted); font-size: .875rem; }
.inline-writing-wait .writing-art, .inline-writing-wait .collection-generating-art { width: 76px; height: 76px; }
.story-review > .btn { margin-top: 14px; }
.story-review .edit-panel { text-align: left; }
@media (max-width: 680px) { .story-review { padding: 20px; } }


/* A lively preview for the narrated version, alongside a quieter PDF. */
.format-showcase { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: 100%; max-width: 520px; margin: 0 auto; }
.format-video-card, .format-pdf-card { position: relative; min-width: 0; padding: 17px 18px; border: 1px solid #eee1d6; border-radius: 20px; background: transparent; }
.format-choice-heading { display: flex; align-items: center; gap: 16px; }
.format-choice-heading .format-choice-copy { flex: 1; min-width: 0; }
.format-choice-arrow { display: grid; place-items: center; color: var(--muted); }
.format-choice-arrow .icon { width: 19px; height: 19px; }
.format-type-icon { flex: 0 0 28px; width: 28px; height: 28px; color: currentColor; }
.format-choice-copy { text-align: left; }
.format-choice-copy h2 { margin: 0; color: var(--ink); font-size: 1.1rem; line-height: 1.3; }
.format-choice-copy p { margin: 5px 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.format-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #f1e7de; color: var(--ink); font-size: .75rem; font-weight: 700; line-height: 1.4; }
.format-features > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.format-feature-art { flex: 0 0 40px; width: 40px; height: 40px; padding: 7px; border-radius: 50%; background: #f9e8dc; }
.format-features > span:nth-child(2) .format-feature-art { background: #fbf0d9; }
.format-features > span:nth-child(3) .format-feature-art { background: #eaf1e5; }
.format-choice-group { text-align: center; }
.format-download { width: 100%; min-height: 56px; }
.format-video-download { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; width: 100%; min-height: 74px; padding: 11px 16px; text-align: center; }
.format-video-download > .format-video-icon, .format-video-download > .format-type-icon { width: 44px; height: 32px; padding-right: 12px; border-right: 1px solid rgba(255, 255, 255, .38); }
.format-pdf-choice .format-video-download > .format-type-icon { border-right-color: #e8dcd2; }
.format-video-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px 14px; margin-top: 10px; color: var(--muted); font-size: .6875rem; line-height: 1.4; }
.format-video-meta > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.format-video-meta .format-feature-art { flex-basis: 16px; width: 16px; height: 16px; padding: 0; background: transparent; }
.format-video-symbol { display: block; flex: 0 0 48px; width: 48px; height: 48px; }
.format-video-copy { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 3px; }
.format-video-copy strong { font-size: .9375rem; line-height: 1.3; }
.format-video-copy > span { font-size: .75rem; font-weight: 400; line-height: 1.4; opacity: .88; }
.format-video-download .format-video-arrow { justify-self: end; width: 18px; height: 18px; }
.format-choice-description { margin: 7px 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.format-choice-group .format-features { width: 100%; max-width: 320px; margin: 10px auto 0; padding: 0; border: 0; gap: 8px; }
.format-choice-group .format-features > span { gap: 4px; }
.format-mini-art { display: block; flex: 0 0 42px; width: 42px; height: 42px; }
.format-mini-float, .format-mini-spark { transform-box: fill-box; transform-origin: center; }
.format-pdf-choice { margin-top: 14px; padding-top: 24px; border-top: 1px solid #f1e7de; }
@media (prefers-reduced-motion: no-preference) {
  .format-video-sound { transform-box: fill-box; transform-origin: center; animation: format-video-sound 1.2s ease-in-out infinite alternate; }
  @keyframes format-video-sound { from { transform: scaleY(.65); } to { transform: scaleY(1.15); } }
  .format-mini-float { animation: format-mini-float 3.4s ease-in-out infinite; }
  .format-mini-spark { animation: format-mini-spark 2.4s ease-in-out infinite; }
  .format-mini-draw { stroke-dasharray: 90; animation: format-mini-draw 4.8s ease-in-out infinite; }
  .format-features > span:nth-child(2) .format-mini-float { animation-delay: -.8s; }
  .format-features > span:nth-child(3) .format-mini-float { animation-delay: -1.6s; }
  @keyframes format-mini-float { 50% { transform: translateY(-2px) rotate(2deg); } }
  @keyframes format-mini-spark { 50% { transform: scale(1.2) rotate(10deg); opacity: .7; } }
  @keyframes format-mini-draw { 0%, 8% { stroke-dashoffset: 90; } 45%, 100% { stroke-dashoffset: 0; } }
}
.format-choice-cta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; color: var(--ink); font-size: .8125rem; font-weight: 700; }
.format-choice-cta .icon { width: 18px; height: 18px; }
.format-card-action { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.format-video-preview { position: relative; isolation: isolate; align-self: center; width: min(100%, 220px); aspect-ratio: 1.55; overflow: hidden; border-radius: 17px; background: #faece0; }
.format-preview-art { display: block; width: 100%; height: 100%; }
.format-page-one { --page-delay: 0s; animation: format-page-one 12s ease-in-out infinite; }
.format-page-two { --page-delay: 4s; opacity: 0; animation: format-page-two 12s ease-in-out infinite; }
.format-page-three { --page-delay: 8s; opacity: 0; animation: format-page-three 12s ease-in-out infinite; }
.format-scene-bob, .format-scene-float { transform-box: fill-box; transform-origin: center; }
.format-scene-bob { animation: format-story-bob 3s ease-in-out infinite; }
.format-scene-float { animation: format-story-float 2.8s ease-in-out infinite; }
.format-closeup { transform-box: view-box; transform-origin: 43% 45%; animation: format-closeup-drift 12s ease-in-out infinite; }
.format-preview-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 48%, #fff4e9c9 100%); }
.format-preview-label { position: absolute; top: 12px; left: 12px; padding: 5px 9px; border-radius: 999px; background: #fffaf1e8; color: var(--ink); font-size: .625rem; font-weight: 700; }
.format-preview-bottom { position: absolute; right: 14px; bottom: 12px; left: 14px; color: #b37d68; }
.format-preview-captions { position: relative; width: min(64%, 165px); height: 24px; margin: 0 auto 4px; border-radius: 8px; background: #fffaf2e8; }
.format-caption-page { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.format-caption-line { display: block; width: var(--line-width); height: 3px; border-radius: 5px; background: #c89d88; transform-origin: left center; animation: format-skeleton-write 12s ease-in-out var(--page-delay) infinite; }
.format-caption-line:nth-child(2) { animation-delay: calc(var(--page-delay) + .3s); }
.format-preview-audio { display: flex; align-items: center; gap: 9px; height: 27px; }
.format-preview-play { display: grid; flex: 0 0 24px; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fffaf1; color: #ca7866; font-size: .55rem; }
.format-preview-wave { display: flex; flex: 1; align-items: center; justify-content: center; gap: 4px; height: 24px; overflow: hidden; }
.format-preview-wave i { display: block; flex: 0 0 3px; height: var(--bar); border-radius: 5px; background: #cb9a84; transform-origin: center; animation: format-wave .8s ease-in-out var(--delay) infinite alternate; }
.format-preview-sound .icon { width: 16px; height: 16px; }
.format-preview-track { height: 3px; margin-top: 6px; overflow: hidden; border-radius: 8px; background: #e6cdbd; }
.format-preview-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: #cf9e87; transform: scaleX(0); transform-origin: left; animation: format-track 12s linear infinite; }
.format-pdf-preview { display: grid; place-items: center; align-self: center; width: min(100%, 220px); aspect-ratio: 1.55; overflow: hidden; background: transparent; }
.format-pdf-preview svg { width: min(60%, 130px); max-height: 78%; height: auto; }
.format-read-link { margin: 12px auto 0; text-align: center; }
.pdf-choice-panel .guide-panel-heading h2 { margin: 0; color: var(--ink); font-size: 1.2rem; line-height: 1.35; }
.pdf-choice-description { margin: 16px 0 0; color: var(--muted); font-size: .9375rem; line-height: 1.6; }
.pdf-choice-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.pdf-choice-actions .btn { width: 100%; min-width: 0; padding-inline: 10px; font-size: .8125rem; text-align: center; }
.pdf-finished { width: 100%; max-width: 420px; margin: 0 auto; text-align: center; }
.pdf-finished-art { position: relative; display: grid; place-items: center; width: 112px; height: 112px; margin: 0 auto; border-radius: 38px; background: #e8f1e5; }
.pdf-finished-art .progress-art { width: 90px; height: 90px; }
.pdf-finished-art > span { position: absolute; top: 8px; right: 9px; color: #dfa976; font-size: 1.15rem; }
.pdf-finished > p { margin: 22px auto 0; color: var(--muted); font-size: .9375rem; line-height: 1.6; }
.pdf-finished-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.pdf-finished-actions .btn { width: 100%; min-width: 0; padding-inline: 10px; }
.voice-intro-step { width: 100%; max-width: 500px; margin: 0 auto; }
.voice-intro-message { padding: 0; border: 0; background: transparent; }
.voice-intro-compact { display: flex; align-items: center; gap: 10px; width: min(100%, 320px); margin: 0 auto; }
.voice-intro-avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.voice-intro-sender { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.voice-intro-sender img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.voice-intro-sender span { display: flex; flex-direction: column; gap: 3px; }
.voice-intro-sender strong { font-size: .9375rem; }
.voice-intro-sender small { color: var(--muted); font-size: .6875rem; }
.voice-intro-message .guide-voice-bubble { flex: 1; min-width: 0; gap: 9px; margin: 0; padding: 7px 12px 7px 7px; border-radius: 20px 20px 20px 6px; background: var(--paper); }
.voice-intro-message .guide-play { flex-basis: 42px; width: 42px; height: 42px; background: var(--ink); }
.voice-intro-message .guide-play:hover { background: var(--muted); }
.voice-intro-message .guide-waveform > span { gap: 2px; }
.voice-intro-message .guide-waveform i { flex: 0 0 2px; min-width: 2px; max-width: 2px; border-radius: 2px; background: #c7d0d4; }
.voice-intro-message .guide-waveform-played i { background: var(--ink); }
:is(.voice-intro-message, #guide-panel) .guide-voice-meta { justify-content: flex-end; margin-top: 0; color: var(--ink); opacity: .65; }
:is(.voice-intro-message, #guide-panel) .voice-intro-compact { display: flex; align-items: center; gap: 11px; width: min(100%, 220px); margin: 0 auto; padding: 7px 13px 7px 7px; border: 0; border-radius: 18px 18px 18px 7px; background: #faf3ec; box-shadow: none; color: var(--ink); text-align: left; cursor: pointer; }
#guide-panel .voice-intro-compact { margin-top: 16px; }
.voice-intro-avatar-wrap { position: relative; display: block; flex: 0 0 40px; width: 40px; height: 40px; }
.voice-intro-avatar-wrap .voice-intro-avatar { display: block; }
.voice-intro-state { position: absolute; right: -4px; bottom: -3px; display: grid; place-items: center; width: 19px; height: 19px; border: 2px solid #faf3ec; border-radius: 50%; background: var(--ink); color: white; }
.voice-intro-state .icon { width: 10px; height: 10px; stroke-width: 2.2; }
.voice-intro-compact .guide-voice-content, .voice-intro-compact .guide-waveform, .voice-intro-compact .guide-voice-meta { display: block; }
.voice-intro-compact .guide-voice-meta { text-align: right; }
.voice-intro-compact .voice-message-waveform, .voice-trial-compact .voice-message-waveform { display: block; width: 100%; height: 25px; fill: var(--ink); stroke: none; opacity: .3; }
.voice-intro-compact .guide-waveform-played .voice-message-waveform, .voice-trial-compact .guide-waveform-played .voice-message-waveform { fill: var(--ink); stroke: none; opacity: .9; }

.voice-intro-copy { max-width: 37ch; margin: 22px auto 0; color: var(--ink); font-size: .9375rem; line-height: 1.7; text-align: center; text-wrap: pretty; }
.voice-intro-copy strong { font-weight: 700; }
.voice-trial { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 420px; margin: 24px auto 0; padding: 24px 0 10px; border-top: 1px solid #eee7df; text-align: center; }
.voice-trial[hidden] { display: none; }
.voice-trial h2 { margin: 0; color: var(--ink); font-family: var(--heading-font); font-size: 1.125rem; line-height: 1.35; }
.voice-trial > p { max-width: 290px; margin: 7px 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.55; }
.voice-trial-record { position: relative; display: grid; place-items: center; width: 90px; height: 90px; margin: 27px 0 16px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; }
.voice-trial-record::before { content: ""; position: absolute; inset: -7px; border: 1px solid #efd7cc; border-radius: 50%; pointer-events: none; }
.voice-trial-record::after { content: "✦"; position: absolute; top: -12px; right: -9px; color: #e0b377; font-size: 16px; line-height: 1; pointer-events: none; }
.voice-trial-record:disabled { opacity: .6; cursor: default; }
.voice-trial-record .icon { width: 34px; height: 34px; stroke-width: 1.8; }
.voice-trial-record.is-recording { background: #b82437; }
.voice-transform-illustration { display: grid; place-items: center; width: 160px; height: 90px; margin: 27px 0 16px; }
.voice-transform-art { display: block; width: 160px; height: auto; overflow: visible; }
.voice-transform-spark, .voice-transform-bars rect { transform-box: fill-box; transform-origin: center; }
.voice-trial-label { color: var(--ink); font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.voice-trial > .voice-trial-error { max-width: 420px; margin-top: 14px; color: var(--accent-hover); }
.voice-trial-result { width: 100%; margin-top: 18px; padding: 0; border: 0; background: transparent; text-align: center; }
.voice-trial-result strong { color: var(--ink); font-size: .875rem; }
.voice-result-player { display: flex; align-items: center; gap: 13px; margin-top: 12px; padding: 14px; border-radius: 17px 17px 17px 6px; background: var(--rose); }
.voice-result-play { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: white; cursor: pointer; }
.voice-result-play .icon { width: 23px; height: 23px; stroke-width: 2; }
.voice-result-main { flex: 1; min-width: 0; }
.voice-result-wave { display: flex; align-items: center; justify-content: space-between; gap: 3px; height: 25px; overflow: hidden; }
.voice-result-wave i { display: block; flex: 1; min-width: 2px; max-width: 4px; max-height: 23px; border-radius: 99px; background: #dbaeb2; }
.voice-result-main input[type="range"].voice-result-seek { display: block; width: 100%; height: 24px; min-height: 24px; margin: 0; padding: 0; border: 0; border-radius: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.voice-result-seek::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(to right, var(--accent) var(--played, 0%), #e3c5c5 var(--played, 0%)); }
.voice-result-seek::-moz-range-track { height: 3px; border-radius: 5px; background: #e3c5c5; }
.voice-result-seek::-moz-range-progress { height: 3px; border-radius: 5px; background: var(--accent); }
.voice-result-seek::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; border: 0; border-radius: 50%; appearance: none; -webkit-appearance: none; background: var(--accent); }
.voice-result-seek::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--accent); }
.voice-result-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .6875rem; font-variant-numeric: tabular-nums; }
.voice-result-tools { display: flex; align-items: center; gap: 8px; }
.voice-result-tools button, .voice-result-tools a { display: grid; place-items: center; min-width: 28px; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; }
.voice-result-tools .icon { width: 17px; height: 17px; }
.voice-result-tools .is-muted { opacity: .4; }
.voice-result-speed { font-size: .6875rem; font-weight: 700; }
.voice-trial-result .voice-trial-compact { width: min(100%, 220px); gap: 11px; margin: 10px auto 0; padding: 7px 13px 7px 7px; border: 0; border-radius: 18px 18px 18px 7px; background: #faf3ec; }
.voice-trial-compact .voice-result-play { flex-basis: 40px; width: 40px; height: 40px; background: var(--ink); }
.voice-trial-compact .voice-result-play .icon { width: 19px; height: 19px; stroke-width: 1.8; }
.voice-trial-wave-wrap { position: relative; }
.voice-trial-compact .guide-waveform.voice-result-wave { display: block; height: 25px; overflow: hidden; }
.voice-trial-compact .voice-result-main input[type="range"].voice-result-seek { position: absolute; inset: 0; z-index: 1; width: 100%; height: 25px; min-height: 0; opacity: 0; }
.voice-trial-compact .voice-result-meta { justify-content: flex-end; color: var(--ink); opacity: .65; }
.voice-trial-result-tools { justify-content: center; margin: 7px auto 0; }
.voice-trial-result p { margin: 10px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.voice-intro-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.voice-intro-actions .btn { width: 100%; min-width: 0; min-height: 54px; padding: 9px 8px; font-size: .8125rem; line-height: 1.3; }
.narrator-choice { width: 100%; max-width: 440px; margin: 0 auto; }
.narrator-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.narrator-option { display: flex; align-items: center; gap: 0; min-width: 0; padding-right: 8px; border: 1px solid #e8e3dc; border-radius: 20px; background: #fffdf9; }
.narrator-option.is-selected { border-color: #c5a99a; background: #faf5f0; }
.narrator-card { position: relative; display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 12px 10px 10px; border: 0; border-radius: 20px; background: transparent; transition: background-color .2s ease; }
.narrator-option .narrator-card { flex: 1; }
.narrator-card.is-selected { background: transparent; }
.narrator-select { display: flex; flex: 1; align-items: center; width: 100%; min-width: 0; gap: 10px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.narrator-avatar { display: block; flex: 0 0 50px; width: 50px; height: 50px; }
.narrator-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.narrator-copy strong { font-size: .95rem; }
.narrator-copy span { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.narrator-copy .narrator-choice-label { margin-top: 5px; color: #906b59; font-size: .6875rem; font-weight: 700; }
.narrator-check { display: grid; place-items: center; flex: 0 0 21px; width: 21px; height: 21px; border: 1.5px solid #dfd0c5; border-radius: 50%; color: #517a58; }
.narrator-card.is-selected .narrator-check { border-color: #b79483; background: #f1e8df; color: #8e6555; }
.narrator-check .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.narrator-select .narrator-check { order: 0; }
.narrator-select .narrator-copy { order: 1; }
.narrator-select .narrator-avatar { order: 2; flex-basis: 44px; width: 44px; height: 44px; }
.narrator-listen { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; align-self: center; flex: 0 0 auto; min-width: 62px; min-height: 44px; margin-top: 0; padding: 6px 10px; border: 0; border-left: 1px solid #e8ded5; border-radius: 0; background: transparent; color: var(--ink); font-size: .75rem; font-weight: 700; cursor: pointer; }
.narrator-listen .icon { width: 16px; height: 16px; stroke-width: 2; }
.narrator-listen .narrator-listen-art { width: 32px; height: 24px; stroke-width: 1.8; }
.narrator-listen-label { color: var(--muted); font-size: .625rem; font-weight: 400; line-height: 1.2; }
@media (prefers-reduced-motion: no-preference) {
  .narrator-listen.is-playing .narrator-listen-wave { transform-box: fill-box; transform-origin: center; animation: narrator-listen-wave .7s ease-in-out infinite alternate; }
  .narrator-listen.is-playing .narrator-listen-wave:nth-of-type(2) { animation-delay: -.2s; }
  .narrator-listen.is-playing .narrator-listen-wave:nth-of-type(3) { animation-delay: -.4s; }
  @keyframes narrator-listen-wave { from { transform: scaleY(.55); } to { transform: scaleY(1.15); } }
}
.narrator-actions { display: flex; justify-content: center; margin-top: 24px; }
.narrator-actions .btn { width: 100%; }
.narration-studio { width: 100%; max-width: 580px; margin: 0 auto; }
.narration-voice { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: .75rem; }
.narration-voice .narrator-avatar { flex-basis: 30px; width: 30px; height: 30px; }
.narration-progress-copy { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: .75rem; }
.narration-progress-copy strong { color: var(--ink); }
.narration-count { margin-left: auto; }
.narration-page-arrow { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 12px; background: #f8eadf; color: #a77560; cursor: pointer; }
.narration-page-arrow .icon { width: 18px; height: 18px; stroke-width: 2; }
.narration-page-arrow:disabled { opacity: .3; cursor: default; }
.narration-track { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 6px; background: #f0e5da; }
.narration-track > span { display: block; height: 100%; border-radius: inherit; background: #a4bc98; }
.narration-reading { display: grid; align-items: center; min-height: clamp(130px, 22dvh, 190px); padding: 18px 0; }
.narration-phrase { margin: 0; color: var(--ink); font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 600; line-height: 1.65; text-align: center; text-wrap: pretty; overflow-wrap: anywhere; }
.narration-wheel { display: grid; grid-template-rows: 36px 28px minmax(100px, auto) 28px 36px; align-items: center; justify-items: center; width: 100%; max-width: 540px; margin: 0 auto; overflow: hidden; overscroll-behavior: contain; touch-action: pan-y; }
.narration-wheel-arrow { display: grid; place-items: center; width: 40px; height: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.narration-wheel-arrow:disabled { opacity: .2; cursor: default; }
.narration-wheel-arrow .icon { width: 20px; height: 20px; stroke-width: 1.8; }
.narration-wheel-arrow.is-up .icon { transform: rotate(-90deg); }
.narration-wheel-arrow.is-down .icon { transform: rotate(90deg); }
.narration-wheel-ghost { width: 100%; overflow: hidden; color: var(--ink); font-size: .875rem; line-height: 1.4; opacity: .3; text-align: center; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.narration-wheel-ghost.is-before { -webkit-mask-image: linear-gradient(to bottom, transparent, black); mask-image: linear-gradient(to bottom, transparent, black); }
.narration-wheel-ghost.is-after { -webkit-mask-image: linear-gradient(to bottom, black, transparent); mask-image: linear-gradient(to bottom, black, transparent); }
.narration-wheel-current { display: grid; align-items: center; width: 100%; max-height: clamp(120px, 27dvh, 230px); min-height: 100px; padding: 6px 4px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.narration-wheel-current, .narration-wheel-ghost { transform: translateY(var(--narration-drag, 0)); }
@media (prefers-reduced-motion: no-preference) {
  .narration-wheel-current, .narration-wheel-ghost { transition: transform .18s ease; }
  .narration-wheel.is-dragging :is(.narration-wheel-current, .narration-wheel-ghost) { transition: none; }
}
.narration-wheel-status { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 8px; color: var(--muted); font-size: .75rem; }
.narration-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: #f3eee8; color: var(--muted); font-weight: 700; }
.narration-status .icon { width: 13px; height: 13px; stroke-width: 2; }
.narration-status.is-done { background: #edf5ec; color: #416a50; }
.narration-status.is-review { background: #fbf2df; color: #86653b; }
.narration-finish { display: flex; justify-content: center; margin: 18px auto 0; }
.narration-finish .btn { width: 100%; }
.narration-wheel { grid-template-rows: 44px 24px clamp(112px, 21dvh, 160px) 24px 44px; }
.narration-wheel-arrow { width: 44px; height: 44px; border-radius: 50%; background: #f8eee5; color: #a9715a; }
.narration-wheel-arrow .icon { width: 22px; height: 22px; stroke-width: 2; }
.narration-wheel-current { height: 100%; min-height: 0; max-height: none; }
.narration-wheel-instruction { margin: 7px 0 14px; color: var(--muted); font-size: .6875rem; line-height: 1.4; text-align: center; }
.narration-dashboard { width: 100%; padding: 16px 16px 12px; border-radius: 20px; background: #faf6f1; }
.narration-dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); font-size: .8125rem; }
.narration-dashboard-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.narration-dashboard-action { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: .6875rem; font-weight: 700; line-height: 1.3; cursor: pointer; }
.narration-action-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #eee8e0; color: var(--ink); }
.narration-action-icon .icon { width: 23px; height: 23px; stroke-width: 1.8; }
.narration-dashboard-action.is-record .narration-action-icon { background: #f7dfd9; color: var(--accent); }
.narration-dashboard-action.is-record.is-recording .narration-action-icon { background: var(--accent); color: white; }
.narration-dashboard-action.is-approve:not(:disabled) .narration-action-icon, .narration-dashboard-action.is-approve.is-done .narration-action-icon { background: #e6f0e4; color: #416a50; }
.narration-dashboard-action:disabled { opacity: .42; cursor: default; }
.narration-dashboard-action.is-done:disabled { opacity: 1; }
.narration-action-label { max-width: 100%; overflow-wrap: anywhere; }
.narration-dashboard-help { height: 3.1em; margin: 12px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; text-align: center; }
.narration-dashboard .narration-error { margin-top: 8px; }
.narration-finish { flex-direction: column; align-items: center; gap: 7px; }
.narration-finish-hint { color: var(--muted); font-size: .6875rem; line-height: 1.4; text-align: center; }
.narration-dashboard { padding: 16px 0 0; border-top: 1px solid #eee7df; border-radius: 0; background: transparent; }
.narration-dashboard-actions { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.narration-dashboard-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.narration-dashboard .narration-dashboard-action { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 10px; border-radius: 14px; font-size: .8125rem; line-height: 1.3; }
.narration-dashboard .narration-dashboard-action.is-record { min-height: 52px; }
.narration-dashboard .narration-dashboard-action .narration-action-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 0; background: transparent; color: inherit; }
.narration-dashboard .narration-action-icon .icon { width: 20px; height: 20px; }
.narration-dashboard .narration-dashboard-action.is-done:disabled { border-color: #d7e7d4; background: #edf5ec; color: #416a50; }
.narration-dashboard-help { margin-top: 10px; text-align: left; }
.narration-finish { visibility: hidden; }
.narration-finish.is-ready { visibility: visible; }
.narration-wheel { position: relative; grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-rows: clamp(150px, 24dvh, 210px); gap: 5px; }
.narration-wheel-ghost { position: absolute; visibility: hidden; }
.narration-wheel-arrow.is-left .icon { transform: rotate(180deg); }
.narration-wheel-arrow.is-right .icon { transform: none; }
.narration-wheel-current { transform: translateX(var(--narration-drag-x, 0)); }
.narration-reading-content { width: 100%; text-align: center; }
.narration-reading-label { display: block; margin-bottom: 12px; color: var(--muted); font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.narration-wheel-current .narration-phrase { font-size: clamp(1.2rem, 3.3vw, 1.75rem); line-height: 1.55; }
.narration-wheel-instruction { margin-top: 5px; }
.narration-dashboard-help { margin: 8px 0 0; }
.narration-dashboard-actions { margin-top: 7px; }
.narration-record-panel { display: flex; flex-direction: column; align-items: center; }
.narration-record-panel .voice-trial-record { margin: 20px auto 12px; }
.narration-record-panel .narration-record-label { margin: 0; font-size: .875rem; }
.narration-record-panel .narration-dashboard-help { width: 100%; height: 3.1em; margin: 7px 0 0; text-align: center; }
.narration-audio-slot { display: flex; align-items: center; justify-content: center; min-height: 68px; }
.narration-audio-slot .voice-result-player.voice-trial-compact { width: min(100%, 220px); gap: 11px; margin: 0 auto; padding: 7px 13px 7px 7px; border: 0; border-radius: 18px 18px 18px 7px; background: #faf3ec; }
.narration-audio-slot .voice-trial-compact.is-empty { opacity: .4; }
.narration-audio-slot .voice-result-play:disabled { cursor: default; }
.narration-recorder { display: flex; flex-direction: column; align-items: center; padding: 12px 0 20px; }
.narration-mic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 96px; height: 96px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: white; cursor: pointer; }
.narration-mic > span { font-size: .6875rem; font-weight: 700; line-height: 1.2; }
.narration-mic .icon { width: 34px; height: 34px; stroke-width: 1.8; }
.narration-mic.is-recording { background: #b82437; }
.narration-mic:disabled { opacity: .55; cursor: wait; }
.narration-record-label { margin-top: 12px; color: var(--ink); font-size: .9375rem; }
.narration-record-hint { display: flex; align-items: center; gap: 5px; min-height: 20px; margin-top: 6px; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.narration-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.narration-review { padding: 4px 0 12px; }
.narration-take { width: 100%; max-width: 300px; margin: 0 auto; padding: 0; background: transparent; }
.narration-take-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); font-size: .8125rem; }
.narration-take-heading > span { color: var(--muted); font-size: .6875rem; }
.narration-take .voice-result-player { gap: 10px; margin-top: 5px; padding: 0; background: transparent; }
.narration-take .voice-result-play { flex-basis: 44px; width: 44px; height: 44px; background: transparent; color: var(--ink); }
.narration-take .voice-result-play .icon { width: 20px; height: 20px; stroke-width: 1.5; }
.narration-take .voice-result-wave { height: 20px; }
.narration-take .voice-result-wave i { flex: 0 0 1px; min-width: 1px; max-width: 1px; max-height: 19px; background: #a9becb; }
.narration-take .voice-result-seek::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--muted) var(--played, 0%), #dbe5e9 var(--played, 0%)); }
.narration-take .voice-result-seek::-moz-range-track { height: 2px; background: #dbe5e9; }
.narration-take .voice-result-seek::-moz-range-progress { height: 2px; background: var(--muted); }
.narration-take .voice-result-seek::-moz-range-thumb { width: 8px; height: 8px; background: var(--muted); }
.narration-take .voice-result-seek::-webkit-slider-thumb { width: 8px; height: 8px; margin-top: -3px; background: var(--muted); }
.narration-take .voice-result-play:disabled { opacity: .4; cursor: wait; }
.narration-take .voice-result-player.voice-trial-compact { width: min(100%, 220px); gap: 11px; margin: 10px auto 0; padding: 7px 13px 7px 7px; border: 0; border-radius: 18px 18px 18px 7px; background: #faf3ec; }
.narration-take .voice-trial-compact .voice-result-play { flex-basis: 40px; width: 40px; height: 40px; background: var(--ink); color: white; }
.narration-take .voice-trial-compact .voice-result-play .icon { width: 19px; height: 19px; stroke-width: 1.8; }
.narration-review-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.narration-review-actions .btn { width: 100%; min-width: 0; min-height: 50px; padding: 9px; font-size: .8125rem; line-height: 1.3; }
.narration-audio-error { margin: 12px 0 0; color: var(--accent-hover); font-size: .75rem; line-height: 1.5; }
.narration-saving { display: flex; align-items: center; justify-content: center; gap: 8px; width: 92px; height: 92px; border-radius: 50%; background: #fbebdf; }
.narration-saving i { width: 7px; height: 7px; border-radius: 50%; background: #cf987e; }
.narration-error { margin: 12px 0 0; color: var(--accent-hover); font-size: .875rem; line-height: 1.6; text-align: center; }
.narration-complete { display: flex; flex-direction: column; align-items: center; padding: 30px 0 12px; text-align: center; }
.narration-complete-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 26px; background: #eaf2e4; color: #5b815a; }
.narration-complete-icon .icon { width: 35px; height: 35px; }
.narration-complete h2 { margin: 20px 0 0; color: var(--ink); font-size: 1.25rem; }
.narration-complete p { margin: 8px 0 24px; color: var(--muted); font-size: .875rem; }
@media (prefers-reduced-motion: no-preference) { .voice-trial-record { transition: transform .18s ease, background-color .18s ease; } .voice-trial-record:not(:disabled):active { transform: scale(.95); } .voice-trial-record.is-recording { animation: voice-trial-pulse 1.5s ease-in-out infinite; } @keyframes voice-trial-pulse { 50% { transform: scale(1.06); } } }
/* Keep the recording control stable while its waveform indicates activity. */
.narration-record-button { transition: background-color .18s ease; }
.narration-record-button.is-recording { animation: none; }
.narration-record-button:not(:disabled):active { transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .narration-mic { transition: transform .16s ease, background-color .16s ease; }
  .narration-mic:not(:disabled):active { transform: scale(.95); }
  .narration-mic.is-recording { animation: voice-trial-pulse 1.5s ease-in-out infinite; }
  .narration-track > span { transition: width .3s ease; }
  .narration-phrase-enter { animation: voice-trial-appear .3s ease both; }
  .narration-review { animation: voice-trial-appear .3s ease both; }
  .narration-saving i { animation: narration-save-pulse .8s ease-in-out infinite alternate; }
  .narration-saving i:nth-child(2) { animation-delay: .15s; }
  .narration-saving i:nth-child(3) { animation-delay: .3s; }
  @keyframes narration-save-pulse { to { opacity: .35; transform: translateY(-4px); } }
  .voice-trial-reveal { animation: voice-trial-appear .45s ease both; }
  @keyframes voice-trial-appear { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  .voice-transform-illustration.is-processing { animation: voice-transform-appear .35s ease both; }
  .voice-transform-illustration.is-processing .voice-transform-path { animation: voice-transform-flow 1s linear infinite; }
  .voice-transform-illustration.is-processing .voice-transform-dot { animation: voice-transform-travel 1.4s ease-in-out infinite; }
  .voice-transform-illustration.is-processing .voice-transform-spark { animation: voice-transform-sparkle 1s ease-in-out infinite; }
  .voice-transform-illustration.is-processing .voice-transform-bars rect { animation: voice-transform-wave .65s ease-in-out infinite alternate; }
  .voice-transform-bars rect:nth-child(2), .voice-transform-bars rect:nth-child(4) { animation-delay: -.2s !important; }
  .voice-transform-bars rect:nth-child(3) { animation-delay: -.4s !important; }
  .voice-trial-result { animation: voice-transform-appear .3s ease both; }
  @keyframes voice-transform-appear { from { opacity: 0; transform: translateY(5px) scale(.96); } to { opacity: 1; transform: none; } }
  @keyframes voice-transform-flow { to { stroke-dashoffset: -16; } }
  @keyframes voice-transform-travel { 0% { transform: translateX(0); opacity: 0; } 15%, 75% { opacity: 1; } 100% { transform: translateX(56px); opacity: 0; } }
  @keyframes voice-transform-sparkle { 50% { transform: scale(1.25) rotate(12deg); } }
  @keyframes voice-transform-wave { from { transform: scaleY(.55); } to { transform: scaleY(1.15); } }
}
@keyframes format-page-one { 0%, 30% { opacity: 1; } 34%, 97% { opacity: 0; } 100% { opacity: 1; } }
@keyframes format-page-two { 0%, 31% { opacity: 0; } 34%, 63% { opacity: 1; } 67%, 100% { opacity: 0; } }
@keyframes format-page-three { 0%, 64% { opacity: 0; } 67%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes format-story-bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-2px) rotate(1deg); } }
@keyframes format-story-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes format-closeup-drift { 0%, 31% { transform: scale(1); } 65%, 100% { transform: scale(1.045); } }
@keyframes format-skeleton-write { 0%, 2% { opacity: 0; transform: scaleX(0); } 10%, 25% { opacity: 1; transform: scaleX(1); } 31%, 100% { opacity: 0; transform: scaleX(1); } }
@keyframes format-wave { from { transform: scaleY(.4); opacity: .7; } to { transform: scaleY(1); opacity: 1; } }
@keyframes format-track { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .format-video-preview :is(.format-page-one, .format-page-two, .format-page-three, .format-scene-bob, .format-scene-float, .format-closeup, .format-caption-line, .format-preview-wave i, .format-preview-track span) { animation: none; } .format-video-preview .format-page-one, .format-video-preview .format-caption-line { opacity: 1; } .format-video-preview :is(.format-page-two, .format-page-three) { opacity: 0; } .format-preview-track span { transform: scaleX(.45); } }
@media (max-width: 680px) {
  .format-showcase { grid-template-columns: minmax(0, 1fr); max-width: 400px; gap: 12px; }
  .format-video-card, .format-pdf-card { padding: 16px; }
}
@media (max-width: 420px) { .pdf-choice-actions { display: flex; flex-direction: column-reverse; } }

.character-step { width: 100%; max-width: 560px; margin-inline: auto; }

/* A small collection book: each empty place belongs to one subject and view. */
.collection-step { width: 100%; max-width: 560px; margin-inline: auto; }
.collection-progress { display: flex; justify-content: space-between; gap: 12px; padding: 0 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8125rem; font-weight: 700; }
.collection-list { position: relative; padding-top: 8px; }
.collection-subject { padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
.collection-subject:last-child { border-bottom: 0; }
.collection-subject-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.collection-subject-heading h2 { margin: 2px 0 0; color: var(--ink); font-size: 1rem; }
.collection-kind, .collection-count { color: var(--muted); font-size: .6875rem; }
.collection-count { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.collection-count.is-incomplete { padding: 6px 9px; border-radius: 999px; background: #fff3d5; color: #805300; font-weight: 700; }
.collection-count strong { font-size: .8125rem; font-variant-numeric: tabular-nums; }
.collection-count.is-complete { padding: 6px 9px; border-radius: 999px; background: var(--green-wash); color: var(--green); font-weight: 700; }
.collection-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.collection-scroll-hint { display: none; margin: -5px 0 8px; color: var(--muted); font-size: .6875rem; text-align: right; }
@media (min-width: 681px) {
  .collection-step { max-width: 720px; }
  .collection-views { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .collection-scroll-hint { display: block; }
  .collection-views.is-scrollable { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc(30.77% - 8px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; padding-bottom: 7px; -webkit-overflow-scrolling: touch; }
  .collection-views.is-scrollable .collection-view { scroll-snap-align: start; }
}
.collection-view { display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: center; }
.collection-sticker { position: relative; isolation: isolate; display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; -webkit-clip-path: inset(0 round 17px); clip-path: inset(0 round 17px); border: 1.5px dashed #d5c5b8; border-radius: 17px; background: #fffaf5; }
.collection-view.is-filled .collection-sticker { border: 1px solid #e8ded3; }
.collection-image-background { position: absolute; inset: -12%; display: block; filter: blur(9px); pointer-events: none; }
.collection-image-background > svg, .collection-image-background > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.collection-image-foreground { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.collection-image-foreground > svg, .collection-image-foreground > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.collection-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.collection-placeholder .icon { width: 22px; height: 22px; color: #a87d6e; }
.collection-generating { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #906d5b; font-size: .6875rem; font-weight: 700; }
.collection-generating-art { display: block; width: clamp(58px, 17vw, 72px); height: clamp(58px, 17vw, 72px); overflow: visible; }
.generation-paper, .generation-pencil, .generation-spark, .generation-dot { transform-box: fill-box; transform-origin: center; }
.generation-paper { animation: generation-float 2.5s ease-in-out infinite; }
.generation-fox-line { stroke-dasharray: 145; stroke-dashoffset: 0; animation: generation-draw 2.5s ease-in-out infinite; }
.generation-fox-fill { opacity: 1; animation: generation-appear 2.5s ease-in-out infinite; }
.generation-pencil { animation: generation-pencil 2.5s ease-in-out infinite; }
.generation-spark-one { animation: generation-twinkle 1.1s ease-in-out infinite; }
.generation-spark-two { animation: generation-twinkle 1.1s .4s ease-in-out infinite; }
.generation-dot { animation: generation-twinkle 1.1s .7s ease-in-out infinite; }
@keyframes generation-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-2px) rotate(2deg); } }
@keyframes generation-draw { 0%, 8% { stroke-dashoffset: 145; } 65%, 90% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 145; } }
@keyframes generation-appear { 0%, 25% { opacity: 0; } 70%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes generation-pencil { 0%, 100% { transform: translate(1px,-3px) rotate(-8deg); } 35% { transform: translate(-5px,4px) rotate(7deg); } 70% { transform: translate(2px,1px) rotate(-4deg); } }
@keyframes generation-twinkle { 0%, 100% { opacity: .45; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .collection-generating-art * { animation: none; } }
.collection-approved { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #edf5ec; color: var(--green); }
.collection-approved .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.collection-view-label { min-height: 24px; color: var(--muted); font-size: .75rem; font-weight: 700; line-height: 1.4; }
.collection-modal-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; }
.collection-modal-content { margin-top: 18px; }
.collection-modal-image { width: 100%; max-width: 300px; aspect-ratio: 1.32; margin: 0 auto; overflow: hidden; border-radius: 18px; background: var(--peach); }
.collection-modal-image > svg { width: 100%; height: 100%; }
.collection-modal-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%; color: var(--muted); font-size: .875rem; }
.collection-modal-wait .collection-generating-art { width: 130px; height: 130px; max-height: 62%; }
.collection-modal-empty { color: var(--muted); font-size: .875rem; }
.collection-modal-versions { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); font-size: .8125rem; font-weight: 700; }
.collection-modal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.collection-modal-actions .btn { width: 100%; min-width: 0; padding-inline: 9px; }
.collection-modal-actions .btn:only-child { grid-column: 1 / -1; }
@media (max-width: 360px) {
  .collection-views { gap: 8px; }
  .collection-placeholder { font-size: .6875rem; }
  .collection-modal-actions .btn { font-size: .8125rem; }
}

.collection-retry { margin-top: 18px; }
.collection-retry label { display: block; margin-bottom: 8px; color: var(--ink); font-size: .875rem; font-weight: 700; }
.collection-retry label span { color: var(--muted); font-size: .75rem; font-weight: 400; }
.collection-retry textarea { min-height: 96px; }
@media (max-width: 680px) {
  .collection-panel[open] { min-height: calc(85dvh + 48px + env(safe-area-inset-bottom, 0px)); }
}

.page-step { width: 100%; max-width: 780px; margin-inline: auto; }
.page-step .page-tools { justify-content: space-between; }

.page-edit-content { margin-top: 18px; }
.page-edit-image { width: 100%; max-width: 300px; aspect-ratio: 1.32; margin: 0 auto 18px; overflow: hidden; border-radius: 18px; background: var(--peach); }
.page-edit-image > svg, .page-edit-image > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.page-edit-content .field label span { color: var(--muted); font-size: .75rem; font-weight: 400; }
.page-edit-content .helper { margin: 0 0 10px; }
.page-edit-versions { margin: 16px 0 0; }
.page-edit-error { margin: 12px 0 0; color: var(--accent-hover); font-size: .8125rem; }
.page-edit-actions { margin-top: 18px; }
@media (max-width: 680px) {
  .page-edit-panel[open] { min-height: calc(85dvh + 48px + env(safe-area-inset-bottom, 0px)); }
}

/* The panel shell stays in place while its sections scroll independently. */
.page-edit-panel[open] { display: flex; flex-direction: column; height: min(640px, calc(100dvh - 48px)); overflow: hidden; }
.page-edit-panel > .guide-sheet-handle, .page-edit-panel > .guide-panel-heading, .page-edit-panel > .page-edit-actions { flex: 0 0 auto; }
.page-edit-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 2px 12px; -webkit-overflow-scrolling: touch; }
.page-edit-section { margin-bottom: 14px; padding: 16px; border: 1px solid #eee5dd; border-radius: 20px; background: #fffaf6; }
.page-edit-section h2 { margin: 0 0 14px; color: var(--ink); font-size: 1rem; }
.page-edit-section .field { margin-bottom: 14px; }
.page-edit-section .helper { margin: 10px 0 0; }
.page-edit-actions { margin-top: 0; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 680px) {
  .page-edit-panel[open] { height: calc(85dvh + 48px + env(safe-area-inset-bottom, 0px)); }
  .page-edit-section { padding: 14px; }
}

/* A collection of pages, with each scene and its text available together. */
.scene-step { width: 100%; max-width: 560px; margin-inline: auto; }
.scene-step .collection-progress { border-bottom: 0; }
.scene-entry { display: grid; grid-template-columns: minmax(88px, 112px) minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.scene-entry:last-child { border-bottom: 0; }
.scene-image-button { display: block; min-width: 0; align-self: start; padding: 0; border: 0; background: transparent; }
.scene-page-copy { display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; padding: 2px 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.scene-page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.scene-page-heading strong { font-size: .9375rem; }
.scene-page-status { padding: 4px 8px; border-radius: 999px; font-size: .6875rem; font-weight: 700; }
.scene-page-status.is-incomplete { color: #805300; background: #fff3d5; }
.scene-page-status.is-complete { color: var(--green); background: var(--green-wash); }
.scene-page-text { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; color: var(--muted); font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; }
.scene-read-text { color: var(--ink); font-size: .875rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.scene-open { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.scene-open .icon { width: 15px; height: 15px; }
.scene-panel[open] { display: flex; flex-direction: column; height: min(640px, calc(100dvh - 48px)); overflow: hidden; }
.scene-panel > .guide-sheet-handle, .scene-panel > .guide-panel-heading, .scene-panel > .scene-panel-actions { flex: 0 0 auto; }
.scene-panel:not([data-text-edit="true"]) .scene-page-heading #scene-panel-title { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 13px; border-radius: 999px; background: #f8e7d8; color: var(--ink); font-size: 1.05rem; font-weight: 800; line-height: 1.25; }
.scene-panel[data-page-transition="true"] :is(.scene-stage-tabs, .scene-panel-content, .scene-panel-actions) { pointer-events: none; }
.scene-panel[data-stage-celebrating] :is(.scene-stage-tabs, .scene-panel-content, .scene-panel-actions) { pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .scene-panel[data-page-transition="true"] .scene-page-heading #scene-panel-title { animation: scene-page-arrival .7s cubic-bezier(.2, .75, .25, 1) both; transform-origin: left center; }
  .scene-panel[data-page-transition="true"] .scene-panel-content { animation: scene-content-arrival .55s ease-out both; }
  @keyframes scene-page-arrival { 0% { transform: scale(.86); background: #f3caaa; } 38% { transform: scale(1.16); background: #f3caaa; } 70% { transform: scale(.98); } 100% { transform: scale(1); background: #f8e7d8; } }
  @keyframes scene-content-arrival { from { opacity: .2; transform: translateX(22px); } to { opacity: 1; transform: translateX(0); } }
  .scene-panel[data-stage-celebrating="text"] [data-stage="text"] .scene-stage-art,
  .scene-panel[data-stage-celebrating="image"] [data-stage="image"] .scene-stage-art { animation: scene-stage-approved .65s cubic-bezier(.2, .75, .25, 1) both; }
  .scene-panel[data-stage-celebrating="text"] [data-stage="text"] .scene-stage-check,
  .scene-panel[data-stage-celebrating="image"] [data-stage="image"] .scene-stage-check { animation: scene-check-approved .65s cubic-bezier(.2, .75, .25, 1) both; }
  @keyframes scene-stage-approved { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.2) rotate(-6deg); } 65% { transform: scale(.96) rotate(2deg); } }
  @keyframes scene-check-approved { 0% { transform: scale(.3); opacity: 0; } 45% { transform: scale(1.4); opacity: 1; } 75% { transform: scale(.9); } 100% { transform: scale(1); } }
}
.scene-panel-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 2px 12px; -webkit-overflow-scrolling: touch; }
.scene-modal-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0; color: var(--muted); font-size: .8125rem; font-weight: 700; }
.scene-modal-nav button { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 15px; background: #faeee4; color: #a96c57; cursor: pointer; }
.scene-modal-nav button:disabled { opacity: .4; cursor: default; }
.scene-modal-nav .scene-nav-arrow { width: 22px; height: 22px; }
@media (hover: hover) { .scene-modal-nav button:not(:disabled):hover { background: #f4dfd2; } }
@media (prefers-reduced-motion: no-preference) { .scene-modal-nav button { transition: background-color .18s ease, transform .18s ease; } .scene-modal-nav button:not(:disabled):active { transform: scale(.94); } }
.scene-image-area .btn { margin-top: 12px; }
.scene-image-area .helper { margin: 10px 0 0; }
.scene-image-empty { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.scene-stage-toggle { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 48px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.scene-stage-toggle:disabled { opacity: .65; }
.scene-stage-art { position: relative; display: grid; flex: 0 0 46px; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: #faeee4; }
.scene-stage-art.is-complete { background: #edf5ec; }
.scene-stage-art > svg { display: block; width: 38px; height: 38px; }
.scene-stage-check { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 19px; height: 19px; border: 2px solid var(--paper); border-radius: 50%; background: #dcebd9; color: var(--green); }
.scene-stage-check .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.scene-stage-label { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.scene-stage-label strong { font-size: .9375rem; }
.scene-stage-label small { color: var(--muted); font-size: .75rem; }
.scene-stage-text-preview { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin-top: 4px; color: var(--muted); font-size: .8125rem; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.scene-stage-thumbnail { display: block; flex: 0 0 56px; width: 56px; height: 48px; overflow: hidden; border-radius: 10px; background: var(--peach); }
.scene-stage-thumbnail > svg { display: block; width: 100%; height: 100%; }
.scene-stage-link { color: var(--ink); font-size: .75rem; font-weight: 700; }
.scene-stage-content:not([hidden]) { padding-top: 14px; }
.scene-editor-heading { justify-content: center; text-align: center; padding-left: 46px; }
.scene-panel[data-text-edit="true"] .scene-editor-heading { justify-content: flex-start; padding-left: 0; text-align: left; }
.scene-editor-content { display: flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 600px; margin: 18px auto 0; }
.scene-editor-content textarea.scene-text-editor { flex: 1 1 auto; width: 100%; min-height: 160px; padding: 18px; border-color: #e5d9cf; font-size: 16px; line-height: 1.7; resize: none; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.scene-editor-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scene-editor-actions .btn { width: 100%; min-width: 0; }
.scene-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.page-edit-section .scene-section-heading h2 { margin: 0; }
.scene-check-status { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; font-size: .6875rem; font-weight: 700; }
.scene-check-status.is-incomplete { color: #805300; background: #fff3d5; }
.scene-check-status.is-complete { color: var(--green); background: var(--green-wash); }
.scene-text-copy { margin: 0; color: var(--ink); font-size: .9375rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.scene-check-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.scene-check-actions .btn { width: 100%; min-width: 0; min-height: 48px; padding: 9px 7px; font-size: .8125rem; line-height: 1.25; }
.scene-image-area .scene-check-actions .btn { margin-top: 0; }
.scene-footer-status { margin-right: auto; color: var(--muted); font-size: .8125rem; font-weight: 700; }
@media (max-width: 680px) {
  .scene-panel[open] { height: calc(85dvh + 48px + env(safe-area-inset-bottom, 0px)); }
  .scene-panel[open][data-text-edit="true"] { top: var(--scene-visible-top, 0px); bottom: auto; height: var(--scene-visible-height, 100dvh); min-height: 0; max-height: var(--scene-visible-height, 100dvh); padding: max(16px, env(safe-area-inset-top, 0px)) 18px max(48px, env(safe-area-inset-bottom, 0px)); border-radius: 0; }
  .scene-panel[data-text-edit="true"] > .guide-sheet-handle { display: none; }
  .scene-panel[data-text-edit="true"] > .sheet-close { top: max(16px, env(safe-area-inset-top, 0px)); }
  .scene-panel[data-text-edit="true"] .scene-editor-content { margin-top: 14px; }
  .scene-panel[data-text-edit="true"] .scene-text-editor { min-height: 0; }
  .scene-panel[data-text-edit="true"] .scene-editor-actions { flex: 0 0 auto; }
}
@media (max-width: 360px) {
  .scene-entry { grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
}

/* A compact, familiar player that sits naturally on the page. */
.voice-simple-player { display: flex; align-items: center; gap: 9px; width: min(100%, 270px); margin: 0 auto; color: var(--ink); }
.voice-simple-avatar { flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.voice-simple-avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.voice-simple-play { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer; }
.voice-simple-play svg { width: 16px; height: 16px; }
.voice-simple-play:disabled { opacity: .45; cursor: default; }
.voice-simple-player input[type="range"].voice-simple-seek { appearance: none; -webkit-appearance: none; flex: 1 1 auto; min-width: 0; width: 100%; height: 28px; min-height: 28px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: pointer; }
.voice-simple-seek::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--ink) var(--played, 0%), #e5ded7 var(--played, 0%)); }
.voice-simple-seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 9px; height: 9px; margin-top: -3px; border: 0; border-radius: 50%; background: var(--ink); }
.voice-simple-seek::-moz-range-track { height: 3px; border-radius: 3px; background: #e5ded7; }
.voice-simple-seek::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--ink); }
.voice-simple-seek::-moz-range-thumb { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--ink); }
.voice-simple-time { flex: 0 0 auto; color: var(--muted); font-size: .65rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.voice-trial-result .voice-simple-player { width: min(100%, 240px); margin: 10px auto 0; }
.narration-audio-slot .voice-simple-player { width: min(100%, 240px); }
.narration-recording-player.is-empty { opacity: .4; }

/* The recording itself becomes a seekable sound trace. */
.narration-wave-wrap { position: relative; display: flex; flex: 1 1 auto; align-items: center; min-width: 0; height: 42px; }
.narration-wave-canvas { display: block; width: 100%; height: 42px; }
.voice-simple-player .narration-wave-wrap input[type="range"].voice-simple-seek { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; opacity: 0; }
.narration-recording-player.is-recording .voice-simple-play, .narration-recording-player.is-recording .voice-simple-time { visibility: hidden; }
.narration-recording-player.is-recording .narration-wave-canvas { opacity: 1; }

/* Phrase, navigation and microphone form one recording space. */
.narration-composition { width: 100%; padding: 18px 20px 14px; }
.narration-composition .narration-dashboard-heading { padding: 0 2px; }
.narration-composition .narration-wheel { grid-template-rows: clamp(120px, 19dvh, 165px); margin-top: 5px; }
.narration-composition .narration-reading-label { margin-bottom: 8px; }
.narration-composition .narration-wheel-instruction { margin: 0; }
.narration-composition .narration-dashboard { padding: 0; border: 0; background: transparent; }
.narration-composition .narration-record-panel .voice-trial-record { width: 76px; height: 76px; margin: 15px auto 9px; }
.narration-composition .narration-record-panel .voice-trial-record .icon { width: 30px; height: 30px; }
.narration-composition .narration-record-panel .narration-dashboard-help { margin-top: 5px; }
.narration-composition .narration-audio-slot { min-height: 54px; }
@media (max-width: 380px) {
  .narration-composition { padding: 15px 14px 12px; }
  .narration-composition .narration-wheel { grid-template-columns: 38px minmax(0, 1fr) 38px; }
  .narration-composition .narration-wheel-arrow { width: 38px; height: 38px; }
}

.narration-status[hidden] { display: none; }

/* Keep the navigation balanced around the reading area. */
.narration-composition .narration-wheel { grid-template-columns: 44px minmax(0, 1fr) 44px; column-gap: 12px; align-items: center; }
.narration-composition .narration-wheel-arrow { display: grid; place-items: center; align-self: center; justify-self: center; width: 42px; height: 42px; padding: 0; border: 1px solid #eee4da; border-radius: 50%; background: #fffaf5; color: #916d5a; }
.narration-composition .narration-wheel-arrow.is-left { grid-column: 1; grid-row: 1; }
.narration-composition .narration-wheel-current { grid-column: 2; grid-row: 1; align-self: stretch; }
.narration-composition .narration-wheel-arrow.is-right { grid-column: 3; grid-row: 1; }
.narration-composition .narration-wheel-arrow .icon { display: block; width: 19px; height: 19px; stroke-width: 1.8; }
.narration-composition .narration-wheel-instruction { margin: 8px 0 2px; }
.narration-composition .narration-record-panel .voice-trial-record { margin-top: 21px; }
@media (max-width: 380px) {
  .narration-composition .narration-wheel { grid-template-columns: 38px minmax(0, 1fr) 38px; column-gap: 7px; }
  .narration-composition .narration-wheel-arrow { width: 38px; height: 38px; }
}

/* The empty trace is ready above the microphone; playback follows a take. */
.narration-composition .narration-audio-slot { margin: 23px auto 0; }
.narration-recording-player.is-empty .voice-simple-play,
.narration-recording-player.is-empty .voice-simple-time,
.narration-recording-player.is-recording .voice-simple-play,
.narration-recording-player.is-recording .voice-simple-time { display: none; }
.narration-composition .narration-record-panel .voice-trial-record { margin-top: 8px; }

/* Navigation is available without competing with the next action. */
.narration-composition .narration-wheel-arrow { border-color: transparent; background: transparent; color: #927e70; }
.narration-composition .narration-wheel-arrow:disabled { opacity: .18; }
.narration-next-phrase { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 9px 18px; border: 1px solid #e7d7c9; border-radius: 14px; background: #fffaf5; color: var(--ink); font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; }
.narration-next-phrase .icon { width: 17px; height: 17px; }
.narration-finish [hidden] { display: none !important; }

.narration-next-phrase { width: 100%; min-height: 50px; border: 1px solid #e8ded5; background: #fffaf6; color: var(--ink); }
.narration-next-phrase:disabled { opacity: .4; cursor: default; }

.narration-composition .narration-wheel-arrow.is-next-ready { border-color: #ead9c9; background: #fff8f1; color: #916d5a; }
.narration-composition .narration-wheel-instruction { min-height: 2.8em; }

.narration-recording-player .voice-simple-play { flex-basis: 44px; width: 44px; height: 44px; background: transparent; color: #8d7567; }
.narration-recording-player .voice-simple-play svg { width: 19px; height: 19px; }

.narration-composition > .narration-reading-label { margin: 16px 0 0; text-align: center; }

.narration-composition .narration-dashboard-heading { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.narration-dashboard-index { color: var(--ink); font-size: .8125rem; font-weight: 700; }
.narration-position-track { width: 96px; height: 3px; overflow: hidden; border-radius: 4px; background: #eee7df; }
.narration-position-track span { display: block; height: 100%; border-radius: inherit; background: #b89a81; }
@media (prefers-reduced-motion: no-preference) { .narration-position-track span { transition: width .2s ease; } }

.narration-scene { display: grid; place-items: center; width: min(100%, 176px); height: clamp(106px, 17dvh, 148px); margin: 15px auto 0; overflow: hidden; border-radius: 16px; background: #fbf4eb; }
.narration-scene svg, .narration-scene img { display: block; width: 100%; height: 100%; object-fit: contain; }
.narration-composition > .narration-reading-label { margin-top: 12px; }

/* A compact reading and recording workspace, without extra panels. */
.narration-composition { padding: 4px 0 0; }
.narration-composition .narration-dashboard-heading { flex-direction: row; justify-content: center; gap: 10px; }
.narration-scene { flex: 0 0 48px; width: 48px; height: 48px; margin: 0; padding: 0; border: 0; border-radius: 10px; cursor: pointer; }
.narration-scene-large { display: block; width: min(100%, 440px); margin: 0 auto; padding: 0; overflow: hidden; border: 0; border-radius: 16px; background: #fbf4eb; cursor: pointer; }
.narration-scene-large svg, .narration-scene-large img { display: block; width: 100%; height: auto; }
.narration-composition .narration-wheel { grid-template-rows: clamp(95px, 19dvh, 165px); margin-top: 4px; }
.narration-composition .narration-wheel-instruction { min-height: 1.4em; margin: 2px 0 0; }
.narration-composition .narration-audio-slot { min-height: 44px; margin-top: 6px; }
.narration-composition .narration-record-panel .voice-trial-record { width: 68px; height: 68px; margin: 4px auto 7px; }
@media (max-width: 680px) {
  .narration-composition .narration-record-panel .narration-record-button { position: fixed; z-index: 10; right: max(24px, env(safe-area-inset-right, 0px)); bottom: calc(88px + env(safe-area-inset-bottom, 0px)); margin: 0; touch-action: none; }
  .narration-studio { padding-bottom: 100px; }
}
.narration-composition .narration-record-panel .narration-dashboard-help { height: auto; min-height: 2.8em; margin-top: 4px; }
.narration-finish { margin-top: 8px; }
@media (max-width: 680px) {
  .narration-focus .site-header { min-height: 62px; padding: 10px 16px; }
  .narration-focus .drawing-progress { margin-bottom: 8px; padding-bottom: 5px; }
  .narration-focus .drawing-progress button, .narration-focus .drawing-progress .progress-current { min-height: 68px; }
  .narration-focus .progress-mark { flex-basis: 34px; width: 34px; height: 34px; margin-bottom: 1px; }
  .narration-focus .progress-mark .progress-art { width: 32px; height: 32px; }
  .narration-focus .progress-connector { top: 10px; }
  .narration-focus .workspace { padding-bottom: max(48px, env(safe-area-inset-bottom, 0px)); }
  .narration-composition { padding: 2px 0 0; }
}

.narration-path { position: relative; max-width: 720px; margin: 0 auto 8px; }
.narration-formats-back { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 8px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .75rem; font-weight: 700; cursor: pointer; }
.narration-formats-back .icon { width: 16px; height: 16px; }
.narration-focus .narration-progress { margin: 0; padding-bottom: 8px; }
.narration-progress li { flex: 0 0 78px; width: 78px; }
.narration-progress .narration-progress-item { min-height: 72px; }
.narration-progress .progress-mark { color: #785b4c; font-size: .8rem; font-weight: 700; }
.narration-progress .narration-progress-item.is-current { color: var(--ink); }
.narration-progress .narration-progress-item:disabled { opacity: .55; }
.narration-progress .narration-progress-item.is-current:disabled { opacity: 1; }
@media (max-width: 680px) {
  .narration-formats-back { min-height: 32px; }
  .narration-focus .narration-progress .narration-progress-item { min-height: 62px; }
  .narration-progress li { flex-basis: 72px; width: 72px; }
}

/* A quiet, single-line path through the narration. */
.narration-path { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.narration-formats-back { flex: 0 0 auto; min-height: 40px; padding: 0 3px; color: #806e63; }
.narration-focus .narration-progress { flex: 1 1 auto; min-width: 0; margin: 0; padding: 3px 0; border: 0; }
.narration-progress ol { justify-content: flex-start; min-width: 0; gap: 5px; }
.narration-progress li { flex: 0 0 36px; width: 36px; }
.narration-focus .narration-progress .narration-progress-item { display: grid; place-items: center; width: 36px; min-height: 40px; padding: 0; }
.narration-focus .narration-progress .progress-mark { width: 30px; height: 30px; margin: 0; font-size: .75rem; }
.narration-progress-position { flex: 0 0 auto; color: #8a7c71; font-size: .6875rem; font-weight: 700; white-space: nowrap; }
@media (max-width: 380px) { .narration-path { gap: 6px; } }

/* Restore the illustrated journey for the narration steps. */
.narration-path { display: block; margin-bottom: 8px; }
.narration-formats-back { min-height: 32px; }
.narration-focus .narration-progress { margin: 0; padding: 2px 0 7px; border-bottom: 1px solid var(--line); }
.narration-progress ol { gap: 0; }
.narration-progress li { flex: 0 0 72px; width: 72px; }
.narration-focus .narration-progress .narration-progress-item { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; min-height: 62px; padding: 0 2px; }
.narration-focus .narration-progress .progress-mark { flex: 0 0 38px; width: 38px; height: 38px; margin: 0; }
.narration-focus .narration-progress .progress-art { width: 36px; height: 36px; }
.narration-progress .progress-label { font-size: .6875rem; }
.narration-progress .progress-connector { top: 11px; left: -8px; }
.narration-progress .narration-progress-state[hidden] { display: none; }

.narration-progress .narration-progress-state { background: var(--paper); border-color: var(--paper); color: #79977a; }

.narration-progress .narration-progress-state { font-size: .625rem; font-weight: 700; line-height: 1; color: #826e61; }

.narration-focus .narration-progress .narration-progress-item { min-height: 44px; }

.narration-path { display: flex; align-items: center; gap: 8px; }
.narration-formats-back { flex: 0 0 auto; min-height: 44px; padding: 0 10px 0 0; border-right: 1px solid var(--line); text-align: left; line-height: 1.2; }
.narration-focus .narration-progress { flex: 1 1 auto; min-width: 0; border-bottom: 0; }

.narration-formats-back { gap: 4px; min-height: 52px; }
.narration-formats-mark { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .6875rem; }
.narration-focus .narration-formats-mark .progress-mark { flex: none; width: 38px; height: 38px; margin: 0; background: #faf0e5; }
.narration-focus .narration-formats-mark .progress-art { width: 36px; height: 36px; }

.narration-formats-back .narration-exit-chevron { width: 18px; height: 18px; color: #c7a694; }

.narration-formats-back { min-height: 44px; font-size: .75rem; }

.narration-path { gap: 0; }
.narration-formats-back { position: relative; padding-right: 10px; border-right: 0; }
.narration-focus .narration-progress { margin-left: 0; }

.narration-path { align-items: center; }
.narration-formats-back { align-self: center; align-items: center; justify-content: center; }
.narration-focus .narration-progress { padding-top: 0; padding-bottom: 0; }

.narration-formats-back::after { content: ''; position: absolute; right: 0; top: calc(50% - 2px); width: 1px; height: 40px; background: var(--line); transform: translateY(-50%); pointer-events: none; }
.narration-formats-back { font-weight: 800; }

.narration-composition .narration-dashboard-heading { margin-top: 10px; }
.narration-composition .narration-scene { flex-basis: 88px; width: 88px; height: 88px; border-radius: 16px; }

.narration-composition .narration-scene { flex-basis: clamp(136px, 24dvh, 176px); width: clamp(136px, 24dvh, 176px); height: clamp(136px, 24dvh, 176px); border-radius: 18px; }
.narration-composition .narration-wheel { grid-template-rows: minmax(76px, auto); margin-top: 4px; }
.narration-composition .narration-wheel-current { min-height: 76px; max-height: min(25dvh, 170px); padding: 4px 0; }
.narration-composition .narration-wheel-current .narration-phrase { line-height: 1.45; }

.narration-scene { position: relative; isolation: isolate; overflow: visible; background: transparent; }
.narration-scene::before { content: ''; position: absolute; z-index: -1; inset: 4px -3px -4px 3px; border-radius: 12px 16px 11px 15px; background: #f6dfd5; transform: rotate(1deg); pointer-events: none; }
.narration-scene > svg, .narration-scene > img { border-radius: 8px; }

/* The decorative backing follows the illustration’s actual proportions. */
.narration-composition .narration-scene { aspect-ratio: 540 / 410; height: auto; }

.narration-path { padding-bottom: 8px; border-bottom: 1px solid var(--line); }

/* Long phrases expand naturally; the page handles vertical scrolling. */
.narration-composition .narration-wheel { overflow: visible; }
.narration-composition .narration-wheel-current { height: auto; max-height: none; overflow: visible; overscroll-behavior: auto; }

/* A lighter narration header, with room around the illustration. */
.narration-path { gap: 10px; margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.narration-formats-back { gap: 5px; padding-right: 0; color: #826e61; }
.narration-formats-back::after { display: none; }
.narration-focus .narration-progress { border: 0; }
.narration-composition .narration-dashboard-heading { margin-top: 22px; }
.narration-composition .narration-wheel { margin-top: 16px; }

.narration-path { display: block; }
.narration-formats-back { min-height: 36px; padding: 0; font-size: .75rem; font-weight: 700; }
.narration-focus .narration-progress { margin-top: 3px; }

/* Image actions stay visible while the page illustration is open. */
.scene-panel-actions.has-image-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.scene-panel-actions.has-image-actions .btn { width: 100%; min-width: 0; min-height: 48px; padding: 9px 7px; font-size: .8125rem; line-height: 1.25; }

/* The page sheet grows with its contents, while the text editor stays full-screen. */
.scene-panel[open]:not([data-text-edit="true"]) { height: auto; }
@media (max-width: 680px) {
  .scene-panel[open]:not([data-text-edit="true"]) { min-height: calc(60dvh + 48px + env(safe-area-inset-bottom, 0px)); }
}

.scene-panel-actions.has-single-action .btn { width: 100%; }

.scene-panel-actions.has-image-actions, .scene-panel-actions.has-single-action { display: grid; gap: 8px; }
.scene-panel-actions.has-single-action { grid-template-columns: minmax(0, 1fr); }
.scene-footer-context { grid-column: 1 / -1; color: var(--ink); font-size: .75rem; font-weight: 700; line-height: 1.3; }
.scene-panel .page-edit-section.is-active { border-color: #e9c9b2; background: #fff9f3; }

/* A single, clearly identified part of the page is shown at a time. */
.scene-panel > .scene-stage-tabs { flex: 0 0 auto; }
.scene-stage-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 8px; }
.scene-stage-tabs button { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 58px; padding: 7px 9px; border: 1px solid #eee7df; border-radius: 16px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.scene-stage-tabs button.is-active { border-color: #e7c3aa; background: #fff5ed; }
.scene-stage-tabs button:disabled { opacity: .52; cursor: default; }
.scene-stage-tabs .scene-stage-art { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
.scene-stage-tabs .scene-stage-art > svg { width: 32px; height: 32px; }
.scene-tab-label { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.scene-tab-label strong { font-size: .8125rem; }
.scene-tab-label small { color: var(--muted); font-size: .6875rem; }
.scene-panel .scene-text-area[hidden], .scene-panel .scene-image-area[hidden] { display: none; }
.scene-panel .scene-text-area:not([hidden]), .scene-panel .scene-image-area:not([hidden]) { border: 0; background: transparent; padding: 10px 4px; }

.scene-panel > .scene-modal-nav { flex: 0 0 auto; margin: 6px 0 2px; }

.scene-modal-nav button { flex-basis: 42px; width: 42px; height: 42px; border: 1px solid transparent; border-radius: 50%; background: transparent; color: #927e70; }
.scene-modal-nav button .icon { display: block; width: 19px; height: 19px; stroke-width: 1.8; }
.scene-modal-nav .scene-nav-previous { transform: rotate(180deg); }
.scene-modal-nav button:disabled { opacity: .18; }

.scene-page-heading { justify-content: flex-start; padding-right: 44px; }
.scene-page-heading .scene-modal-nav { justify-content: flex-start; gap: 5px; margin: 0; }
.scene-page-heading .scene-modal-nav button { width: 36px; height: 36px; flex-basis: 36px; }
.scene-page-heading .scene-modal-nav span { min-width: 40px; text-align: center; }

/* Page review: compact controls, one task, and as much room as possible for its content. */
.scene-panel:not([data-text-edit="true"]) > .guide-sheet-handle { margin-bottom: 8px; }
.scene-panel:not([data-text-edit="true"]) .scene-stage-tabs { gap: 16px; margin: 5px 0 8px; border-bottom: 1px solid var(--line); }
.scene-panel:not([data-text-edit="true"]) .scene-stage-tabs button { justify-content: center; min-height: 44px; padding: 5px 4px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; }
.scene-panel:not([data-text-edit="true"]) .scene-stage-tabs button.is-active { border-bottom-color: #c8896b; background: transparent; }
.scene-panel:not([data-text-edit="true"]) .scene-tab-label { align-items: center; gap: 1px; }
.scene-panel:not([data-text-edit="true"]) .scene-panel-content { padding-top: 4px; }
.scene-panel:not([data-text-edit="true"]) .scene-panel-actions { padding-top: 10px; }
@media (max-width: 680px) {
  .scene-panel[open]:not([data-text-edit="true"]) { min-height: calc(78dvh + 48px + env(safe-area-inset-bottom, 0px)); }
}

/* The page steps use the soft illustrated markers of the rest of the journey. */
.scene-panel:not([data-text-edit="true"]) .scene-stage-tabs { gap: 8px; margin: 8px 0 12px; border: 0; }
.scene-panel:not([data-text-edit="true"]) .scene-stage-tabs button { justify-content: flex-start; gap: 9px; min-height: 56px; padding: 7px 9px; border: 1px solid transparent; border-radius: 16px; background: #faf7f1; }
.scene-panel:not([data-text-edit="true"]) .scene-stage-tabs button.is-active { border-color: #ecd2bd; background: #fff3e7; }
.scene-panel:not([data-text-edit="true"]) .scene-tab-label { align-items: flex-start; gap: 2px; }
.scene-stage-tabs .scene-stage-art { width: 36px; height: 36px; flex-basis: 36px; border-radius: 50%; background: #f8e8d9; }
.scene-stage-tabs .scene-stage-art.is-complete { background: #dfeedd; }
.scene-stage-tabs .scene-stage-art > svg { width: 32px; height: 32px; }
.scene-stage-tabs .scene-stage-check { right: -2px; bottom: -2px; width: 16px; height: 16px; background: var(--paper); border-color: var(--paper); }
.scene-stage-tabs .scene-stage-check .icon { width: 10px; height: 10px; }

/* A guide message followed by illustrations revealed during playback. */
#guide-panel .guide-message-block { width: 100%; padding: 4px 0 0; }
#guide-panel .guide-panel-heading { padding-right: 46px; align-items: flex-start; }
#guide-panel .guide-panel-sender { display: flex; flex-direction: column; align-items: flex-start; }
#guide-panel .guide-simple-player { width: min(100%, 280px); margin: 18px 0 0; }
#guide-panel .guide-text { max-width: 42ch; margin: 14px 0 0; color: var(--ink); }
#guide-panel .guide-tutorial { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
#guide-panel .guide-tutorial[hidden] { display: none; }
.guide-tutorial-heading { color: var(--muted); font-size: .75rem; font-weight: 700; }
.guide-tutorial-scenes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 11px; }
.guide-tutorial-frame { display: grid; place-items: center; min-width: 0; aspect-ratio: 1.1; overflow: hidden; border-radius: 15px; background: #fbf3ea; }
.guide-tutorial-frame svg { display: block; width: 100%; height: 100%; opacity: 0; transform: translateY(5px) scale(.96); }
.guide-tutorial-frame.is-revealed svg { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) { .guide-tutorial-frame svg { transition: opacity .4s ease, transform .4s ease; } }

/* Rounded, friendly navigation with a clear next step after recording. */
.narration-composition .narration-wheel { grid-template-columns: 48px minmax(0, 1fr) 48px; }
.narration-composition .narration-wheel-arrow { width: 48px; height: 48px; border: 0; border-radius: 50%; background: #f8eee5; color: #a8735e; }
.narration-composition .narration-arrow-art { display: block; width: 25px; height: 25px; }
.narration-composition .narration-wheel-arrow.is-left .narration-arrow-art { transform: rotate(180deg); }
.narration-composition .narration-wheel-arrow:disabled { opacity: .35; }
.narration-composition .narration-wheel-arrow.is-next-ready { background: #b85b49; color: #fff; }
@media (prefers-reduced-motion: no-preference) { .narration-composition .narration-wheel-arrow { transition: background-color .2s ease, color .2s ease, transform .2s ease; } .narration-composition .narration-wheel-arrow:not(:disabled):active { transform: scale(.94); } }
@media (max-width: 380px) { .narration-composition .narration-wheel { grid-template-columns: 44px minmax(0, 1fr) 44px; } .narration-composition .narration-wheel-arrow { width: 44px; height: 44px; } }
.narration-composition .narration-wheel-arrow { background: transparent; }
.narration-composition .narration-wheel-arrow.is-next-ready { background: transparent; color: #b85b49; }

.narration-composition .narration-wheel-arrow.is-next-ready { color: var(--accent); }
.narration-composition .narration-wheel-arrow.is-next-ready .narration-arrow-art { width: 30px; height: 30px; }
@media (prefers-reduced-motion: no-preference) {
  .narration-composition .narration-wheel-arrow.is-next-ready .narration-arrow-art { animation: narration-next-pulse 1.4s ease-in-out infinite; }
  @keyframes narration-next-pulse { 0%, 100% { transform: scale(1); opacity: .75; } 50% { transform: scale(1.28) translateX(3px); opacity: 1; } }
  @keyframes narration-next-arrive { 0% { transform: scale(.78); opacity: .65; } 60% { transform: scale(1.16); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
}

.narration-composition .narration-wheel-arrow[hidden] { visibility: hidden; }

/* Images awaiting a deliberate validation stay distinct from the collection. */
.collection-sticker.is-unapproved .collection-image-foreground { filter: grayscale(1); }
.collection-sticker.is-unapproved .collection-image-background { filter: blur(9px) grayscale(1); }
.collection-needs-review { position: absolute; z-index: 1; left: 50%; bottom: 6px; transform: translateX(-50%); max-width: calc(100% - 8px); padding: 3px 8px; border-radius: 99px; background: rgba(255, 250, 241, .95); color: #79533c; font-size: .625rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }

.collection-sticker.is-unapproved { border: 1px solid #e3c4a8; background: #f8eee3; }
.collection-sticker.is-unapproved .collection-image-foreground { filter: grayscale(.35) saturate(.85) brightness(.9); }
.collection-sticker.is-unapproved .collection-image-background { filter: blur(9px) grayscale(.35) saturate(.85) brightness(.9); }
.collection-sticker.is-unapproved::after { content: ''; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, transparent 55%, rgba(85, 55, 39, .18)); pointer-events: none; }
.collection-needs-review { display: inline-flex; align-items: center; justify-content: center; gap: 2px; padding: 4px 8px; background: #fff7e8; color: #815634; }
.collection-needs-review .icon { width: 12px; height: 12px; stroke-width: 2.4; }

.collection-sticker.is-unapproved .collection-image-foreground { filter: grayscale(1) brightness(.88); }
.collection-sticker.is-unapproved .collection-image-background { filter: blur(9px) grayscale(1) brightness(.88); }
.collection-invite { position: absolute; z-index: 1; top: 50%; left: 50%; display: inline-flex; align-items: center; justify-content: center; gap: 4px; max-width: calc(100% - 8px); padding: 7px 9px; border: 1px solid #efdbc5; border-radius: 99px; background: #fffaf0; color: #79513d; font-size: .6875rem; font-weight: 700; line-height: 1; white-space: nowrap; transform: translate(-50%, -50%); }
.collection-invite .icon { flex: 0 0 13px; width: 13px; height: 13px; color: #c68f58; }
.collection-needs-review { color: #79533c; }
@media (prefers-reduced-motion: no-preference) { .collection-invite.is-new { animation: collection-invite-enter .45s ease-out both; } @keyframes collection-invite-enter { from { opacity: 0; transform: translate(-50%, -45%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } } }

.collection-invite { width: 64px; height: 64px; max-width: calc(100% - 12px); padding: 8px; border-radius: 50%; text-align: center; white-space: normal; line-height: 1.2; }

/* Image versions sit together with their preview, like a page indicator. */
.image-version-stage { position: relative; width: min(100%, 300px); margin: 0 auto; }
.image-version-stage .collection-modal-versions { position: absolute; z-index: 1; left: 50%; bottom: 8px; display: flex; max-width: calc(100% - 16px); margin: 0; padding: 3px; border: 1px solid rgba(226, 210, 194, .8); border-radius: 999px; background: rgba(255, 253, 248, .94); transform: translateX(-50%); }
.image-version-stage .collection-modal-versions > span { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.image-version-stage .collection-modal-versions { position: relative; left: auto; bottom: auto; width: fit-content; margin: 8px auto 0; transform: none; }


/* Personal messages use the portrait as the playback control. */
.voice-simple-player .voice-simple-avatar-play { position: relative; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; overflow: visible; background: transparent; }
.voice-simple-avatar-play > img { display: block; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.voice-simple-play-state { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid var(--paper); border-radius: 50%; background: var(--ink); color: white; }
.voice-simple-play-state .icon { width: 10px; height: 10px; stroke-width: 2; }

/* The live trace, transformation and result share a stable place. */
.voice-trial-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 160px; }
.voice-trial-live { width: min(100%, 240px); height: 42px; }
.voice-trial-stage .voice-trial-record { margin: 10px 0 0; }
.voice-trial-stage .voice-transform-illustration { margin: 0; }
.voice-trial-stage .voice-trial-result { margin: 0; }
.voice-trial-result .voice-trial-player { width: min(100%, 240px); margin: 0 auto; }
.voice-trial-player .voice-simple-play { flex-basis: 44px; width: 44px; height: 44px; background: transparent; color: #8d7567; }
.voice-trial-player .voice-simple-play svg { width: 19px; height: 19px; }

.voice-trial > .voice-trial-prompt { max-width: 32ch; margin: 10px auto 0; color: var(--ink); font-size: .9375rem; font-weight: 700; line-height: 1.45; }
.voice-trial-countdown { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: #faeee4; color: #a9715a; font-family: var(--heading-font); font-size: 2rem; font-weight: 700; }

/* Optional story preferences, folded away until the reader wants them. */
.story-idea-step { max-width: 480px; }
.story-idea-input, .story-style-free { display: block; width: 100%; min-height: 94px; padding: 14px 16px; border: 1px solid #e8ded3; border-radius: 16px; background: #fffaf5; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.5; resize: vertical; }
.story-idea-input::placeholder, .story-style-free::placeholder { color: #9caaa9; }
.story-style-options { margin-top: 14px; border: 1px solid #eee4d8; border-radius: 16px; background: #fffdf9; }
.story-style-options summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 10px 14px; color: var(--ink); font-size: .875rem; font-weight: 700; list-style: none; cursor: pointer; }
.story-style-options summary::-webkit-details-marker { display: none; }
.story-style-options summary .icon { width: 17px; height: 17px; color: #a9715a; transform: rotate(90deg); }
.story-style-options[open] summary .icon { transform: rotate(-90deg); }
.story-style-content { padding: 4px 14px 16px; }
.story-style-content fieldset { margin: 0; padding: 0; border: 0; }
.story-style-content legend, .story-style-free-label { color: var(--ink); font-size: .8125rem; font-weight: 700; }
.story-style-content fieldset p { margin: 5px 0 10px; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.story-style-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.story-style-chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid #e8ded3; border-radius: 99px; background: #fffaf5; color: var(--ink); font-size: .8125rem; font-weight: 700; cursor: pointer; }
.story-style-chip input:checked + span { border-color: #dcb49a; background: #fbe8d6; }
.story-style-free-label { display: block; margin: 16px 0 7px; }
.story-style-free { min-height: 80px; }

/* A quiet disclosure for optional story settings. */
.story-style-options { margin-top: 8px; border: 0; border-radius: 0; background: transparent; }
.story-style-options summary { justify-content: flex-start; gap: 9px; width: fit-content; min-height: 44px; padding: 6px 1px; color: var(--ink); }
.story-style-options summary .icon { width: 16px; height: 16px; color: #b7836d; }
.story-style-content { padding: 12px 0 2px; }
.story-style-content fieldset p { margin-bottom: 12px; }
.story-style-chip span { border-color: #eee4d9; background: transparent; }
.story-style-chip input:checked + span { border-color: #e4c5ab; background: #fff3e7; }
.story-style-free { background: #fffdf9; }

.story-style-options summary { margin-left: auto; }
.story-options-icon { flex: 0 0 18px; width: 18px; height: 18px; color: #a9715a; }

.story-style-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid #eee4d9; border-radius: 99px; background: transparent; color: var(--ink); font-size: .8125rem; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.story-style-chip[aria-checked="true"] { border-color: #e4c5ab; background: #fff3e7; }

/* A calm collection with room for each illustration and one clear progress line. */
.collection-step .collection-progress { align-items: center; gap: 10px; padding: 0 2px 14px; font-size: .75rem; }
.collection-step .collection-progress [data-collection-total] { color: var(--ink); white-space: nowrap; }
.collection-step .collection-list { display: grid; gap: 0; padding-top: 0; }
.collection-step .collection-subject { min-width: 0; padding: 22px 0; border: 0; border-radius: 0; background: transparent; }
.collection-step .collection-subject + .collection-subject { border-top: 1px solid var(--line); }
.collection-step .collection-subject-heading { align-items: center; margin-bottom: 14px; }
.collection-step .collection-subject-heading h2 { margin: 0; font-size: 1.0625rem; }
.collection-step .collection-subject-info { display: flex; flex-direction: column; gap: 3px; }
.collection-step .collection-subject-info > span { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.collection-step .collection-count { padding: 0; color: var(--muted); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.collection-step .collection-views { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.collection-step .collection-view { max-width: 160px; }
.collection-step .collection-views.is-scrollable { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 136px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; padding-bottom: 7px; -webkit-overflow-scrolling: touch; }
.collection-step .collection-views.is-scrollable .collection-view { max-width: none; scroll-snap-align: start; }
.collection-step .collection-invite { top: 50%; bottom: auto; left: 50%; display: flex; width: 52px; height: 52px; max-width: calc(100% - 12px); padding: 5px; border: 1px solid #efdbc5; border-radius: 50%; background: #fffaf0; color: #79513d; font-size: .625rem; line-height: 1.15; white-space: normal; transform: translate(-50%, -50%); box-shadow: 0 3px 12px rgba(68, 43, 30, .13); }
@media (prefers-reduced-motion: no-preference) {
  .collection-step .collection-invite.is-new { animation: collection-invite-enter .45s ease-out both; }
  @keyframes collection-step-invite { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }
}
@media (max-width: 680px) {
  .collection-step .collection-subject { padding: 18px 0 22px; }
  .collection-step .collection-views.is-scrollable { grid-auto-columns: 31%; }
}

/* Keep the review actions in place while moving through the collection. */
.collection-panel[open] { display: flex; flex-direction: column; height: min(640px, calc(100dvh - 48px)); overflow: hidden; }
.collection-panel > :is(.guide-sheet-handle, .guide-panel-heading, .collection-modal-actions) { flex: 0 0 auto; }
.collection-panel-heading #collection-panel-title { color: var(--ink); font-size: 1.1rem; }
.collection-panel-heading .collection-modal-subtitle { color: var(--muted); font-size: .8125rem; font-weight: 700; }
.collection-panel .collection-modal-content { flex: 1 1 auto; min-height: 0; margin-top: 16px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.collection-panel .collection-modal-actions { flex: 0 0 auto; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.collection-panel .collection-retry .btn { width: 100%; margin-top: 10px; }
.collection-panel[data-collection-transition="true"] :is(.collection-modal-content, .collection-modal-actions) { pointer-events: none; }
@media (max-width: 680px) {
  .collection-panel[open] { min-height: calc(78dvh + 48px + env(safe-area-inset-bottom, 0px)); height: calc(78dvh + 48px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: no-preference) {
  .collection-panel[data-collection-transition="true"] .collection-review-position { animation: scene-page-arrival .7s cubic-bezier(.2, .75, .25, 1) both; transform-origin: left center; }
  .collection-panel[data-collection-transition="true"] .collection-modal-content { animation: scene-content-arrival .55s ease-out both; }
}

/* Small picture cards keep each view and its review status easy to read. */
.collection-step .collection-view { gap: 0; padding: 4px 4px 0; border: 1px solid #e9ded0; border-radius: 16px; background: #fffdf8; box-shadow: 0 2px 7px rgba(83, 58, 43, .045); }
.collection-step .collection-sticker { border-radius: 12px; -webkit-clip-path: inset(0 round 12px); clip-path: inset(0 round 12px); }
.collection-step .collection-view-label { display: grid; place-items: center; min-height: 30px; padding: 4px 2px; color: var(--ink); font-size: .6875rem; line-height: 1.25; }
.collection-step .collection-approved { z-index: 1; top: 6px; right: 6px; width: 23px; height: 23px; border: 1px solid #dce9d9; background: #f5faf2; }
.collection-step .collection-approved .icon { width: 13px; height: 13px; }

.collection-heading-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.collection-review-position { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 34px; padding: 6px 13px; border-radius: 999px; background: #f8e7d8; color: var(--ink); font-size: .9375rem; font-weight: 800; line-height: 1.25; }
.collection-panel-heading #collection-panel-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Each card reads as an illustrated page, with its own text beneath the image. */
.scene-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.scene-grid .scene-entry { display: block; min-width: 0; padding: 0; border: 0; }
.scene-grid .scene-page-copy { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%; height: 100%; min-width: 0; padding: 12px 11px 9px; border: 1px solid #e9ded0; border-radius: 3px 9px 9px 3px; background: #fffdf8; box-shadow: 0 2px 0 #f5eee5, 0 3px 0 #e8ddcf, 0 5px 0 #f8f2e9, 0 6px 8px rgba(83, 58, 43, .08); text-align: left; }
.scene-grid .scene-page-copy::after { content: ''; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; border-bottom-right-radius: 7px; background: linear-gradient(135deg, transparent 44%, rgba(119, 93, 68, .15) 48%, #e6d9c8 50%, #f8f0e4 63%, #fffaf2 100%); filter: drop-shadow(-1px -1px 1px rgba(94, 72, 52, .09)); pointer-events: none; }
.scene-grid .collection-sticker { aspect-ratio: 1.28; border-radius: 7px; -webkit-clip-path: inset(0 round 7px); clip-path: inset(0 round 7px); }
.scene-grid .collection-invite { z-index: 1; top: 50%; bottom: auto; left: 50%; display: flex; width: 58px; height: 58px; max-width: calc(100% - 12px); padding: 6px; border: 1px solid #efdbc5; border-radius: 50%; background: #fffaf0; color: #79513d; font-size: .625rem; line-height: 1.15; white-space: normal; transform: translate(-50%, -50%); box-shadow: 0 3px 12px rgba(68, 43, 30, .13); }
.scene-grid .collection-approved { z-index: 1; top: 6px; right: 6px; width: 23px; height: 23px; border: 1px solid #dce9d9; background: #f5faf2; }
.scene-grid .collection-approved .icon { width: 13px; height: 13px; }
.scene-grid .scene-card-label { display: block; padding: 0 1px 8px; color: var(--ink); font-size: .75rem; font-weight: 800; line-height: 1.25; }
.scene-grid .scene-page-text { flex: 1 1 auto; margin: 10px 1px 8px; color: #6c625b; font-family: Georgia, serif; font-size: .75rem; line-height: 1.45; text-align: left; }
.scene-grid .scene-page-status { align-self: flex-start; padding: 0 1px; background: transparent; font-size: .625rem; line-height: 1.3; }
.scene-grid .scene-page-status.is-incomplete { color: #8b6c5b; }
.scene-grid .scene-page-folio { align-self: center; margin-top: 7px; color: #a5998b; font-family: Georgia, serif; font-size: .625rem; line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .scene-grid .collection-invite.is-new { animation: collection-invite-enter .45s ease-out both; }
}

/* Keep the selected book page visible while guiding its two review steps. */
.scene-panel:not([data-text-edit="true"]) .scene-stage-tabs button { min-height: 48px; padding: 6px 9px; border-radius: 12px; }
.scene-stage-tabs .scene-stage-art { width: 30px; height: 30px; flex-basis: 30px; color: #906c59; }
.scene-stage-number { font-size: .8125rem; font-weight: 800; line-height: 1; }
.scene-stage-tabs .scene-stage-check { width: 16px; height: 16px; right: -3px; bottom: -3px; }
.scene-stage-tabs .scene-stage-check .icon { width: 10px; height: 10px; }
.scene-review-instruction { display: flex; flex-direction: column; gap: 3px; margin: 0 0 12px; }
.scene-review-instruction strong { color: var(--ink); font-size: .9375rem; }
.scene-review-instruction span { color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.scene-review-paper { position: relative; max-width: 340px; margin: 0 auto 5px; padding: 12px 13px 10px; border: 1px solid #e9ded0; border-radius: 3px 9px 9px 3px; background: #fffdf8; box-shadow: 0 2px 0 #f5eee5, 0 3px 0 #e8ddcf, 0 5px 0 #f8f2e9, 0 6px 8px rgba(83, 58, 43, .08); }
.scene-review-paper::after { content: ''; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; border-bottom-right-radius: 7px; background: linear-gradient(135deg, transparent 44%, rgba(119, 93, 68, .15) 48%, #e6d9c8 50%, #f8f0e4 63%, #fffaf2 100%); pointer-events: none; }
.scene-review-thumbnail { width: 100%; max-width: 300px; aspect-ratio: 1.8; margin: 0 auto 13px; border-radius: 7px; -webkit-clip-path: inset(0 round 7px); clip-path: inset(0 round 7px); }
.scene-review-placeholder { color: var(--muted); font-size: .75rem; font-weight: 700; }
.scene-review-paper .scene-text-copy { margin: 0; font-family: Georgia, serif; font-size: .9375rem; line-height: 1.65; }
.scene-review-paper .image-version-stage { margin-bottom: 13px; }
.scene-review-paper .collection-modal-image { max-width: 100%; border-radius: 7px; }
.scene-review-folio { display: block; margin-top: 12px; color: #a5998b; font-family: Georgia, serif; font-size: .6875rem; line-height: 1; text-align: center; }
.scene-review-step { align-self: flex-start; margin-bottom: 2px; color: #a16d55 !important; font-size: .6875rem !important; font-weight: 800; letter-spacing: .03em; }
.scene-review-paper-text .scene-review-thumbnail { max-height: 112px; }
.scene-review-paper-image .scene-text-copy { color: #786e65; font-size: .8125rem; }
.scene-review-switch { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 2px; border: 0; background: transparent; color: #89624e; font-size: .75rem; font-weight: 700; }
.scene-review-switch .icon { width: 14px; height: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .scene-panel[data-stage-celebrating="text"] .scene-review-paper-text .scene-text-copy,
  .scene-panel[data-stage-celebrating="image"] .scene-review-paper-image .collection-modal-image { animation: scene-review-approved .65s ease-out both; }
  @keyframes scene-review-approved { 0%, 100% { opacity: 1; } 45% { opacity: .55; } }
}

.scene-review-paper-text .scene-text-copy { font-size: 1rem; line-height: 1.75; }
.scene-review-paper .image-version-stage .scene-version-picker { display: block; width: 100%; max-width: 100%; margin: 12px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.scene-review-paper .scene-version-picker > span { position: static; display: block; width: auto; height: auto; margin-bottom: 7px; overflow: visible; clip: auto; color: var(--muted); font-size: .75rem; font-weight: 700; white-space: normal; }
.scene-version-thumbnail, .scene-version-thumbnail svg { display: block; width: 100%; height: 100%; }
.scene-version-number { position: absolute; bottom: 2px; left: 2px; min-width: 16px; padding: 2px; border-radius: 5px; background: rgba(255, 253, 248, .9); color: var(--ink); font-size: .625rem; line-height: 1; }
.scene-panel[data-text-edit="true"] .scene-page-heading #scene-panel-title { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 13px; border-radius: 999px; background: #f8e7d8; color: var(--ink); font-size: 1.05rem; font-weight: 800; line-height: 1.25; }
.scene-panel[data-text-edit="true"] .scene-editor-content { margin-top: 16px; }
.scene-panel[data-text-edit="true"] .scene-text-editor { border-radius: 9px; background: #fffdf8; font-family: Georgia, serif; }
@media (max-width: 680px) {
  .scene-panel[open][data-text-edit="true"] { top: calc(var(--scene-visible-top, 0px) + var(--scene-visible-height, 100dvh) - min(var(--scene-visible-height, 100dvh), var(--scene-review-height, 78dvh))); bottom: auto; height: min(var(--scene-visible-height, 100dvh), var(--scene-review-height, 78dvh)); max-height: var(--scene-visible-height, 100dvh); padding: 16px 18px max(24px, env(safe-area-inset-bottom, 0px)); border-radius: 26px 26px 0 0; }
  .scene-panel[data-text-edit="true"] > .guide-sheet-handle { display: block; margin-bottom: 8px; }
}

/* The selected page opens as a full-screen workspace. */
.scene-panel.scene-workspace[open] { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; min-height: 0; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #f8f3ec; box-shadow: none; overflow: hidden; }
.scene-panel.scene-workspace[open]:not([data-text-edit="true"]) { height: 100dvh; min-height: 0; }
.scene-panel.scene-workspace[open][data-text-edit="true"] { inset: 0; padding: max(20px, env(safe-area-inset-top, 0px)) 18px max(20px, env(safe-area-inset-bottom, 0px)); background: #fffdf8; }
@media (max-width: 680px) {
  .scene-panel.scene-workspace[open][data-text-edit="true"] { top: var(--scene-visible-top, 0px); bottom: auto; height: var(--scene-visible-height, 100dvh); max-height: var(--scene-visible-height, 100dvh); }
}
.scene-workspace > .scene-page-heading { position: relative; flex: 0 0 auto; justify-content: center; min-height: 62px; padding: max(10px, env(safe-area-inset-top, 0px)) 55px 10px; background: #fffdf8; }
.scene-workspace > .sheet-close { top: max(10px, env(safe-area-inset-top, 0px)); right: 14px; z-index: 2; }
.scene-workspace .scene-page-heading #scene-panel-title { font-size: .9375rem; }
.scene-panel.scene-workspace .scene-workspace-content { flex: 1 1 auto; min-height: 0; padding: 16px 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
.scene-workspace-page { max-width: 640px; margin: 0 auto; padding: 18px; border: 1px solid #e9ded0; border-radius: 4px 12px 12px 4px; background: #fffdf8; box-shadow: 0 3px 0 #f0e8dd, 0 5px 12px rgba(83, 58, 43, .08); }
.scene-workspace-page > section { min-width: 0; }
.scene-workspace-page > section + section { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee6dc; }
.scene-workspace-page h2 { margin: 0 0 11px; color: var(--ink); font-size: .9375rem; }
.scene-workspace .scene-review-paper { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.scene-workspace .scene-review-paper::after { display: none; }
.scene-workspace .image-version-stage { width: 100%; max-width: 440px; margin: 0 auto; }
.scene-workspace .scene-review-paper .image-version-stage { margin-bottom: 0; }
.scene-workspace .collection-modal-image { width: 100%; max-width: none; aspect-ratio: 1.32; max-height: 36dvh; border-radius: 10px; }
.scene-workspace .scene-image-area > .btn, .scene-workspace .scene-text-area > .btn { width: 100%; margin-top: 12px; }
.scene-workspace .scene-text-copy { font-family: Georgia, serif; font-size: 1rem; line-height: 1.7; }
.scene-workspace .scene-text-editor { width: 100%; min-height: 150px; padding: 14px; border-radius: 10px; background: #fffdf8; font-family: Georgia, serif; font-size: 16px; line-height: 1.6; resize: vertical; }
.scene-workspace-edit-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.scene-workspace-edit-actions .btn { width: 100%; min-width: 0; }
.scene-workspace > .scene-panel-actions { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 12px 16px max(24px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid #eee6dc; background: #fffdf8; }
.scene-workspace > .scene-panel-actions .btn { width: 100%; max-width: 640px; margin: 0 auto; }
.scene-workspace-edit-hint { color: var(--muted); font-size: .8125rem; text-align: center; }
.scene-workspace .scene-version-picker { display: block; width: 100%; margin: 14px 0 0; color: var(--muted); font-size: .75rem; font-weight: 700; }
.scene-workspace .scene-version-picker > span { display: block; margin-bottom: 8px; }
@media (min-width: 720px) {
  .scene-workspace-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .scene-workspace-page > section + section { margin: 0; padding: 0 0 0 24px; border-top: 0; border-left: 1px solid #eee6dc; }
  .scene-workspace-page > .scene-review-folio { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .scene-panel.scene-workspace[open][data-text-edit="true"] { top: var(--scene-visible-top, 0px); left: 0; right: 0; bottom: auto; height: var(--scene-visible-height, 100dvh); max-height: var(--scene-visible-height, 100dvh); padding: 0; border-radius: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .scene-panel.scene-workspace[open] { transform-origin: var(--scene-origin-x, 50%) var(--scene-origin-y, 50%); animation: scene-workspace-open .3s ease-out both; }
  @keyframes scene-workspace-open { from { opacity: .3; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
}

/* Let the illustration and story fill the workspace without nested cards. */
.scene-panel.scene-workspace[open] { background: #fffdf8; }
.scene-panel.scene-workspace .scene-workspace-content { padding: 0 0 24px; }
.scene-panel.scene-workspace .scene-workspace-page { display: block; max-width: 720px; margin: 0 auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.scene-panel.scene-workspace .scene-workspace-page > section { margin: 0; padding: 0; border: 0; background: transparent; }
.scene-panel.scene-workspace .scene-workspace-page > .scene-text-area { padding: 20px 20px 0; }
.scene-workspace .image-version-stage { max-width: none; }
.scene-workspace .collection-modal-image { max-height: none; border-radius: 0; }
.scene-image-tools, .scene-text-tools { display: flex; justify-content: flex-end; padding: 2px 14px 0; }
.scene-text-tools { padding: 4px 0 0; }
.scene-workspace .scene-compact-action { width: auto; min-height: 44px; margin: 0; padding: 8px 10px; color: #8a604e; font-size: .75rem; gap: 6px; }
.scene-workspace .scene-compact-action .icon { width: 16px; height: 16px; }
.scene-workspace .scene-version-picker { width: auto; margin: 8px 20px 0; }
.scene-workspace .scene-text-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.scene-workspace > .scene-panel-actions { padding-bottom: max(48px, env(safe-area-inset-bottom, 0px)); }
.scene-workspace[data-text-edit="true"] > .scene-panel-actions { display: none; }

/* A story page: the illustration leads, with quiet controls and open text. */
.scene-workspace .scene-image-hero { position: relative; background: #f8efe4; }
.scene-workspace .scene-image-empty { display: grid; place-items: center; min-height: 180px; padding: 20px 20px 64px; text-align: center; }
.scene-workspace .scene-image-tools { position: absolute; right: 12px; bottom: 12px; padding: 0; }
.scene-workspace .scene-image-tools .scene-compact-action { min-height: 44px; padding: 8px 14px; border: 1px solid rgba(234, 222, 209, .8); border-radius: 999px; background: rgba(255, 253, 248, .96); color: var(--ink); box-shadow: 0 3px 12px rgba(8, 44, 81, .1); }
.scene-workspace .scene-image-tools .scene-compact-action .icon { color: #c88268; }
.scene-panel.scene-workspace .scene-workspace-page > .scene-text-area { max-width: 600px; margin: 0 auto; padding: 25px 24px 0; }
.scene-workspace .scene-text-copy { color: var(--ink); font-size: 1.0625rem; line-height: 1.8; }
.scene-workspace .scene-text-tools { padding-top: 10px; }
.scene-workspace .scene-text-tools .scene-compact-action { padding-inline: 12px; border-radius: 999px; background: #f8efe4; color: var(--ink); }
.scene-workspace .scene-text-tools .scene-compact-action .icon { color: #c88268; }
.scene-workspace .scene-review-folio { margin-top: 22px; color: #b2a496; }
.scene-workspace > .scene-panel-actions { border-top-color: #f0e8df; }

/* A smaller illustration, framed like the pages in the book overview. */
.scene-panel.scene-workspace .scene-workspace-content { padding-top: 18px; }
.scene-workspace .scene-image-hero { width: min(76%, 340px); margin: 0 auto; padding: 5px; border: 1px solid #e9ded0; border-radius: 4px 10px 10px 4px; background: #fffdf8; box-shadow: 0 2px 0 #f5eee5, 0 3px 0 #e8ddcf, 0 5px 0 #f8f2e9, 0 6px 8px rgba(83, 58, 43, .08); }
.scene-workspace .collection-modal-image { border-radius: 7px; }
.scene-workspace .scene-image-tools { right: 12px; bottom: 12px; }

/* The next illustration is created in the same row as its saved versions. */
.scene-workspace .scene-version-picker { width: min(76%, 340px); margin: 16px auto 0; }
.scene-workspace .scene-version-picker > span { color: var(--ink); font-size: .75rem; }
.scene-workspace .scene-version-pending { flex: 0 0 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 68px; height: 58px; min-height: 58px; padding: 4px; border: 1px dashed #d9b9a5; border-radius: 10px; background: #fff7ef; color: #936b57; font-size: .625rem; font-weight: 700; line-height: 1.12; text-align: center; }
.scene-workspace .scene-version-picker .scene-generate-tile .icon { width: 18px; height: 18px; color: #c88268; }
.scene-workspace .scene-version-picker .scene-generate-tile .icon { width: 20px; height: 20px; color: #b47e69; }
.scene-generate-mark { display: grid; flex: 0 0 27px; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #e7ad94; }
.scene-workspace .scene-version-picker .scene-generate-tile .scene-generate-mark .icon { width: 17px; height: 17px; color: #fffdf8; }
.scene-workspace .scene-version-pending { background: #faf5ed; color: var(--muted); }
.scene-version-spinner { width: 17px; height: 17px; border: 2px solid #ead8c9; border-top-color: #c88268; border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) {
  .scene-version-spinner { animation: scene-version-spin .8s linear infinite; }
  @keyframes scene-version-spin { to { transform: rotate(360deg); } }
  @keyframes scene-version-arrive { 0% { opacity: .25; transform: scale(.78); } 60% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
}

/* The text is presented as the written page, with its correction close by. */
.scene-panel.scene-workspace .scene-workspace-page > .scene-text-area { width: min(76%, 340px); max-width: none; margin: 0 auto; padding: 22px 0 0; }
.scene-text-page { position: relative; padding: 16px 16px 12px; border: 1px solid #e9ded0; border-radius: 4px 10px 10px 4px; background: #fffdf8; box-shadow: 0 2px 0 #f5eee5, 0 3px 0 #e8ddcf, 0 5px 0 #f8f2e9, 0 6px 8px rgba(83, 58, 43, .08); }
.scene-text-page::after { content: ''; position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; border-bottom-right-radius: 7px; background: linear-gradient(135deg, transparent 44%, rgba(119, 93, 68, .15) 48%, #e6d9c8 50%, #f8f0e4 63%, #fffaf2 100%); pointer-events: none; }
.scene-text-page-label { display: block; margin-bottom: 12px; color: var(--ink); font-size: .75rem; font-weight: 800; }
.scene-text-page .scene-text-copy { font-size: 1rem; line-height: 1.75; }
.scene-text-page .scene-text-tools { justify-content: flex-start; padding: 14px 0 0; }
.scene-text-edit { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 12px 5px 5px; border: 0; border-radius: 999px; background: #fff2e7; color: #7d5144; font-size: .75rem; font-weight: 700; }
.scene-text-edit-mark { display: grid; flex: 0 0 28px; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e7ad94; color: #fffdf8; }
.scene-text-edit-mark .icon { width: 15px; height: 15px; }
.scene-text-page .scene-review-folio { margin-top: 14px; }
.scene-text-page .scene-workspace-edit-actions .btn { min-height: 44px; padding: 8px 5px; font-size: .75rem; }

.scene-text-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -5px -5px 8px 0; }
.scene-text-page-heading .scene-text-page-label { margin: 0; }
.scene-text-page-heading .scene-text-edit { flex: 0 0 auto; }
.scene-panel.scene-workspace .scene-text-editor { min-height: 150px; overflow-y: hidden; resize: none; }
.scene-workspace[data-text-edit="true"] > .scene-panel-actions.scene-edit-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.scene-workspace > .scene-panel-actions.scene-edit-footer .btn { min-width: 0; padding-inline: 8px; }

/* Keep validation available without dominating the reading space. */
.scene-workspace > .scene-panel-actions:not(.scene-edit-footer) { padding-top: 8px; border-top-color: transparent; }
.scene-workspace > .scene-panel-actions:not(.scene-edit-footer) .btn { width: min(100%, 220px); min-height: 46px; padding: 10px 18px; background: #cb4353; font-size: .8125rem; }
.scene-workspace > .scene-panel-actions:not(.scene-edit-footer) .btn .icon { width: 17px; height: 17px; }

/* Character drawings use the same soft paper treatment as the book pages. */
.collection-step .collection-view {
  position: relative;
  gap: 0;
  padding: 6px 6px 1px;
  border: 1px solid #e9ded0;
  border-radius: 4px 10px 10px 4px;
  background: #fffdf8;
  box-shadow: 0 2px 0 #f5eee5, 0 3px 0 #e8ddcf, 0 5px 7px rgba(83, 58, 43, .08);
}
.collection-step .collection-sticker,
.collection-step .collection-view.is-filled .collection-sticker {
  border: 0;
  border-radius: 7px;
  -webkit-clip-path: inset(0 round 7px);
  clip-path: inset(0 round 7px);
  background: #fffaf6;
}
.collection-step .collection-image-background { display: none; }
.collection-step .collection-image-foreground > svg > rect:first-child,
.collection-step .collection-image-foreground > svg > circle:nth-child(2) { display: none; }
.collection-step .collection-image-foreground > svg { width: 94%; height: 94%; }
.collection-step .collection-view-label {
  min-height: 30px;
  color: var(--ink);
  font-family: inherit;
  font-size: .6875rem;
  font-style: normal;
  font-weight: 700;
}

/* A gentle colored-pencil finish for character images awaiting review. */
.collection-step .collection-sticker.is-unapproved .collection-image-foreground {
  filter: url(#character-pencil);
}
.collection-step .collection-sticker.is-unapproved::after { display: none; }

/* Keep the preview visible while inviting the user to review it. */
.collection-step .collection-sticker.is-unapproved .collection-image-foreground {
  filter: url(#character-pencil) grayscale(1) blur(1px);
}
.collection-step .collection-sticker.is-unapproved::after { display: none; }
.collection-step .collection-invite {
  top: auto;
  right: 6px;
  bottom: 6px;
  left: auto;
  display: flex;
  width: 46px;
  height: 46px;
  max-width: calc(100% - 12px);
  padding: 5px;
  border-radius: 50%;
  font-size: .625rem;
  line-height: 1.15;
  white-space: normal;
  transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  .collection-step .collection-invite,
  .collection-step .collection-invite.is-new { animation: character-review-pulse 2s ease-in-out infinite; }
  @keyframes character-review-pulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(102, 69, 48, .14), 0 0 0 0 rgba(215, 164, 125, 0); }
    50% { box-shadow: 0 2px 6px rgba(102, 69, 48, .14), 0 0 0 5px rgba(215, 164, 125, .2); }
  }
}

/* The review cue sits across the edge of the image and its caption. */
.collection-step .collection-sticker,
.collection-step .collection-view.is-filled .collection-sticker {
  overflow: visible;
  -webkit-clip-path: none;
  clip-path: none;
}
.collection-step .collection-sticker .collection-image-foreground {
  overflow: hidden;
  border-radius: 7px;
}
.collection-step .collection-invite { right: 5px; bottom: -17px; }
.collection-step .collection-view-label {
  min-height: 35px;
  padding: 5px 53px 5px 4px;
  text-align: left;
}

/* Place the review cue in the caption, beneath the drawing. */
.collection-step .collection-invite {
  right: 3px;
  bottom: -47px;
  width: 42px;
  height: 42px;
}
.collection-step .collection-view-label {
  min-height: 52px;
  padding-right: 50px;
}

/* The whole picture becomes the invitation to review it. */
.collection-step .collection-sticker,
.collection-step .collection-view.is-filled .collection-sticker {
  overflow: hidden;
  -webkit-clip-path: inset(0 round 7px);
  clip-path: inset(0 round 7px);
}
.collection-step .collection-invite {
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 250, 243, .28);
  box-shadow: none;
  color: #654839;
  font-size: .875rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 5px #fffaf3, 0 0 12px #fffaf3;
  transform: none;
}
.collection-step .collection-view-label {
  min-height: 30px;
  padding: 4px 2px;
  text-align: center;
}
@media (prefers-reduced-motion: no-preference) {
  .collection-step .collection-invite,
  .collection-step .collection-invite.is-new { animation: character-review-text 2.8s ease-in-out infinite; }
  .collection-step .collection-sticker.is-unapproved .collection-image-foreground { animation: character-review-drawing 2.8s ease-in-out infinite; }
  @keyframes character-review-text {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
  }
  @keyframes character-review-drawing {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
  }
}

/* Animate the invitation text while the drawing stays still. */
.collection-step .collection-invite { background: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .collection-step .collection-sticker.is-unapproved .collection-image-foreground { animation: none; }
  .collection-step .collection-invite,
  .collection-step .collection-invite.is-new { animation: character-review-label 2.8s ease-in-out infinite; }
  @keyframes character-review-label {
    0%, 100% { opacity: .55; transform: scale(.96); }
    50% { opacity: 1; transform: scale(1.05); }
  }
}

/* A single, bold translucent word invites a tap. */
.collection-step .collection-invite {
  color: #563d32;
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  font-weight: 900;
  letter-spacing: -.04em;
  text-shadow: 0 1px 5px rgba(255, 250, 243, .8);
  opacity: .72;
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes character-review-label {
    0%, 100% { opacity: .42; transform: scale(.96); }
    50% { opacity: .85; transform: scale(1.05); }
  }
}

/* Scale the word to the width of each picture. */
.collection-step .collection-sticker { container-type: inline-size; }
.collection-step .collection-invite {
  padding: 0;
  font-size: 22cqw;
  white-space: nowrap;
}

/* Soft contrast keeps the translucent word readable over light and dark areas. */
.collection-step .collection-invite {
  color: #fffdf8;
  font-size: 21cqw;
  letter-spacing: -.045em;
  text-shadow: 0 1px 3px rgba(42, 31, 27, .8), 0 0 9px rgba(42, 31, 27, .45);
  opacity: .6;
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes character-review-label {
    0%, 100% { opacity: .32; transform: scale(.97); }
    50% { opacity: .7; transform: scale(1.03); }
  }
}

/* The change request stays available as soon as an image opens. */
.collection-panel .collection-retry { margin-top: 12px; }
.collection-panel .collection-retry textarea { min-height: 62px; }
@media (max-width: 680px) {
  .collection-panel .image-version-stage { width: min(100%, 29dvh, 270px); }
}

/* Character review follows the full-screen book-page workspace. */
.collection-panel[open] {
  position: fixed;
  inset: 0;
  display: flex;
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fffdf8;
  box-shadow: none;
}
.collection-panel > .collection-panel-heading {
  min-height: 70px;
  margin: 0;
  padding: max(10px, env(safe-area-inset-top, 0px)) 60px 10px 20px;
  background: #fffdf8;
}
.collection-panel > .sheet-close { top: max(10px, env(safe-area-inset-top, 0px)); right: 14px; z-index: 2; }
.collection-panel .collection-modal-content { margin: 0; padding: 18px 20px 28px; }
.collection-workspace-body { width: min(100%, 460px); margin: 0 auto; }
.collection-workspace-picture { width: min(100%, 340px); margin: 0 auto; padding: 5px; border: 1px solid #e9ded0; border-radius: 4px 10px 10px 4px; background: #fffdf8; box-shadow: 0 2px 0 #f5eee5, 0 3px 0 #e8ddcf, 0 5px 7px rgba(83, 58, 43, .08); }
.collection-workspace-picture .collection-modal-image { max-width: none; border-radius: 7px; }
.collection-workspace-versions { width: min(100%, 340px); margin: 18px auto 0; }
.collection-workspace-versions > span { display: block; margin-bottom: 8px; color: var(--ink); font-size: .75rem; font-weight: 700; }
.collection-panel .collection-retry { width: min(100%, 340px); margin: 22px auto 0; }
.collection-panel .collection-retry textarea { width: 100%; min-height: 82px; font-size: 16px; }
.collection-panel .collection-modal-actions { display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px 16px max(24px, env(safe-area-inset-bottom, 0px)); background: #fffdf8; }
.collection-panel .collection-modal-actions .btn { width: min(100%, 220px); margin: 0 auto; }

/* Match regeneration and validation controls across the review workspaces. */
.scene-workspace .scene-regenerate-action { width: min(76%, 340px); margin: 10px auto 0; }
.scene-workspace .scene-regenerate-action .btn { width: 100%; }
/* Keep regeneration close to its image without competing with validation. */
.scene-workspace .scene-regenerate-action { display: flex; justify-content: flex-end; }
.scene-workspace .scene-regenerate-action .btn,
.collection-panel .collection-retry .btn {
  width: auto;
  min-height: 38px;
  padding: 7px 12px;
  border: 0;
  background: #f8efe4;
  color: #7d5144;
  font-size: .75rem;
}
.collection-panel .collection-retry .btn { display: flex; margin-left: auto; }
.scene-workspace .scene-regenerate-action .btn .icon,
.collection-panel .collection-retry .btn .icon { width: 16px; height: 16px; }
.scene-versions-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--ink); }
.scene-workspace .scene-versions-heading .btn { width: auto; min-height: 36px; padding: 7px 12px; border: 0; background: #f8efe4; color: #7d5144; font-size: .75rem; }
.scene-workspace .scene-versions-heading .btn .icon { width: 16px; height: 16px; }
.collection-panel .collection-retry { margin-top: 16px; }
.collection-panel .collection-retry textarea { min-height: 62px; }
.collection-panel .collection-retry .btn { margin: 8px 0 0 auto; }
.scene-workspace > .scene-panel-actions:not(.scene-edit-footer) {
  padding: 12px 16px max(24px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: #fffdf8;
}
.scene-workspace > .scene-panel-actions:not(.scene-edit-footer) .btn {
  width: min(100%, 220px);
  min-height: 54px;
  padding: 14px 9px;
  background: var(--accent);
  font-size: .9375rem;
}
.scene-workspace > .scene-panel-actions:not(.scene-edit-footer) .btn:hover:not(:disabled) { background: var(--accent-hover); }
.scene-workspace > .scene-panel-actions:not(.scene-edit-footer) .btn .icon { width: 20px; height: 20px; }
@media (max-width: 680px) {
  .scene-workspace > .scene-panel-actions:not(.scene-edit-footer) .btn { font-size: .8125rem; }
}

/* Pages awaiting review use the same invitation as character drawings. */
.scene-grid .collection-sticker { container-type: inline-size; }
.scene-grid .collection-sticker.is-unapproved .collection-image-foreground { filter: url(#character-pencil) grayscale(1) blur(1px); }
.scene-grid .collection-sticker.is-unapproved::after { display: none; }
.scene-grid .collection-invite {
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fffdf8;
  font-size: 16cqw;
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 3px rgba(42, 31, 27, .8), 0 0 9px rgba(42, 31, 27, .45);
  white-space: nowrap;
  opacity: .6;
  transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  .scene-grid .collection-invite,
  .scene-grid .collection-invite.is-new { animation: character-review-label 2.8s ease-in-out infinite; }
}

/* Keep both review previews soft and remove the page image's inner border. */
.collection-step .collection-sticker.is-unapproved .collection-image-foreground,
.scene-grid .collection-sticker.is-unapproved .collection-image-foreground {
  filter: url(#character-pencil) grayscale(1) blur(2px);
}
.scene-grid .collection-sticker,
.scene-grid .collection-sticker.is-unapproved { border: 0; }

.scene-grid .scene-page-status.is-incomplete {
  color: var(--ink);
  font-family: inherit;
  font-size: .6875rem;
  font-weight: 700;
  line-height: 1.25;
}

/* A quiet, spacious writing surface for correcting a page. */
.scene-panel.scene-workspace[open][data-text-edit="true"] { background: #fffdf8; }
.scene-workspace[data-text-edit="true"] .scene-editor-content {
  width: min(100%, 600px);
  margin: 0 auto;
  padding: 0 0 6px;
  overflow: hidden;
}
.scene-panel.scene-workspace .scene-editor-content textarea.scene-text-editor {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 2px;
  border: 0;
  border-radius: 0;
  background: #fffdf8;
  box-shadow: none;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-y: auto;
  resize: none;
}
.scene-workspace[data-text-edit="true"] > .scene-editor-actions {
  flex: 0 0 auto;
  width: min(100%, 600px);
  margin: 0 auto;
  padding-top: 16px;
  border: 0;
}
@media (max-width: 680px) {
  .scene-panel.scene-workspace[open][data-text-edit="true"] { padding: max(20px, env(safe-area-inset-top, 0px)) 20px max(20px, env(safe-area-inset-bottom, 0px)); }
  .scene-panel.scene-workspace .scene-editor-content textarea.scene-text-editor { padding: 8px 2px; }
  .scene-workspace[data-text-edit="true"] > .scene-editor-actions { padding-top: 10px; }
}

/* Finished stories have their own place in the library. */
.library-book { width: min(100%, 440px); margin: 0 auto; padding-bottom: 32px; }
.library-book-back { margin-bottom: 20px; }
.library-book-cover { width: 155px; margin: 0 auto 16px; }
.library-book-cover .story-bouquet { width: 100%; }
.library-book-heading { text-align: center; }
.library-book-heading h1 { margin: 0; color: var(--ink); font-size: clamp(1.5rem, 5vw, 1.85rem); line-height: 1.3; overflow-wrap: anywhere; }
.library-book-heading p { margin: 8px 0 0; color: var(--muted); font-size: .875rem; }
.library-book-actions { display: grid; gap: 10px; margin: 28px auto 0; width: min(100%, 340px); }
.library-book-actions .btn { width: 100%; }
.library-book-share-status { max-width: 340px; margin: 12px auto 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; text-align: center; }

.guide-upload-art { margin-top: 10px; border-radius: 16px; overflow: hidden; background: transparent; }
.guide-upload-art svg { display: block; width: 100%; height: auto; }
.guide-upload-caption { margin: 10px 0 0; color: var(--ink); font-size: .8125rem; line-height: 1.5; }
@media (prefers-reduced-motion: no-preference) {
  .guide-upload-tap { animation: guide-upload-tap 2.4s ease-in-out infinite; transform-origin: 201px 147px; }
  @keyframes guide-upload-tap { 0%, 35%, 100% { transform: translate(8px, 8px); } 50%, 65% { transform: translate(0, 0); } }
}
.guide-phone-gallery { transform: translateY(-68px); }
@media (prefers-reduced-motion: no-preference) {
  .guide-phone-gallery { animation: guide-gallery-scroll 5s ease-in-out infinite; }
  .guide-phone-hand { animation: guide-phone-gesture 5s ease-in-out infinite; }
  .guide-phone-selection { animation: guide-phone-selected 5s ease-in-out infinite; }
  @keyframes guide-gallery-scroll { 0%, 20% { transform: translateY(0); } 45%, 100% { transform: translateY(-68px); } }
  @keyframes guide-phone-gesture { 0%, 20% { transform: translateY(45px); } 45%, 58% { transform: translateY(-23px); } 70%, 82% { transform: translateY(0); } 100% { transform: translateY(45px); } }
  @keyframes guide-phone-selected { 0%, 68% { opacity: 0; } 75%, 100% { opacity: 1; } }
}
@media (prefers-reduced-motion: no-preference) {
  .guide-result-drawing { transform-origin: center; animation: guide-drawing-arrival 3s ease-in-out infinite; }
  @keyframes guide-drawing-arrival { 0%, 12% { opacity: .25; transform: translateY(8px) scale(.96); } 35%, 80% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: .25; transform: translateY(8px) scale(.96); } }
}
.guide-upload-slide .guide-upload-art { height: 220px; display: grid; place-items: center; }
.guide-upload-slide .guide-upload-art svg { width: auto; max-width: 100%; height: 100%; }
.guide-upload-caption { min-height: 2.8em; }
.guide-upload-controls { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 8px; }
.guide-upload-controls button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #f8efe4; color: #9b6957; cursor: pointer; }
.guide-upload-controls button:disabled { opacity: .35; cursor: default; }
.guide-upload-controls .icon { width: 19px; height: 19px; }
.guide-upload-progress { color: var(--muted); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) {
  .guide-upload-slide:not([hidden]) { animation: guide-upload-slide-in .35s ease-out; }
  @keyframes guide-upload-slide-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
}
.guide-record-draft { display: grid; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.guide-record-draft strong { color: var(--ink); font-size: .875rem; }
.guide-record-draft p { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.guide-record-draft .btn { width: 100%; min-height: 44px; }
.guide-record-preview { width: 100%; }
.guide-record-status:empty { display: none; }
.guide-record-device-label { color: var(--ink); font-size: .8125rem; font-weight: 700; }
.guide-record-device { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #e2d7ce; border-radius: 12px; background: #fffdf8; color: var(--ink); font-size: .875rem; }
.guide-analysis-skeleton { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .guide-analysis-loupe { animation: guide-analysis-scan 4s ease-in-out infinite; }
  .guide-analysis-skeleton { animation: guide-analysis-placeholder 4s ease-in-out infinite; }
  .guide-analysis-description { animation: guide-analysis-reveal 4s ease-in-out infinite; }
  @keyframes guide-analysis-scan { 0%, 100% { transform: translate(-8px, -6px); } 45% { transform: translate(9px, 7px); } 70% { transform: translate(3px, 1px); } }
  @keyframes guide-analysis-placeholder { 0%, 45% { opacity: 1; } 65%, 100% { opacity: 0; } }
  @keyframes guide-analysis-reveal { 0%, 45% { opacity: 0; } 70%, 100% { opacity: 1; } }
}
.guide-upload-progress { display: flex; align-items: center; gap: 6px; }
.guide-upload-progress i { width: 6px; height: 6px; border-radius: 50%; background: #e4d5c9; }
.guide-upload-progress[data-index="0"] i:nth-child(1),
.guide-upload-progress[data-index="1"] i:nth-child(2),
.guide-upload-progress[data-index="2"] i:nth-child(3) { background: #cb4353; }
.guide-upload-progress[data-index="3"] i:nth-child(4) { background: #cb4353; }
@media (prefers-reduced-motion: no-preference) {
  .guide-correction-form { animation: guide-correction-show 6s ease-in-out infinite; transform-origin: center; }
  .guide-correction-line { animation: guide-correction-type 6s ease-in-out infinite; transform-origin: left center; }
  .guide-correction-hand { animation: guide-correction-tap 6s ease-in-out infinite; }
  @keyframes guide-correction-show { 0%, 20% { opacity: 0; transform: translateY(5px); } 30%, 85% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }
  @keyframes guide-correction-type { 0%, 35% { transform: scaleX(0); } 55%, 100% { transform: scaleX(1); } }
  @keyframes guide-correction-tap { 0%, 10% { opacity: 1; transform: translate(8px, 8px); } 20%, 25% { opacity: 1; transform: translate(0, 0); } 35%, 100% { opacity: 0; } }
}
.guide-correction-submit-hand { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .guide-correction-submit-hand { animation: guide-correction-send 6s ease-in-out infinite; }
  @keyframes guide-correction-send { 0%, 59% { opacity: 0; transform: translate(5px, 5px); } 68% { opacity: 1; transform: translate(5px, 5px); } 76%, 82% { opacity: 1; transform: translate(0, 0); } 94%, 100% { opacity: 0; } }
}
.guide-upload-progress[data-index="4"] i:nth-child(5) { background: #cb4353; }
@media (prefers-reduced-motion: no-preference) {
  .guide-typing-lines rect { animation: guide-typing-appear 6s ease-in-out infinite; }
  .guide-typing-lines rect:nth-child(2) { animation-delay: .35s; }
  .guide-typing-lines rect:nth-child(3) { animation-delay: .7s; }
  @keyframes guide-typing-appear { 0%, 12% { opacity: 0; } 30%, 80% { opacity: 1; } 100% { opacity: 0; } }
}
.guide-general-message { display: grid; gap: 8px; margin: 0 0 18px; }
.guide-general-message strong { color: var(--ink); font-size: .875rem; }
.guide-general-message audio { width: 100%; }
.guide-general-placeholder { margin: 0; color: var(--muted); font-size: .8125rem; }
.guide-step-audio { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.guide-step-sound { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 999px; background: #f8efe4; color: #805a4b; font-size: .75rem; font-weight: 700; cursor: pointer; }
.guide-step-sound[aria-pressed="true"] { background: #fae5e1; color: #b82e43; }
.guide-step-sound .icon { width: 17px; height: 17px; }
.guide-step-audio-status { width: 100%; color: var(--muted); font-size: .75rem; text-align: center; }
.guide-record-draft summary { color: var(--muted); font-size: .75rem; font-weight: 700; cursor: pointer; }
.guide-record-draft:not([open]) { display: block; }
.guide-inline-record { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; margin-top: 10px; }
.guide-inline-record-button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 7px 12px; border: 0; border-radius: 999px; background: #f8efe4; color: #805a4b; font-size: .75rem; font-weight: 700; cursor: pointer; }
.guide-inline-record-button .icon { width: 16px; height: 16px; }
.guide-inline-record-button:disabled { opacity: .45; cursor: default; }
.guide-inline-record > span { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.guide-step-audio .guide-inline-record { justify-content: center; }
.guide-step-audio .guide-inline-record > span { text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .guide-age-hand { animation: guide-upload-tap 2.4s ease-in-out infinite; }
}
.story-setup-back { margin: 0 0 10px; }
@media (prefers-reduced-motion: no-preference) {
  .guide-input-caret { animation: guide-caret-blink 1.1s step-end infinite; }
  @keyframes guide-caret-blink { 50% { opacity: 0; } }
}
@media (prefers-reduced-motion: no-preference) {
  .guide-typing-lines { animation: guide-typewriter-text 4s steps(22, end) infinite; }
  .guide-typing-lines rect { animation: none; }
  .guide-input-caret { animation: guide-typewriter-caret 4s steps(22, end) infinite; }
  .guide-upload-tutorial[data-tutorial-subject="age"] .guide-input-caret { animation-name: guide-typewriter-caret-short; }
  @keyframes guide-typewriter-text { 0%, 8% { clip-path: inset(0 100% 0 0); } 65%, 88% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 100% 0 0); } }
  @keyframes guide-typewriter-caret { 0%, 8% { transform: translateX(0); opacity: 1; } 65%, 88% { transform: translateX(110px); opacity: 1; } 100% { transform: translateX(0); opacity: 1; } }
  @keyframes guide-typewriter-caret-short { 0%, 8% { transform: translateX(0); opacity: 1; } 65%, 88% { transform: translateX(67px); opacity: 1; } 100% { transform: translateX(0); opacity: 1; } }
}
@media (prefers-reduced-motion: no-preference) {
  .guide-options-reveal { animation: guide-options-open 4s ease-in-out infinite; transform-origin: 50% 110px; }
  .guide-options-hand { animation: guide-options-touch 4s ease-in-out infinite; }
  @keyframes guide-options-open { 0%, 24% { opacity: 0; transform: scaleY(.1); } 40%, 85% { opacity: 1; transform: scaleY(1); } 100% { opacity: 0; transform: scaleY(.1); } }
  @keyframes guide-options-touch { 0%, 14% { opacity: 1; transform: translate(6px, 7px); } 24%, 30% { opacity: 1; transform: translate(0, 0); } 45%, 100% { opacity: 0; } }
}
@media (prefers-reduced-motion: no-preference) {
  .guide-options-chevron { transform-box: fill-box; transform-origin: center; animation: guide-options-chevron-turn 4s ease-in-out infinite; }
  @keyframes guide-options-chevron-turn { 0%, 24% { transform: rotate(0); } 40%, 85% { transform: rotate(180deg); } 100% { transform: rotate(0); } }
}
/* Tutorials use one general voice message. */
.guide-upload-tutorial > .guide-upload-slide,
.guide-upload-tutorial > .guide-step-audio,
.guide-upload-tutorial > .guide-upload-controls,
.guide-tutorial-scenes { display: none !important; }
#guide-panel .guide-upload-tutorial { margin-top: 16px; padding-top: 0; border-top: 0; }
#guide-panel .guide-tutorial:not(.guide-upload-tutorial) { display: none !important; }
