/* RASIK AI — «Галерея»: автомонтаж «Ролик под ключ» #/create, #/order/{id}/… (wizard.js) и прежние экраны app.js/extras.js:
   #/orders, #/balance, #/heroes, #/plan, #/invite, #/help. Owner: wizard screen agent. Loaded after gallery.css.
   Builds on the .g-* components and --g-* tokens; neutralises the «Монтажный стол» / polaroid leftovers of site.css and
   platform.css for the classes wizard.js still relies on (.fmt-card, .q-card, .dur, .rv-card, .cast-card …).
   Contents: 1 step frame & stepper · 2 sticky bar · 3 step «Идея» · 4 «Герои» + фото · 5 «Стиль» · 6 «Сценарий» ·
   7 «Портреты» + голоса · 8 «Запуск» · 9 производство · 10 «Кадры»/«Сцены» · 11 «Готово» + окна · 12 «Мои ролики» ·
   13 баланс · 14 друзья · 15 помощь · 16 мои герои · 17 контент-план · 18 phones · 19 reduced motion */

/* ---------- 1. step frame, page heads, order meta, stepper ---------- */
.wz-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.wz-head { margin-bottom: 28px; }
.wz-head .g-lead { max-width: 64ch; }
.wz-label { margin: 0 0 10px; font: 600 13px/1.35 var(--g-font-ui); color: var(--g-ink); }
.wz-n { flex: none; font: 600 12px/1.6 var(--g-font-ui); letter-spacing: .08em; color: var(--g-accent); font-variant-numeric: tabular-nums; }
.wz-skel { display: grid; }

.sc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 22px; }
.wz-body .sc-top { margin-bottom: 22px; }
.wz-body .stack-lg > .sc-top, .wz-body .writing > .sc-top, .wz-body .prod > .sc-top { margin-bottom: 0; }
.wz-oid { margin-right: 4px; font: 600 11.5px/1.4 var(--g-font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); font-variant-numeric: tabular-nums; }
.sc-top .g-tag svg { width: 14px; height: 14px; color: var(--g-accent); }

/* stepper «01 Идея · 02 Герои …»: nav.wz-steps > ol.g-steps (9 steps incl. the review stages) */
.wz-steps { position: relative; margin: 0 0 30px; }
.wz-steps .g-steps { position: relative; gap: 6px; margin: 0; }
.wz-steps .g-steps > li > a, .wz-steps .g-steps > li > span { display: block; min-height: 44px; padding: 10px 2px 12px; border: 0; border-bottom: 2px solid var(--g-line); border-radius: 0; background: none; color: var(--g-muted); font: 500 13px/1.3 var(--g-font-ui); text-align: left; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--g-dur), border-color var(--g-dur); }
.wz-steps .g-steps > li > a:focus-visible { outline-offset: -2px; }
.wz-steps .g-steps-n { color: var(--g-muted); }   /* upcoming numbers are text: AA (--g-faint is for icons and lines) */
.wz-steps .g-steps > li.is-done > * { color: var(--g-ink); border-bottom-color: var(--g-line-strong); }
.wz-steps .g-steps > li.is-done .g-steps-n, .wz-steps .g-steps > li.is-now .g-steps-n { color: var(--g-accent); }
.wz-steps .g-steps > li.is-done > a:hover { color: var(--g-accent); border-bottom-color: var(--g-accent); }
.wz-steps .g-steps > li.is-now > * { color: var(--g-ink); font-weight: 600; border-bottom-color: color-mix(in srgb, var(--g-accent) 45%, var(--g-line)); }
.wz-steps .g-steps > li.is-now > a:hover { color: var(--g-accent); border-bottom-color: var(--g-accent); }
.wz-steps .g-steps > li.is-current > * { color: var(--g-accent); font-weight: 600; border-bottom-color: var(--g-accent); }
.wz-steps .g-steps > li.is-current .g-steps-n { color: var(--g-accent); }
.wz-steps .g-steps > li.is-skip > * { opacity: .55; text-decoration: line-through; text-decoration-color: var(--g-line-strong); }
/* phones / narrow tablets: the stepper scrolls sideways. No scroll snapping — a snap after the focus scroll would push a
   focused step back off the screen; wizard.js keeps the focused (and the current) step fully in view instead */
@media (max-width: 899px) {
  .wz-steps .g-steps { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(88px, 1fr); overflow-x: auto; scrollbar-width: none; scroll-snap-type: none; margin: 0 calc(-1 * var(--g-gutter)); padding: 0 var(--g-gutter); scroll-padding: 0 var(--g-gutter); }
  .wz-steps .g-steps::-webkit-scrollbar { display: none; }
  .wz-steps .g-steps > li { scroll-snap-align: none; }
}
/* Windows high contrast: colours are replaced, so the states are told apart by shape — current step: a thick
   Highlight bar and a frame; done: a solid line; upcoming: a dotted line; skipped: struck through (above) */
@media (forced-colors: active) {
  .wz-steps .g-steps > li > a, .wz-steps .g-steps > li > span { border-bottom: 2px dotted GrayText; }
  .wz-steps .g-steps > li.is-done > *, .wz-steps .g-steps > li.is-now > * { border-bottom: 2px solid CanvasText; }
  .wz-steps .g-steps > li.is-done > a { border-bottom-color: LinkText; }
  .wz-steps .g-steps > li.is-current > *, .wz-steps .g-steps > li[aria-current="step"] > * { border-bottom: 5px solid Highlight; outline: 2px solid Highlight; outline-offset: -2px; font-weight: 700; }
  .wz-steps .g-steps > li.is-current .g-steps-n, .wz-steps .g-steps > li[aria-current="step"] .g-steps-n { text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- 2. sticky action bar (one main action per screen) ---------- */
.wz-bar { position: sticky; bottom: calc(var(--g-tabbar-space, 0px) + 12px); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 30px; padding: 12px 12px 12px 22px; border: 1px solid var(--g-line); border-radius: var(--g-r-md); background: var(--g-paper); box-shadow: var(--g-shadow-pop); }
.wz-bar .info { display: grid; gap: 2px; min-width: 0; }
.wz-bar .info b { font: 700 19px/1.25 var(--g-font-ui); color: var(--g-ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wz-bar .info span { font-size: 12.5px; line-height: 1.4; color: var(--g-muted); }
.wz-bar > .g-btn, .wz-bar > a.g-btn { flex: none; }
/* (i) «Подробнее»: shown by wizard.js only while a line of the bar is cut with «…»; it unfolds the full text */
.wz-bar .wz-more { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; margin: 0 -4px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--g-muted); cursor: pointer; }
.wz-bar .wz-more[hidden] { display: none; }
.wz-bar .wz-more:hover, .wz-bar .wz-more[aria-expanded="true"] { background: var(--g-soft); color: var(--g-accent); }
.wz-bar .wz-more svg { display: block; width: 22px; height: 22px; }
.wz-bar.is-open .info b, .wz-bar.is-open .info span { overflow: visible; white-space: normal; text-overflow: clip; }
/* short button labels for small phones (wizard.js btnLabel): the full label stays the accessible name */
.wz-bl-s { display: none; }
.wz-fine { max-width: 62ch; margin: 14px auto 0; text-align: center; font-size: 12.5px; line-height: 1.55; color: var(--g-muted); }

/* ---------- 3. step «Идея» (#/create) ---------- */
.wz-step { margin: 0 0 38px; }
.wz-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 16px; font: 700 18px/1.3 var(--g-font-ui); letter-spacing: -.005em; color: var(--g-ink); }
.view .wz-title .n { min-width: 22px; }
.wz-title.done::after { content: ""; align-self: center; width: 16px; height: 16px; background: var(--g-ok); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.wz-title .offpeak { height: auto; margin: 0; transform: none; border-radius: var(--g-r-xs); background: var(--g-accent-soft); }

/* format tiles */
.fmt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.view .fmt-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 128px; padding: 18px 16px; border: 1px solid var(--g-line); border-radius: var(--g-r-md); background: var(--g-paper); box-shadow: none; text-align: left; transform: none; }
.view .fmt-card:hover { border-color: var(--g-accent); }
.view .fmt-card .g-tile-ic svg { width: 22px; height: 22px; }
.view .fmt-card .ft { display: grid; gap: 5px; }
.view .fmt-card[aria-checked="true"]::after { content: "✓"; position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--g-accent); color: var(--g-on-accent); font: 700 12px/1 var(--g-font-ui); }
.view .fmt-card.fmt-gift { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 18px; min-height: 0; padding: 20px 22px; border-color: transparent; background: var(--g-soft); overflow: visible; }
.view .fmt-card.fmt-gift:hover { border-color: var(--g-accent); }
.view .fmt-card.fmt-gift[aria-checked="true"] { border-color: var(--g-accent); background: var(--g-accent-soft); }
.view .fmt-card.fmt-gift[aria-checked="true"]::after { top: 50%; right: 18px; transform: translateY(-50%); }
.view .fmt-card.fmt-gift .g-tile-ic svg { width: 26px; height: 26px; }
.view .fmt-card.fmt-gift strong { font: 400 21px/1.25 var(--g-font-display); letter-spacing: -.01em; }
.view .fmt-card.fmt-gift small { font-size: 13.5px; }
.wz-new { flex: none; margin-left: auto; }
.fmt-card.fmt-gift[aria-checked="true"] .wz-new { margin-right: 36px; }

/* gift box + content-plan hint */
.view .gift-box { display: grid; gap: 18px; margin: -18px 0 38px; padding: 22px; background: var(--g-soft); }
.view .gb-tpl-note { margin: -6px 0 0; font-size: 13px; }
.view .gb-tpl-note[hidden], .view .gb-pair[hidden] { display: none; }
.gb-head .g-eyebrow { margin-bottom: 6px; }
.gb-title { margin: 0; }
.gb-pair { align-items: start; }
.gb-pair .g-field, .gift-box .g-field { gap: 8px; }
.chips-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 1px 4px; -webkit-overflow-scrolling: touch; }
.chips-row::-webkit-scrollbar { display: none; }
.chips-row .g-chip { flex: none; }
@media (min-width: 640px) { .chips-row { flex-wrap: wrap; overflow: visible; } }
.view .cp-hint { margin: -18px 0 38px; border-style: solid; border-color: var(--g-line); background: var(--g-paper); }
.view .cp-hint:hover { border-color: var(--g-accent); }
.cp-hint .g-link, .resume-card .rc-go { flex: none; margin-left: auto; min-height: 0; padding: 0; }
.cp-hint .g-link svg, .resume-card .rc-go svg { width: 15px; height: 15px; color: currentColor; }
.view .resume-card { margin: 0 0 26px; padding: 16px 18px; border: 1px solid var(--g-line); background: var(--g-paper); transform: none; }
.view .resume-card:hover { border-color: var(--g-accent); transform: none; }

