:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  --ink: #2f4c49;
  --muted: #71817d;
  --paper: #fffdf8;
  --line: #ddd4b8;
  --green: #58a67a;
  --gold: #e3a64e;
  --coral: #e87866;
  --purple: #8774ae;
  --blue: #5c9fbd;
  --shadow: 0 19px 46px rgba(58, 75, 68, .14);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #f2f7ed; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--ink); background: radial-gradient(circle at 7% 11%, rgba(227, 166, 78, .19) 0 145px, transparent 147px), radial-gradient(circle at 95% 30%, rgba(92, 159, 189, .13) 0 175px, transparent 177px), linear-gradient(145deg, #f1f7ec, #fff8ed 55%, #f1eef9); }
body::before { position: fixed; inset: 0; z-index: -1; opacity: .12; background-image: radial-gradient(#738e86 1.2px, transparent 1.2px); background-size: 29px 29px; content: ""; }
button, input, textarea { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 4px solid rgba(227, 166, 78, .72); outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
.app { width: min(1120px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 20px 0 48px; }
.loading-card { display: grid; min-height: 320px; place-items: center; align-content: center; gap: 12px; margin-top: 60px; background: var(--paper); border: 3px solid var(--line); border-radius: 42px; box-shadow: var(--shadow); }
.loading-card span { font-size: 64px; }
.loading-card p { color: var(--muted); font-weight: 900; }
.topbar, .brand, .top-actions, .section-heading, .editor-head, .panel-heading, .animal-note { display: flex; align-items: center; }
.topbar { min-height: 68px; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.brand { gap: 12px; padding: 0; text-align: left; background: none; border: 0; }
.brand-mark { display: grid; width: 56px; height: 56px; place-items: center; font-size: 29px; background: #fff0c8; border: 3px solid #dac790; border-radius: 19px; box-shadow: 0 7px 16px rgba(65, 84, 76, .12); transform: rotate(-4deg); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 23px; font-weight: 900; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.top-actions { gap: 10px; }
.top-burst { padding: 8px 11px; color: white; font-size: 15px; font-weight: 900; background: var(--coral); clip-path: polygon(50% 0, 62% 17%, 82% 8%, 84% 30%, 100% 39%, 85% 53%, 94% 74%, 72% 75%, 65% 100%, 48% 84%, 28% 97%, 25% 75%, 2% 69%, 17% 50%, 0 35%, 23% 28%, 27% 7%); }
.sound-button, .back-button { min-width: 48px; min-height: 48px; font-weight: 900; background: rgba(255, 253, 248, .95); border: 2px solid var(--line); border-radius: 17px; }
.sound-button { display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 13px; }
.back-button { padding: 0; font-size: 22px; }
.eyebrow { margin: 0 0 8px; color: #3c7d63; font-family: Georgia, serif; font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.primary-button, .secondary-button, .continue-button, .preview-button { min-width: 44px; min-height: 52px; border-radius: 17px; font-weight: 900; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; color: white; background: #409775; border: 0; box-shadow: 0 8px 0 #2e795e; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 4px 0 #2e795e; }
.primary-button.compact { min-height: 46px; box-shadow: none; }
.secondary-button { padding: 0 20px; background: white; border: 2px solid var(--line); }
.continue-button { margin-left: 9px; padding: 0 18px; color: #6d5c83; background: #f2eafa; border: 2px solid #c9b9dd; }
.preview-button { padding: 0 20px; color: white; background: var(--coral); border: 0; box-shadow: 0 7px 0 #bd5e50; }

.hero { display: grid; min-height: 520px; align-items: center; grid-template-columns: 1.04fr .96fr; gap: 40px; padding: clamp(40px, 6vw, 68px); overflow: hidden; background: rgba(255, 253, 248, .97); border: 3px solid var(--line); border-radius: 46px; box-shadow: var(--shadow); }
.hero h1 { max-width: 610px; margin-bottom: 19px; font-size: clamp(47px, 5.6vw, 67px); font-weight: 900; letter-spacing: -.055em; line-height: .98; }
.hero-copy > p:not(.eyebrow) { max-width: 550px; margin-bottom: 27px; color: var(--muted); font-size: 18px; font-weight: 800; line-height: 1.52; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 29px; }
.hero-facts span { color: var(--muted); font-size: 13px; font-weight: 900; }
.hero-facts strong { margin-right: 4px; color: var(--ink); font-size: 24px; }
.hero-art { min-height: 390px; }
.hero-comic { display: grid; height: 380px; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; padding: 11px; background: #f6eecf; border: 4px solid #394e4c; box-shadow: 13px 14px 0 rgba(57, 78, 76, .14); transform: rotate(2deg); }
.preview-panel { position: relative; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; border: 3px solid #394e4c; }
.preview-panel img { width: 145px; height: 145px; object-fit: contain; }
.preview-one { background: linear-gradient(#bfe2f0 58%, #9fc780 59%); }
.preview-two { background: linear-gradient(#716998 58%, #4c665b 59%); }
.preview-three { grid-column: 1 / span 2; background: linear-gradient(135deg, #ffe2a4, #f7a888); }
.preview-three img { width: 160px; height: 160px; }
.preview-bubble { position: absolute; top: 10px; left: 10px; z-index: 2; max-width: 120px; padding: 8px 11px; font-size: 12px; font-weight: 900; background: white; border: 3px solid #394e4c; border-radius: 50%; }
.preview-bubble::after { position: absolute; bottom: -10px; left: 24px; width: 17px; height: 17px; background: white; border-right: 3px solid #394e4c; border-bottom: 3px solid #394e4c; content: ""; transform: rotate(45deg); }
.preview-bubble.thought { right: 8px; left: auto; border-style: dashed; }
.preview-burst { position: absolute; top: 14px; right: 18px; z-index: 2; padding: 18px; color: white; font-size: 24px; font-weight: 900; background: var(--coral); clip-path: polygon(50% 0, 62% 20%, 82% 8%, 84% 31%, 100% 40%, 83% 53%, 94% 75%, 70% 76%, 64% 100%, 48% 84%, 27% 97%, 25% 74%, 2% 68%, 17% 50%, 0 34%, 23% 28%, 28% 6%); }

.how-section, .templates-section { margin-top: 30px; padding: 38px; background: rgba(255, 253, 248, .84); border: 2px solid rgba(221, 212, 184, .86); border-radius: 36px; }
.section-heading { justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.section-heading h2 { margin: 0; font-size: 31px; }
.section-heading > p { max-width: 440px; margin: 0; color: var(--muted); font-size: 14px; font-weight: 800; text-align: right; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.steps-grid article { display: flex; min-height: 112px; align-items: center; gap: 15px; padding: 19px; background: white; border: 2px solid var(--line); border-radius: 24px; }
.steps-grid article > b { display: grid; flex: 0 0 42px; height: 42px; place-items: center; color: white; background: var(--green); border-radius: 14px; }
.steps-grid strong, .steps-grid small { display: block; }
.steps-grid strong { margin-bottom: 5px; font-size: 17px; }
.steps-grid small { color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.35; }
.templates-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.template-card { display: flex; min-height: 340px; padding: 19px; text-align: left; background: white; border: 3px solid var(--line); border-radius: 29px; box-shadow: 0 10px 0 #ded6bc; flex-direction: column; transition: transform .18s ease; }
.template-card:hover { transform: translateY(-4px); }
.template-card.green { --card-accent: var(--green); }
.template-card.gold { --card-accent: var(--gold); }
.template-card.purple { --card-accent: var(--purple); }
.template-top { display: flex; align-items: center; justify-content: space-between; }
.template-top > b { display: grid; width: 45px; height: 45px; place-items: center; color: white; background: var(--card-accent); border-radius: 15px; }
.template-top small { color: var(--card-accent); font-weight: 900; }
.panel-miniatures { display: flex; min-height: 105px; align-items: stretch; gap: 7px; margin: 16px 0; padding: 9px; background: #f6f0d9; border: 3px solid #4c5b58; transform: rotate(-1deg); }
.panel-miniatures i { display: grid; flex: 1; place-items: center; background: color-mix(in srgb, var(--card-accent) 20%, white); border: 2px solid #4c5b58; font-style: normal; }
.panel-miniatures i:nth-child(even) { background: color-mix(in srgb, var(--card-accent) 32%, white); }
.panel-miniatures b { display: grid; width: 28px; height: 28px; place-items: center; color: white; background: #4c5b58; border-radius: 50%; }
.template-copy { flex: 1; }
.template-copy strong, .template-copy span { display: block; }
.template-copy strong { margin-bottom: 7px; font-size: 22px; }
.template-copy span { color: var(--muted); font-size: 14px; font-weight: 800; line-height: 1.4; }
.template-go { display: flex; min-height: 48px; align-items: center; justify-content: space-between; margin-top: 14px; padding: 0 15px; color: white; font-weight: 900; background: var(--card-accent); border-radius: 15px; }
.animal-note { gap: 22px; margin: 28px auto 0; padding: 17px 27px; background: #e9f2e6; border: 2px solid #b9d1b7; border-radius: 28px; }
.animal-note img { width: 88px; height: 88px; object-fit: contain; }
.animal-note strong, .animal-note span { display: block; }
.animal-note strong { margin-bottom: 5px; font-size: 18px; }
.animal-note span { color: var(--muted); font-size: 14px; font-weight: 800; line-height: 1.4; }

.editor-shell { padding: clamp(22px, 3.5vw, 39px); background: var(--paper); border: 3px solid var(--line); border-radius: 40px; box-shadow: var(--shadow); }
.editor-head { justify-content: space-between; gap: 25px; }
.editor-head > div { min-width: 0; flex: 1; }
.editor-head label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.editor-head input { width: min(100%, 590px); padding: 5px 2px 7px; font-size: clamp(29px, 4vw, 43px); font-weight: 900; letter-spacing: -.035em; background: transparent; border: 0; border-bottom: 3px dashed #d8cfb3; }
.frame-strip { display: grid; grid-template-columns: repeat(4, minmax(70px, 1fr)); gap: 9px; margin: 24px 0 20px; }
.frame-strip button { display: flex; min-height: 51px; align-items: center; justify-content: space-between; padding: 0 14px; font-weight: 900; background: #f2efe4; border: 3px solid transparent; border-radius: 15px; }
.frame-strip button.active { background: white; border-color: var(--accent); box-shadow: 0 5px 13px rgba(57, 73, 66, .1); }
.frame-strip button.complete span { color: var(--green); }
.frame-strip button.invalid { color: #9e554b; border-color: #dd867b; }
.editor-workspace { display: grid; align-items: start; grid-template-columns: minmax(390px, 1.06fr) minmax(390px, .94fr); gap: 18px; }
.canvas-panel, .controls-panel { min-width: 0; padding: 19px; background: #f6f4e8; border: 3px solid var(--line); border-radius: 28px; }
.canvas-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.canvas-label span { font-family: Georgia, serif; font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.canvas-label small { color: var(--muted); font-weight: 900; }
.comic-scene { position: relative; min-height: 340px; overflow: hidden; border: 4px solid #405551; box-shadow: 8px 9px 0 rgba(64, 85, 81, .15); }
.bg-meadow { background: linear-gradient(#bfe5f3 0 58%, #9aca77 59% 100%); }
.bg-forest { background: linear-gradient(#85b8a1 0 54%, #4f795a 55% 100%); }
.bg-beach { background: linear-gradient(#aadff0 0 45%, #5caac5 46% 68%, #f1d08c 69% 100%); }
.bg-city { background: linear-gradient(#bfdce9 0 57%, #a8a7a2 58% 100%); }
.bg-night { background: linear-gradient(#46436f 0 62%, #35594a 63% 100%); }
.bg-space { background: radial-gradient(circle at 22% 17%, #fff 0 2px, transparent 3px), radial-gradient(circle at 77% 28%, #fff 0 2px, transparent 3px), linear-gradient(145deg, #29274f, #5a3f79); background-size: 70px 70px, 95px 95px, auto; }
.bg-mountains { background: linear-gradient(#b9dfed 0 52%, #91a98a 53% 100%); }
.bg-room { background: linear-gradient(#f1d9b9 0 72%, #b9785d 73% 77%, #ddba82 78% 100%); }
.scene-decor { position: absolute; z-index: 0; font-size: 62px; filter: drop-shadow(0 5px 5px rgba(46, 60, 55, .12)); }
.decor-one { top: 28px; right: 32px; }
.decor-two { bottom: 21px; left: 28px; }
.empty-scene { position: absolute; top: 50%; left: 50%; z-index: 1; padding: 11px 15px; color: var(--muted); font-weight: 900; background: rgba(255, 255, 255, .9); border: 3px dashed #758a84; border-radius: 15px; transform: translate(-50%, -50%); }
.scene-character { position: absolute; bottom: 12px; z-index: 2; width: 45%; text-align: center; }
.scene-character.slot-1 { left: 3%; }
.scene-character.slot-2 { right: 3%; }
.scene-character img { width: min(100%, 180px); height: 175px; object-fit: contain; filter: drop-shadow(0 7px 5px rgba(34, 48, 43, .18)); }
.scene-character small { position: absolute; bottom: 0; left: 50%; padding: 4px 8px; font-size: 11px; font-weight: 900; white-space: nowrap; background: rgba(255, 255, 255, .9); border-radius: 8px; transform: translateX(-50%); }
.comic-bubble { position: absolute; bottom: 154px; left: 50%; width: min(190px, 105%); min-height: 62px; padding: 12px 13px; font-size: 13px; font-weight: 900; line-height: 1.25; background: white; border: 3px solid #405551; border-radius: 50%; transform: translateX(-50%); }
.comic-bubble::after { position: absolute; bottom: -10px; left: 48%; width: 17px; height: 17px; background: white; border-right: 3px solid #405551; border-bottom: 3px solid #405551; content: ""; transform: rotate(45deg); }
.comic-bubble.thought { border-style: dashed; border-radius: 45%; }
.comic-bubble.thought::after { width: 11px; height: 11px; bottom: -13px; border: 3px solid #405551; border-radius: 50%; }
.comic-bubble.shout { color: #7a3c34; background: #fff0b9; border-radius: 4px; clip-path: polygon(0 14%, 12% 17%, 16% 0, 29% 13%, 39% 2%, 51% 14%, 65% 1%, 72% 17%, 88% 10%, 86% 27%, 100% 35%, 87% 48%, 98% 61%, 82% 67%, 86% 86%, 68% 82%, 60% 100%, 48% 85%, 34% 98%, 29% 82%, 10% 90%, 14% 70%, 0 61%, 13% 48%, 1% 36%, 15% 29%); }
.comic-bubble.shout::after { display: none; }
.canvas-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 17px; }
.tool-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; background: #e9e5d8; border-radius: 17px; }
.tool-tabs button { display: flex; min-height: 48px; align-items: center; justify-content: center; gap: 5px; padding: 6px; font-size: 13px; font-weight: 900; background: transparent; border: 0; border-radius: 12px; }
.tool-tabs button.active { background: white; box-shadow: 0 4px 12px rgba(55, 70, 64, .1); }
.tool-panel { margin-top: 18px; }
.tool-heading h2 { margin-bottom: 15px; font-size: 25px; }
.background-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.background-grid button { min-width: 0; min-height: 88px; padding: 6px; background: white; border: 3px solid transparent; border-radius: 16px; }
.background-grid button.selected, .character-grid button.selected, .bubble-types button.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.background-grid strong { display: block; margin-top: 4px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.swatch { display: grid; height: 51px; place-items: center; overflow: hidden; font-size: 27px; border-radius: 11px; }
.slot-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.slot-picker button { display: grid; min-height: 50px; align-items: center; grid-template-columns: 32px 1fr; gap: 5px; padding: 6px 9px; text-align: left; background: white; border: 3px solid transparent; border-radius: 14px; }
.slot-picker button.active { border-color: var(--accent); }
.slot-picker span { display: grid; width: 30px; height: 30px; place-items: center; color: white; background: #708a83; border-radius: 9px; }
.slot-picker strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.character-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; max-height: 285px; overflow-y: auto; padding: 3px; }
.character-grid button { min-width: 0; min-height: 88px; padding: 5px; background: white; border: 3px solid transparent; border-radius: 15px; }
.character-grid img { width: 58px; height: 58px; object-fit: contain; }
.character-grid strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.remove-button { width: 100%; min-height: 44px; margin-top: 10px; padding: 5px 12px; color: #88584f; font-size: 12px; font-weight: 900; background: #fff0ec; border: 2px solid #e1aaa1; border-radius: 13px; }
.bubble-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.bubble-types button { min-height: 66px; padding: 7px; background: white; border: 3px solid transparent; border-radius: 15px; }
.bubble-types span, .bubble-types strong { display: block; }
.bubble-types span { font-size: 23px; }
.bubble-types strong { margin-top: 2px; font-size: 11px; }
.phrase-starters { display: flex; gap: 7px; margin: 11px 0; padding-bottom: 5px; overflow-x: auto; }
.phrase-starters button { flex: 0 0 auto; min-height: 44px; padding: 6px 11px; color: #66587c; font-size: 11px; font-weight: 900; background: #eee7f7; border: 2px solid #c8badd; border-radius: 13px; }
.bubble-editor { position: relative; display: block; }
.bubble-editor > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.bubble-editor textarea { width: 100%; min-height: 100px; padding: 13px 45px 13px 13px; resize: vertical; font-weight: 800; line-height: 1.4; background: white; border: 3px solid var(--line); border-radius: 16px; }
.bubble-editor > small { position: absolute; right: 12px; bottom: 12px; color: var(--muted); font-weight: 900; }
.editor-feedback { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; padding: 11px 15px; background: #fff0ec; border: 2px solid #e2a299; border-radius: 16px; }
.editor-feedback.success { background: #e8f4e9; border-color: #9fc5a8; }
.editor-feedback > span { display: grid; flex: 0 0 40px; height: 40px; place-items: center; background: white; border-radius: 12px; }
.editor-feedback p { margin: 0; }
.editor-feedback strong, .editor-feedback small { display: block; }
.editor-feedback small { margin-top: 2px; color: var(--muted); font-weight: 800; }

.result-card { max-width: 960px; margin: 35px auto; padding: clamp(28px, 4.5vw, 50px); text-align: center; background: var(--paper); border: 3px solid var(--line); border-radius: 42px; box-shadow: var(--shadow); }
.result-badge { position: relative; width: 145px; height: 125px; margin: 0 auto 7px; }
.result-badge img { width: 135px; height: 135px; object-fit: contain; }
.result-badge span { position: absolute; top: 1px; right: -22px; z-index: 2; padding: 15px; color: white; font-size: 16px; font-weight: 900; background: var(--coral); clip-path: polygon(50% 0, 62% 19%, 82% 8%, 84% 30%, 100% 39%, 84% 52%, 94% 74%, 71% 75%, 64% 100%, 48% 84%, 28% 97%, 25% 74%, 2% 68%, 17% 50%, 0 35%, 23% 28%, 27% 7%); }
.result-card h1 { margin-bottom: 10px; font-size: clamp(37px, 5vw, 54px); letter-spacing: -.045em; line-height: 1; }
.result-card > p:not(.eyebrow) { color: var(--muted); font-weight: 800; }
.final-comic { display: grid; gap: 10px; margin: 24px 0; padding: 12px; background: #f5eccb; border: 4px solid #405551; box-shadow: 10px 11px 0 rgba(64, 85, 81, .13); }
.final-comic.frames-2 { grid-template-columns: 1fr 1fr; }
.final-comic.frames-3 { grid-template-columns: repeat(2, 1fr); }
.final-comic.frames-3 .final-frame:last-child { grid-column: 1 / span 2; }
.final-comic.frames-4 { grid-template-columns: 1fr 1fr; }
.final-frame { position: relative; min-width: 0; }
.final-frame > span { position: absolute; top: 7px; left: 7px; z-index: 6; display: grid; width: 30px; height: 30px; place-items: center; color: white; font-weight: 900; background: #405551; border-radius: 50%; }
.final-frame .comic-scene { min-height: 260px; box-shadow: none; }
.final-frame .scene-character img { height: 130px; }
.final-frame .comic-bubble { bottom: 112px; min-height: 50px; font-size: 11px; }
.result-stats, .result-actions { display: flex; justify-content: center; gap: 13px; }
.result-stats { margin: 23px 0; }
.result-stats > span { min-width: 125px; padding: 12px; background: #f0f4eb; border-radius: 17px; }
.result-stats strong, .result-stats small { display: block; }
.result-stats strong { font-size: 25px; }
.result-stats small { color: var(--muted); font-weight: 800; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-copy > p, .hero h1 { margin-right: auto; margin-left: auto; }
  .hero-facts { justify-content: center; }
  .hero-art { width: min(100%, 530px); margin: auto; }
  .steps-grid { grid-template-columns: 1fr; }
  .templates-grid { grid-template-columns: 1fr; }
  .template-card { display: grid; min-height: 0; grid-template-columns: 75px 190px 1fr; column-gap: 16px; }
  .template-top { display: contents; }
  .template-top > b { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .template-top small { grid-column: 1; grid-row: 3; text-align: center; }
  .panel-miniatures { height: 125px; grid-column: 2; grid-row: 1 / span 3; margin: 0; }
  .template-copy { grid-column: 3; grid-row: 1 / span 2; }
  .template-go { grid-column: 3; grid-row: 3; }
  .editor-workspace { grid-template-columns: 1fr; }
  .comic-scene { min-height: 390px; }
}

@media (max-width: 700px) {
  .app { width: min(100% - 20px, 1120px); padding-top: 10px; }
  .topbar { min-height: 58px; margin-bottom: 10px; }
  .brand-mark { width: 48px; height: 48px; font-size: 24px; border-radius: 16px; }
  .brand strong { font-size: 18px; }
  .brand small, .sound-button span:last-child, .top-burst { display: none; }
  .sound-button { width: 48px; padding: 0; justify-content: center; }
  .hero { min-height: 0; gap: 24px; padding: 34px 20px; border-radius: 31px; }
  .hero h1 { font-size: clamp(39px, 12vw, 55px); }
  .hero-copy > p:not(.eyebrow) { font-size: 16px; }
  .continue-button { margin: 15px 0 0; }
  .hero-facts { gap: 8px; }
  .hero-facts span { padding: 8px 9px; background: #f5f3e9; border-radius: 12px; }
  .hero-art { min-height: 310px; }
  .hero-comic { height: 305px; }
  .preview-panel img { width: 110px; height: 110px; }
  .preview-three img { width: 120px; height: 120px; }
  .preview-bubble { font-size: 10px; }
  .how-section, .templates-section { margin-top: 18px; padding: 24px 15px; border-radius: 28px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .section-heading > p { text-align: left; }
  .template-card { display: flex; min-height: 330px; }
  .template-top { display: flex; width: 100%; }
  .panel-miniatures { width: 100%; height: 105px; margin: 14px 0; }
  .animal-note { align-items: flex-start; padding: 15px; }
  .animal-note img { width: 70px; height: 70px; }
  .editor-shell { padding: 21px 12px; border-radius: 29px; }
  .editor-head { align-items: flex-start; flex-direction: column; }
  .editor-head input { font-size: 29px; }
  .preview-button { width: 100%; }
  .frame-strip { grid-template-columns: repeat(2, 1fr); }
  .canvas-panel, .controls-panel { padding: 13px; border-radius: 22px; }
  .comic-scene { min-height: 270px; }
  .scene-character img { height: 125px; }
  .comic-bubble { bottom: 111px; min-height: 48px; padding: 9px; font-size: 11px; }
  .scene-decor { font-size: 48px; }
  .canvas-actions { flex-direction: column-reverse; }
  .canvas-actions button { width: 100%; }
  .background-grid, .character-grid { grid-template-columns: repeat(3, 1fr); }
  .character-grid { max-height: 340px; }
  .result-card { margin: 22px auto; padding: 28px 13px; border-radius: 29px; }
  .final-comic, .final-comic.frames-2, .final-comic.frames-3, .final-comic.frames-4 { grid-template-columns: 1fr; }
  .final-comic.frames-3 .final-frame:last-child { grid-column: auto; }
  .final-frame .comic-scene { min-height: 260px; }
  .result-stats { flex-wrap: wrap; }
  .result-stats > span { min-width: 95px; flex: 1; }
  .result-actions { flex-direction: column-reverse; }
}

@media (max-width: 420px) {
  .brand { gap: 8px; }
  .brand strong { font-size: 16px; }
  .hero-comic { gap: 6px; padding: 7px; }
  .preview-burst { padding: 14px; font-size: 18px; }
  .tool-tabs button { flex-direction: column; font-size: 11px; }
  .background-grid, .character-grid { grid-template-columns: repeat(3, 1fr); }
  .background-grid strong { font-size: 10px; }
  .character-grid img { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .app { width: 100%; padding: 0; }
  .topbar,
  .result-badge,
  .result-card > .eyebrow,
  .result-card > p,
  .result-stats,
  .result-actions { display: none !important; }
  .result-card { max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .result-card h1 { margin: 0 0 8mm; }
  .final-comic { margin: 0; box-shadow: none; break-inside: avoid; print-color-adjust: exact; }
}