/* Animations tab (app/js/ui/animations.js): "Make an animation". Uses the studio's light tokens from studio.css
   (Kevin 2026-10-11: no black page); only the animation previews stay on their own dark ground. Nothing here restyles
   another tab: every rule below is scoped to the portal or to a page that shows it. Nothing here animates by itself:
   the only transitions run once on a press (a border, a switch's knob, a progress bar). */

/* ---- the portal: the shared parts restyled inside it ---- */
.anim-portal { display: grid; gap: 22px; min-width: 0; }
.anim-portal .btn:hover { background: var(--soft); border-color: #CFC7B9; }
.anim-portal .btn.primary:hover { background: var(--accent-hover); }
.anim-portal .btn.ghost:hover { background: var(--soft); }
.anim-portal .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.anim-portal .seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.anim-portal .qnow, .anim-portal .pickcard { background: var(--soft); }
.anim-portal dialog { background: var(--panel); color: var(--ink); }
.anim-portal .dlg > footer { background: var(--soft); }
.anim-portal .dict-bar { background: #FBE4DF; }
.anim-portal .pill.used { background: #FBE4DF; color: var(--bad); } .anim-portal .pill.ok { background: #E1EFE6; color: var(--ok); } .anim-portal .pill.warn { background: #F6EBD3; color: var(--warn); }
.anim-portal .swbtn.no { color: var(--bad); } .anim-portal .swbtn.yes { color: var(--ok); } .anim-portal .swbtn.up { color: var(--accent); }
.anim-portal .swempty { border-color: var(--line); }
.anim-portal .swcard { box-shadow: 0 10px 30px rgba(20,19,17,.12); background: var(--panel); }
/* every text field reads 16 px (iOS zooms into anything smaller; QA 2026-10-11 C14) */
.anim-portal input[type=text], .anim-portal input[type=search], .anim-portal select, .anim-portal textarea { font-size: 16px; }

/* ---- the heading, the one start, the two other ways in ---- */
.ap-hero { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 6px 0 0; } /* one line: the title and the guide's "?" */
.ap-title { margin: 0; font-family: "TBV Newsreader", Georgia, serif; font-weight: 560; font-size: clamp(1.6rem, 1.2rem + 1vw, 2.25rem); line-height: 1.1; letter-spacing: -.015em; }
.ap-step-n { display: inline-grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); font: 650 13px "TBV Inter", sans-serif; color: var(--muted); }
.ap-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.ap-panel { display: grid; gap: 16px; min-width: 0; }
.ap-tell, .ap-surprise, .ap-pages, .ap-ideas { display: grid; gap: 16px; min-width: 0; }
.ap-prompt-wrap { display: grid; gap: 8px; max-width: 920px; }
.ap-prompt { font-size: 19px !important; line-height: 1.45; min-height: 112px; padding: 16px 52px 16px 16px; border-radius: 14px; }
.ap-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.ap-go { max-width: 420px; }
.ap-fail { margin: 0; padding: 12px 14px; border-radius: 10px; background: rgba(255, 123, 107, .1); background: color-mix(in srgb, var(--bad) 12%, transparent); border: 1px solid rgba(255, 123, 107, .45); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--ink); display: grid; gap: 10px; min-width: 0; }
.ap-fail p { margin: 0; overflow-wrap: anywhere; }
.ap-fail .row { flex-wrap: wrap; gap: 8px; }
.ap-hint { margin: 0; color: var(--muted); font-size: 14px; }
.ap-more > summary, .ap-adv > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.ap-page-pick select { min-height: 40px; }
.ap-line-box { display: grid; gap: 4px; cursor: default; max-width: 720px; }
.ap-line-box .t { font-family: "TBV Newsreader", Georgia, serif; font-size: 18px; line-height: 1.35; }
.ap-line-box .btn { justify-self: start; min-height: 32px; padding-left: 0; color: var(--accent); }
/* an empty state that teaches: what is missing, why, and the one thing to do */
.ap-empty { display: grid; gap: 10px; padding: 16px 18px; border: 1px dashed #CFC7B9; border-radius: 14px; background: var(--panel); max-width: 720px; }
.ap-empty strong { font-size: 16px; }
.ap-how-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }

/* "More options": folded, a chevron that turns once on a press */
.ap-adv { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 0 14px; min-width: 0; }
.ap-adv > summary { list-style: none; font-size: 14px; color: var(--ink); }
.ap-adv > summary::-webkit-details-marker { display: none; }
.ap-adv > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: 0 0 auto; margin-right: 2px; }
.ap-adv[open] > summary::before { transform: rotate(45deg); }
.ap-adv-body { display: grid; gap: 14px; padding: 2px 0 16px; min-width: 0; }
.ap-adv-body .anim-panel { background: var(--soft); }