/* templates «Быстрый старт» */
.tpl-wrap { display: grid; gap: 10px; margin: 0 0 16px; }
.tpl-wrap .wz-label { margin: 0; }
.tpl-groups.g-seg { margin: 0; }
.tpl-groups.g-seg > button { height: auto; border: 1px solid transparent; border-radius: var(--g-r-xs); color: var(--g-ink); }
.tpl-groups.g-seg > button[aria-pressed="true"] { border-color: var(--g-line); background: var(--g-soft); color: var(--g-accent); box-shadow: none; }
.tpl-groups.g-seg > button:hover:not([aria-pressed="true"]) { border-color: var(--g-line); }
.tpl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.view .tpl-row { scroll-snap-type: none; }   /* site.css snaps chips: a snap after the focus scroll hid the focused chip */
.view .tpl-row .tpl-chip { scroll-snap-align: none; }
.view .tpl-chip { height: auto; padding: 8px 14px; border-style: solid; border-radius: var(--g-r-xs); font-weight: 500; }
.tpl-chip .tc-f { display: inline-grid; color: var(--g-accent); }
.tpl-chip .tc-f svg { width: 14px; height: 14px; }
.view .tpl-form { display: grid; gap: 14px; margin-top: 4px; padding: 18px; background: var(--g-soft); }
.tf-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tf-h b { font: 600 15px/1.35 var(--g-font-ui); }
.tf-h small { font-size: 12.5px; color: var(--g-muted); }
.tf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

/* idea field */
.idea-box { position: relative; }
.idea-box .g-textarea { min-height: 164px; padding-bottom: 44px; font-size: 15px; line-height: 1.65; }
.idea-meta { position: absolute; left: 14px; right: 14px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--g-muted); pointer-events: none; font-variant-numeric: tabular-nums; }
#ideaHint.ok { display: inline-flex; align-items: center; gap: 6px; color: var(--g-ok); font-weight: 600; }
#ideaHint.ok::before { content: ""; width: 13px; height: 13px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.idea-ex { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; }
.idea-ex .g-link { min-height: 32px; padding: 6px 0; white-space: normal; text-align: left; font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px; }
.idea-ex .g-link:empty { display: none; }
.lang-row { display: grid; gap: 10px; margin-top: 22px; }
.lang-row .wz-label { margin: 0; }

/* quality & duration tiles */
.q-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.view .q-card { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-height: 0; padding: 18px; border: 1px solid var(--g-line); border-radius: var(--g-r-md); background: var(--g-paper); box-shadow: none; transform: none; }
.view .q-card.q-cinema { background: var(--g-paper); border-color: var(--g-line); }
.view .q-card:hover { border-color: var(--g-accent); }
.qc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 26px; }
.qc-top strong { font: 600 16px/1.3 var(--g-font-ui); }
.view .qc-sub { font-size: 12.5px; line-height: 1.45; color: var(--g-muted); }
.view .qc-price { margin-top: auto; padding-top: 6px; font: 700 17px/1.2 var(--g-font-ui); color: var(--g-ink); font-variant-numeric: tabular-nums; }
.view .qc-price small { font: 500 12.5px/1 var(--g-font-ui); color: var(--g-muted); }
.dur-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.view .dur { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 0; padding: 14px; border: 1px solid var(--g-line); border-radius: var(--g-r-md); background: var(--g-paper); box-shadow: none; text-align: left; }
.view .dur:hover { border-color: var(--g-accent); }
.view .dur strong { font: 700 18px/1.2 var(--g-font-ui); font-variant-numeric: tabular-nums; }
.view .dur .g-tile-meta { margin: 0; font: 500 13px/1.3 var(--g-font-ui); color: var(--g-muted); }
.view .dur[aria-checked="true"] .g-tile-meta { color: var(--g-ink); font-weight: 600; }

/* ---------- 4. step «Герои»: briefing, idea card, questions, photo references ---------- */
.view .brief-anim { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; margin: 0; padding: 28px; overflow: hidden; }
.ba-idea-wrap { padding-right: 28px; border-right: 1px solid var(--g-line); }
.ba-idea-wrap .g-eyebrow { margin-bottom: 8px; }
.view .ba-idea { margin: 0; font: 400 19px/1.5 var(--g-font-display); color: var(--g-ink); -webkit-line-clamp: 5; }
.ba-gift { display: flex; align-items: center; gap: 7px; margin: 12px 0 0; }
.ba-gift svg { width: 15px; height: 15px; flex: none; color: var(--g-accent); }
.ba-text h2 { display: flex; align-items: center; gap: 10px; }
.ba-text h2 .spinner, .writer-head .spinner { color: var(--g-accent); }
.view .ba-text p { min-height: 1.6em; margin: 8px 0 16px; font-size: 14.5px; color: var(--g-muted); transition: opacity .3s; }
.wz-indet > i { width: 34%; animation: wz-indet 1.6s var(--g-ease) infinite; }
@keyframes wz-indet { from { transform: translateX(-110%); } to { transform: translateX(310%); } }

.view .idea-card { display: grid; gap: 10px; margin: 0 0 22px; padding: 20px; border: 0; background: var(--g-soft); }
.view .ic-ta { min-height: 100px; resize: vertical; background: var(--g-paper); font-size: 15.5px; line-height: 1.6; }
.ic-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.ic-foot .g-link { padding: 8px 4px; }
.lib-pick { display: grid; gap: 12px; margin: 0 0 26px; }
.view .lib-imp { padding: 16px; border: 0; }
.li-h { display: grid; gap: 2px; }
.li-h b { font: 600 14.5px/1.35 var(--g-font-ui); }
.li-h small { font-size: 12.5px; color: var(--g-muted); }
.li-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.view .li-pol { display: grid; gap: 6px; width: 84px; margin: 0; padding: 0; background: none; box-shadow: none; transform: none; }
.view .li-img { aspect-ratio: 1; overflow: hidden; border-radius: var(--g-r-xs); background: var(--g-soft-2); }
.view .li-pol figcaption { position: static; overflow: hidden; text-align: left; white-space: nowrap; text-overflow: ellipsis; }
.view .lib-btn { border-style: solid; }
.wz-sec-head { margin: 0 0 14px; }
.hero-qs { display: grid; gap: 16px; margin: 0 0 20px; }
.view .hero-q { display: grid; gap: 18px; align-content: start; }
.hq-head { display: flex; align-items: center; gap: 12px; }
.hq-head h3 { margin: 0; }
.hq-head small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--g-muted); }
.view .hq-ava { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid color-mix(in srgb, var(--c, var(--g-accent)) 32%, var(--g-paper)); border-radius: 50%; background: color-mix(in srgb, var(--c, var(--g-accent)) 13%, var(--g-paper)); color: var(--c, var(--g-accent)); font: 400 19px/1 var(--g-font-display); transform: none; box-shadow: none; }
.opt-row { margin: 0; }
.view .wz-extra { padding: 20px; }
.view .wz-extra .g-label { font: 400 18px/1.4 var(--g-font-display); letter-spacing: -.01em; }

