/* 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. */
.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; }
.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); }
.back-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.back-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; }

/* The invitation leads with the drawing, then gets out of the way. */
.home { padding-top: 24px; padding-bottom: 48px; }
.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); }
.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; }

/* Stable phase navigation; the current task carries the detail. */
.workspace { max-width: 880px; padding-bottom: 40px; }
.stage-header { margin: 0 auto 32px; max-width: 680px; text-align: center; }
.stage-title, .stage-header h1 { font-size: clamp(1.9rem, 4.1vw, 2.85rem); }

.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; }
.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. */
.actions > .btn-primary { order: 2; min-width: 230px; margin-left: auto; }
.actions > .btn-secondary { 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 { 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 { background: #fff8f3; border-color: var(--accent); }
.upload-zone > .icon { width: 38px; height: 38px; padding: 10px; box-sizing: content-box; border-radius: 20px; background: var(--peach); }
.upload-zone strong { font-size: 1.0625rem; }
.upload-zone span { color: var(--muted); font-size: .875rem; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label { font-size: .875rem; font-weight: 700; }
.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); }
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; }

/* A page is a page to read, not a form to repair. */
.book-text { font-size: 1.1875rem; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }

/* One phrase, one action, then the next phrase. */
.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; }

/* Native dialog handles containment; typography stays consistent with the task. */
.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); }

@media (min-width: 1200px) {
  .workspace { padding-top: 10px; }
  .stage-header { margin-bottom: 38px; }
}
@media (max-width: 900px) {
  .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; }
  .shell { width: calc(100% - 44px); }
  .home { padding-top: 0; }
  .eyebrow { font-size: .6875rem; margin-bottom: 18px; }
  .section-heading { padding-top: 24px; margin-bottom: 17px; }
  .section-heading h2 { font-size: 1.45rem; }
  .section-heading p { display: none; }
  .workspace { padding-top: 5px; padding-bottom: max(48px, env(safe-area-inset-bottom, 0px)); }
  .stage-header { margin-bottom: 25px; }
  .stage-title, .stage-header h1 { font-size: clamp(1.8rem, 7vw, 2.3rem); }
  .split { grid-template-columns: 1fr; gap: 20px; }
  .drawing-preview { padding: 14px; border-radius: 21px; }
  .drawing-preview img, .drawing-preview svg { max-height: 230px; }
  .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-secondary { order: 1; min-height: 44px; }
  .actions .helper { text-align: center; }
  .clip-row { padding: 13px; gap: 10px; }
  .clip-status { font-size: .625rem; }
  .modal { padding: 23px; border-radius: 23px; }
}
@media (max-width: 390px) {
  .site-header { padding: 15px 20px; }
  .shell { width: calc(100% - 40px); }
  .header-right { gap: 3px; }
}

