@layer moonshot-pages {
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.studio-examples,.studio-revision{border-block-start:1px solid var(--line);padding:14px 0;margin:16px 0;max-width:690px}
.studio-examples summary{cursor:pointer;font-weight:650;width:fit-content}.studio-examples h2{font:400 1.4rem var(--title);letter-spacing:-.035em}.studio-examples p{margin:6px 0 12px;color:var(--muted)}
.studio-revision label{margin-top:0}.studio-revision .secondary{margin-top:10px}.desk #draw:disabled{opacity:.65}
#idea-form{max-width:720px}#idea{font-size:1.14rem}
#presets{display:flex;flex-wrap:wrap;gap:8px}#presets .preset{padding:8px 12px;font-weight:550}
.story-shelf{border:0;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.story-option{display:grid;grid-template-columns:110px 1fr;align-items:start;gap:14px;border:1px solid var(--line);border-radius:8px;background:var(--ui-surface);padding:10px}
.story-option:has(input:checked){border-color:var(--forest);box-shadow:inset 0 0 0 1px var(--forest);background:color-mix(in srgb, var(--book-sage) 30%, var(--book-paper))}
.story-option img{width:100%;height:118px;object-fit:contain;background:var(--ui-surface)}.story-option label{margin:0;cursor:pointer}.story-option input{width:18px;height:18px;margin:0 5px 0 0;vertical-align:middle;accent-color:var(--forest)}.story-option p{font-size:.93rem;line-height:1.35;margin:5px 0}.story-option a{font-size:.85rem}.confirm-sheet{display:grid;grid-template-columns:minmax(120px,220px) 1fr;gap:24px;padding:18px;border:1px solid var(--line);border-radius:8px;background:var(--ui-surface);max-width:720px}.confirm-sheet img{width:100%;max-height:250px;object-fit:contain}.confirm-sheet h2{font:400 1.65rem var(--title);letter-spacing:-.045em}.confirm-sheet h3{margin:10px 0 3px}.confirm-sheet p{overflow-wrap:anywhere}
@media(max-width:670px){.story-shelf{grid-template-columns:1fr;gap:8px}.story-option{grid-template-columns:82px 1fr;gap:10px}.story-option img{height:100px}.confirm-sheet{grid-template-columns:90px 1fr;gap:12px;padding:12px}}
.confirm-sheet{background:color-mix(in srgb, var(--book-sage) 30%, var(--book-paper))}#confirm-idea{font:600 clamp(20px,3vw,28px)/1.2 var(--ui-font)}

/* The studio keeps each decision beside the sheet it affects. */
.studio-body{--studio-ink:var(--book-ink);--studio-line:var(--book-rule);background:var(--book-paper);color:var(--studio-ink)}
.studio-body .desk{width:min(1110px,calc(100% - clamp(36px,9vw,130px)));padding:24px 0 60px}

.studio-body :where(h1,h2,h3){letter-spacing:-.035em}.studio-body .stage-title h1{letter-spacing:-.04em;font-size:clamp(38px,4.6vw,62px)}
.studio-body .stage-title{padding:22px 0}.studio-body .stage-title p{margin-top:10px}
.studio-body .cta{border-radius:7px;background:var(--book-orange);color:var(--ui-on-accent)}.studio-body .cta:hover{background:color-mix(in srgb, var(--book-orange) 82%, var(--book-paper))}.studio-body .cta:disabled{background:var(--book-sand);color:var(--book-muted);border-color:var(--book-sage);opacity:1}
.studio-body .desk button,.studio-body a{touch-action:manipulation}.studio-body ::selection{background:color-mix(in srgb, var(--book-sage) 30%, var(--book-paper))}
.character-desk{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(32px,6vw,88px);align-items:center;border-block:1px solid var(--studio-line);padding:clamp(24px,3.8vw,54px) 0}
.character-editor .stage-title{padding:0 0 22px}.character-editor .stage-title h1{max-width:13ch}.character-editor .stage-title p{font-size:1.18rem;margin-top:11px}
.character-editor #idea-form label{margin:0 0 6px}.character-editor #idea{min-height:110px;border-radius:8px;border-color:var(--ui-field-border);padding:14px 16px;background:var(--ui-surface);font-size:1.05rem}
.character-editor .stage-actions{margin:14px 0 0}
.character-gallery{background:color-mix(in srgb, var(--book-sage) 30%, var(--book-paper));border-radius:14px;padding:clamp(14px,2.3vw,31px);align-self:stretch;display:flex;flex-direction:column;justify-content:center}
.drawing-mat{background:white;border:1px solid var(--book-rule);overflow:hidden}.drawing-mat img{width:100%;height:clamp(200px,22vw,300px);object-fit:contain}
.character-gallery figcaption{padding:10px 0 0}.character-gallery h2{font-size:1.03rem;font-family:inherit;letter-spacing:0;margin:0 0 6px}
.character-gallery #presets{display:flex;gap:7px;flex-wrap:wrap}.character-gallery #presets button{font-size:.92rem;padding:7px 13px;min-height:36px;border:1px solid var(--ui-field-border);border-radius:20px;background:var(--book-paper);color:var(--studio-ink)}.character-gallery #presets button[aria-pressed=true]{background:var(--book-ink);color:var(--ui-surface);border-color:var(--book-ink)}
.story-shelf{grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(10px,1.4vw,18px)}
.story-option{display:block;padding:0;overflow:hidden;background:var(--ui-surface);border:1px solid var(--studio-line);border-radius:12px}
.story-option>div{padding:10px 12px 12px}.story-option label{font-weight:700;display:block;line-height:1.18;font-size:1.04rem}.story-option img{width:100%;height:clamp(140px,13.3vw,190px);object-fit:cover;cursor:pointer;border-bottom:1px solid var(--studio-line)}
.story-option p{line-height:1.38;font-size:.9rem}.story-option a{display:inline-block;padding:4px 0}.story-option:has(:checked){outline:2px solid var(--book-ink);outline-offset:0;background:var(--book-sand);box-shadow:none}.story-option:has(:disabled){opacity:.66}
.confirm-layout{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.1fr);align-items:start;gap:clamp(22px,4vw,52px)}
.confirm-sheet{grid-template-columns:95px 1fr;background:color-mix(in srgb, var(--book-sage) 30%, var(--book-paper));gap:15px;padding:15px;max-width:none;border-radius:12px;border-color:var(--studio-line)}.confirm-sheet img{border-radius:4px}
#detail-level{min-width:0;padding:0;border:0;margin:0}#detail-level legend{font:400 clamp(23px,2.4vw,32px)/1.16 var(--title);letter-spacing:-.035em}
#detail-level>p{font-size:.95rem;color:var(--muted);margin:6px 0 12px}
.detail-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.detail-options label{cursor:pointer;position:relative;margin:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--studio-line);border-radius:10px;background:var(--ui-surface)}
.detail-options label:has(:checked){outline:2px solid var(--book-ink);background:var(--book-sand)}.detail-options label:focus-within{outline:3px solid var(--ui-focus)}
.detail-options input{position:absolute;top:7px;left:7px;width:18px;height:18px;accent-color:var(--book-ink)}
.detail-options img{width:100%;height:auto;aspect-ratio:600/424;object-fit:contain;padding:30px 8px 8px;background:#fff;box-sizing:border-box;border-bottom:1px solid var(--studio-line)}
.detail-options strong,.detail-options span{display:block;margin:5px 7px 0}.detail-options span{font-size:.82rem;font-weight:400;margin:1px 7px 7px}
#confirm-source{margin-top:20px}#confirm-demo:not([hidden]){background:var(--book-orange);color:var(--ui-on-accent);font-weight:700}
@media(max-width:780px){.studio-body .desk{width:calc(100% - 32px);padding-top:8px}
.character-desk,.confirm-layout{grid-template-columns:1fr;gap:17px}.character-desk{padding:19px 0}.character-editor .stage-title{padding-bottom:15px}.character-editor .stage-title h1{max-width:100%}.character-editor .stage-actions{margin:10px 0 0}
.character-gallery{padding:11px}.drawing-mat img{height:clamp(150px,37vw,215px)}.character-gallery figcaption>div{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:5px}.character-gallery h2{font-size:.92rem;margin:0}.character-gallery #presets{gap:4px}.character-gallery #presets button{padding:4px 9px;font-size:.83rem;min-height:36px}
.story-shelf{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.story-option img{height:clamp(90px,25vw,165px)}.story-option>div{padding:8px}.story-option label{font-size:.97rem}.story-option p{font-size:.85rem}.story-option input{width:15px;height:15px}.confirm-sheet{grid-template-columns:75px 1fr}.confirm-sheet h2{font-size:1.32rem}#confirm-idea{font-size:1.17rem}.confirm-sheet h3{margin-top:4px}.detail-options img{height:auto;padding:30px 4px 4px}.detail-options span{white-space:nowrap;font-size:.78rem}.studio-body .stage-title{padding:18px 0}.studio-body .confirm-sheet .plain{padding-block:4px}}
@media(max-width:780px){
  .studio-body .desk :is(button,a,summary){min-height:44px}
  .studio-body .desk :is(a,summary){display:inline-flex;align-items:center}
  .studio-body .desk .choose-mode label,.studio-body .desk .story-option label{min-height:44px;align-content:center}
  .studio-body .desk .page-jumps button{min-width:44px}
  .studio-body .desk #presets button{min-width:44px;min-height:44px}
  .studio-body .navline a{min-height:44px;display:inline-flex;align-items:center}
}
@media(max-width:380px){
  .studio-body .navline{gap:7px}.studio-body .navline nav{gap:8px;font-size:.88rem}
  .studio-body .navline .mini-cta{padding-inline:10px}.studio-body .navline .brand{font-size:22px}
}

.studio-body .cta,#confirm-demo:not([hidden]){border-color:var(--book-orange);color:var(--ui-on-accent);font-weight:800}
.studio-body .stage-title h1,.studio-body .confirm-sheet h2,.studio-body #detail-level legend{font-family:Fraunces,Georgia,serif;font-weight:600;letter-spacing:-.035em}
.studio-body .character-gallery{background:color-mix(in srgb, var(--book-sage) 30%, var(--book-paper)) url('/creator-art/sky-background.webp') center 55%/cover;border:1px solid var(--book-sage);border-radius:18px;padding:clamp(14px,2.6vw,36px)}
.studio-body .drawing-mat{width:93%;margin:auto;border:0;border-radius:5px;box-shadow:0 5px 16px color-mix(in srgb, var(--book-ink) 15%, transparent);transform:rotate(-1.3deg)}
.studio-body .character-gallery figcaption{background:var(--book-paper);padding:11px 14px;margin:15px auto 0;width:96%;border-radius:12px}
.studio-body .character-gallery h2{font-family:Fraunces,Georgia,serif;font-size:1.16rem;color:var(--book-ink)}
.studio-body .art-card{padding:12px;border-radius:15px;border-color:var(--book-rule);background:var(--ui-surface)}
.studio-body .art-card[aria-pressed=true]{border-color:var(--book-ink);background:var(--ui-surface)}
.studio-body .redraw-card{background:var(--book-sand);border-color:var(--ui-field-border)}
/* Each drawing in the side-by-side choice sits on its own sheet, trimmed to the drawing. */
.studio-body .art-card-paper{display:block;margin:12px 12px 0;--ui-paper-background:#fffdfa}
.studio-body .art-card-paper img{display:block;width:100%;height:auto}
/* The pressed card ticks its label only, not the sheet; the unpressed card below. */
.studio-body .art-card[aria-pressed=true] .art-card-paper::after{content:none}
.studio-body .checkout-fields,.studio-body dialog{background:var(--ui-surface);border:1px solid var(--book-rule);border-radius:16px;padding:clamp(16px,2.5vw,28px)}
@media(max-width:780px){.studio-body .character-gallery{padding:13px 14px}.studio-body .character-gallery figcaption{margin-top:9px;padding:6px 8px}.studio-body .character-gallery h2{font-size:1rem}.studio-body .character-gallery .drawing-mat img{height:clamp(135px,35vw,210px)}}


.story-option label .story-name {
  position: relative;
  display: inline-block;
  max-width: calc(100% - 26px);
  vertical-align: middle;
}

#drawing-wait { text-align: center; padding-block: 2rem; }
#drawing-wait #wait-title { margin: 0 0 calc(.15em + 18px); font-size: clamp(1.5rem, 4vw, 2rem); text-wrap: balance; }
/* The wait sits on the sheet the drawing will land on, so the drawing arrives where the eye already is. */
#drawing-wait .wait-sheet { --ui-paper-background: white; display: grid; place-content: center; width: min(340px, 100%); aspect-ratio: 1; margin: 0 auto 20px; box-sizing: border-box; }
#drawing-wait .wait-sheet moonshot-drawing-loader figure { margin: 0; }
#wait-return { max-width: 38ch; margin: 0 auto .6rem; text-wrap: pretty; }
/* A link inside a sentence stays on the line, like the words around it. */
#wait-return a, #receipt-instructions a, #first-page-note a, #free-limit a { display: inline; min-height: 0; white-space: nowrap; }
moonshot-drawing-loader:not([hidden]) { display: block; }
moonshot-drawing-loader figure { margin: 1rem auto 1.5rem; text-align: center; }
moonshot-drawing-loader moonshot-paper-planet { --paper-planet-size: clamp(92px, 20vw, 124px); margin-inline: auto; }
moonshot-drawing-loader figcaption { margin-top: .9rem; font: italic 600 1.12rem/1.4 var(--title); color: var(--book-ink); }

}

/* While a drawing is underway, the active stage shows only the loader. This sits
   outside the layer so it outranks unlayered stage styles such as the poster wall. */
[data-stage]:has(> #drawing-wait:not([hidden])) > :not(#drawing-wait) { display: none; }

.studio-body .art-choices.single-drawing { grid-template-columns: minmax(0, 1fr); }
/* An unpressed drawing choice is a sand table, so its white sheet shows against it. */
.studio-body .art-card[aria-pressed=false] { background: var(--book-sand); }
/* The sheet is trimmed to the drawing: the img sets the size (by width, capped by the window's
   height), and the paper wraps it with its own even margin. No fixed box, so no blank bands. */
#single-portrait {
  --ui-surface: #fffdfa;
  --art-max: clamp(260px, calc(100svh - 360px), 560px);
  position: relative;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  justify-self: center;
  margin: 0;
}
#single-portrait img { display: block; width: auto; height: auto; max-width: 100%; max-height: var(--art-max); }
/* While the sketch loads, hold a square of the same size so nothing jumps when it arrives. */
#single-portrait[data-waiting] { width: min(100%, var(--art-max)); }
#single-portrait[data-waiting] img { visibility: hidden; aspect-ratio: 1; width: 100%; }
#portrait-status:not([hidden]) { position: absolute; inset: 0; display: grid; place-content: center; margin: 0; padding: 1rem; text-align: center; }
/* Their words: what the family typed, quoted the same way wherever it shows (the confirm before drawing,
   the drawing wait and the character review), in Fraunces italic, between curly quotes. The script
   sets the words with theirWords() (trimmed, a capital first); the quotes come from here. */
.their-words { margin: 0; overflow-wrap: anywhere; text-wrap: balance; font: italic 400 clamp(1.12rem, 1.5vw, 1.3rem)/1.4 var(--title); letter-spacing: 0; color: var(--book-ink); }
.their-words::before { content: "\201C"; }
.their-words::after { content: "\201D"; }
.their-words[hidden] { display: none; }
/* On the drawing wait, their words sit under the heading as on the sign-up step, so they see what is being
   drawn (Adam, December 2, 2026: "when its drasing the craracter, shouldnt it display what the user wrote?"). */
#wait-words { max-width: 34ch; margin: -4px auto 24px; }
#art-idea { position: relative; max-width: 30ch; }
/* On the review the opening quote hangs in the margin, so the words line up with the heading above them. */
#art-idea::before { position: absolute; right: 100%; }

/* Drawing the book: eight sheets in book order, filled as each page is saved. */
.drawing-pages { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 22px); max-width: 760px; }
.drawing-pages[hidden] { display: none; }
.drawing-pages > li { --ui-paper-background: white; position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; container-type: inline-size; }
.drawing-pages > li:not(:has(img, moonshot-drawing-loader)) { opacity: .55; }
.drawing-pages img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
.drawing-pages img[data-fit-art]:not([data-fitted]) { visibility: hidden; }
.drawing-pages moonshot-drawing-loader { width: 100%; }
.drawing-pages moonshot-drawing-loader figure { margin: 0; }
.drawing-pages moonshot-paper-planet { --paper-planet-size: clamp(40px, 40cqi, 84px); }
.drawing-pages moonshot-drawing-loader figcaption { margin-top: .3rem; padding: 0 6px; font-size: clamp(.78rem, 12cqi, 1rem); line-height: 1.25; }
/* On a phone the whole book still fits on the first screen; the sheets are too small for the caption. */
@media (max-width: 650px) { .drawing-pages { gap: 10px 8px; } }
@container (max-width: 130px) { .drawing-pages moonshot-drawing-loader figcaption { display: none; } }
@media (max-width: 480px) {
  .studio-body .bar .studio-sample { display: none; }

}

.studio-body .idea-entry { max-width: 640px; margin: 0 auto; padding-block: clamp(18px,5vh,58px) 32px; }
.studio-body .idea-entry h1 { max-width: none; }
.idea-entry #idea-form { max-width: none; }
.idea-entry #idea { width: 100%; }
#idea-count { text-align: right; font-variant-numeric: tabular-nums; }
#idea-count[data-error] { color: var(--ui-error); font-weight: 700; }
.preset-tools { margin-block: 14px; }
.preset-tools h2 { font: 600 1.15rem var(--title); margin-block: 0 8px; }
#sample-description { margin: 0 0 8px; overflow-wrap: anywhere; }

/* Pages: the first coloring page leads, trimmed to its drawing and as large as the window allows.
   Its title and star sit under it like a plate in a picture book. Beside it (under it on phones):
   what this is, the price and the one next step. The Ready pages use the same arrangement. */
.reader-art{min-width:0;margin:0}
.reader .pagination{justify-content:space-between;margin:0 0 .5rem}
.reader .pagination button{min-width:48px;min-height:48px}
.reader .page-jumps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.45rem;margin:0 0 18px}
.reader .page-jumps[hidden]{display:none}
.reader .page-jumps button{padding:.25rem;display:grid;justify-items:center;gap:.15rem;font:inherit;cursor:pointer}
.reader .page-jumps img{width:100%;height:auto;aspect-ratio:8.5/11;object-fit:contain;background:white}
/* The story page is mounted on the shared paper sheet, white like the printed page. */
.studio-body .reader-sheet { --ui-paper-background: white; background: none; border: 0; border-radius: 0; touch-action: pan-y pinch-zoom; }
/* Show the whole drawing at its real shape: the sheet hugs the trimmed art, never stretched. */
.studio-body .reader-sheet { width: fit-content; max-width: 100%; }
.studio-body .reader-sheet img { display: block; width: auto; max-width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }

/* Heading and subline, measured from the ink (DESIGN, Spacing between text): about 19px of air under the
   descenders on desktop and 16px on phones. The studio heading's line-height is 1.06, not the .9 the
   DESIGN formula assumes, so less of the .15em hangs below the box and the fixed part is smaller. */
.studio-body #pages-title { margin: 0 0 calc(.15em + 8px); }
.studio-body #pages-description { margin-top: 0; max-width: 24ch; text-wrap: balance; }

/* The plate under the page: the adventure's name and who stars in it, then printing as a quiet link.
   The caption never widens the figure past its sheet. */
.reader-caption { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 4px 24px; width: 0; min-width: 100%; margin-top: 16px; }
.reader-credits { min-width: 0; flex: 1 1 14rem; }
.studio-body .reader-caption h2 { margin: 0; font: 600 clamp(1.45rem, 2.1vw, 1.9rem)/1.1 Fraunces, Georgia, serif; letter-spacing: -.02em; text-wrap: balance; }
.reader-credit { margin: 6px 0 0; font: 700 .95rem/1.3 var(--ui-font); color: color-mix(in srgb, var(--book-ink) 72%, var(--book-muted)); }
.reader-credit strong { font-weight: 800; color: var(--book-ink); }
.reader-credit[hidden] { display: none; }
.reader-print { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0; }

/* What they decide on, and the one next step. Plain type on the sky: the drawing is the showpiece. */
.reader-side { min-width: 0; }
.reader-summary { margin: 0; }
.studio-body #finish-pages { min-width: 13rem; }
.reader-links { margin: 6px 0 0; }

@media (min-width: 860px) {
  .studio-body [data-stage="pages"]:not([hidden]) {
    display: grid; grid-template-columns: auto minmax(280px, 22rem); grid-template-rows: auto 1fr; justify-content: center;
    column-gap: clamp(40px, 5vw, 72px); align-items: start; padding-top: 22px;
  }
  /* Beside the page the heading has a narrower column, so it steps down a size to keep two lines. */
  .studio-body [data-stage="pages"] #pages-title { font-size: clamp(38px, 3.7vw, 50px); }
  .studio-body [data-stage="pages"] > .stage-title { grid-column: 2; grid-row: 1; padding: 0; }
  .studio-body [data-stage="pages"] .reader { display: contents; }
  .studio-body [data-stage="pages"] .reader-art { grid-column: 1; grid-row: 1 / span 2; width: fit-content; max-width: 100%; }
  .studio-body [data-stage="pages"] .reader-side { grid-column: 2; grid-row: 2; padding: 30px 0 0; }
  /* Cap the sheet to the window left under the planets, so the page, its title and the step beside it all fit. */
  .studio-body .reader-sheet img { max-height: max(320px, calc(100svh - 390px)); }
}
@media (min-width: 651px) and (max-width: 859px) {
  .studio-body .reader { grid-template-columns: minmax(0, 1fr) minmax(240px, 18rem); }
  .studio-body .reader-sheet img { max-height: max(300px, calc(100svh - 420px)); }
}
@media (max-width: 650px) {
  .studio-body #pages-title { margin-bottom: calc(.15em + 9px); }
  .studio-body .reader { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .studio-body .reader-side { display: contents; }
  .studio-body .reader-sheet { max-width: none; }
  .reader-caption { display: block; margin-top: 14px; }
  .reader-print { margin-top: 2px; }
  .reader-links { order: 1; margin-top: 0; }
  .reader-summary { order: 2; }
  /* After purchase nothing is pinned: the page numbers come before the way back to the order. */
  .studio-body [data-stage="pages"]:not([data-preview]) .reader-links { order: 3; margin-top: 4px; }
  .reader:has(.pagination:not([hidden])) .reader-sheet img{height:auto;max-height:58svh;object-fit:contain}
  .reader-art .pagination{position:sticky;top:0;z-index:2;background:var(--book-paper)}
}

.studio-body {
  position: relative;
  isolation: isolate;
}
.studio-body .bar { background: transparent; border: 0; }
/* One top padding on every step, so the step guide under the header never moves between pages. */
.studio-body .desk { padding-top: clamp(8px, 1.6svh, 18px); }
.character-step { width: min(31rem, 100%); margin-inline: auto; }
#idea-stage .idea-entry, .character-step [data-stage="art"] { padding: clamp(26px, 4.8svh, 48px) 0 32px; }
/* The smaller step guide lets the question sit a little higher (Adam, November 30, 2026: "make the iamges a bit smaller. so that hte content can be pushed up a little"). */
#idea-stage .idea-entry { padding-top: clamp(18px, 3svh, 32px); }
#idea-stage h1 { max-width: none; font-size: clamp(1.65rem, 8vw, 3rem); }
.studio-body .filter-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.draw-mark { width: 30px; height: 23px; vertical-align: middle; }

.studio-body:has(#account[data-drawing-step][open]) #idea-stage { display: none; }
#account[data-drawing-step][open] {
  position: static; width: min(31rem, 100%); max-height: none; overflow: visible;
  margin: clamp(24px, 4svh, 44px) auto 0; padding: 0; border: 0;
  background: transparent; box-shadow: none;
}
#account[data-drawing-step] #account-title { font: 600 clamp(2rem, 5vw, 3rem)/1.05 var(--title); }
#account[data-drawing-step] .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 1rem; }
#account[data-drawing-step] .dialog-actions .cta { margin: 0; }
#account[data-drawing-step] .dialog-actions > .ui-button { min-width: 0; white-space: normal; }
.idea-back img { vertical-align: middle; transform: scaleX(-1); }

.pencil-note:not([hidden]) {
  display: flex; align-items: flex-start; gap: .8rem; margin: .8rem 0 .25rem;
  padding: .7rem .9rem; color: var(--book-ink);
  /* The pencil mark says "tip"; a soft tint sets it apart. No side bar. */
  background: color-mix(in srgb, var(--book-sage) 22%, var(--book-paper));
  border-radius: 3% 1% 2% 1% / 7% 13% 4% 8%;
}
.pencil-note svg { width: 2rem; height: 1.5rem; flex: none; }

.reader-illustration { position: relative; display: grid; }
.reader-illustration > * { grid-area: 1 / 1; }
@media (prefers-reduced-motion: no-preference) {
  #single-portrait[data-unfold]:not([hidden]) img { animation: portrait-unfold .75s ease-out both; }
  @keyframes portrait-unfold { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
}

#account[data-drawing-step] .dialog-head { flex-direction: column; align-items: center; gap: .25rem; text-align: center; }
.studio-body .studio-control-sheet, #account .account-paper {
  --ui-paper-background: #fffaf1;
  padding: clamp(.75rem, 4vw, 1.75rem);
}
.studio-control-sheet .ui-field, .account-paper .ui-field { --ui-surface: white; }
.account-modes { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 .65rem; border: 0; }
#account[data-drawing-step] .account-modes { justify-content: center; }
#signup-planet {
  --paper-planet-size: clamp(72px, 10vw, 90px);
  margin: clamp(.875rem, 2vw, 1.125rem) auto clamp(1.5rem, 3vw, 2rem);
}
/* Sign in before drawing: the form and its button belong on the first screen at every size, so the
   planets shrink, the moon waits for the drawing itself, and the two account choices share one row. */
#account[data-drawing-step] #signup-planet { display: none; }
#account[data-drawing-step] .account-paper { margin-top: 18px; }
#account[data-drawing-step] .account-modes { flex-wrap: nowrap; gap: .4rem; }
#account[data-drawing-step] .account-modes .ui-choice { white-space: nowrap; }


.studio-body .studio-action-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
}
.studio-action-row > .ui-button { min-width: 0; white-space: normal; }
.studio-action-row > .ui-primary { margin-inline-start: auto; }