/* photo references (.refs blocks: hero questions, script step, cast cards) */
.view .refs { display: grid; gap: 12px; padding: 16px; border: 1px dashed var(--g-line-strong); border-radius: var(--g-r-xs); background: var(--g-soft); }
.view .refs.drag { border-color: var(--g-accent); border-style: solid; background: var(--g-accent-soft); }
.view .refs.has-poor { border-color: var(--g-warn); border-style: solid; }
.refs-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.view .refs-h b { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font: 600 14px/1.35 var(--g-font-ui); }
.refs-h b svg { width: 17px; height: 17px; flex: none; color: var(--g-accent); }
.refs-h span { font-size: 12.5px; color: var(--g-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.refs-thumbs { display: flex; flex-wrap: wrap; gap: 14px 12px; padding: 6px 2px 2px; }
.view .ref-pol { position: relative; display: grid; gap: 6px; width: 84px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; transform: none; }
.view .ref-img { aspect-ratio: 1; overflow: hidden; border-radius: var(--g-r-xs); background: var(--g-soft-2); }
.view .ref-pol figcaption { position: static; display: flex; justify-content: flex-start; }
.view .ref-q { padding: 2px 6px; border-radius: var(--g-r-xs); font: 600 11px/1.3 var(--g-font-ui); white-space: nowrap; }
.view .ref-q.q-good { background: var(--g-ok-soft); color: var(--g-ok); }
.view .ref-q.q-ok { background: var(--g-info-soft); color: var(--g-info); }
.view .ref-q.q-poor { background: var(--g-warn-soft); color: var(--g-warn); }
.view .ref-del { position: absolute; top: -10px; right: -10px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--g-line-strong); border-radius: 50%; background: var(--g-paper); color: var(--g-danger); box-shadow: var(--g-shadow-sm); cursor: pointer; }
.view .ref-del::before { content: ""; position: absolute; inset: -6px; }
.view .ref-del:hover { background: var(--g-danger-soft); }
.view .refs-poor-tips { border-radius: var(--g-r-xs); background: var(--g-warn-soft); }
.view .refs-kind { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-paper); }
.view .refs-kind button { min-height: 40px; padding: 4px 6px; border: 0; border-radius: var(--g-r-xs); background: none; color: var(--g-muted); font: 600 12.5px/1.2 var(--g-font-ui); cursor: pointer; }
.view .refs-kind button:hover { color: var(--g-ink); }
.view .refs-kind button[aria-checked="true"] { background: var(--g-accent-soft); color: var(--g-accent); }
.view .refs-consent { min-height: 0; padding: 2px 0; font-size: 13px; line-height: 1.45; }
.view .refs-drop, .view .upl-drop { display: grid; justify-items: center; gap: 2px; width: 100%; min-height: 44px; padding: 14px; border: 1px dashed var(--g-line-strong); border-radius: var(--g-r-xs); background: var(--g-paper); color: var(--g-ink); text-align: center; cursor: pointer; transition: border-color var(--g-dur), background-color var(--g-dur); }
.view .refs-drop:hover, .view .upl-drop:hover, .music-card.drag .upl-drop { border-color: var(--g-accent); background: var(--g-accent-soft); }
.refs-drop .rd-ic svg, .upl-drop > span svg { width: 20px; height: 20px; color: var(--g-accent); }
.refs-drop b, .upl-drop b { font: 600 14px/1.35 var(--g-font-ui); }
.refs-drop small, .upl-drop small { font-size: 12px; color: var(--g-muted); }
.refs-prog, .upl-prog { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.view .refs-prog .progress, .view .upl-prog .progress { flex: 1; height: 4px; border: 0; }
.view .refs-tip { position: relative; margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--g-muted); }
.view .refs-tip::before { content: ""; position: absolute; left: 3px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--g-accent); font: inherit; }
.view .refs-tip.ok { color: var(--g-ok); }
.view .refs-tip.ok::before { content: ""; background: var(--g-ok); }
.view .refs-tip.warn { color: var(--g-warn); }
.view .refs-tip.warn::before { content: ""; background: var(--g-warn); }
.view .refs-help { padding-top: 6px; border-top: 1px solid var(--g-line); }
.view .refs-help summary { min-height: 40px; }
.rh-body { display: grid; gap: 10px; margin-top: 8px; }
.view .rh-col { padding: 12px 14px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-paper); }
.rh-col b { font: 600 13px/1.35 var(--g-font-ui); }
.view .rh-col ul { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.view .rh-col li { position: relative; display: block; padding-left: 20px; font-size: 12.5px; line-height: 1.45; }
.rh-col li::before { content: ""; position: absolute; left: 0; top: .2em; width: 13px; height: 13px; background: var(--g-ok); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.rh-dont li::before { background: var(--g-danger); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 4l8 8M12 4l-8 8'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 4l8 8M12 4l-8 8'/%3E%3C/svg%3E") center / contain no-repeat; }
.view .refs.compact { gap: 10px; padding: 12px; }
.view .refs.compact .ref-pol { width: 62px; padding: 0; }
.view .refs.compact .refs-kind { grid-template-columns: 1fr 1fr; }
.view .refs.compact .refs-kind button { min-height: 40px; font-size: 12.5px; }
.view .ref-nudge { display: grid; gap: 10px; font-weight: 600; }
.view .ref-nudge .g-btn { justify-self: start; }

/* ---------- 5. step «Стиль» ---------- */
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; padding-top: 0; }
@media (min-width: 640px) { .style-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 18px; } }
.style-grid.one { grid-template-columns: minmax(0, 300px); justify-content: start; }
.view .style-card { position: relative; display: grid; align-content: start; gap: 0; padding: 0; border: 0; border-radius: var(--g-r-xs); background: none; color: var(--g-ink); box-shadow: none; text-align: left; transform: none; outline: 0; cursor: pointer; }
.view div.style-card { cursor: default; }
.view .style-card:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 4px; }
.view button.style-card:hover, .view button.style-card:active, .view .style-card[aria-checked="true"] { transform: none; box-shadow: none; }
.view .sc-media { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--g-r-xs); background: var(--g-soft-2); transition: outline-color var(--g-dur); outline: 2px solid transparent; outline-offset: 3px; }
.view .sc-media img { transition: opacity .4s, transform .5s var(--g-ease); }
.view button.style-card:hover .sc-media img { transform: scale(1.025); }
.view .style-card[aria-checked="true"] .sc-media { outline-color: var(--g-accent); }
/* style card without a preview file (/api/styles preview: null): a typographic «specimen» — every style has its own
   composition drawn in CSS (data-look), the motto in caps and the name in Prata. Like a picture, the specimen keeps its
   colours in both themes; each text colour is AA on its own background. With a preview the <img> covers it. */