/* ---- story cards: a 9:16 still with Watch, then the story's name, the line, why ---- */
.ap-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1060px; }
.ap-panel .seg { justify-self: start; }
.ap-h { margin: 6px 0 0; font-size: 13px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ap-card { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; min-width: 0; }
.ap-card .anim-tile-cv, .ap-draft .anim-tile-cv { background: #000; }
.ap-card-media { position: relative; }
.ap-watch { position: absolute; left: 10px; bottom: 10px; min-height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28); background: rgba(10, 12, 15, .78); color: #fff; font: 600 14px "TBV Inter", sans-serif; cursor: pointer; }
.ap-watch:hover { background: rgba(10, 12, 15, .92); }
.ap-watch[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.ap-watch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-card-meta { display: grid; gap: 6px; padding: 12px 14px 14px; align-content: start; }
.ap-card-meta strong { font-size: 17px; }
.ap-card-sub { margin: 0; color: var(--muted); font-size: 13px; }
.ap-card-line { margin: 2px 0 0; font-family: "TBV Newsreader", Georgia, serif; font-size: 16px; line-height: 1.35; }
.ap-card-meta .btn { justify-self: start; margin-top: 6px; min-height: 40px; }
.ap-carousel { display: grid; gap: 8px; min-width: 0; }
.ap-dots { display: none; justify-content: center; gap: 2px; }
.ap-dot { width: 24px; height: 24px; padding: 0; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.ap-dot span { width: 8px; height: 8px; border-radius: 50%; background: #CFC7B9; }
.ap-dot[aria-pressed="true"] span { background: var(--accent); }

/* ---- the look picker (small stills, not names) and the colour swatches ---- */
.ap-look-field { gap: 8px; }
.ap-looks { display: grid; grid-template-columns: repeat(5, minmax(0, 92px)); gap: 10px; }
.ap-look { display: grid; gap: 6px; padding: 4px 4px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: inherit; cursor: pointer; text-align: center; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.ap-look:hover { border-color: #CFC7B9; }
.ap-look:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-look[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ap-look-cv { display: block; aspect-ratio: 9 / 13; overflow: hidden; border-radius: 8px; background: #000; }
.ap-look-cv canvas { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; }
.ap-look-name { font-size: 13px; font-weight: 600; }
.ap-look[aria-pressed="true"] .ap-look-name { color: var(--accent); }
.ap-look-blurb { margin: 0; }
.ap-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-swatch { display: grid; justify-items: center; gap: 4px; min-width: 60px; padding: 6px 6px 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; cursor: pointer; }
.ap-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ap-swatch-dot { display: block; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(20,19,17,.18); }

/* ---- an AI job's wait: what is happening, the usual time, the minutes so far, what to do meanwhile ---- */
.ap-wait { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--panel); min-width: 0; }
.ap-wait-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.ap-wait-head strong { font-size: 16px; }
.ap-wait-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.ap-wait-steps li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.ap-wait-steps li[data-state="now"] { color: var(--ink); font-weight: 600; }
.ap-wait-mark { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #CFC7B9; flex: 0 0 auto; }
.ap-wait-steps li[data-state="done"] .ap-wait-mark { background: var(--accent); border-color: var(--accent); }
.ap-wait-steps li[data-state="now"] .ap-wait-mark { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--panel), inset 0 0 0 6px var(--accent); }
.ap-wait-slot:empty { display: none; }

/* ---- Daily drafts: what it is, the status, the page with its On / Off, the deck ---- */
.ap-auto { display: grid; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); min-width: 0; }
.ap-auto-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: flex-start; }
.ap-auto-text { display: grid; gap: 4px; max-width: 70ch; }
.ap-auto-text h3 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 6px; }
.ap-auto-side { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ap-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.ap-pill.is-on { border-color: var(--accent); color: var(--accent); }
.ap-auto-body { display: grid; gap: 14px; min-width: 0; }
.ap-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 4px 0 0; border: 0; background: transparent; color: inherit; font: 600 15px "TBV Inter", sans-serif; cursor: pointer; justify-self: start; }
.ap-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ap-switch-track { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--soft); border: 1px solid #CFC7B9; flex: 0 0 auto; }
.ap-switch-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(20,19,17,.25); transition: transform .15s; }
.ap-switch[aria-checked="true"] .ap-switch-track { background: var(--accent); border-color: var(--accent); }
.ap-switch[aria-checked="true"] .ap-switch-knob { transform: translateX(18px); background: var(--on-accent); }
.ap-page-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-page-row .chip { min-height: 40px; padding: 0 16px; }
.ap-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.ap-page-text { display: grid; gap: 6px; }
.ap-page-head h3 { font-size: 20px; margin: 0; }
.ap-deck { display: grid; justify-items: center; }
.ap-draft { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; background: var(--panel); }
.ap-draft .anim-tile-cv { aspect-ratio: auto; min-height: 0; }
.ap-draft .anim-tile-cv canvas { height: 100%; width: auto; margin: 0 auto; }
.ap-approved { display: grid; gap: 8px; }
.ap-form { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); max-width: 720px; }
.ap-form h3 { font-size: 18px; margin: 0; }

/* More ways to start, and the footer */
.ap-more { border-top: 1px solid var(--line); padding-top: 10px; }
.ap-more-body { display: grid; gap: 16px; padding-top: 10px; }
.ap-foot { margin: 0 0 20px; color: var(--muted); font-size: 12px; }

/* ---- the editor: the preview, then the steps ---- */
.ap-ed { gap: 14px; }
.ap-ed-head { display: grid; gap: 4px; padding-top: 6px; }
.ap-back { justify-self: start; padding-left: 0; color: var(--accent); }
.ap-ed-title { font-family: "TBV Newsreader", Georgia, serif; font-weight: 560; font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); line-height: 1.1; }
.anim-editor.ap-editor { grid-template-columns: minmax(280px, 460px) minmax(0, 680px); justify-content: center; gap: 32px; } /* the steps sit next to the preview, not at the far edge */
.ap-editor .anim-frame { width: min(100%, 500px, calc((100vh - 200px) * .5625 + 20px)); }
.ap-editor .anim-transport { width: min(100%, 500px); }
.ap-editor .anim-cv { background: #000; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.anim-portal .frame { background: transparent; border: 0; box-shadow: none; padding: 0; }
.ap-editor .anim-controls { max-width: 680px; }
.ap-steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ap-steps li { flex: 1 1 auto; }
.ap-step { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--muted); font: 600 14px "TBV Inter", sans-serif; text-align: left; cursor: pointer; }
.ap-step:hover { border-color: #CFC7B9; }
.ap-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-step[data-state="now"] { border-color: var(--accent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.ap-step[data-state="now"] .ap-step-n { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.ap-step[data-state="done"] { color: var(--ink); }
.ap-step[data-state="done"] .ap-step-n { border-color: var(--accent); color: var(--accent); }
.ap-step-name { min-width: 0; line-height: 1.2; }
.ap-stepnav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 2px; }
.ap-stepnav .btn.primary { min-height: 44px; padding: 0 20px; }
.ap-stepnav-note { flex: 1 1 100%; margin: 0; }
.ap-story-name { margin: 0; font-size: 16px; }
.ap-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ap-choice { display: grid; gap: 4px; align-content: start; text-align: left; padding: 12px 14px; min-height: 64px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); color: inherit; cursor: pointer; }
.ap-choice strong { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 15px; }
.ap-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: linear-gradient(180deg, rgba(168, 68, 42, .08), transparent 80%), var(--soft); }
.ap-listen { gap: 10px; align-items: center; flex-wrap: wrap; }
.ap-make { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.ap-sum { margin: 0; display: grid; gap: 0; }
.ap-sum-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.ap-sum-row:first-child { border-top: 0; }
.ap-sum dt { color: var(--muted); font-size: 13px; }
.ap-sum dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ap-sum-act .btn { min-height: 32px; color: var(--accent); }
.ap-result:empty { display: none; }
.ap-result { display: grid; gap: 12px; }
.ap-res-title { margin: 0; font-size: 22px; }
.ap-res-title:focus { outline: none; }
.ap-res-main .btn.primary { min-height: 48px; padding: 0 22px; font-size: 16px; }
.ap-res-next { gap: 10px; flex-wrap: wrap; }
.ap-quick { display: grid; gap: 10px; }

/* gallery tiles (still used for the hand-made story crop) */
.anim-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.anim-tile { display: grid; grid-template-rows: auto 1fr; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; cursor: pointer; text-align: left; color: inherit; box-shadow: var(--shadow); transition: border-color .15s; }
.anim-tile:hover { border-color: #CFC7B9; }
.anim-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the tile shows the scene and the line, not the bottom 35 % the reels UI covers */
.anim-tile-cv { display: block; background: #1D1519; aspect-ratio: 9 / 11.5; overflow: hidden; }
.anim-tile-cv canvas { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; }
.anim-tile-meta { display: grid; gap: 4px; padding: 12px 14px 14px; }
.anim-tile-meta strong { font-size: 17px; }
.anim-beats { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 2px; font-size: 12.5px; color: var(--muted); }

/* the chosen line, the evidence notes */
.anim-vline { display: grid; gap: 4px; cursor: default; }
.anim-vline .btn { justify-self: start; min-height: 32px; padding-left: 0; }
.anim-why { margin: 2px 0 0; padding-left: 16px; display: grid; gap: 2px; font-size: 12px; color: var(--muted); }

/* More ways to start: the line, five big style tiles, story shape + length, Open */
.anim-gen { display: grid; gap: 14px; min-width: 0; }
.anim-styles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.anim-style { display: grid; grid-template-rows: auto 1fr; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; cursor: pointer; text-align: left; color: inherit; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.anim-style:hover { border-color: #CFC7B9; }
.anim-style[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.anim-style:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.anim-style-meta { display: grid; gap: 2px; padding: 10px 12px 12px; }
.anim-style-meta strong { font-size: 16px; }
.anim-gen-opts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.anim-gen-go { gap: 10px; align-items: center; flex-wrap: wrap; }
.anim-gen-go .btn[disabled] { opacity: .55; cursor: not-allowed; }
.anim-ai { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--soft); }

/* editor: the preview and the steps; one column under 980 px */
.anim-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 22px; align-items: start; }
.anim-controls { display: grid; gap: 14px; min-width: 0; }
.anim-panel { display: grid; gap: 12px; min-width: 0; }
.anim-panel h3 { margin: 0; }
.anim-field { display: grid; gap: 6px; min-width: 0; }
.anim-label { font-size: 13px; font-weight: 600; }
.anim-tpls { display: flex; flex-wrap: wrap; gap: 8px; }
.anim-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.anim-check { display: flex; gap: 10px; align-items: center; font-size: 14px; min-height: 32px; cursor: pointer; }
.anim-check input { width: 24px; height: 24px; accent-color: var(--accent); flex: 0 0 auto; }
.anim-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.anim-theme { display: grid; justify-items: center; gap: 6px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; color: inherit; }
.anim-theme[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.anim-theme:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.anim-theme-sw { position: relative; display: block; width: 52px; height: 84px; border-radius: 7px; border: 1px solid rgba(0,0,0,.18); }
.anim-theme-dot { position: absolute; left: 50%; top: 52%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid rgba(0,0,0,.35); }
.anim-cap { gap: 6px; }
.anim-cap .chip { min-height: 30px; font-size: 13px; }
.anim-stage { position: sticky; top: 80px; display: grid; gap: 10px; justify-items: center; min-width: 0; }
.anim-frame { width: min(100%, 400px, calc((100vh - 230px) * .5625 + 20px)); min-width: min(100%, 240px); }
.anim-cv { width: 100%; height: auto; aspect-ratio: 9 / 16; display: block; border-radius: 6px; background: #1D1519; }
.anim-transport { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 8px; align-items: center; width: min(100%, 400px); }
.anim-transport input[type=range] { min-width: 0; }
.anim-note { margin: 0; min-height: 18px; color: var(--warn); text-align: center; max-width: 400px; }
.anim-video { width: min(100%, 300px); border-radius: 8px; background: #000; display: block; }
.swatch-btn[disabled], .seg button[disabled] { opacity: .5; cursor: not-allowed; }

@media (max-width: 980px) {
  .anim-editor, .anim-editor.ap-editor { grid-template-columns: minmax(0, 1fr); }
  .anim-stage { position: static; order: -1; }
  .anim-gen-opts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .anim-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .anim-style-meta { padding: 8px 10px 10px; }
  .anim-style-meta strong { font-size: 15px; }
  .anim-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .anim-tile-meta { padding: 10px; }
  .anim-tile-meta strong { font-size: 15px; }
  .anim-two { grid-template-columns: minmax(0, 1fr); }
  .anim-transport { grid-template-columns: auto auto minmax(0, 1fr); }
  .anim-transport output { grid-column: 1 / -1; text-align: center; }
  .anim-frame { width: min(100%, 300px); }
  .ap-hero { padding-top: 0; }
  .ap-prompt { font-size: 17px !important; min-height: 92px; }
  .ap-go { max-width: none; }
  /* cards: a scroll-snap carousel with dots, 80 % cards, proximity snapping */
  .ap-cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 80%; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; padding-bottom: 4px; scrollbar-width: none; }
  .ap-cards::-webkit-scrollbar { display: none; }
  .ap-card { scroll-snap-align: start; }
  .ap-dots { display: flex; }
  .ap-card-meta { padding: 10px; }
  .ap-card-meta strong { font-size: 15px; }
  .ap-card-line { font-size: 14px; }
  .ap-card .anim-why, .ap-card .anim-beats { display: none; }
  .ap-looks { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .ap-look { padding: 3px 3px 6px; border-radius: 10px; }
  .ap-look-name { font-size: 12px; }
  .ap-swatch { min-width: 54px; }
  .ap-auto { padding: 14px; }
  .ap-auto-side { width: 100%; }
  .ap-auto-side .btn { flex: 1 1 auto; justify-content: center; }
  .ap-page-head .row { width: 100%; }
  .ap-page-head .btn.primary { flex: 1 1 auto; justify-content: center; }
  .ap-editor .anim-frame { width: min(100%, 300px); }
  .ap-steps ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .ap-step { flex-direction: column; gap: 4px; padding: 6px 4px; font-size: 12px; text-align: center; justify-content: center; }
  .ap-choices { grid-template-columns: minmax(0, 1fr); }
  .ap-stepnav .btn { flex: 1 1 auto; justify-content: center; }
  .ap-sum-row { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .ap-res-main .btn { flex: 1 1 100%; justify-content: center; }
}
/* the five hand-made stories: one compact row on a wide screen (their beats show in the editor's Story step) */
@media (min-width: 1100px) {
  .ap-cards.is-compact { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 1180px; gap: 12px; }
  .ap-cards.is-compact .anim-beats { display: none; }
  .ap-cards.is-compact .ap-card-meta strong { font-size: 16px; }
}
.ap-go[disabled] { opacity: .6; cursor: progress; }
.ap-make > .btn:not(.big), .anim-versions > .btn { justify-self: start; }

/* the one start: 1 your idea, 2 the look (already chosen), the button, what happens next (Kevin 2026-10-11 14:28) */
.ap-start { display: grid; gap: 16px; padding: 22px 24px 24px; border: 1px solid var(--accent); border-radius: 18px; background: linear-gradient(180deg, rgba(168, 68, 42, .08), transparent 55%), var(--panel); box-shadow: inset 0 0 0 1px rgba(168, 68, 42, .25); min-width: 0; }
.ap-start-q { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.ap-start-q2 { font-size: 17px; }
.ap-start-note { font-weight: 400; color: var(--muted); font-size: 15px; letter-spacing: 0; }
.ap-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 14px "TBV Inter", sans-serif; flex: 0 0 auto; }
.ap-start-look { display: grid; gap: 8px; }
.ap-start-look .ap-look-field > .anim-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* the "2 The look" line labels it */
.ap-next { margin: 0; font-size: 14px; color: var(--muted); max-width: 80ch; }
.ap-next strong { color: var(--ink); }
.ap-alt { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.ap-alt-label { flex: 1 1 100%; font-size: 13px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ap-alt-btn { flex: 1 1 280px; display: grid; gap: 2px; text-align: left; padding: 12px 16px; min-height: 56px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: inherit; cursor: pointer; max-width: 460px; }
.ap-alt-btn strong { font-size: 15px; }
.ap-alt-btn:hover { border-color: #CFC7B9; }
.ap-alt-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-alt-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ap-alt-h { margin: 0; font-size: 20px; }
.ap-panel[hidden] { display: none; }
@media (max-width: 760px) {
  .ap-start { padding: 16px 14px 18px; border-radius: 14px; }
  .ap-start-q { font-size: 19px; }
  .ap-start-q2 { font-size: 16px; }
  .ap-start-note { font-size: 14px; }
  .ap-alt-btn { flex: 1 1 100%; max-width: none; }
}
.ap-start-q > span:not(.ap-num) { flex: 1 1 0; min-width: 0; } /* the number and its words stay on one row on a phone */
@media (max-width: 380px) { .ap-look-name { font-size: 11px; } .ap-looks { gap: 4px; } }
@media (max-width: 380px) { .anim-transport { grid-template-columns: auto auto; justify-content: center; } .anim-transport input[type=range] { grid-column: 1 / -1; width: 100%; } }
/* One accent per screen (the calm-UI review, as Edit): the accent is the screen's one main action (Make my animation,
   Make the video now, Make the video); what is selected or current reads in ink on cream. */
.anim-portal .chip[aria-pressed="true"], .anim-portal .seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.ap-start { border-color: var(--line); background: var(--panel); box-shadow: none; }
.ap-num { background: var(--ink); color: var(--panel); }
.ap-step[data-state="now"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ap-step[data-state="now"] .ap-step-n { border-color: var(--ink); background: var(--ink); color: var(--panel); }
.ap-step[data-state="done"] .ap-step-n { border-color: var(--ink); color: var(--ink); }
.ap-look[aria-pressed="true"], .ap-swatch[aria-pressed="true"], .ap-choice[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ap-choice[aria-pressed="true"] { background: var(--soft); }
.ap-look[aria-pressed="true"] .ap-look-name { color: var(--ink); }
.anim-style[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.ap-watch[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.ap-switch[aria-checked="true"] .ap-switch-track { background: var(--ink); border-color: var(--ink); }
.ap-pill.is-on { border-color: var(--ink); color: var(--ink); }
.ap-back { color: var(--ink); }