/* Choose an adventure: a wall of posters. The art shows the world, never the hero.
   Title and credit are live type so the credit can name the family's character. */
.studio-body [data-stage="stories"] .stage-title { padding-bottom: clamp(18px, 2.4vw, 26px); }
.studio-body [data-stage="stories"] .stage-title h1 { text-wrap: balance; margin: 0 0 calc(.15em + 20px); }
.studio-body [data-stage="stories"] .stage-title p { margin: 0; max-width: 38ch; text-wrap: balance; font-size: 1.06rem; }
.poster-wall { border: 0; margin: 0 0 clamp(22px, 3vw, 34px); padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(22px, 2.6vw, 32px) clamp(16px, 2vw, 26px); }
.poster-wall[hidden] { display: none; }
.adventure-poster { position: relative; flex: 0 1 calc((100% - 2 * clamp(16px, 2vw, 26px)) / 3); min-width: 0; cursor: pointer; color: var(--book-ink); }
/* The radio is pinned to the poster's top left corner on a paper disc, at every size,
   so it never pushes the title down. */
.adventure-poster > wired-radio { position: absolute; top: -9px; left: -9px; z-index: 2; padding: 0; border-radius: 50%; background: var(--book-paper); box-shadow: 0 0 0 5px var(--book-paper), 0 2px 6px 4px rgba(43,50,64,.22); }
.poster { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 6px; background: var(--book-sand);
  box-shadow: 0 1px 0 rgba(43,50,64,.15), 0 10px 24px -14px rgba(43,50,64,.55); outline: 1px solid rgba(43,50,64,.18); outline-offset: -1px; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster-title { position: absolute; inset: 0 0 auto; padding: 8% 9% 0; text-align: center; font: 700 clamp(1.05rem, 1.9vw, 1.6rem)/1.02 var(--title); color: var(--book-ink);
  letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 0 10px rgba(251,247,240,.95), 0 0 2px rgba(251,247,240,.9); }
.poster-title small { display: block; margin-bottom: .45em; font: 700 max(12px, .62em)/1.2 Nunito, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.poster-title .story-name { display: block; }
.poster-credit { position: absolute; inset: auto 0 0; padding: 22% 8% 6%; text-align: center; color: var(--book-paper);
  background: linear-gradient(to top, rgba(43,50,64,.9), rgba(43,50,64,.6) 55%, transparent);
  font: 700 .75rem/1.35 Nunito, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.poster-credit strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin-top: 3px;
  font: 700 clamp(.86rem, 1.2vw, 1rem)/1.2 var(--title); letter-spacing: 0; text-transform: none; }
.poster-summary { display: block; margin: 10px 2px 0; font-size: .92rem; line-height: 1.38; }
/* No hover lift: the poster answers a pick, not a pointer passing over it. */
.adventure-poster:hover .poster { outline-color: rgba(43,50,64,.5); }
.adventure-poster:has(:checked) .poster { outline: 3px solid var(--book-ink); outline-offset: 3px; box-shadow: 0 16px 30px -14px rgba(43,50,64,.7); }
.adventure-poster:has(:focus-visible) .poster { outline: 3px solid var(--ui-focus); outline-offset: 3px; }
.adventure-poster:has(:disabled) { cursor: default; opacity: .5; }

/* The adventure step's bottom bar (ui-bottom-bar in components.css): their character, what is
   picked, and the way on. Phones pin it with the shared bar; wider screens float it as a card
   at the bottom of the window while the posters scroll. */
.studio-body .shelf-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px 18px; --ui-paper-background: var(--book-paper); }
@media (min-width: 761px) {
  .studio-body .shelf-actions { position: sticky; bottom: 12px; z-index: 3; margin: 18px 0 0; padding: 12px 16px 14px; }
}
.studio-body .shelf-actions[hidden] { display: none; }
.shelf-cast { --ui-paper-background: white; flex: none; padding: 5px 5px 7px; }
.shelf-cast[hidden] { display: none; }
.shelf-cast img { display: block; width: 76px; height: 76px; object-fit: contain; }
.shelf-choice { flex: 1 1 auto; min-width: 0; }
.studio-body .shelf-actions .shelf-selection { width: auto; margin: 0; font: 600 1.28rem/1.15 var(--title); letter-spacing: -.02em; }
.shelf-actions .shelf-selection[data-hint] { font: 600 1rem/1.3 var(--ui-font, Nunito, sans-serif); letter-spacing: 0; color: var(--book-muted); }
.shelf-actions .shelf-selection[data-error] { color: var(--ui-error); }
.shelf-detail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .7em; margin: 2px 0 0; color: var(--book-muted); font-size: .95rem; }
.shelf-detail[hidden] { display: none; }
.shelf-detail .ui-link { min-height: 32px; font-size: .95rem; color: var(--book-ink); }
.studio-body .shelf-actions .studio-action-row { flex: none; width: auto; margin: 0 0 0 auto; gap: 22px; }
.studio-action-row > .ui-link { white-space: nowrap; }
.shelf-detail .ui-link { position: relative; }
.shelf-detail .ui-link::after { content: ""; position: absolute; inset: -8px -10px; }
.studio-body .shelf-actions .studio-action-row > .ui-primary, .studio-body .shelf-actions .studio-action-row > wired-button.ui-primary { white-space: nowrap; }