.view .sc-spec { position: absolute; inset: 0; z-index: 0; display: grid; align-content: end; gap: 6px; padding: 14px 14px 16px; overflow: hidden; isolation: isolate; container-type: inline-size; background: linear-gradient(160deg, var(--g-soft), var(--g-soft-2)); color: var(--g-ink); text-align: left; }
.view .sc-media > img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.sc-spec::before, .sc-spec::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.view .sc-spec-k { font: 700 10.5px/1.35 var(--g-font-ui); letter-spacing: .14em; text-transform: uppercase; opacity: .86; }
.view .sc-spec-t { font: 400 clamp(15px, 13cqi, 26px)/1.12 var(--g-font-display); font-style: normal; letter-spacing: -.01em; overflow-wrap: break-word; hyphens: manual; text-wrap: balance; }
.view .sc-spec.ph-1 { background: linear-gradient(200deg, var(--g-soft-2), var(--g-soft)); }
.view .sc-spec.ph-2 { background: linear-gradient(135deg, var(--g-accent-soft), var(--g-soft)); }
.view .sc-spec.ph-3 { background: linear-gradient(180deg, var(--g-soft), var(--g-accent-soft)); }
.view .sc-spec.ph-4 { background: linear-gradient(110deg, var(--g-soft-2), var(--g-accent-soft)); }
/* 3D-мультфильм: glossy spheres in warm light */
.view .sc-spec[data-look="pixar3d"] { background: linear-gradient(165deg, #FCE7CF, #F3BE97); color: #3A1D10; }
.sc-spec[data-look="pixar3d"]::before { width: 66%; aspect-ratio: 1; right: -10%; top: -8%; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #FFF6EA 0 7%, #FFC992 22%, #E07B4E 62%, #A9472A 100%); box-shadow: 0 18px 32px rgba(110, 45, 18, .28); }
.sc-spec[data-look="pixar3d"]::after { width: 28%; aspect-ratio: 1; left: 10%; top: 20%; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #F2FFFB 0 8%, #8FD3C4 30%, #2F8C7E 100%); box-shadow: 0 10px 18px rgba(20, 80, 70, .25); }
/* Кино-реализм: letterbox, evening light */
.view .sc-spec[data-look="realism"] { padding-bottom: calc(14% + 12px); background: linear-gradient(180deg, #0D0E10 0 13%, transparent 13% 87%, #0D0E10 87%), radial-gradient(circle at 72% 40%, rgba(255, 190, 120, .62), transparent 46%), linear-gradient(180deg, #3D4B57, #1E262E); color: #F5F1EA; }
.sc-spec[data-look="realism"]::before { left: 0; right: 0; top: 56%; height: 1px; background: rgba(255, 220, 180, .35); }
/* Аниме: speed lines and a red sun */
.view .sc-spec[data-look="anime"] { background: #FFF0F3; color: #3A0B1C; }
.sc-spec[data-look="anime"]::before { inset: 0; background: repeating-conic-gradient(from 0deg at 82% 18%, rgba(214, 51, 108, .17) 0 3deg, transparent 3deg 10deg); }
.sc-spec[data-look="anime"]::after { width: 42%; aspect-ratio: 1; right: 8%; top: 8%; border-radius: 50%; background: #E2456F; }
/* Пластилин: soft hand-made blobs */
.view .sc-spec[data-look="clay"] { background: #ECDFCB; color: #33240F; }
.sc-spec[data-look="clay"]::before { width: 58%; aspect-ratio: 1.1; right: -6%; top: 6%; border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; background: #D9774B; box-shadow: inset -10px -14px 0 rgba(0, 0, 0, .13), inset 8px 10px 0 rgba(255, 255, 255, .28); }
.sc-spec[data-look="clay"]::after { width: 30%; aspect-ratio: 1; left: 12%; top: 16%; border-radius: 61% 39% 46% 54% / 52% 61% 39% 48%; background: #6E9E7B; box-shadow: inset -6px -8px 0 rgba(0, 0, 0, .14), inset 5px 6px 0 rgba(255, 255, 255, .25); }
/* Классика 2D: flat colour with an ink outline */
.view .sc-spec[data-look="classic2d"] { background: #FFF7E3; color: #222018; }
.sc-spec[data-look="classic2d"]::before { width: 52%; aspect-ratio: 1; right: 8%; top: 9%; border: 3px solid #26231D; border-radius: 50%; background: #F4C542; }
.sc-spec[data-look="classic2d"]::after { width: 34%; aspect-ratio: 1.3; left: 10%; top: 26%; border: 3px solid #26231D; border-radius: 10px; background: #E2563B; transform: rotate(-8deg); }
/* Акварель: washes of colour */
.view .sc-spec[data-look="watercolor"] { background: #FBF8F1; color: #26303D; }
.sc-spec[data-look="watercolor"]::before { inset: -12% -12% 30%; background: radial-gradient(circle at 30% 34%, rgba(102, 158, 214, .58), transparent 52%), radial-gradient(circle at 70% 46%, rgba(230, 136, 168, .52), transparent 48%), radial-gradient(circle at 48% 70%, rgba(238, 196, 104, .48), transparent 50%); filter: blur(7px); }
.view .sc-spec[data-look="watercolor"] .sc-spec-t { font-style: italic; }
/* Комикс: halftone and a speech balloon */
.view .sc-spec[data-look="comic"] { background: #FFE04D; color: #141210; }
.sc-spec[data-look="comic"]::before { inset: 0; background: radial-gradient(circle, rgba(20, 18, 16, .2) 24%, transparent 26%) 0 0 / 11px 11px; -webkit-mask: linear-gradient(200deg, #000 20%, transparent 70%); mask: linear-gradient(200deg, #000 20%, transparent 70%); }
.sc-spec[data-look="comic"]::after { width: 46%; height: 26%; right: 9%; top: 9%; border: 3px solid #141210; border-radius: 50%; background: #fff; }
.view .sc-spec[data-look="comic"] .sc-spec-t { font: 800 clamp(14px, 11cqi, 22px)/1.08 var(--g-font-ui); letter-spacing: .01em; text-transform: uppercase; }
/* Стоп-моушн: felt, stitches and a button */
.view .sc-spec[data-look="puppet"] { padding: 20px 20px 22px; background: #D2BE9F; color: #2A1D10; }
.sc-spec[data-look="puppet"]::before { inset: 9px; border: 2px dashed rgba(58, 38, 18, .55); border-radius: 10px; }
.sc-spec[data-look="puppet"]::after { width: 30%; aspect-ratio: 1; right: 14%; top: 13%; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #2A1D10 0 5%, transparent 6%), radial-gradient(circle at 60% 40%, #2A1D10 0 5%, transparent 6%), radial-gradient(circle at 40% 60%, #2A1D10 0 5%, transparent 6%), radial-gradient(circle at 60% 60%, #2A1D10 0 5%, transparent 6%), #9B4F3B; box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .12); }
/* Аппликация: cut paper layers */
.view .sc-spec[data-look="paper"] { background: #F3EEE3; color: #26241F; }
.sc-spec[data-look="paper"]::before { width: 44%; height: 30%; left: 12%; top: 11%; background: #E07A5F; box-shadow: 12px 12px 0 #F2CC8F, 24px 24px 0 #81B29A; transform: rotate(-6deg); }
/* Нуар: dark room, a slatted beam of light */
.view .sc-spec[data-look="noir"] { background: #121212; color: #F3F0EA; }
.sc-spec[data-look="noir"]::before { inset: 0; background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .17) 32% 56%, transparent 56%); }
.sc-spec[data-look="noir"]::after { inset: 0 0 34% 46%; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .09) 0 6px, transparent 6px 15px); }
.view .sc-rec { z-index: 2; left: 10px; top: 10px; padding: 3px 8px; border-radius: var(--g-r-xs); background: var(--g-media-chip); color: var(--g-media-chip-ink); font: 600 11px/1.4 var(--g-font-ui); letter-spacing: .02em; }
.wz-check { position: absolute; right: 10px; top: 10px; z-index: 3; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--g-accent); color: var(--g-on-accent); transform: scale(0); transition: transform .2s var(--g-ease); pointer-events: none; }
.wz-check svg { width: 15px; height: 15px; }
.style-card[aria-checked="true"] .wz-check, .hp-card[aria-checked="true"] .wz-check { transform: scale(1); }
.sc-body { display: grid; gap: 4px; padding: 12px 2px 0; }
.sc-name { font: 600 15px/1.3 var(--g-font-ui); }
.style-card[aria-checked="true"] .sc-name { color: var(--g-accent); }
.view .sc-desc { display: block; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--g-muted); }
.view .sc-fit { justify-self: start; margin-top: 4px; padding: 2px 7px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); font: 500 11.5px/1.4 var(--g-font-ui); color: var(--g-muted); }
.view .style-card.is-rec .sc-fit { border-style: solid; border-color: color-mix(in srgb, var(--g-accent) 40%, var(--g-line)); color: var(--g-accent); }

/* ---------- 6. step «Сценарий»: writing, script page, tools, manual editor ---------- */
.writing, .prod { display: grid; gap: 20px; }
.writing > .wz-head, .prod > .wz-head, .stack-lg > .wz-head { margin-bottom: 0; }
.writer { display: grid; gap: 22px; padding: 24px; }
.writer-head { display: flex; align-items: center; gap: 14px; }
.writer-head .spinner { width: 20px; height: 20px; }
.view .writer-head p { min-height: 1.5em; margin: 4px 0 0; font-size: 14.5px; color: var(--g-muted); transition: opacity .3s; }
.skel-script { display: grid; gap: 14px; }
.skel-script .g-skel-line { margin: 0; }
.view .skel-scene { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding-top: 14px; border-top: 1px solid var(--g-line); }

.view .script-card { display: grid; gap: 26px; padding: 30px; overflow: hidden; }
.view .script-card::before { display: none; }
.sc-head .g-eyebrow { margin-bottom: 8px; }
.view .sc-title { margin: 0 0 10px; }
.view .sc-log { margin: 0; }
.view .hook { padding: 16px 18px; border: 0; border-left: 2px solid var(--g-accent); border-radius: 0; background: var(--g-soft); transform: none; }
.view .hook .g-eyebrow { margin-bottom: 6px; font-size: 11.5px; font-weight: 600; line-height: 1.4; }
.view .hook p:not(.g-eyebrow) { margin: 0; font-size: 15.5px; font-weight: 500; line-height: 1.6; }
.chars { display: flex; flex-wrap: wrap; gap: 8px; }
.view .char { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--g-line); border-radius: var(--g-r-pill); background: var(--g-paper); font-size: 14px; font-weight: 500; }
.view .char i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c, var(--g-accent)); color: var(--g-paper); font: 700 12px/1 var(--g-font-ui); font-style: normal; }
.sc-sec { margin-bottom: 4px; }
.sc-sec .g-eyebrow { margin: 0; }
.view .timeline { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--g-line); }
.view .tl-scene, .view .tl-scene:first-child, .view .tl-scene:last-child { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--g-line); }
.tl-scene.fb .wz-n { color: var(--g-warn); }
.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.tl-meta:not(:has(.g-tag)) { margin-bottom: 0; }
.view .tl-sum { margin: 0; font-size: 15.5px; line-height: 1.6; }
.lines { display: grid; gap: 8px; margin-top: 12px; }
.view .dl-line { display: grid; gap: 2px; width: fit-content; max-width: 100%; padding: 9px 14px; border: 0; border-left: 2px solid var(--g-line-strong); border-radius: 0; background: var(--g-soft); }
.view .dl-line b { font: 700 12px/1.4 var(--g-font-ui); color: var(--c, var(--g-accent)); }
.view .dl-line span { font-size: 14.5px; line-height: 1.55; color: var(--g-ink); }
.view .caption-box { padding: 16px 18px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-soft); font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.caption-box .g-eyebrow { margin-bottom: 8px; white-space: normal; }

.wz-tools { display: grid; gap: 20px; padding: 22px; }
.wz-tools-q { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; }
.wz-tools-q .g-caption { margin-top: 4px; }
.wz-seg-price > button { flex-direction: column; gap: 2px; min-height: 54px; padding: 8px 16px; }
.wz-seg-price small { font-size: 12px; }
.sc-actions { display: grid; gap: 4px; }
.wz-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wz-row3 > button { min-width: 0; padding: 10px 12px; white-space: normal; line-height: 1.25; }
.view .rev-count { margin: 8px 0 0; text-align: center; }
.view .refs-card { padding: 0; }
.view .refs-card > summary { position: relative; display: grid; gap: 3px; min-height: 44px; padding: 18px 52px 18px 22px; list-style: none; cursor: pointer; }
.refs-card > summary::-webkit-details-marker { display: none; }
.refs-card > summary::after { content: ""; position: absolute; right: 22px; top: 50%; width: 12px; height: 8px; margin-top: -4px; background: var(--g-chevron) center / contain no-repeat; transition: transform var(--g-dur); }
.refs-card[open] > summary::after { transform: rotate(180deg); }
.view .refs-card > summary small { font-size: 13px; color: var(--g-muted); }
.view .refs-list { display: grid; gap: 18px; padding: 0 22px 22px; }
.refs-row { display: grid; gap: 8px; }
.refs-row .wz-label { margin: 0; }

.view .script-edit { display: grid; gap: 18px; padding: 24px; }
.se-head .g-eyebrow { margin-bottom: 6px; }
.se-head .g-caption { margin-top: 6px; }
.se-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.view .se-scene { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-soft); }
.se-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.se-meta { display: flex; flex: 1; flex-wrap: wrap; gap: 6px; min-width: 0; }
.se-tools { display: flex; flex: none; gap: 6px; }
.view .se-tool { width: 40px; height: 40px; font: 700 16px/1 var(--g-font-ui); color: var(--g-ink); }
.view .se-tool svg { width: 17px; height: 17px; }
.view .se-tool:disabled { opacity: .4; cursor: not-allowed; }
.view .se-tool.del { color: var(--g-danger); }
.view .se-tool.del:hover:not(:disabled) { border-color: var(--g-danger); background: var(--g-danger-soft); }
.view .se-sum { min-height: 64px; resize: vertical; background: var(--g-paper); }
.se-lines { display: grid; gap: 10px; }
.se-line { display: grid; gap: 4px; }
.view .se-sp { font: 700 12px/1.4 var(--g-font-ui); color: var(--c, var(--g-accent)); }
.se-in { position: relative; }
.view .se-in .g-input { padding-right: 66px; background: var(--g-paper); }
.se-cnt { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--g-muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.se-cnt.max { color: var(--g-danger); font-weight: 700; }
.view .se-actions { position: sticky; bottom: calc(var(--g-tabbar-space, 0px) + 12px); z-index: 5; display: flex; justify-content: flex-end; gap: 10px; margin: 4px -12px -12px; padding: 12px; border-top: 1px solid var(--g-line); border-radius: 0 0 var(--g-r-xs) var(--g-r-xs); background: var(--g-paper); }

/* ---------- 7. step «Портреты» (cast) + voices ---------- */
.cast-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; padding-top: 0; }
@media (min-width: 700px) { .cast-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; } }
.cast-grid:has(> .cast-card:only-child) { grid-template-columns: minmax(0, 340px); justify-content: start; }
.cast-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; min-width: 0; }
.wz-frame { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; transform: none; }
.view .cast-media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--g-r-xs); background: var(--g-soft-2); }
.view .cast-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.view .cast-gen, .view .cast-fail { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; padding: 12px; overflow: hidden; background: var(--g-soft-2); color: var(--g-muted); text-align: center; }
.view .cast-gen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--g-paper) 55%, transparent) 50%, transparent 70%); transform: translateX(-100%); animation: g-shimmer 1.6s infinite; }
.cast-gen .spinner { width: 22px; height: 22px; color: var(--g-accent); }
.wz-media-t { position: relative; font: 600 13px/1.35 var(--g-font-ui); color: var(--g-ink); }
.view .cast-fail { background: var(--g-danger-soft); color: var(--g-danger); }
.cast-fail svg { width: 24px; height: 24px; }
.view .cast-fail small { font-size: 12px; line-height: 1.4; color: var(--g-ink); }
/* caption under a frame: «01 Сцена 1» + status chip. In a narrow card (2 columns at 320 px ≈ 136 px) the chip wraps
   under the title instead of pushing the card out of its grid track */
.wz-cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; min-width: 0; }
.wz-cap .cn { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin: 0; overflow: hidden; font: 600 15px/1.3 var(--g-font-ui); color: var(--g-ink); white-space: nowrap; text-overflow: ellipsis; }
.wz-cap .cn .g-steps-n { margin: 0; color: var(--g-accent); }
.wz-cap .cs { flex: none; }
.wz-cap .cs:empty { display: none; }
.view .voice-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 8px 8px 12px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-paper); }
.vr-k svg { width: 18px; height: 18px; color: var(--g-accent); }
.vr-t { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.view .vr-t small { font: 600 11px/1.4 var(--g-font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); }
.vr-t b { overflow: hidden; font: 600 14px/1.3 var(--g-font-ui); white-space: nowrap; text-overflow: ellipsis; }
.cast-fb { gap: 8px; }
.view .cast-fb .g-textarea { min-height: 76px; resize: vertical; }
.cast-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.cast-actions .g-btn-secondary { white-space: normal; text-align: left; }
.view .cast-left { text-align: left; }
.view .cast-card.is-gen .cast-fb { opacity: .7; }

.vp-list { display: grid; gap: 6px; max-height: min(52vh, 460px); overflow-y: auto; padding: 2px; }
.view .vp-item, #modal .vp-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 6px 12px 6px 6px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-paper); color: var(--g-ink); text-align: left; cursor: pointer; }
#modal .vp-item:hover { border-color: var(--g-line-strong); }
#modal .vp-item[aria-checked="true"] { border-color: var(--g-accent); background: var(--g-accent-soft); }
#modal .vp-play { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--g-accent); color: var(--g-on-accent); cursor: pointer; }
#modal .vp-play.ghost { background: var(--g-soft); color: var(--g-accent); }
#modal .vp-play svg { width: 18px; height: 18px; }
.vp-ic-play { width: 0; height: 0; margin-left: 3px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent currentColor; }
.vp-ic-pause { width: 11px; height: 13px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
#modal .vp-t b { font: 600 15px/1.3 var(--g-font-ui); }
#modal .vp-t small { font-size: 12.5px; color: var(--g-muted); }
#modal .vp-badges i { padding: 1px 7px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: none; color: var(--g-muted); font: 500 11.5px/1.5 var(--g-font-ui); font-style: normal; }
#modal .vp-dot { border-color: var(--g-muted); }
#modal .vp-item[aria-checked="true"] .vp-dot { border-color: var(--g-accent); }
#modal .vc-card { padding: 0; }
#modal .vc-card > summary { display: grid; gap: 2px; min-height: 44px; padding: 14px 16px; list-style: none; cursor: pointer; }
#modal .vc-card > summary::-webkit-details-marker { display: none; }
#modal .vc-card > summary span { font: 600 15px/1.35 var(--g-font-ui); }
#modal .vc-card > summary small { font-size: 12.5px; color: var(--g-muted); }
#modal .vc-body { display: grid; gap: 12px; padding: 0 16px 16px; }
.vc-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.vc-time { min-width: 42px; font: 700 14px/1 var(--g-font-ui); font-variant-numeric: tabular-nums; }
.vc-up svg { width: 16px; height: 16px; }
#modal .rec-on { color: #fff; }

/* heroes picker (modal) */
.hp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px 12px; padding-top: 4px; }
#modal .hp-card { position: relative; display: grid; gap: 3px; padding: 0 0 6px; border: 0; background: none; color: var(--g-ink); box-shadow: none; text-align: left; transform: none; outline: 0; cursor: pointer; }
#modal .hp-card:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 4px; }
#modal .hp-img { display: block; aspect-ratio: 3 / 4; margin-bottom: 6px; overflow: hidden; border-radius: var(--g-r-xs); background: var(--g-soft-2); outline: 2px solid transparent; outline-offset: 3px; transition: outline-color var(--g-dur); }
#modal .hp-card[aria-checked="true"] .hp-img { outline-color: var(--g-accent); }
.hp-n { font: 600 14px/1.3 var(--g-font-ui); }
#modal .hp-card small { font-size: 12px; color: var(--g-muted); }

/* ---------- 8. step «Запуск» ---------- */
.launch-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .launch-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .launch-grid .sum-card { grid-column: 1 / -1; } }
.launch-grid > .g-panel { padding: 22px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.view .saved { font-size: 12.5px; font-weight: 600; color: var(--g-ok); }
.wm-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
.view .phone-mock { width: 150px; padding: 6px; border-radius: 18px; background: #1D1813; box-shadow: none; }
.view .pm-screen { border-radius: 12px; }
.view .pm-fallback { color: rgba(255, 255, 255, .55); opacity: 1; }
.pm-fallback svg { width: 34px; height: 34px; }
.view .pm-screen.live::after { content: none; display: none; }   /* the label lives under the screen (.pm-cap): no clash with the mark or the spots */
.view .pm-cap { margin: 6px 0 1px; color: rgba(255, 255, 255, .82); font: 600 10.5px/1.3 var(--g-font-ui); text-align: center; letter-spacing: .02em; }
.view .pm-screen .wm-mark { z-index: 3; }   /* the mark reads over the dashed rings (rings stay clickable: the mark ignores the pointer) */
:root[data-theme="dark"] .view .phone-mock { background: #3B352E; box-shadow: 0 0 0 1px var(--g-line-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .view .phone-mock { background: #3B352E; box-shadow: 0 0 0 1px var(--g-line-strong); } }
.wm-side { display: grid; gap: 12px; min-width: 0; align-content: start; }
.wm-none { justify-self: start; }
.radio-cards { display: grid; gap: 8px; }
.view .rc { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 14px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-paper); cursor: pointer; }
.view .rc:hover { border-color: var(--g-line-strong); }
.view .rc input { border-color: var(--g-muted); }
.view .rc input:checked { border-color: var(--g-accent); }
.view .rc input::after { background: var(--g-accent); }
.view .rc.on { border-color: var(--g-accent); background: var(--g-accent-soft); }
.view .rc-b b { font: 600 14.5px/1.35 var(--g-font-ui); }
.view .rc-b small { font-size: 12.5px; color: var(--g-muted); }
.view .rc-extra { padding: 4px 0 8px 46px; }
.mood-row { display: flex; flex-wrap: wrap; gap: 6px; }
.view .upl-file { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 4px 4px 12px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-soft); }
.uf-ic svg { width: 18px; height: 18px; color: var(--g-accent); }
.view .upl-file .uf-n { flex: 1; min-width: 0; overflow: hidden; font: 600 14px/1.35 var(--g-font-ui); white-space: nowrap; text-overflow: ellipsis; }
.view .uf-del { width: 40px; height: 40px; color: var(--g-danger); }
.view .uf-del:hover { background: var(--g-danger-soft); }
.view .toggle-row, #modal .toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--g-line); }
.toggle-row > div { display: grid; gap: 2px; min-width: 0; }
.view .toggle-row b, #modal .toggle-row b { font: 600 14.5px/1.35 var(--g-font-ui); }
.view .toggle-row small, #modal .toggle-row small { font-size: 12.5px; line-height: 1.5; color: var(--g-muted); }
.toggle-row small b { color: var(--g-ink); font-size: inherit; }
#modal .ed-toggle { margin: 0; padding: 0; border: 0; }
.view .switch, #modal .switch { position: relative; flex: none; width: 52px; height: 30px; padding: 0; border: 0; border-radius: var(--g-r-pill); background: var(--g-faint); cursor: pointer; transition: background-color var(--g-dur); }
.view .switch::before, #modal .switch::before { content: ""; position: absolute; inset: -7px -4px; }
.view .switch i, #modal .switch i { position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--g-paper); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform var(--g-dur) var(--g-ease); }
.view .switch[aria-checked="true"], #modal .switch[aria-checked="true"] { background: var(--g-accent); }
.view .switch[aria-checked="true"] i, #modal .switch[aria-checked="true"] i { transform: translateX(22px); }
.view .switch:disabled, #modal .switch:disabled { opacity: .5; cursor: not-allowed; }
.view .sum-list { display: grid; gap: 0; margin: 10px 0 12px; }
.view .sum-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--g-line); font-size: 14.5px; }
.view .sum-list dt { flex: none; font-weight: 500; color: var(--g-muted); }
.view .sum-list dd { min-width: 0; margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.view .sum-list .total { padding-top: 14px; border-bottom: 0; }
.view .sum-list .total dt { color: var(--g-ink); font-weight: 600; }
.view .sum-list .total dd { font: 800 26px/1.1 var(--g-font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.view .exp-row-l { padding: 12px 0 !important; border-bottom: 1px solid var(--g-line); }
.view .sum-list .sum-disc dd { font-weight: 500; color: var(--g-muted); }
.view .sum-list > div[hidden] { display: none; }
.view .exp-toggle { display: flex; min-height: 44px; padding: 0; }
.et-b { display: grid; gap: 2px; }
.et-b b { font: 600 14.5px/1.35 var(--g-font-ui); }
.et-b small { font-size: 12.5px; color: var(--g-muted); }
.wz-pay { padding: 18px 20px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-soft); }
.wz-pay .g-eyebrow { margin: 0 0 4px; }
.wz-pay-v { margin: 0 0 6px; font: 800 38px/1.1 var(--g-font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- 9. production (after launch) & re-montage ---------- */
.view .prod-hero { display: grid; gap: 8px; padding: 28px 28px 26px; text-align: left; justify-items: stretch; }
.prod-hero .g-eyebrow { margin: 0; }
.view .prod-stage { margin: 0; }
.prod-meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 28px; margin-top: 14px; }
.wz-prog-row { display: grid; gap: 8px; }
.view .wz-prog-row .g-progress { height: 6px; border: 0; border-radius: 3px; }
.wz-pct { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--g-muted); font-variant-numeric: tabular-nums; }
#pPct { font: 700 15px/1.3 var(--g-font-ui); color: var(--g-accent); }
.view .eta { display: grid; justify-items: end; gap: 2px; margin: 0; }
.view .eta-v { font: 800 clamp(28px, 4.4vw, 38px)/1.05 var(--g-font-ui); letter-spacing: -.02em; color: var(--g-ink); font-variant-numeric: tabular-nums; }
.view .notif-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px; }
.view .nc-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--g-line); border-radius: 50%; background: var(--g-paper); color: var(--g-accent); animation: none; }
.nc-ic svg { width: 19px; height: 19px; }
.notif-card b { font: 600 15px/1.35 var(--g-font-ui); }
.view .notif-card p { margin: 3px 0 0; font-size: 13.5px; color: var(--g-muted); }
.nc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.prod-pipe { display: grid; gap: 10px; }
.prod-pipe > .g-eyebrow { margin: 0; }
.prod-pipe .g-pipeline > li { padding: 15px 12px; }
.prod-pipe .g-pipeline > li.is-done .g-pipe-body strong { color: var(--g-ink); font-weight: 500; }
.prod-pipe .g-pipeline > li.is-current .g-pipe-body strong { color: var(--g-ink); font-weight: 700; }
.view .email-card { display: grid; gap: 10px; padding: 18px; }
.promo-row { display: flex; gap: 8px; min-width: 0; }
.promo-row .g-input { flex: 1; min-width: 0; }
.promo-row > button { flex: none; }
.view .ok-line { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; font-weight: 500; color: var(--g-ink); }
.ok-line svg { flex: none; width: 17px; height: 17px; color: var(--g-ok); }
.view .prod > .g-note svg, .view .g-note > svg { width: 17px; height: 17px; }

