:root{--teal:#0f766e;--teal2:#14b8a6;--sea:#134e4a;--amber:#f59e0b;--peach:#ff8a5c;--cream:#fff8e7;--ink:#1c2b2a;--muted:#5f6f6d;--bg:#fffaf0;--card:#ffffff;--border:#e6ddc8}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--ink);line-height:1.55}
body.dark{background:#12211f;color:#f2f7f5;--card:#1b2f2c;--border:#33504b;--muted:#b9c9c4}
body.dark .card,body.dark input,body.dark select,body.dark textarea{background:#1b2f2c;color:#f2f7f5;border-color:#33504b}
.topbar{display:flex;gap:16px;align-items:center;flex-wrap:wrap;padding:14px 22px;background:linear-gradient(90deg,#0f766e,#14b8a6 45%,#f59e0b);color:#fff;position:sticky;top:0;z-index:10;box-shadow:0 4px 18px rgba(15,118,110,.25)}
.brand{display:flex;gap:10px;align-items:center}.logo{font-size:28px}
.brand small{display:block;opacity:.9;font-size:12px}
#nav{display:flex;gap:6px;flex-wrap:wrap;flex:1}
#nav button{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.4);color:#fff;padding:8px 12px;border-radius:999px;cursor:pointer;font-size:13px;font-weight:600}
#nav button.active,#nav button:hover{background:#fff;color:#0f766e}
.pill{background:#fff;color:#0f766e;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700}
.pill.soft{background:rgba(255,255,255,.22);color:#fff}
main{max-width:1080px;margin:0 auto;padding:22px}
h1{font-size:32px;margin:8px 0;letter-spacing:-.5px}h2{margin:28px 0 10px}h3{margin:0 0 8px}
.hero{display:grid;grid-template-columns:1.2fr .8fr;gap:20px;align-items:center;padding:24px;border-radius:24px;background:linear-gradient(135deg,#fef3c7,#fff8e7 55%,#ccfbf1);border:1px solid var(--border)}
.hero h1{font-size:44px;line-height:1.08}
.badge{display:inline-block;background:#f59e0b;color:#fff;padding:6px 12px;border-radius:999px;font-size:13px;font-weight:700}
.grid3{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin:12px 0}
.card{background:var(--card);border:1px solid var(--border);border-radius:20px;padding:18px;margin:14px 0;box-shadow:0 4px 16px rgba(15,118,110,.08)}
.btn{background:#fff;border:1px solid #d6cfae;color:#0f766e;padding:10px 16px;border-radius:999px;cursor:pointer;font-size:14px;font-weight:600;text-decoration:none;display:inline-block}
.btn.primary{background:linear-gradient(90deg,#0f766e,#f59e0b);color:#fff;border:none;font-weight:700}
.btn:disabled{opacity:.6;cursor:wait}
.btn.danger{border-color:#fda4af;color:#be123c}
.btn.file{cursor:pointer}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0}
.muted{color:var(--muted)}.small{font-size:13px}
input,select,textarea{width:100%;padding:10px;border:1px solid #d6cfae;border-radius:12px;font:inherit;background:#fff}
textarea{resize:vertical}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
.form-grid label{font-size:13px;font-weight:600;display:block}
.steps{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}
.step{background:#ccfbf1;border-radius:999px;padding:6px 10px;font-size:12px}
.step.on{background:#0f766e;color:#fff}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.chip{background:#fff7ed;border:1px solid #fed7aa;border-radius:999px;padding:6px 10px;cursor:pointer;font-size:13px}
.page-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}
.page-card{border:1px solid var(--border);border-radius:18px;overflow:hidden;background:#fff}
.page-card img{width:100%;display:block;aspect-ratio:4/3;object-fit:cover}
.page-card .pad{padding:12px}
.mono{font-family:ui-monospace,Menlo,monospace;white-space:pre-wrap;background:#f0fdfa;padding:10px;border-radius:10px}
body.dark .mono{background:#243f3a}
.progress-wrap{height:10px;background:#e7e0c8;border-radius:999px;overflow:hidden;margin:10px 0}
.progress-bar{height:100%;width:0%;background:linear-gradient(90deg,#0f766e,#f59e0b);border-radius:999px;transition:width .3s}
.error-text{color:#b91c1c;font-weight:600;font-size:14px}
#renderPreview canvas{box-shadow:0 6px 20px rgba(15,118,110,.2)}
footer{text-align:center;color:var(--muted);padding:24px;font-size:13px}
.hero-art img{width:100%;border-radius:20px}
.book-page{border:1px solid var(--border);border-radius:16px;padding:16px;margin:12px 0}
.book-page img{width:100%;border-radius:10px}
.menu-btn{display:none;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.45);color:#fff;font-size:22px;line-height:1;padding:8px 12px;border-radius:12px;cursor:pointer}
.install-btn{background:#fff;color:#0f766e;border:none;font-weight:700}
#bottomnav{display:none}
.card{transition:transform .15s ease,box-shadow .15s ease}
.card:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(15,118,110,.14)}
.btn{min-height:44px}
input,select,textarea{font-size:16px}
#nav button{min-height:40px}
@media(max-width:860px){
  .topbar{padding:10px 12px;gap:10px}
  .brand strong{font-size:16px}.brand small{font-size:11px}.logo{font-size:24px}
  .menu-btn{display:block;margin-left:auto}
  .top-right{order:3;width:100%;justify-content:flex-start}
  .top-right .pill.soft{display:none}
  #nav{display:none;order:4;flex-basis:100%;flex-direction:column;align-items:stretch;background:rgba(255,255,255,.12);border-radius:14px;padding:8px}
  #nav.open{display:flex}
  #nav button{text-align:left;border:none;border-bottom:1px solid rgba(255,255,255,.18);border-radius:10px;padding:12px}
  #nav button.active{background:#fff;color:#0f766e}
  main{padding:14px 14px 96px}
  .hero{grid-template-columns:1fr;padding:18px}
  .hero h1{font-size:32px}
  h1{font-size:26px}
  #bottomnav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:20;background:#0f766e;border-top:2px solid #f59e0b;padding:6px 4px calc(6px + env(safe-area-inset-bottom));justify-content:space-around;box-shadow:0 -4px 18px rgba(0,0,0,.2)}
  #bottomnav button{background:transparent;border:none;color:#c8f5ee;font-size:20px;padding:6px 8px;border-radius:12px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:2px;min-width:56px}
  #bottomnav button span{font-size:11px;font-weight:700}
  #bottomnav button.active{background:rgba(255,255,255,.18);color:#fff}
  footer{padding-bottom:96px}
}
@media print{
  body{background:#fff}.topbar,footer,.btn,.steps,#nav{display:none!important}
  main{max-width:100%;padding:0}
  .page{display:none!important}.page.active{display:block!important}
  .card{border:none;box-shadow:none}
  .book-page{page-break-after:always;border:none}
}

/* ---- Google sign-in modal (v5) ----
   Landing is fully visible on load. Sign-in opens only when a button is tapped
   while signed out; the modal appears only for the sign-in flow / errors. */
#authGate{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(20,30,40,.55);text-align:center}
#authGate.show{display:flex}
body.signed-in #topSignInBtn,body.signed-in #topGetStartedBtn{display:none}
body.on-home .topbar{position:absolute;top:0;left:0;right:0;z-index:20;background:linear-gradient(rgba(15,23,42,.45),rgba(15,23,42,0));box-shadow:none}
body.on-home #bottomnav{display:none!important}
body.on-home main{padding-top:0}
.topbar{position:relative}
.signin-btn{background:transparent;border:1.5px solid rgba(255,255,255,.85);color:#fff}
.getstarted-btn{background:#9333ea;color:#fff;border:none;font-weight:700}
.more-btn{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.4);color:#fff}
.more-menu{display:none;position:absolute;right:16px;top:64px;z-index:30;background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:0 12px 32px rgba(0,0,0,.25);padding:8px;min-width:210px}
.more-menu.open{display:block}
.more-menu button{display:block;width:100%;text-align:left;background:none;border:none;padding:11px 12px;border-radius:10px;cursor:pointer;font-size:14px;font-weight:600;color:#1c2b2a}
.more-menu button:hover{background:#f0fdfa}
.landing-hero{position:relative;width:100%;aspect-ratio:16/9;border-radius:24px;overflow:hidden;box-shadow:0 10px 32px rgba(15,118,110,.2)}
.hotspot{position:absolute;background:transparent;border:none;cursor:pointer;padding:0;border-radius:12px}
.hotspot:hover{box-shadow:inset 0 0 0 2px rgba(255,255,255,.45)}
.hotspot:focus-visible{outline:3px solid #f59e0b;outline-offset:2px}
.hs-brand{left:3.5%;top:2%;width:28%;height:8%}
.hs-home{left:39%;top:3%;width:5.5%;height:5%}
.hs-book{left:45.9%;top:3%;width:7.2%;height:5%}
.hs-animation{left:54.7%;top:3%;width:6%;height:5%}
.hs-library{left:63%;top:3%;width:4.5%;height:5%}
.hs-pricing{left:70.3%;top:3%;width:4.7%;height:5%}
.hs-signin{left:81.2%;top:3%;width:6.6%;height:5%}
.hs-getstarted{left:89%;top:3%;width:9%;height:5%}
.hs-create{left:51%;top:48.5%;width:17%;height:7.5%}
.hs-card-book{left:30.3%;top:74.5%;width:11.6%;height:19%}
.hs-card-animation{left:42.8%;top:74.5%;width:11.6%;height:19%}
.hs-card-music{left:55.6%;top:74.5%;width:11.6%;height:19%}
.hs-card-comic{left:68%;top:74.5%;width:11.9%;height:19%}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.gate-card{background:rgba(255,255,255,.97);color:#1c2b2a;border-radius:24px;padding:30px 26px;max-width:440px;width:100%;box-shadow:0 18px 50px rgba(0,0,0,.35)}
.gate-logo{font-size:44px;line-height:1}
.gate-card h1{font-size:30px;margin:10px 0 2px}
.gate-sub{color:#5f6f6d;font-weight:600;margin:0 0 12px}
.google-btn{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;background:#fff;border:1px solid #dadce0;color:#1f1f1f;padding:14px 18px;border-radius:999px;font-size:16px;font-weight:700;cursor:pointer;min-height:54px;margin:16px 0 8px}
.google-btn:hover{background:#f8f9fa}
.google-btn:disabled{opacity:.6;cursor:wait}
.g-logo{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#4285f4;color:#fff;font-size:18px;font-weight:800}
#authError{min-height:20px;margin:8px 0}
#userChip{display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.4);border-radius:999px;padding:4px 6px 4px 4px}
#userChip img{width:28px;height:28px;border-radius:50%;display:block}
#userChip span{color:#fff;font-size:13px;font-weight:600;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#userChip button{background:#fff;border:none;color:#0f766e;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700;cursor:pointer}

/* ---- v6: nav legibility over the hero image ----
   The landing hero is the user's own design image, so its top-nav words
   (Home / Picture Book / Animation / ...) are baked into the picture and
   a letter can vanish against tree foliage. A dark gradient shade behind
   the top strip of the hero lifts the baked-in white nav text off the
   foliage; hotspots stay above the shade and clickable. The real HTML
   nav buttons (shown off-home) also get a darker pill + text shadow. */
.landing-hero::before{content:"";position:absolute;left:0;right:0;top:0;height:12%;background:linear-gradient(rgba(8,20,32,.62),rgba(8,20,32,0));pointer-events:none;z-index:0}
.landing-hero .hotspot{z-index:1}
#nav button:not(.active){background:rgba(15,118,110,.45);text-shadow:0 1px 3px rgba(0,0,0,.55)}

/* ---- v9: welcome-only while signed out; creation choices after sign-in ----
   Signed out, the visitor sees ONLY the welcome hero (top nav, headline,
   subheading, Create Your Story + Explore Projects). The 4 hero format
   cards, the simple home, stats, bottom nav and footer are all hidden
   until Google sign-in. After sign-in the simple home on Home is the way
   in: creation choices first — Story, Picture Book, Animation, Music
   Video, Comic — each opening its own studio. */
/* ---- v10: signed-out page ends at the hero — root-cause fix ----
   v9 hid only .hero-cards / #simpleHome / footer / bottomnav, but the app
   sections themselves were NEVER hidden: there was no .page{display:none}
   rule anywhere (only inside @media print), so go() toggling .active did
   nothing visually and every section (pricing, book, story, animation,
   music, comic, library, projects, dashboard, settings, admin) rendered
   stacked below the hero while signed out. v10 adds the missing rule, so
   only the .active page shows, AND belt-and-braces signed-out rules that
   force every non-home section display:none even if it somehow becomes
   .active. After Google sign-in all sections work exactly as before,
   with creation choices (Story, Picture Book, Animation, Music Video,
   Comic) first on the signed-in home. */
.page{display:none}
.page.active{display:block}
body:not(.signed-in) main .page:not(#page-home){display:none!important}
body:not(.signed-in) #simpleHome{display:none!important}
#simpleHome{display:none;max-width:1080px;margin:0 auto;padding:30px 22px 10px}
body.signed-in #simpleHome{display:block}
body:not(.signed-in) .hero-cards{display:none!important}
body:not(.signed-in) #bottomnav{display:none!important}
body:not(.signed-in) footer{display:none}
body:not(.signed-in) #countPill,body:not(.signed-in) #limitPill,body:not(.signed-in) #moreBtn,body:not(.signed-in) #installBtn,body:not(.signed-in) #moreMenu{display:none!important}
body.signed-in #nav button[data-page="book"],body.signed-in #nav button[data-page="animation"],body.signed-in #nav button[data-page="library"],body.signed-in #nav button[data-page="pricing"]{display:none}
body.signed-in #moreBtn,body.signed-in #installBtn{display:none}
body.on-home main{max-width:none;padding:0 0 22px}
.big-cta{display:block;width:100%;max-width:640px;margin:14px auto 8px;padding:20px 28px;border:none;border-radius:20px;background:linear-gradient(90deg,#0f766e,#f59e0b);color:#fff;font-size:22px;font-weight:800;cursor:pointer;min-height:64px;box-shadow:0 8px 22px rgba(15,118,110,.25)}
.big-cta:hover{transform:translateY(-2px)}
.simple-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin:12px 0 6px}
.simple-choices button{background:#fff;border:1px solid var(--border);border-radius:20px;padding:22px 14px;cursor:pointer;display:flex;flex-direction:column;gap:6px;align-items:center;text-align:center;min-height:150px;box-shadow:0 4px 16px rgba(15,118,110,.08);color:var(--ink)}
.simple-choices button:hover{transform:translateY(-2px)}
.simple-choices strong{font-size:19px}
.simple-choices span:last-child{font-size:14px;color:var(--muted)}
.sc-icon{font-size:44px;line-height:1}
.simple-row{display:flex;gap:12px;align-items:center;justify-content:space-between;background:var(--card);border:1px solid var(--border);border-radius:16px;padding:14px 16px;margin:10px 0}
.simple-row strong{font-size:17px}
.simple-more{display:flex;gap:8px;flex-wrap:wrap;margin:22px 0 8px}
.simple-more button{background:#fff;border:1px solid #d6cfae;color:#0f766e;padding:10px 16px;border-radius:999px;cursor:pointer;font-size:14px;font-weight:600;min-height:44px}
@media(max-width:860px){
  body:not(.signed-in) #nav{display:flex;order:4;flex-basis:100%;flex-direction:row;flex-wrap:nowrap;overflow-x:auto;background:rgba(8,20,32,.35);border-radius:14px;padding:6px}
  body:not(.signed-in) #nav button{white-space:nowrap;border:none;flex:0 0 auto}
  body:not(.signed-in) .menu-btn{display:none}
  .big-cta{font-size:19px}
}

/* ---- v11: fresh start (no auto-seed) + tidy nav + spacing + real card art ----
   - No sample projects/characters are seeded any more: a new user starts at
     0 projects / 0 characters (empty Library / Projects / Dashboard).
   - Post-sign-in topbar tidied: nav no longer crowds the user chip — the
     signed-in nav (which only ever showed Home) is hidden and the More menu
     carries the sections; top-right items are a flex row with even gaps.
   - Clear gap under the "Create a story" button before the format choices.
   - Format cards use drawn SVG illustrations (.sc-art / hero .sc-art),
     not emoji-only icons. */
.topbar{gap:12px 18px;padding:12px 20px}
.top-right{display:flex;align-items:center;gap:10px;margin-left:auto;flex-wrap:wrap}
#nav{gap:8px;flex:1 1 auto;align-items:center}
#nav button{padding:9px 14px;white-space:nowrap}
#userChip{flex:0 0 auto}
#userChip span{max-width:160px}
body.signed-in #nav{display:none}
body.signed-in #moreBtn{display:inline-block}
body.signed-in .top-right{gap:10px}
#simpleHome .big-cta{margin:14px auto 38px}
#simpleHome h3{margin-top:36px}
.simple-choices{gap:18px;margin:20px 0 12px}
.simple-choices button{padding:0 0 18px;overflow:hidden;gap:10px;min-height:0}
.simple-choices button strong{padding:0 12px}
.simple-choices button span:last-child{padding:0 12px}
.sc-art{display:block;width:100%;height:96px}
.sc-art svg{width:100%;height:100%;display:block}
.hero-card .sc-art{height:72px;border-radius:18px 18px 0 0;margin:-16px -10px 8px;width:calc(100% + 20px)}
.hero-card{overflow:hidden}
@media(max-width:860px){
  .topbar{gap:10px 12px}
  .top-right{order:3;width:100%;justify-content:flex-start;gap:8px;margin-left:0}
  #userChip span{max-width:110px}
  #simpleHome .big-cta{margin-bottom:30px}
  .sc-art{height:84px}
  .hero-card .sc-art{height:60px}
}

/* ---- v12: button click animations + mobile capability ----
   EVERY button animates on click: press scale + lift on hover, ripple
   (JS adds .ripple at the tap point — see app.js), and a short page
   fade/slide when a view opens. All 150–250ms, disabled under
   prefers-reduced-motion. Mobile: no horizontal overflow, single-column
   stacks, 44px+ touch targets, 16px inputs, compact topbar. */
button{transition:transform .18s ease,box-shadow .18s ease,background-color .18s ease,filter .18s ease}
.btn,.hero-cta,.hero-card,.simple-choices button,.simple-more button,.chip,#nav button,#bottomnav button,.google-btn,.menu-btn,.more-btn,.more-menu button{position:relative;overflow:hidden}
.btn:hover,.simple-more button:hover{transform:translateY(-2px);box-shadow:0 6px 18px rgba(15,118,110,.18)}
.btn:active,.simple-more button:active,.chip:active,#nav button:active,.more-menu button:active{transform:scale(.96)}
.btn.primary:active,.big-cta:active{transform:scale(.97)}
.simple-choices button:active,.hero-card:active{transform:scale(.97)}
#nav button:hover{transform:translateY(-1px)}
#bottomnav button:active{transform:scale(.92)}
.google-btn:active{transform:scale(.97)}
button:focus-visible,a.btn:focus-visible{outline:3px solid #f59e0b;outline-offset:2px}
.ripple{position:absolute;border-radius:50%;background:rgba(15,118,110,.22);transform:scale(0);animation:rippleIn .25s ease-out forwards;pointer-events:none;z-index:0}
.ripple.light{background:rgba(255,255,255,.45)}
@keyframes rippleIn{to{transform:scale(1);opacity:0}}
.page.active{animation:pageIn .25s ease both}
@keyframes pageIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.scene-img{width:100%;border-radius:12px;display:block;margin:6px 0 10px;box-shadow:0 4px 14px rgba(15,118,110,.15)}
@media(max-width:860px){
  html,body{overflow-x:hidden}
  .btn,#nav button,.chip,.more-menu button,.simple-more button{min-height:44px}
  #nav button{padding:11px 14px}
  .menu-btn,.more-btn{min-height:44px;min-width:44px}
  #bottomnav button{min-height:48px;flex:1;min-width:0}
  .topbar{padding:10px 12px}
  .brand strong{font-size:15px}
  .brand small{font-size:11px}
  .top-right .btn{padding:10px 14px;font-size:13px}
  #limitPill{display:none}
  .big-cta{font-size:18px;padding:16px 20px;min-height:56px}
  .mono{overflow-x:auto}
  .gate-card{padding:22px 18px}
  .google-btn{min-height:52px;font-size:15px}
}
@media(max-width:560px){
  .simple-choices{grid-template-columns:1fr}
  .form-grid{grid-template-columns:1fr}
  .grid3{grid-template-columns:1fr}
  .page-grid{grid-template-columns:1fr}
  .hero-cards{grid-template-columns:repeat(2,1fr)}
  main{padding:12px 12px 96px}
  h1{font-size:24px}
  .card{padding:14px}
  .row{row-gap:8px}
  .row .btn{flex:1 1 44%}
  #userChip span{max-width:84px}
  .top-right{flex-wrap:wrap}
}
@media(prefers-reduced-motion:reduce){
  button,.card,.btn,.page.active{animation:none!important;transition:none!important}
  .ripple{display:none}
}

/* ---- v13: centred shell + Animation Studio one-screen layout + Back buttons ----
   Centring: every page sits in ONE centred band (1200px) with balanced
   side margins on laptop; the topbar keeps its full-width gradient but
   its content aligns to the same band. Mobile stays full-width tidy.
   Animation Studio (laptop): idea card on top, then a two-column grid —
   scenes LEFT as four small thumb blocks (thumbnail + scene number +
   short caption; tap to expand details) and render/video RIGHT at the
   top — sized to fit one laptop screen without scrolling. The live
   preview canvas / finished video is capped so it cannot push the
   page taller than the screen. */
main{max-width:1200px;width:100%;margin-left:auto;margin-right:auto;padding:22px clamp(16px,4vw,32px)}
footer{max-width:1200px;margin-left:auto;margin-right:auto}
#simpleHome{max-width:1200px}
.back-btn{margin:2px 0 10px}
.anim-format{font-size:13px;font-weight:600;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.anim-format select{width:auto;min-width:180px}
.scene-thumb{border:1px solid var(--border);border-radius:14px;overflow:hidden;background:#fff;cursor:pointer}
.scene-thumb-img{width:100%;aspect-ratio:16/10;object-fit:cover;display:block}
.scene-thumb-body{padding:8px 10px}
.scene-thumb-body strong{font-size:14px}
.scene-thumb-body p{margin:2px 0 0;font-size:12.5px;color:var(--muted);line-height:1.45}
.scene-detail{border-top:1px solid var(--border);padding:10px;background:#fff}
.scene-detail .mono{font-size:11.5px}
body.dark .scene-thumb{background:#1b2f2c;border-color:#33504b}
body.dark .scene-detail{background:#1b2f2c}
#animVideo{width:100%;max-width:480px}
.anim-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.anim-head h1{margin:0}
.anim-head .back-btn{margin:0}
details.anim-providers-card summary{cursor:pointer;font-weight:600;font-size:15px}
@media(min-width:861px){
  .topbar{padding-left:max(20px,calc((100vw - 1200px)/2));padding-right:max(20px,calc((100vw - 1200px)/2))}
  main{padding-top:12px;padding-bottom:10px}
  footer{padding:8px 20px}
  /* One-screen Animation Studio (laptop): header, idea card and the
     two-column layout must fit in 768px height with no scrolling, so
     everything below is compact on desktop only. Mobile keeps the
     roomier stacked layout and scrolls normally. */
  #page-animation h1{font-size:24px}
  #page-animation .anim-intro{display:none}
  #page-animation #bibleNote{display:none}
  /* Idea card as ONE horizontal strip: idea + Random | settings + Generate. */
  #page-animation .anim-idea-card{margin:8px 0 10px;padding:8px 14px}
  #page-animation .anim-idea-card h3{display:none}
  #page-animation .anim-idea-grid{display:flex;gap:10px;align-items:center;flex-wrap:nowrap}
  #page-animation .anim-idea-grid>div{display:flex;gap:8px;align-items:center;flex:1 1 auto;min-width:0}
  #page-animation .anim-idea-grid>div:last-child{flex:0 0 auto}
  #page-animation #anIdea{flex:1;min-width:80px}
  #page-animation .anim-settings select{max-width:100px}
  #page-animation .anim-settings label{display:flex;align-items:center;gap:6px;white-space:nowrap}
  #page-animation .anim-idea-grid .row{margin:0;flex-wrap:nowrap}
  #page-animation .anim-idea-grid .muted.small{display:none}
  #page-animation .anim-settings{flex-wrap:nowrap;gap:6px}
  #page-animation .anim-layout{display:grid;grid-template-columns:minmax(0,1.02fr) minmax(0,1fr);gap:12px;align-items:start}
  #page-animation .anim-layout .card{margin:0}
  #page-animation .anim-scenes-card,#page-animation .anim-render-card{padding:10px 14px}
  #page-animation .anim-scenes-card h3,#page-animation .anim-render-card h3{margin:0 0 4px;font-size:15px}
  #page-animation .anim-scenes-card>p.muted.small{display:none}
  #page-animation .anim-render-card>p.muted.small{margin:2px 0 6px;line-height:1.4}
  #page-animation #animOut{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  #page-animation .scene-thumb-img{height:84px;aspect-ratio:auto}
  #page-animation .scene-thumb-body{padding:4px 8px}
  #page-animation .scene-thumb-body p{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
  #page-animation .anim-tip{display:none}
  #page-animation #renderPreview canvas{max-width:100%;max-height:170px;width:auto;height:auto}
  #page-animation #animVideo{max-height:140px;width:auto;max-width:100%}
  #page-animation .anim-video-row{display:flex;gap:12px;align-items:flex-start}
  #page-animation .anim-video-side{flex:1;min-width:0}
  #page-animation .anim-video-side .row{margin:0 0 6px}
  footer p{margin:0}
  #page-animation .anim-providers-card{padding:8px 14px}
  #page-animation .anim-providers-card summary{font-size:14px}
  #page-animation .row{margin:6px 0}
}
@media(max-width:860px){
  #page-animation #animOut{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  #page-animation #renderPreview canvas{max-width:100%}
  .back-btn{margin-bottom:8px}
}