/* Saved adventure: the one poster, what it means for the pages, and the way on. */
.saved-adventure { display: grid; grid-template-columns: min(300px, calc((100svh - 400px) * 2 / 3), 42%) minmax(0, 34rem); grid-template-rows: auto 1fr; grid-template-areas: "poster facts" "poster actions"; column-gap: clamp(20px, 3.4vw, 44px); align-items: start; margin: 4px 0 clamp(28px, 4vw, 48px); }
.saved-adventure[hidden] { display: none; }
.saved-poster .poster { box-shadow: 0 1px 0 rgba(43,50,64,.15), 0 18px 34px -16px rgba(43,50,64,.65); }
.saved-poster { grid-area: poster; }
.saved-facts { grid-area: facts; padding-top: clamp(4px, 1.4vw, 18px); }
.saved-summary { margin: 0; max-width: 30ch; font: 500 clamp(1.15rem, 1.7vw, 1.42rem)/1.32 var(--title); text-wrap: pretty; }
.saved-detail { display: flex; align-items: center; gap: 14px; margin: clamp(18px, 2.4vw, 26px) 0 0; }
.saved-detail .ui-paper { --ui-paper-background: white; flex: none; padding: 4px 4px 6px; }
.saved-detail img { display: block; width: clamp(92px, 11vw, 120px); height: auto; }
.saved-detail p { margin: 0; }
.saved-detail strong, .saved-detail span { display: block; }
.saved-detail span { color: var(--book-muted); font-size: .92rem; }
.saved-actions { grid-area: actions; margin-top: clamp(26px, 3.4vw, 36px); }
.studio-body .saved-actions .studio-action-row { justify-content: flex-start; flex-wrap: wrap; gap: 10px 26px; }
.studio-body .saved-actions .studio-action-row > .ui-primary, .studio-body .saved-actions .studio-action-row > wired-button.ui-primary { order: -1; margin-inline-start: 0; }