/* ---------- 10. «Кадры» и «Сцены»: review grid with «Сгенерировать заново» + «Что изменить» ---------- */
.rv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; padding-top: 0; }
@media (min-width: 700px) { .rv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; } }
.rv-grid:has(> .rv-card:only-child) { grid-template-columns: minmax(0, 340px); justify-content: start; }
/* one minmax(0, 1fr) track: the card never grows past its grid column (an auto track took the caption's min-content) */
.rv-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; min-width: 0; }
/* «Сгенерировать заново» rows line up across a row of cards: the description reserves two lines */
.view .rv-grid:not(.recap-grid) .rv-sum { min-height: calc(2 * 1.5em); }
.view .rv-media { position: relative; aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--g-r-xs); background: var(--g-soft-2); }
.view .rv-media img, .view .rv-media video { display: block; width: 100%; height: 100%; object-fit: cover; background: #1D1A17; }
.view .player-media { position: relative; }
.view .wz-play { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.view .wz-play:focus-visible { outline-offset: -4px; }
.view .wz-play.is-loading .g-art-play { opacity: .5; }
.view .rv-sum { margin: 0; font-size: 14px; line-height: 1.5; color: var(--g-ink); overflow-wrap: anywhere; }
.view .rv-note { margin: 0; font-size: 12.5px; line-height: 1.45; }
.view .rv-note[hidden] { display: none; }
.view .rv-err, :root[data-theme="dark"] .view .rv-err { background: var(--g-danger-soft); color: var(--g-ink); }
.rv-actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 6px; }
.rv-actions .g-btn-secondary { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
/* two cards per row on a small phone (≤ 379 px: a card is under 160 px): «Сгенерировать заново» without its icon
   and with tighter padding, so the long word fits the card instead of sticking out of it */
@media (max-width: 379px) {
  .rv-actions .g-btn-secondary { gap: 6px; padding-inline: 10px; font-size: 13px; }
  .rv-actions .g-btn-secondary > svg { display: none; }
  .view .rv-fb { padding: 10px; }
  .view .rv-fb .g-textarea { padding: 8px 10px; font-size: 14px; }
  .rv-fb-row > button { max-width: 100%; padding-inline: 10px; font-size: 13px; overflow-wrap: anywhere; }
}
.view .rv-price { text-align: left; }
.view .rv-fb { gap: 8px; padding: 12px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-soft); }
.view .rv-fb[hidden] { display: none; }
.view .rv-fb .g-textarea { min-height: 92px; background: var(--g-paper); }
.rv-fb-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.rv-count { margin-right: auto; font-size: 12px; color: var(--g-muted); font-variant-numeric: tabular-nums; }
.view .rv-card.is-gen .rv-actions { opacity: .6; }
.view .rv-montage { font-size: 15px; letter-spacing: 0; }

/* ---------- 11. «Готово»: player + actions; editor / lines / fix modals; recaps ---------- */
.done-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 40px; align-items: start; }
.view .player { position: sticky; top: calc(var(--g-header-h) + env(safe-area-inset-top) + 24px); margin: 0; padding: 0; border: 0; background: none; box-shadow: none; transform: none; }
.view .player-media { aspect-ratio: 9 / 16; max-height: calc(100dvh - var(--g-header-h) - 110px); overflow: hidden; border-radius: var(--g-r-xs); background: #000; }
.view .player video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-cap { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--g-muted); font-variant-numeric: tabular-nums; }
.player-cap span:first-child { min-width: 0; overflow: hidden; color: var(--g-ink); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.player-cap span:last-child { flex: none; }
.done-side { display: grid; gap: 22px; min-width: 0; }
.done-head { display: grid; justify-items: start; gap: 10px; }
.view .done-title { margin: 4px 0 0; }
.done-head .g-lead { margin: 0; }
.done-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.done-actions > button { min-width: 0; }
.view .gift-hint { margin: -10px 0 0; font-size: 13px; transform: none; }
.share-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: -10px; }
.view .sh-btn { height: auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.view .sh-btn svg { width: 16px; height: 16px; }
.wz-sec { display: grid; gap: 12px; margin: 0; padding: 22px 0 0; border: 0; border-top: 1px solid var(--g-line); border-radius: 0; background: none; box-shadow: none; }
.view .exp-card, .view .cap-card, .view .edit-card, .view .next-ep, .view .pub-card, .view .rate-card, .view .cover-card { padding: 22px 0 0; background: none; }
.exp-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.view .exp-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; min-height: 0; padding: 14px 12px; border: 1px solid var(--g-line); border-radius: var(--g-r-md); background: var(--g-paper); text-align: left; }
.view .exp-btn:hover { border-color: var(--g-accent); }
.view .exp-btn .ex-ic { display: flex; align-items: center; height: 30px; font-size: 0; }
.ex-ic .spinner { color: var(--g-accent); }
.ar { display: block; border: 1.5px solid var(--g-accent); border-radius: 2px; }
.ar-square { width: 24px; height: 24px; }
.ar-wide { width: 34px; height: 19px; }
.ar-cover { width: 17px; height: 30px; background: linear-gradient(180deg, transparent 58%, color-mix(in srgb, var(--g-accent) 28%, transparent) 58%); }
.view .exp-btn strong { font: 600 14.5px/1.3 var(--g-font-ui); }
.view .exp-btn small { font-size: 12px; line-height: 1.35; color: var(--g-muted); }
.view .exp-btn.busy { border-color: var(--g-accent); background: var(--g-accent-soft); pointer-events: none; }
.ec-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ec-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.view .ec-lines { margin: -4px 0 0; }
.view .next-ep { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.next-ep .g-caption { max-width: 46ch; margin-top: 4px; }
.cap-seg { justify-self: start; max-width: 100%; }
.view .cap-seg > button { padding: 9px 14px; }
#capBox { min-height: 4.8em; }
#copyCap, .ec-btns > button { justify-self: start; }
.view .cover-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 16px; }
.view .cv-img { aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--g-r-xs); background: var(--g-soft-2); box-shadow: none; }
.view .cv-t { display: grid; justify-items: start; gap: 6px; }
.view .cv-t small { font-size: 12.5px; color: var(--g-muted); }
.rate-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.view .wz-stars { display: inline-flex; gap: 0; letter-spacing: 0; }
.view .wz-stars button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--g-faint); font: 400 28px/1 var(--g-font-ui); cursor: pointer; transition: transform var(--g-dur) var(--g-ease), color var(--g-dur); }
.view .wz-stars button.on { color: var(--g-accent); }
.view .wz-stars button:hover { transform: scale(1.1); }
.view .review-form { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.review-form[hidden], .view .ok-line[hidden] { display: none; }
.review-form .g-btn { justify-self: start; }
.view .sr-box { margin: 0; padding-top: 10px; border-top: 1px solid var(--g-line); }
.view .sr-box > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 44px; font: 600 14px/1.35 var(--g-font-ui); cursor: pointer; }
.view .sr-box > summary small { font-size: 12px; font-weight: 500; color: var(--g-muted); }
.sr-list { display: grid; gap: 0; margin: 6px 0 12px; padding: 0; list-style: none; }
.view .sr-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--g-line); }
.view .sr-t { min-width: 0; font-size: 13px; line-height: 1.4; }
.sr-b { display: flex; gap: 4px; }
.view .sr-b button { width: auto; height: auto; min-height: 40px; padding: 6px 10px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-paper); color: var(--g-ink); font: 600 12.5px/1.2 var(--g-font-ui); filter: none; cursor: pointer; }
.view .sr-b button:hover { border-color: var(--g-line-strong); }
.view .sr-b button[aria-pressed="true"] { border-color: var(--g-accent); background: var(--g-accent-soft); transform: none; }
.view .sr-note { grid-column: 2 / -1; }
#fixBtn { white-space: normal; }
.done-links { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0 14px; }
.done-links .g-link { padding: 10px 2px; }
.done-links .g-link svg { width: 16px; height: 16px; }