/* 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; }
.section-heading > span { font-size: .75rem; color: var(--muted); }
.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; }
.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; }
.video-result { width: 100%; max-width: 560px; margin: 0 auto; text-align: center; }

/* 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-home { margin: 0 auto; padding: 24px 0 max(48px, env(safe-area-inset-bottom, 0px)); }
.atelier-home-heading { margin-bottom: 16px; }
.atelier-home-heading h1 { font-family: 'Nunito', var(--heading-font); font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 850; letter-spacing: -.03em; line-height: 1.15; }
/* The coral full stop echoes the wordmark and the public headline. */
.atelier-home-heading h1::after { content: '.'; color: #eb4954; }
.story-filter-empty { padding: 34px 12px; color: var(--muted); font-size: .875rem; text-align: center; }
.library-sections { display: grid; align-items: start; gap: 40px 32px; }
.library-sections > section { min-width: 0; }
.library-sections h2 {
  margin-bottom: 18px;
  color: var(--ink);
  font: 850 clamp(1.25rem, 2.1vw, 1.65rem)/1.2 Nunito, var(--heading-font);
  letter-spacing: -.025em;
}
.library-book-list, .library-draft-list { margin: 0; padding: 0; list-style: none; }
.library-book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr));
  gap: 8px 24px;
}
.library-story-entry { min-width: 0; }
.library-book-list > .library-story-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 20px;
}
.library-book-link, .library-draft-link { color: var(--ink); text-decoration: none; }
.library-book-link { display: flex; flex-direction: column; gap: 8px; }
.library-story-art { display: block; width: 100%; object-fit: cover; object-position: center; }
.library-book-art, .library-draft-art { position: relative; isolation: isolate; width: 100%; overflow: hidden; background: #f6dfd5; }
.library-book-art { aspect-ratio: 3 / 2; border-radius: 8px 16px 16px 8px; }
.library-book-image-link { display: block; width: 100%; height: 100%; }
.library-book-image-link > .library-story-art { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Whether the family marked this finished story for publication. */
.library-story-art.is-placeholder { padding: 14%; object-fit: contain; }
.library-story-title {
  display: block;
  overflow: hidden;
  height: 1.4em;
  margin: 0;
  color: var(--ink);
  font: 750 1.125rem/1.4 Nunito, var(--heading-font);
  letter-spacing: -.025em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.library-story-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.library-story-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.library-story-actions > :is(a, button) { min-width: 0; height: 44px; line-height: 1.4; text-align: left; }
.library-action-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.library-story-actions > .library-action-error { grid-column: 1 / -1; }
.library-story-resume { display: inline-flex; align-items: center; gap: 3px; color: var(--ink); font-weight: 700; white-space: nowrap; }
.library-story-resume > .icon { width: 16px; height: 16px; }
.library-narration-status { --story-icon-ink: var(--muted); --story-icon-accent: var(--blue-wash); display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); font-size: .8125rem; line-height: 1.3; text-decoration: none; }
.library-narration-status[data-state="ready"] { --story-icon-ink: var(--green); --story-icon-accent: #c9dcc4; }
.library-narration-status:is([data-state="recording"], [data-state="review"], [data-state="updated"]) { --story-icon-ink: #88683f; --story-icon-accent: #e4ca9f; }
.library-narration-status > .icon { flex: none; width: 22px; height: 22px; scale: 1; }
.library-narration-status.is-compact { justify-content: center; width: 32px; min-height: 32px; border-radius: 50%; background: rgb(255 255 255 / .88); }
.library-narration-status.is-compact > .icon { width: 20px; height: 20px; }
.library-secondary-action { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: .8125rem; text-decoration: none; cursor: pointer; }
.library-secondary-action > .icon { flex: none; width: 16px; height: 16px; }
.library-secondary-action.library-story-resume { font-weight: 700; }
.library-secondary-action:hover, .library-narration-status:hover { text-decoration: underline; }
.library-secondary-action:disabled { color: var(--muted); cursor: wait; }
.library-action-error { width: 100%; color: var(--accent); font-size: .8125rem; }
.library-draft-list { --draft-thumbnail: 80px; max-width: 35rem; }
.library-draft-list > .library-story-entry {
  display: grid;
  grid-template-columns: var(--draft-thumbnail) minmax(0, 1fr);
  gap: 8px 16px;
  padding-block: 20px;
}
.library-draft-list > li + li { border-top: 1px solid var(--line); }
.library-draft-list > li:first-child { padding-top: 0; }
.library-draft-link {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  grid-template-areas: "art title" "art meta" "art status";
  gap: 6px 16px;
  align-items: start;
  align-content: start;
}
.library-draft-link > .library-draft-art { grid-area: art; align-self: start; aspect-ratio: 1; border-radius: 7px; }
.library-draft-art > .library-story-art { position: absolute; inset: 0; height: 100%; }
.library-draft-link > .library-story-title { grid-area: title; font-size: 1.0625rem; }
.library-draft-link > .library-story-meta { grid-area: meta; }
.library-draft-list .library-story-actions { grid-column: 2; gap: 0 12px; }
.library-draft-list .library-narration-status { order: 1; flex-basis: 100%; }
@media (min-width: 781px) {
  .library-sections[data-split] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-sections[data-split] .library-book-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr)); }
  .library-sections[data-split] .library-book-list > .library-story-entry:only-child { width: 100%; max-width: 440px; }
}
.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; }
  .library-book-list { column-gap: 18px; }
  .atelier-empty { padding: 38px 20px; }
}

@media (max-width: 680px) {
  .section-heading > span { font-size: .625rem; }
}
@media (max-width: 390px) {
  .section-heading > span { max-width: 90px; text-align: right; }
}
@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, .actions { display: none !important; }
  .shell, .workspace { width: 100%; max-width: none; padding: 0; }
  .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; }
.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 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 { 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)); } }
}

/* 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; }

/* 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; }
}

/* 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 { margin-bottom: auto; }
}

.guide-panel .guide-panel-heading { padding-right: 46px; }

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

/* 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));
  }
}

/* A lively preview for the narrated version, alongside a quieter PDF. */
:is(.voice-intro-message, #guide-panel) .guide-voice-meta { justify-content: flex-end; margin-top: 0; color: var(--ink); opacity: .65; }

.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-trial-result p { margin: 10px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
/* Keep the recording control stable while its waveform indicates activity. */
@media (prefers-reduced-motion: no-preference) {
  .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; } }
}

/* A small collection book: each empty place belongs to one subject and view. */
.generation-paper { transform-box: fill-box; transform-origin: center; }
.generation-paper { animation: generation-float 2.5s ease-in-out infinite; }
@keyframes generation-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-2px) rotate(2deg); } }

/* A compact, familiar player that sits naturally on the page. */
.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-time { flex: 0 0 auto; color: var(--muted); font-size: .65rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The recording itself becomes a seekable sound trace. */
.narration-wave-canvas { display: block; width: 100%; height: 42px; }

/* 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; } }

/* Keep the selected book page visible while guiding its two review steps. */
.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; }

/* Animate the invitation text while the drawing stays still. */
@media (prefers-reduced-motion: no-preference) {
  @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. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes character-review-label {
    0%, 100% { opacity: .42; transform: scale(.96); }
    50% { opacity: .85; transform: scale(1.05); }
  }
}

/* Soft contrast keeps the translucent word readable over light and dark areas. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes character-review-label {
    0%, 100% { opacity: .32; transform: scale(.97); }
    50% { opacity: .7; transform: scale(1.03); }
  }
}

/* Finished stories have their own place in the library. */

.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; }
}
@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; }