@media (min-width: 761px) {
  .studio-body [data-stage="stories"][data-saved] { display: grid; grid-template-columns: min(340px, calc((100svh - 290px) * 2 / 3)) minmax(0, 36rem);
    grid-template-rows: auto auto auto 1fr; grid-template-areas: "poster title" "poster note" "poster facts" "poster actions"; column-gap: clamp(28px, 4vw, 56px); padding-top: 12px; }
  [data-stage="stories"][data-saved] > .stage-title { grid-area: title; padding-top: clamp(8px, 2vw, 28px); }
  [data-stage="stories"][data-saved] > #shelf-mode { grid-area: note; }
  [data-stage="stories"][data-saved] > .saved-adventure { display: contents; }
  [data-stage="stories"][data-saved] .saved-facts { padding-top: 6px; }
  [data-stage="stories"][data-saved] .saved-actions { margin-top: clamp(24px, 3vw, 34px); }
}
@media (max-width: 760px) {
  .adventure-poster { flex-basis: calc((100% - 14px) / 2); }
  .poster-wall { gap: 22px 14px; }
  .poster-summary { font-size: .88rem; }
  .poster-title { font-size: 1.02rem; padding-top: 11%; }
  .studio-body [data-stage="stories"] .stage-title h1 { margin-bottom: calc(.15em + 16px); }
  .studio-body .shelf-actions { flex-wrap: wrap; gap: 2px 12px; }
  .shelf-cast { padding: 3px 3px 5px; }
  .shelf-cast img { width: 46px; height: 46px; }
  .shelf-choice { flex-basis: calc(100% - 70px); }
  .studio-body .shelf-actions .shelf-selection { font-size: 1.1rem; }
  .shelf-actions .shelf-selection[data-hint] { font-size: .95rem; }
  .shelf-detail, .shelf-detail .ui-link { font-size: .88rem; }
  .shelf-detail .ui-link { min-height: 28px; }
  .studio-body .shelf-actions .studio-action-row { flex-basis: 100%; width: 100%; justify-content: space-between; gap: 14px; }
  .saved-adventure { grid-template-columns: minmax(0, 44%) minmax(0, 1fr); grid-template-rows: auto auto; grid-template-areas: "poster facts" "actions actions"; column-gap: 16px; }
  .saved-facts { padding-top: 0; }
  .saved-summary { font-size: 1.04rem; }
  .saved-detail { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 14px; }
  .saved-detail img { width: 96px; }
  .saved-detail strong { font-size: .95rem; }
  .saved-detail span { font-size: .86rem; }
  .saved-actions { margin-top: 22px; }
}
/* Wide screens fit every adventure on one row, so the pinned bar never covers a poster's summary.
   Phones keep the radio disc inside the poster's corner, clear of the screen edge. */