/* modals of the done page */
#modal .ed-sec { display: grid; gap: 8px; }
#modal .ed-sec > b { font: 600 13px/1.35 var(--g-font-ui); }
#modal .ed-scenes { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#modal .ed-scenes li { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-soft); cursor: grab; user-select: none; }
#modal .ed-scenes li.dragging { opacity: .5; border-style: dashed; border-color: var(--g-accent); }
#modal .es-grip { display: inline-grid; color: var(--g-muted); letter-spacing: 0; }
.es-grip svg { width: 16px; height: 16px; }
#modal .es-t { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; }
#modal .ed-scenes .se-tool { width: 40px; height: 40px; }
#modal .ed-foot { margin: 0; }
#modal .ln-list { display: grid; gap: 18px; max-height: 56vh; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
#modal .ln-list .g-eyebrow { margin: 0; }
#modal .ln-row { display: grid; gap: 4px; margin-top: 8px; }
#modal .ln-row .se-sp { color: var(--g-ink); }
#modal .ln-in { display: flex; gap: 6px; }
#modal .ln-in .g-input { flex: 1; min-width: 0; }
#modal .ln-in .g-btn { flex: none; }

/* recaps (viewing a finished step from the stepper) */
.recap-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.recap-text { margin: 0; font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; }
.recap .idea-card { margin: 0; }
.recap .hero-qs { margin: 0; }