@media (min-width: 1100px) {
  .adventure-poster { flex-basis: calc((100% - 4 * clamp(16px, 2vw, 26px)) / 5); }
  .poster-title { font-size: clamp(1.05rem, 1.5vw, 1.4rem); }
  .studio-body [data-stage="stories"]:not([data-saved]) .stage-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
  .studio-body [data-stage="stories"]:not([data-saved]) .stage-title h1 { margin-bottom: 0; }
  .studio-body [data-stage="stories"]:not([data-saved]) .stage-title p { padding-bottom: .4em; }
  [data-stage="stories"]:not([data-saved]) .poster { aspect-ratio: 3 / 4; }
  .studio-body .shelf-actions { padding: 8px 16px 10px; }
  .shelf-cast img { width: 56px; height: 56px; }
}
@media (max-width: 480px) {
  .adventure-poster > wired-radio { top: 6px; left: 6px; }
}

/* Character review, the payoff of the wait. The drawing is the one bold thing; around it the page
   reads like the Ready pages' title page: heading, the family's idea, one button, one plain link.
   Phone: heading, drawing, idea, then the button across the full width with the link under it.
   Desktop: the drawing on the left as large as the window allows, the rest beside it, so the
   button sits on the first screen. */
.character-step:has(> [data-stage="art"]:not([hidden])) { width: min(58rem, 100%); }
.character-step [data-stage="art"]:not([hidden]) { display: grid; padding: clamp(18px, 3svh, 32px) 0 32px; }
.studio-body .art-title { margin: 0 0 calc(.15em + 16px); font: 600 clamp(2rem, 7.4vw, 3.1rem)/.95 var(--title); letter-spacing: -.04em; text-wrap: balance; }
/* Headings take focus only so a screen reader starts at the new step; they aren't controls, so no focus box. */
.studio-body :is(h1, h2)[tabindex="-1"]:focus { outline: none; }
.studio-body .art-controls { display: grid; justify-items: start; margin-top: 22px; }
.art-actions { display: grid; justify-items: start; gap: 6px; margin-top: 26px; }
.art-actions .ui-primary { min-width: 15rem; min-height: 52px; font-size: 1.06rem; }
.art-actions .ui-link { font-weight: 700; }
/* Drawing tools (non-hosted books only) sit on their own sheet, which hides when they all do. */
.studio-body .art-tools { margin-top: 24px; width: 100%; box-sizing: border-box; }
.art-tools:not(:has(> :not([hidden]))) { display: none; }
.art-tools .redraw-card:not([hidden]) { display: block; padding: 0 0 14px; margin: 0 0 14px; border: 0; border-bottom: 1px solid var(--book-rule); border-radius: 0; background: none; }
.art-tools .redraw-card p { margin: 4px 0 10px; }
.art-tools .studio-revision { max-width: none; margin-top: 0; border: 0; padding-top: 0; }
.art-tools > label[for="print-style"] { display: block; margin-top: 4px; }
@media (max-width: 859px) {
  .studio-body .art-controls { margin-top: 18px; }
  .art-actions { width: 100%; justify-items: stretch; margin-top: 22px; }
  .art-actions .ui-primary { width: 100%; }
  .art-actions .ui-link { justify-self: center; }
  /* Leave room for the idea and both actions under the drawing on shorter phones. */
  #single-portrait { --art-max: clamp(240px, calc(100svh - 420px), 560px); }
}
@media (min-width: 860px) {
  #single-portrait { --art-max: clamp(300px, calc(100svh - 330px), 560px); }
  .character-step [data-stage="art"]:not([hidden]):not(:has(> #drawing-wait:not([hidden]))) {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
    grid-template-rows: 1fr auto auto 1fr;
    grid-template-areas: "art ." "art title" "art controls" "art .";
    column-gap: clamp(40px, 5vw, 72px);
    align-items: start;
  }
  .character-step [data-stage="art"] > .art-title { grid-area: title; }
  .character-step [data-stage="art"] > .art-choices { grid-area: art; align-self: start; }
  .character-step [data-stage="art"] > .art-controls { grid-area: controls; margin-top: 0; }
  /* One drawing: size its column to the sheet and centre the pair under the planets. */
  .character-step [data-stage="art"]:not([hidden]):has(> .single-drawing):not(:has(> #drawing-wait:not([hidden]))) { grid-template-columns: auto minmax(17rem, 21rem); justify-content: center; }
}

/* Detail level: the fill and the drawing sit inside the pencil frame, and the radio
   sits beside the level's name, not on the artwork. */
.studio-body .detail-options { gap: clamp(10px, 1.4vw, 16px); }
.studio-body .detail-options label { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "art art" "radio name" "radio ages";
  column-gap: 10px; padding: 6px; background: transparent; background-clip: content-box; border-radius: 0; text-align: left; outline: 0; overflow: visible; }
.studio-body .detail-options label:has(:checked) { background-color: var(--book-sage); color: var(--ui-on-sage); }
.studio-body .detail-options label:has(:focus-visible) { outline: 3px solid var(--ui-focus); outline-offset: 2px; }
.studio-body .detail-options img { grid-area: art; width: 100%; height: auto; padding: 8px; margin: 0 0 8px; border: 0; background: #fff; }
.studio-body .detail-options .wired-field { grid-area: radio; position: static; align-self: center; margin-inline-start: 8px; background: transparent; }
.studio-body .detail-options strong { grid-area: name; margin: 0; padding: 0; font-size: 1.02rem; }
.studio-body .detail-options span { grid-area: ages; margin: 0 0 8px; font-size: .86rem; white-space: normal; }

/* Phones: one detail card per row so each picture is large enough to compare. */
@media (max-width: 600px) {
  .studio-body .detail-options { grid-template-columns: 1fr; gap: 10px; }
  .studio-body .detail-options label { grid-template-columns: minmax(0, 54%) minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr; grid-template-areas: "art ." "art radio" "art name" "art ages" "art ."; column-gap: 12px; }
  .studio-body .detail-options img { margin: 0; padding: 6px; }
  .studio-body .detail-options .wired-field { margin: 0 0 6px; }
  .studio-body .detail-options span { margin: 2px 0 0; }
}

/* Order pages. Drawing keeps a plain status column. Ready to print and Ready to give become the
   book's title page: the first finished page leads, large, on a hand-trimmed sheet with the rest
   of the book stacked under it; the adventure is named and its hero credited as on its poster;
   one button; then the child's choice of page (print) or the giver's note (give). */
.receipt-group { margin-top: 24px; }
.receipt-links { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 6px 0 0; }
.receipt-later { margin: 40px 0 0; }
/* Under a finished book, two quiet links, one to a row on every size: pass it on, then start another.
   Each link's 44px row already carries the air between them. */
.receipt-later > p { margin: 0; }
.share-site-field { display: block; width: 100%; max-width: 24rem; margin-top: 8px; }

/* Title page: status, then the adventure's name, then who stars in it. Gaps are measured from the ink.
   Quiet text on this page is a step darker than --book-muted: it sits on the busiest part of the sky. */
[data-stage="receipt"] { --ready-quiet: color-mix(in srgb, var(--book-ink) 72%, var(--book-muted)); }
.ready-head { padding-top: 8px; }
.ready-kicker { margin: 0 0 12px; font: 800 1.02rem/1.2 var(--ui-font); color: color-mix(in srgb, var(--book-ink) 45%, var(--ui-leaf-text)); }
.studio-body #ready-title { margin: 0; font: 600 clamp(44px, 5.6vw, 76px)/.95 Fraunces, Georgia, serif; letter-spacing: -.04em; text-wrap: balance; }
.ready-credit { margin: calc(.15 * clamp(44px, 5.6vw, 76px) + 18px) 0 0; max-width: 34ch; font: 700 .95rem/1.3 var(--ui-font); color: var(--ready-quiet); }
.ready-credit strong { display: block; margin-top: 2px; font: 600 clamp(1.2rem, 1.6vw, 1.42rem)/1.22 Fraunces, Georgia, serif; letter-spacing: -.01em; color: var(--book-ink); text-wrap: balance; }

/* The hero sheet. Two blank sheets sit under it, each a little askew, so the book reads as a stack. */
.ready-art { margin-top: 28px; }
.ready-cover-link { display: block; padding: 0 12px 12px 4px; border: 0; background: none; cursor: pointer; }
.ready-cover-link:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 6px; }
/* The sheets under it come from the shared .ui-paper-stack. */
.ready-stack { display: inline-block; vertical-align: top; }
.ready-stack .ui-paper { --ui-paper-background: white; }
.ready-stack img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100svh - 290px); }
.ready-stack, .ready-stack img { transition: transform .25s ease-out; }
.ready-cover-link:hover .ready-stack { transform: translateY(-3px) rotate(-.4deg); }

.ready-actions .ui-button { min-width: 12.5rem; }
.ready-hint { margin: 10px 0 0; max-width: 34ch; color: var(--ready-quiet); font-size: .95rem; line-height: 1.4; text-wrap: balance; }

/* Hold each page back until it is trimmed to its drawing, so the uncropped sheet never flashes. */
img[data-fit-art]:not([data-fitted]) { opacity: 0; }
img[data-fit-art] { transition: opacity .2s ease-out; }
.ready-stack:has(img[data-fit-art]:not([data-fitted])) { visibility: hidden; }

/* Ready to give: the gift first (copy, then the note as the recipient will see it); a copy for
   yourself is one quiet link under it. */
.gift-card { margin: 28px 0 0; max-width: 22rem; }
.gift-note { padding: 18px 22px 20px; --ui-paper-background: var(--book-paper); rotate: -1.2deg; }
.gift-to { margin: 0; font: 600 1.3rem/1.2 Fraunces, Georgia, serif; letter-spacing: -.01em; }
.gift-note blockquote { margin: 10px 0 0; white-space: pre-line; font: 400 1.08rem/1.5 Fraunces, Georgia, serif; }
.gift-from { margin: 12px 0 0; font: 700 .98rem/1.3 var(--ui-font); }
/* The note's sheet already carries air below it. */
#sharing:not([hidden]) ~ .receipt-later { margin-top: 28px; }
.gift-link-field { display: grid; gap: 6px; max-width: 24rem; margin: 10px 0 0; }
.gift-link-field .ui-text-frame, .gift-link-field input { width: 100%; }

/* Desktop: the sheet on the left as large as the window allows, the title page beside it. */
@media (min-width: 860px) {
  .studio-body [data-stage="receipt"][data-ready]:not([hidden]):has(#ready-head:not([hidden])) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 25rem); grid-template-rows: 1fr repeat(3, auto) 1fr;
    column-gap: clamp(40px, 6vw, 96px); min-height: calc(100svh - 170px);
  }
  [data-ready] > #ready-art { grid-column: 1; grid-row: 2 / -1; align-self: start; justify-self: end; margin: 0; }
  [data-ready] > :not(#ready-art) { grid-column: 2; }
  [data-ready] > #ready-head { grid-row: 2; }
  [data-ready] > :is(#finished-actions, #sharing) { grid-row: 3; margin-top: 34px; }
  [data-ready] > .receipt-later { grid-row: 4; }
  [data-ready] .ready-stack img { max-height: min(calc(100svh - 210px), 720px); }
}
@media (max-width: 600px) {
  .ready-art { margin-top: 22px; }
  /* Keep the askew sheets under the top one inside the text's gutter. */
  .ready-cover-link { padding: 0 8px 12px 8px; }
  .ready-credit { margin-top: calc(.15 * 44px + 14px); }
}

/* The one orchestrated moment: the first time a finished book is shown, the top sheet lands,
   the stack settles under it and, when giving, the note is tucked in after it. */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] .ready-stack .ui-paper { animation: sheet-land .7s cubic-bezier(.2, .9, .25, 1.15) both; }
  [data-reveal] .ready-stack::before, [data-reveal] .ready-stack::after { animation: stack-fan .6s .18s ease-out both; }
  [data-reveal] .gift-note { animation: note-tuck .6s .55s cubic-bezier(.2, .8, .3, 1.1) both; }
  @keyframes sheet-land { from { opacity: 0; transform: translateY(-26px) rotate(-3.5deg); } 60% { opacity: 1; } to { transform: none; } }
  @keyframes stack-fan { from { opacity: 0; transform: none; } }
  @keyframes note-tuck { from { opacity: 0; transform: translateY(14px) rotate(3deg); } }
}
@media (prefers-reduced-motion: reduce) {
  .ready-stack, .ready-stack img { transition: none; }
  .ready-cover-link:hover .ready-stack { transform: none; }
}

/* The first coloring page is drawn in place. The sheet already sits where the drawing
   will land, holding the paper planet at the drawing's square shape, so nothing moves
   when it arrives; the summary beside it already names what is being drawn. */
#pages-title { text-wrap: balance; }
#first-page-note { text-wrap: balance; }
#first-page-note[data-pending] { visibility: hidden; }
.studio-body .reader-sheet[data-drawing] #reader-image,
.studio-body .reader-sheet[data-drawing] #reader-status { display: none; }
.studio-body .reader-sheet[data-drawing] { width: 100%; }
#first-page-loader:not([hidden]), .first-page-failed:not([hidden]) {
  display: grid; place-content: center; justify-items: center;
  box-sizing: border-box; width: 100%; aspect-ratio: 1; container-type: inline-size;
}
#first-page-loader figure { margin: 0; display: grid; justify-items: center; }
#first-page-loader moonshot-paper-planet { --paper-planet-size: clamp(96px, 44cqi, 170px); }
#first-page-loader figcaption { margin-top: clamp(.5rem, 3cqi, .9rem); }
/* If the drawing stops, the sheet keeps its place and offers the one way on. */
.studio-body .reader-sheet .first-page-failed img { width: clamp(80px, 34cqi, 130px); height: auto; margin-bottom: clamp(.75rem, 5cqi, 1.25rem); }
@media (min-width: 651px) {
  .studio-body .reader-sheet[data-drawing] { width: fit-content; }
  /* As big as the finished page will be, so the wait isn't a small card beside a big heading. */
  #first-page-loader:not([hidden]), .first-page-failed:not([hidden]) { width: auto; aspect-ratio: 4 / 3; height: max(320px, calc(100svh - 364px)); }
}
.reader-print [aria-disabled="true"] { pointer-events: none; opacity: .45; }
@media (prefers-reduced-motion: no-preference) {
  /* The one moment on this page: the drawing comes in on the sheet, top to bottom, once. */
  .reader-sheet[data-landing] #reader-image { animation: portrait-unfold .9s ease-out both; }
}
/* Air under the heading is measured from its descenders (DESIGN spacing rule). */
#pages-title { margin-bottom: calc(.15em + 14px); }
#pages-title ~ p { margin-top: 0; }
@media (max-width: 650px) { #pages-title { margin-bottom: calc(.15em + 15px); } }
/* The page sheet is already sized to the window; nothing sits below Print, so the
   desk's bottom padding would only add a scroll with nothing in it. */
@media (min-width: 651px) {
  .desk:has(> [data-stage="pages"]:not([hidden])) { padding-bottom: 0; }
}

/* Past the first question the heading tightens, so the page's own content
   (the character, the worlds, the coloring page) starts in the top half of the first screen. */
.studio-body:not(:has(#idea-stage:not([hidden]))) .stage-title { padding-block: clamp(12px, 1.8vw, 20px) clamp(14px, 1.8vw, 20px); }
.studio-body:not(:has(#idea-stage:not([hidden]))) .stage-title h1 { font-size: clamp(30px, 4vw, 50px); }
@media (max-width: 650px) {
  .studio-body:not(:has(#idea-stage:not([hidden]))) .stage-title h1 { font-size: clamp(28px, 7.6vw, 32px); }
}


/* Before purchase, Continue is the first page's bottom bar on phones (studio.js adds ui-bottom-bar).
   Prices show only on the checkout bar, so Continue takes the bar's whole width. */
@media (max-width: 760px) {
  .studio-body .reader-summary.ui-bottom-bar { display: flex; align-items: center; gap: 12px; }
  .studio-body .reader-summary.ui-bottom-bar .cta { min-width: 0; flex: 1 1 auto; margin: 0; }
}

/* The two ways back from the first page sit together: what they can change, then where they came from. */
.reader-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }

/* Checkout. Desktop: the choices on the left, the order sheet with its one button on the right,
   both on the first screen. Narrower: the choices, then the quiet extras, then the order sheet,
   which on phones is the step's bottom bar (ui-bottom-bar in components.css). */
.studio-body .checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.studio-body .checkout-fields { min-width: 0; }
.studio-body .checkout-fields .choose-mode { margin-top: 0; }
/* Packs (Abe, issue #32): one choice per line, name and price on top, what it's for under it. */
.studio-body .pack-choice { min-width: 0; margin: 0 0 28px; padding: 0; border: 0; }
.studio-body .pack-options { display: grid; gap: 12px; }
.studio-body .pack-options > .pack-option { margin: 0; }
.studio-body label.ui-choice.pack-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 4px .7em; padding: 14px 16px 15px; font-weight: 400; line-height: 1.3; }
.studio-body .pack-option > .ui-check { grid-row: 1 / span 3; align-self: start; margin: .1em 0 0; }
.studio-body .pack-option .pack-name, .studio-body .pack-option .pack-price { font-size: 1.1rem; font-weight: 700; }
.studio-body .pack-option .pack-name { grid-column: 2; }
.studio-body .pack-option .pack-price { grid-column: 3; font-variant-numeric: lining-nums tabular-nums; }
.studio-body .pack-option :is(.pack-line, .pack-save) { grid-column: 2 / 4; font-size: .95rem; }
.studio-body .pack-option .pack-save { font-weight: 700; color: var(--ui-leaf-text); }
.studio-body .pack-option:has(:checked) .pack-save { color: inherit; }
.studio-body .pack-note { margin: 14px 0 0; }
.studio-body .promo { margin: 6px 0 0; }
.studio-body .promo-entry > label { display: block; margin: 10px 0 8px; font-weight: 700; }
.studio-body .promo-row { display: flex; align-items: center; gap: 12px; }
.studio-body .promo-row > :first-child { flex: 1 1 auto; min-width: 0; }
.studio-body .promo-row .ui-button { flex: 0 0 auto; margin: 0; }
.studio-body .promo-applied { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .5em; margin: 4px 0 0; font-size: 1.05rem; }
.studio-body .promo-applied strong { letter-spacing: .03em; }
.studio-body .promo-error { margin: 10px 0 0; font-weight: 700; text-wrap: balance; }
.studio-body .pack-option .pack-price:has(.price-was) { display: flex; flex-direction: column; align-items: flex-end; }
.studio-body .price-was { font-size: .85em; font-weight: 400; color: var(--book-muted); }
.studio-body .pack-left { margin: 0 0 24px; font-size: 1.05rem; font-weight: 700; text-wrap: balance; }
.studio-body .checkout-bar { --ui-paper-background: var(--book-paper); display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 821px) { .studio-body .checkout-bar { padding: 20px 22px 22px; } }
@media (min-width: 761px) and (max-width: 820px) { .studio-body .checkout-bar { padding: 12px 16px 14px; } }
.studio-body .checkout-summary h2 { margin: 0; font: 600 1.6rem/1.1 var(--title); letter-spacing: -.02em; text-wrap: balance; }
.studio-body .checkout-summary .estimate { margin: 10px 0 0; padding: 0; border: 0; align-items: baseline; font-size: 1rem; }
.studio-body .checkout-summary .estimate strong { font-size: 1.15rem; }
.studio-body .checkout-bar .cta { margin: 0; width: 100%; }
.studio-body .checkout-more { color: var(--book-muted); }
.studio-body .checkout-more p { margin: 0 0 8px; }
.studio-body .checkout-more .ui-link { color: var(--book-ink); }
@media (min-width: 821px) {
  .studio-body .checkout-layout { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); grid-template-areas: "fields bar" "fields more"; grid-template-rows: auto 1fr; column-gap: clamp(24px, 3vw, 40px); align-items: start; max-width: 1040px; }
  .studio-body .checkout-fields { grid-area: fields; }
  .studio-body .checkout-bar { grid-area: bar; }
  .studio-body .checkout-more { grid-area: more; align-self: start; padding: 0 4px; }
}
@media (max-width: 820px) {
  .studio-body .checkout-bar { order: 2; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
  .studio-body .checkout-summary { flex: 1 1 11.5rem; min-width: 0; }
  .studio-body .checkout-summary h2 { font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .studio-body .checkout-summary .estimate { margin-top: 2px; justify-content: flex-start; gap: .6em; font-size: .95rem; white-space: nowrap; }
  .studio-body .checkout-summary .estimate strong { font-size: 1rem; }
  /* On the narrowest phones the button drops under the order line and spans the bar. */
  .studio-body .checkout-bar .cta { width: auto; flex: 1 0 auto; white-space: nowrap; }
  .studio-body .checkout-more { order: 1; }
}


/* The step guide for the whole flow, the one shared component for it: their idea, their character,
   their adventure, joined by a dashed line, each numbered in the landing page's orange pencil circle on
   the top left of its drawing (see .step-number in flight.css). The step they are on is in full colour
   with the highlighter under its label; steps done stay in quieter colour and steps ahead are grey
   (Adam, November 30, 2026). Hidden once the book is bought.
   It is the same size, in the same place, on every step: style it only here, never from a page or stage
   selector (Adam, December 2, 2026: "the step indicators change size from page to page ... This should be
   a shared component and look the same"). step-guide.test.mjs fails if a rule elsewhere targets it. */
.idea-strip {
  --strip-art: clamp(50px, 13vw, 72px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  column-gap: clamp(12px, 4vw, 32px);
  position: relative;
  isolation: isolate;
  width: min(28rem, 100%);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  counter-reset: strip-step;
}
.idea-strip[hidden] { display: none; }
.idea-strip::before { content: ''; position: absolute; inset: calc(var(--strip-art) * .5) 16% auto; border-top: 2px dashed #99a69b; z-index: -1; }
.idea-strip li { min-width: 0; counter-increment: strip-step; }
.idea-strip button { display: grid; justify-items: center; gap: 4px; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--book-ink); font: 600 clamp(13px, 3.6vw, 15px)/1.2 var(--ui-font); text-align: center; white-space: nowrap; cursor: pointer; }
.idea-strip button:disabled { opacity: 1; cursor: default; }
.idea-strip button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
/* Every drawing sits in a box of the same height, so the three numbers line up in a row. */
.idea-strip-art { position: relative; display: flex; align-items: flex-end; height: var(--strip-art); max-width: 100%; }
.idea-strip img { display: block; width: auto; max-width: 100%; height: var(--strip-art); object-fit: contain; filter: grayscale(1) opacity(.7); }
/* The character's square sheet would outweigh the two wider drawings at the same height. */
.idea-strip li:nth-child(2) img { height: calc(var(--strip-art) * .88); }
.idea-strip [aria-current] img { filter: none; }
.idea-strip [data-done] img { filter: saturate(.75) opacity(.85); }
.idea-strip [aria-current] .idea-strip-label { font-weight: 700; background: linear-gradient(176deg, transparent 55%, #bfd1bc 56% 90%, transparent 91%); }
.idea-strip-art::before { content: counter(strip-step); position: absolute; z-index: 1; top: -5px; left: -5px; display: grid; place-items: center; width: clamp(21px, 5.8vw, 26px); height: clamp(21px, 5.8vw, 26px); rotate: -6deg; background: url(/assets/pencil-ring.svg) center / 100% 100% no-repeat, radial-gradient(closest-side, var(--book-orange) 80%, transparent 84%); font: 700 clamp(12px, 3.2vw, 14px)/1 var(--ui-font); font-variant-numeric: lining-nums; color: var(--book-ink); }
.idea-strip button:not([aria-current]):not([data-done]) .idea-strip-art::before { opacity: .6; }

/* "See a page": one already drawn page of the adventure, whole on its paper (STYLE-RULES M1). */
.sample-page-dialog { width: min(34rem, calc(100% - 2rem)); }
.sample-page-dialog .dialog-head h2 { margin: 0; font: 600 clamp(1.5rem, 4vw, 2rem)/1.05 var(--title); letter-spacing: -.02em; }
.sample-page-paper { --ui-paper-background: white; margin-top: 16px; }
.sample-page-paper img { display: block; width: 100%; height: auto; }
#sample-page-caption { margin: 16px 0 0; color: var(--book-muted); text-wrap: balance; }
.saved-facts #see-page { display: inline-block; margin: 10px 0 4px; }
.saved-facts #see-page[hidden] { display: none; }

/* Their own vehicle or held things sit out some pages (issue #14): said once above the shelf. */
.studio-body [data-stage="stories"] > #own-things-note { margin: 0 0 clamp(20px, 2.6vw, 32px); max-width: 38rem; }
.studio-body [data-stage="stories"][data-saved] > #own-things-note { display: none; }

/* Who should we draw: Just type or Help me (character-helper.js). The toggle is two pencil choices, small so
   the question stays the headline. Help me is a storybook line with pencil blanks, the blank being filled
   marked in orange, and ideas to tap under it. */
.helper-toggle { display: flex; gap: 8px; margin: 0 0 20px; }
.helper-toggle .ui-choice { font-size: .95rem; }
.helper-panel { overflow: clip; overflow-clip-margin: 8px; }
.helper-mode[hidden], .plain-mode[hidden] { display: none; }
.helper-sentence {
  margin: 0; font: 500 clamp(1.3rem, 5.2vw, 1.65rem)/2.05 var(--title); letter-spacing: -.015em;
  color: var(--book-ink); text-wrap: pretty;
}
.helper-sentence .helper-blank {
  display: inline-block; width: auto; vertical-align: baseline; box-sizing: content-box;
  min-width: 4ch; max-width: 100%; margin: 0 .1em; padding: 0 .15em .02em;
  border: 0; border-radius: 3px 3px 0 0; outline: 0;
  font: italic 600 1em/1.2 var(--title); letter-spacing: 0; color: var(--book-ink);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1 3.6C11 2.4 20 4.2 31 3.1S50 2.6 59 3.4' fill='none' stroke='%232b3240' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 100% 6px no-repeat;
  caret-color: var(--ui-focus);
  transition: background-color .2s ease-out;
}
.helper-slot { position: relative; display: inline-block; max-width: 100%; vertical-align: baseline; line-height: 1.2; }
/* The example in an empty blank, drawn over it with the input's own box so the words sit where typing goes,
   set as a placeholder (see the empty blank below). */
.helper-hint {
  position: absolute; inset: 0 .1em; display: flex; align-items: center; padding: .1em .25em 0; overflow: hidden; white-space: nowrap; pointer-events: none;
  font: 400 1rem/1 var(--ui-font); letter-spacing: 0; color: var(--book-muted);
}
.helper-blank::placeholder { color: transparent; }
.helper-blank:not(:placeholder-shown) + .helper-hint { visibility: hidden; }
.helper-sentence .helper-blank[data-active] {
  background-color: color-mix(in srgb, var(--book-orange) 14%, transparent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1 3.4C11 2.2 20 4.4 31 3S50 2.4 59 3.3' fill='none' stroke='%23c2671c' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}
/* An empty blank reads as a hint, never an answer (Adam, December 2, 2026: "this makes it seem like rain
   boots will be in the drawing. but thats just the placeholder"). Its line is dashed until something is
   typed or tapped, and its example is set like every other placeholder on the site: small, plain Nunito in
   the muted ink (.ui-field::placeholder), not the big italic Fraunces of a real answer. An empty blank
   sends nothing: describe() leaves it out of the sentence. */
.helper-sentence .helper-blank:placeholder-shown {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1 3.6C11 2.4 20 4.2 31 3.1S50 2.6 59 3.4' fill='none' stroke='%232b3240' stroke-width='1.3' stroke-linecap='round' stroke-dasharray='3.5 3' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}
.helper-sentence .helper-blank[data-active]:placeholder-shown {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1 3.4C11 2.2 20 4.4 31 3S50 2.4 59 3.3' fill='none' stroke='%23c2671c' stroke-width='2.4' stroke-linecap='round' stroke-dasharray='5 4' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}
.helper-blank:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 1px; border-radius: 6px; }
.helper-chip-shelf { margin: 18px 0 0; }
.helper-chip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 6px; }
.helper-chip-heading { margin: 0; font: 700 .95rem/1.3 var(--ui-font); color: var(--book-muted); }
/* The turning arrows, drawn alone with no words (Adam, December 2, 2026: "can we remove the rotate text
   \"more ideas\". just the rotation symbol is fine"): More ideas beside the chip heading, and another
   sentence beside the sentence ("for the sentence shape, maybe add the same rotate symbol so those can be
   changed too"). Each keeps its words as its accessible name. */
.helper-turn {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--book-ink); font-size: 1.2rem; cursor: pointer;
}
.helper-turn:hover { background: color-mix(in srgb, var(--book-ink) 7%, transparent); }
.helper-turn svg { width: 1.2em; height: 1.2em; flex: none; }
.helper-more { margin-right: -.55em; }
.helper-reshape { margin: .1em -.55em 0 0; }
.helper-sentence-row { display: flex; align-items: flex-start; gap: 4px; }
.helper-sentence-row .helper-sentence { flex: 1; min-width: 0; }
/* Room for two rows, so moving between blanks or dealing new ideas never moves Draw it. */
.helper-chips { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; min-height: calc(2 * var(--ui-control-height) + 8px); }
.helper-chips .ui-choice { font-size: .95rem; font-weight: 600; }
@media (max-width: 480px) {
  .helper-toggle .ui-choice { flex: 1; justify-content: center; }
}
/* Ideas deal in one after another, leave together and give under a finger; the refresh arrows turn once
   per new hand. None of it runs for people who ask for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .helper-chips > wired-button { animation: helper-chip-in .34s cubic-bezier(.2, .9, .3, 1.25) both; transition: transform .12s ease-out; }
  .helper-chips > wired-button:nth-of-type(2) { animation-delay: 35ms; }
  .helper-chips > wired-button:nth-of-type(3) { animation-delay: 70ms; }
  .helper-chips > wired-button:nth-of-type(4) { animation-delay: 105ms; }
  .helper-chips > wired-button:nth-of-type(5) { animation-delay: 140ms; }
  .helper-chips[data-leaving] > wired-button { animation: helper-chip-out .14s ease-in both; }
  .helper-chips > wired-button:active { transform: scale(.94) rotate(-1.5deg); }
  .helper-turn[data-spin] svg { animation: helper-spin .45s cubic-bezier(.3, .7, .3, 1); }
  @keyframes helper-chip-in { from { opacity: 0; transform: translateY(10px) scale(.9) rotate(-2deg); } }
  @keyframes helper-chip-out { to { opacity: 0; transform: translateY(-6px) scale(.94); } }
  @keyframes helper-spin { to { transform: rotate(360deg); } }
}
@media (prefers-reduced-motion: reduce) {
  .helper-blank { transition: none; }
}