/* ---------- 12. «Мои ролики» (#/orders) ---------- */
.view .guest-note { margin-bottom: 20px; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px 16px; }
.view .ocard { display: grid; align-content: start; gap: 10px; padding: 0; border: 0; border-radius: var(--g-r-xs); background: none; color: var(--g-ink); box-shadow: none; text-align: left; text-decoration: none; transition: none; }
.view .ocard:hover { transform: none; border: 0; box-shadow: none; }
.view .ocard:focus-visible { outline-offset: 4px; }
.view .othumb { display: block; font-size: inherit; border-radius: var(--g-r-xs); }
.othumb .g-art-ph svg { width: 30px; height: 30px; color: var(--g-accent); }
.view .ocard:hover .othumb video { transform: scale(1.02); }
.othumb video { transition: transform .5s var(--g-ease); }
.ocard-prog { margin-top: -4px; }
.othumb > img { transition: transform .5s var(--g-ease); }
.view .ocard:hover .othumb > img { transform: scale(1.02); }
.view .oinfo .ocard-step { color: var(--g-accent); font-size: 12.5px; font-weight: 600; }
.view .oinfo { display: grid; gap: 3px; padding: 0; }
.view .oinfo b { overflow: hidden; font: 600 15px/1.3 var(--g-font-ui); white-space: nowrap; text-overflow: ellipsis; }
.view .oinfo span { font-size: 13px; color: var(--g-muted); font-weight: 500; }
.oinfo small { font-size: 12px; color: var(--g-muted); }

/* ---------- 13. баланс (#/balance) ---------- */
.view .bal-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 18px 28px; padding: 24px; }
.bal-now .g-eyebrow { margin-bottom: 6px; }
.bal-now .g-big-num { margin: 0 0 8px; }
.view .sub-widget { margin: 0; border-style: solid; transform: none; }
.view .sub-widget:hover { transform: none; }
.view .sub-widget.sw-off { border-style: solid; border-color: var(--g-line); }
.sub-widget .g-link { flex: none; margin-left: auto; min-height: 0; padding: 0; }
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.view .preset { position: relative; min-height: 52px; height: auto; padding: 10px; border: 1px solid var(--g-line); border-radius: var(--g-r-md); background: var(--g-paper); color: var(--g-ink); font: 600 15px/1.2 var(--g-font-ui); font-variant-numeric: tabular-nums; box-shadow: none; cursor: pointer; }
.view .preset:hover { border-color: var(--g-accent); }
.view .preset[aria-checked="true"] { border-color: var(--g-accent); background: var(--g-accent-soft); box-shadow: none; }
.view .preset .pb { top: -9px; right: 8px; padding: 1px 6px; border: 1px solid color-mix(in srgb, var(--g-ok) 40%, transparent); border-radius: var(--g-r-xs); background: var(--g-ok-soft); color: var(--g-ok); font: 700 11px/1.4 var(--g-font-ui); }
.amount-input { position: relative; }
.view .amount-input .g-input { padding-right: 44px; font-size: 17px; font-weight: 600; }
.view .amount-input::after { right: 16px; font-size: 17px; }
.view .bonus-live { min-height: 1.45em; }
.bonus-live b { color: var(--g-ok); }
.view .bonus-note { margin: 0; }
.view .pay-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; text-align: center; }
.pay-note svg { width: 16px; height: 16px; flex: none; color: var(--g-ok); }
.view .gift-card-sec { padding: 22px; }
.gc-head { display: flex; align-items: flex-start; gap: 14px; }
.gc-head .g-tile-ic svg { width: 22px; height: 22px; }
.gc-head .g-caption { margin-top: 4px; font-size: 13.5px; }
.gc-list { display: grid; gap: 8px; }
.gc-list .g-eyebrow { margin: 4px 0 0; }
.view .gc-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "amt code btn" "amt st btn"; align-items: center; gap: 2px 12px; padding: 10px 10px 10px 14px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-paper); }
.view .gc-amt { font: 700 16px/1.3 var(--g-font-ui); font-variant-numeric: tabular-nums; }
.gc-item .g-status { grid-area: st; justify-self: start; }
.gc-item .g-btn-secondary { grid-area: btn; }
.hist-wrap { margin-top: 12px; }
.hist-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 12px; }
.hist-foot .g-link { padding-inline: 0; }
.hist-foot [hidden] { display: none; }
.hist-d { color: var(--g-muted); font-size: 13px; white-space: nowrap; }

/* ---------- 14. друзья (#/invite) ---------- */
.view .invite-hero { display: grid; gap: 18px; padding: clamp(22px, 4vw, 32px); }
.view .invite-hero h2 { margin: 0; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; }
.invite-hero .g-lead { margin-top: 8px; }
.invite-hero .g-lead b { color: var(--g-ink); }
.view .link-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-soft); }
.view .link-box code { flex: 1; min-width: 0; overflow: hidden; font: 500 14px/1.45 var(--g-font-ui); font-variant-numeric: tabular-nums; letter-spacing: .01em; color: var(--g-ink); white-space: nowrap; text-overflow: ellipsis; }
.view .gc-code { font: 600 14px/1.4 var(--g-font-ui); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
@media (max-width: 479px) {
  /* the whole link is visible on a phone: the link on its own lines, the copy button under it */
  .view .link-box { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
  .view .link-box code { white-space: normal; overflow: visible; overflow-wrap: anywhere; word-break: break-all; }
  .view .link-box .g-btn-secondary { align-self: flex-start; }
}
.iv-share { justify-self: start; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.view .stat { min-width: 0; padding: 18px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-paper); box-shadow: none; }
.view .stat b { display: block; overflow: hidden; font: 800 clamp(22px, 4vw, 32px)/1.15 var(--g-font-ui); letter-spacing: -.02em; white-space: nowrap; text-overflow: ellipsis; }
.view .stat span { font-size: 12.5px; color: var(--g-muted); }
.iv-rules { margin-top: 14px; }
.iv-rules b { color: var(--g-ink); }

/* ---------- 15. помощь (#/help) ---------- */
.view .chat { display: grid; gap: 14px; padding: 22px; }
.chat .g-section-head { margin: 0; }
.view .chat-log { display: grid; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 2px; }
.view .bubble { max-width: 86%; padding: 11px 15px; border-radius: var(--g-r-xs); font-size: 15px; line-height: 1.55; }
.view .bubble.me { background: var(--g-accent); color: var(--g-on-accent); }
.view .bubble.bot { border: 1px solid var(--g-line); background: var(--g-soft); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; }
.view .chat-form .g-textarea { height: 52px; min-height: 52px; max-height: 160px; padding: 13px 14px; resize: none; line-height: 1.5; }
.view .chat-send { flex: none; width: 52px; min-height: 52px; padding: 0; }
.faq-h { margin: 0 0 10px; }
.view .wz-faq { max-width: none; gap: 0; margin: 0; border-top: 1px solid var(--g-line); }
.view .wz-faq details, .view .wz-faq details[open] { border: 0; border-bottom: 1px solid var(--g-line); border-radius: 0; background: none; box-shadow: none; }
.view .wz-faq summary { min-height: 56px; padding: 14px 0; border-radius: 0; font: 600 15.5px/1.4 var(--g-font-ui); }
.view .wz-faq details[open] .pm { background: var(--g-accent); color: var(--g-on-accent); }
.view .wz-faq .ans { max-width: 65ch; padding: 0 0 18px; font-size: 15px; color: var(--g-muted); }
.help-docs { text-align: center; }
.help-docs a { color: var(--g-ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 16. мои герои (#/heroes) ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; padding-top: 0; }
@media (min-width: 700px) { .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; } }
.lib-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; min-width: 0; }
.view .lib-img { aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--g-r-xs); background: var(--g-soft-2); }
.view .lib-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lib-name { margin: 2px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lib-meta .g-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lib-meta .g-tag svg { width: 13px; height: 13px; flex: none; color: var(--g-accent); }
.lib-actions { display: flex; gap: 8px; }
.view .lib-del { color: var(--g-danger); }
.view .lib-del:hover { background: var(--g-danger-soft); }

/* ---------- 17. контент-план (#/plan) ---------- */
.view .cp-form { padding: 22px; }
.view .cp-form .cp-row { display: grid; grid-template-columns: auto auto auto; align-items: start; justify-content: start; gap: 16px 22px; }
.cp-count { display: flex; align-items: center; gap: 8px; }
.view .cp-count output { min-width: 32px; text-align: center; font: 800 22px/1 var(--g-font-ui); font-variant-numeric: tabular-nums; }
.view .cp-plan { display: grid; gap: 14px; margin-top: 22px; padding: 22px; }
.cp-plan .g-section-head { margin: 0; }
.cp-items { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.view .cp-item { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 12px 14px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); background: var(--g-paper); cursor: pointer; }
.view .cp-item input { width: 20px; height: 20px; margin: 2px 0 0; }
.view .cp-t b { font: 600 14.5px/1.35 var(--g-font-ui); }
.view .cp-t small { font-size: 12.5px; line-height: 1.45; color: var(--g-muted); }
.view .cp-item:has(input:not(:checked)) { opacity: .6; }
.cp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cp-ok { margin-top: 14px; }
.cp-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- 18. tablets & phones ---------- */
@media (pointer: coarse) {
  .view .refs-kind button, .view .refs.compact .refs-kind button, .view .sr-b button, .view .se-tool, #modal .ed-scenes .se-tool, .view .uf-del { min-height: 44px; }
  .view .se-tool, #modal .ed-scenes .se-tool, .view .uf-del { width: 44px; height: 44px; }
  .idea-ex .g-link { min-height: 44px; }
}
@media (max-width: 899px) {
  .done-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .view .player { position: static; width: min(100%, 340px); margin: 0 auto; }
  .view .player-media { max-height: none; }
}
@media (max-width: 767px) {
  .wz-head { margin-bottom: 22px; }
  .wz-steps { margin-bottom: 22px; }
  .wz-step { margin-bottom: 32px; }
  .fmt-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .view .fmt-card { min-height: 112px; padding: 15px 13px; gap: 10px; }
  .view .fmt-card.fmt-gift { padding: 16px; gap: 14px; }
  .view .fmt-card.fmt-gift strong { font-size: 19px; }
  .view .brief-anim { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 22px 18px; }
  .ba-idea-wrap { padding: 0 0 20px; border-right: 0; border-bottom: 1px solid var(--g-line); }
  .view .script-card { padding: 22px 18px; }
  .view .tl-scene, .view .tl-scene:first-child, .view .tl-scene:last-child { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  .launch-grid > .g-panel, .wz-tools, .view .script-edit, .writer { padding: 18px; }
  .view .prod-hero { padding: 22px 18px; }
  .prod-meter { grid-template-columns: minmax(0, 1fr); }
  .view .eta { justify-items: start; order: -1; }
  .view .bal-top { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .view .cp-form .cp-row { grid-template-columns: minmax(0, 1fr); }
  .cp-form .cp-row .g-seg { display: flex; width: 100%; }
  .cp-form .cp-row .g-seg > button { flex: 1 1 0; }
}
@media (max-width: 639px) {
  /* one row (site.css ≤ 560 px still stacks the bar in a column: overridden here) */
  .wz-bar { flex-direction: row; align-items: center; gap: 12px; margin-top: 24px; padding: 10px 10px 10px 16px; }
  .wz-bar .info { flex: 1 1 auto; grid-template-columns: minmax(0, 1fr); align-items: start; padding: 0; }
  .wz-bar .info b { font-size: 16px; }
  .wz-bar .info span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .wz-bar > .g-btn, .wz-bar > a.g-btn { padding-inline: 16px; }
  .gb-pair { grid-template-columns: minmax(0, 1fr); }
  .q-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .view .q-card.q-cinema { grid-column: 1 / -1; }
  .view .q-card { padding: 15px; }
  .wz-row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wz-row3 > :first-child { grid-column: 1 / -1; }
  .view .tpl-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--g-gutter)); padding: 2px var(--g-gutter) 6px; scroll-padding-inline: var(--g-gutter); }
  .view .tpl-row::-webkit-scrollbar { display: none; }
  .tpl-row .tpl-chip { flex: none; white-space: nowrap; }
  .exp-row { gap: 8px; }
  .view .exp-btn { padding: 12px 10px; }
  .presets { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stats { gap: 8px; }
  .view .stat { padding: 14px 12px; }
  .cast-grid, .cast-grid:has(> .cast-card:only-child) { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .cast-card { grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 14px; row-gap: 10px; }
  .cast-card > .wz-frame { display: contents; }
  .cast-card .cast-media { grid-column: 1; grid-row: 1 / span 3; align-self: start; }
  .cast-card .wz-cap { grid-column: 2; grid-row: 1; align-self: start; flex-wrap: wrap; }
  .cast-card .wz-cap .cn { white-space: normal; }
  .cast-card > .voice-row { grid-column: 2; grid-row: 2; align-self: start; flex-wrap: wrap; }
  .cast-card > .voice-row .g-btn-secondary { width: 100%; }
  .cast-card > .refs, .cast-card > .ref-nudge, .cast-card > .cast-fb { grid-column: 1 / -1; }
  .recap .cast-card { grid-template-columns: 112px minmax(0, 1fr); }
}
@media (max-width: 479px) {
  /* small phones: ONE row of about 60 px — «what / price» · (i) · short button. Header, tab bar and this bar stay
     under a third of a 640 px screen; the cut text unfolds behind (i), the full button label stays its name */
  .wz-bar { gap: 6px; margin-top: 20px; padding: 7px 7px 7px 14px; }
  .wz-bar .info { flex: 1 1 auto; gap: 1px; }
  .wz-bar .info b { font-size: 15px; line-height: 1.25; }
  .wz-bar .info span { font-size: 12px; line-height: 1.3; }
  .wz-bar > .g-btn, .wz-bar > a.g-btn { min-height: 46px; padding: 10px 14px; gap: 6px; white-space: nowrap; }
  .wz-bl-l { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .wz-bl-s { display: inline; }
  .dur-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .done-actions { grid-template-columns: minmax(0, 1fr); }
  .orders { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 12px; }
  .resume-card .rc-go, .cp-hint .g-link, .sub-widget .g-link { display: none; }
  .view .rc-extra { padding-left: 4px; }
  .view .cover-card { grid-template-columns: 72px minmax(0, 1fr); }
  .exp-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .view .exp-btn small { display: none; }
}
@media (max-width: 400px) {
  .wm-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .wm-side { width: 100%; }
  .view .refs-kind { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .view .sr-list li { grid-template-columns: 22px minmax(0, 1fr); }
  .view .sr-list .sr-b { grid-column: 2; }
}
@media (max-width: 359px) {
  .view .fmt-card { padding: 13px 11px; }
  .view .fmt-card.fmt-gift { flex-wrap: wrap; }
  .wz-new { margin-left: 0; }
  .fmt-card.fmt-gift[aria-checked="true"] .wz-new { margin-right: 0; }
  .cast-card { grid-template-columns: 92px minmax(0, 1fr); }
  .stats { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 19. reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .wz-indet > i { animation: none; width: 100%; opacity: .35; }
  .view .cast-gen::after { display: none; }
  .view button.style-card:hover .sc-media img, .view .ocard:hover .othumb video { transform: none; }
  .wz-check { transition: none; }
}
#modal .ed-sec.toggle-row { display: flex; }
/* explicit look for labels that platform.css still styles through its interim «handwritten → caps» list,
   so that list can be deleted without changing the wizard */
.view .wz-title .n, .view .eta-k, .view .cp-day, .view .li-pol figcaption { font: 600 11.5px/1.4 var(--g-font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--g-accent); transform: none; }
.view .refs-help summary { font: 600 13px/1.4 var(--g-font-ui); letter-spacing: .01em; text-transform: none; color: var(--g-accent); }
