/* VidEdit concept: flow components (stepper, uploads library, language selector, style gallery, customize). Uses tokens from styles.css. */

.flow-wrap { max-width: 1600px; margin: 0 auto; display: grid; gap: var(--s5); animation: enter var(--d-slow) var(--ease) backwards; }
.hide-phone { display: none; }
.btn-grow { flex: 1; }
.fg { color: var(--fg); }
.tag-accent { background: var(--accent-soft); color: var(--accent-ink); }
.is-off { opacity: .5; }
.field-stack { display: grid; gap: 12px; }
.form-err { color: var(--danger); }
.proto-link { font-size: 13px; color: var(--fg-3); font-weight: 500; }
.up-actions, .rd-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.new-aside { display: grid; gap: 12px; align-content: start; }
.rd-title { font-size: var(--t-2xl); }
.usage-grid { display: grid; gap: 0 28px; padding-bottom: 8px; }
.notify-row { padding-block: 8px; }
.notify-row > div { min-width: 0; }
.tr-hint .i, .hint .i { vertical-align: -3px; }
@media (hover: none) { .only-fine, kbd { display: none !important; } }
@media (hover: hover) { .only-touch { display: none; } }

/* keep focused / scrolled-to elements clear of the sticky top bar, mini preview and fixed action bars */
html { scroll-padding-top: calc(var(--topbar-h) + 16px); scroll-padding-bottom: 24px; }
html:has(.actionbar) { scroll-padding-bottom: 120px; }
@media (max-width: 719px) {
  html:has(.cz-mini), html:has(.rv-mini) { scroll-padding-top: calc(var(--topbar-h) + 200px); }
  html:has(.wd-selbar.is-on) { scroll-padding-bottom: 150px; }
}
.proj { min-width: 0; }
.proc-side { display: grid; gap: var(--s4); align-content: start; }
.attn { text-decoration: none; }
.attn:hover .attn-body b { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 719px) { .rd-frame { width: min(170px, 44vw); } .rd-grid { gap: var(--s5); } .rd-pct { font-size: 3.5rem; } }
@media (max-width: 999px) { .vid-specs span + span::before { content: "·"; margin-right: 10px; color: var(--fg-3); } .vid-specs { gap: 2px 10px; } }
@media (min-width: 720px) { .proj-grid { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); } }

/* ---------- stepper ---------- */
.stepper ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.stepper li > a, .stepper li > span { display: block; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; font-size: 0; color: transparent; }
.stepper li i, .stepper li b { display: none; }
.stepper li.is-done > a, .stepper li.is-current > span { background: var(--accent); }
.stepper-phone { margin: 8px 0 0; display: flex; gap: 8px; align-items: baseline; font-weight: 650; font-size: var(--t-sm); }
.stepper-phone .mono { color: var(--fg-3); font-weight: 500; font-size: 12px; }
@media (min-width: 720px) {
  .stepper-phone { display: none; }
  .stepper ol { display: flex; gap: 8px; align-items: center; }
  .stepper li { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; }
  .stepper li:last-child { flex: none; }
  .stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--line); min-width: 12px; }
  .stepper li.is-done::after { background: var(--accent); }
  .stepper li > a, .stepper li > span { height: auto; background: none; overflow: visible; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: var(--t-sm); color: var(--fg-3); font-weight: 600; text-decoration: none; white-space: nowrap; border-radius: 8px; }
  .stepper li.is-done > a, .stepper li.is-current > span { background: none; }
  .stepper li > a:hover b { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
  .stepper li i, .stepper li b { display: inline-flex; }
  .stepper li i { width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; font: 600 12px var(--font-mono); font-style: normal; border: 1.5px solid var(--line-strong); color: var(--fg-3); flex: none; }
  .stepper li i .i { width: 14px; height: 14px; stroke-width: 2.6; }
  .stepper li.is-done i { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  .stepper li.is-done b { color: var(--fg-2); }
  .stepper li.is-current i { border-color: var(--fg); background: var(--fg); color: var(--bg); }
  .stepper li.is-current b { color: var(--fg); }
}

/* ---------- two entry paths ---------- */
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.path { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease); }
.path:hover { border-color: var(--line-strong); }
.path.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.path-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--fg-2); flex: none; }
.path.is-on .path-ic { background: var(--accent); color: var(--on-accent); }
.path-txt { display: grid; gap: 2px; min-width: 0; }
.path-txt b { font-weight: 650; font-size: var(--t-md); line-height: 1.25; }
.path-txt span { font-size: var(--t-xs); color: var(--fg-3); }
@media (min-width: 720px) {
  .path { flex-direction: row; align-items: center; padding: 16px 18px; gap: 14px; }
  .path-ic { width: 52px; height: 52px; border-radius: 14px; }
  .path-txt b { font-size: var(--t-lg); }
  .path-txt span { font-size: var(--t-sm); }
}

/* ---------- uploads library ---------- */
.lib { display: grid; gap: var(--s3); }
.lib-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.lib-tools h2 { grid-column: 1 / -1; }
.sort .select { min-width: 140px; }
.vid-when { font-size: 12.5px; }
.vid-head { display: none; }
.vids { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vid {
  position: relative; display: grid; gap: 4px 12px; align-items: start;
  grid-template-columns: 24px 60px minmax(0, 1fr);
  grid-template-areas: "radio thumb main" "radio thumb specs" "radio thumb status" "radio thumb renders";
  padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  transition: border-color var(--d-fast) var(--ease), background var(--d-fast) var(--ease);
}
.vid:hover { border-color: var(--line-strong); }
.vid.is-sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); }
.vid.is-disabled { opacity: .62; }
.vid.is-disabled .vid-hit { cursor: not-allowed; }
.vid:has(input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.vid-hit { position: absolute; inset: 0; z-index: 1; cursor: pointer; border-radius: inherit; }
.vid-hit input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vid-radio { grid-area: radio; align-self: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; background: var(--surface); }
.vid-radio .i { width: 14px; height: 14px; stroke-width: 3; }
.vid.is-sel .vid-radio { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vid-thumb { grid-area: thumb; }
.vid-thumb .frame { width: 100%; border-radius: 8px; }
.vid-thumb .frame-badge { font-size: 10px; padding: 1px 4px; right: 4px; bottom: 4px; }
.vid-main { grid-area: main; min-width: 0; display: grid; }
.vid-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid-when { font-size: 12.5px; color: var(--fg-3); }
.vid-specs { grid-area: specs; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--fg-2); }
.vid-status { grid-area: status; }
.vid-renders { grid-area: renders; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; padding-top: 2px; }
.lib-bar-sel { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1; }
.lib-bar-sel .frame { width: 30px; border-radius: 5px; flex: none; }
.app[data-route="uploads"] #view { padding-bottom: calc(var(--tabbar-h) + 110px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 719px) {
  .app[data-route="uploads"] .actionbar { bottom: calc(var(--tabbar-h) + 4px + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; border-radius: 16px 16px 0 0; }
}
@media (min-width: 720px) {
  .hide-phone { display: inline; }
  .app[data-route="uploads"] #view { padding-bottom: 120px; }
}
@media (min-width: 1000px) {
  .lib-tools { grid-template-columns: auto minmax(0, 1fr) 190px; }
  .lib-tools h2 { grid-column: auto; margin-right: 12px; }
  .vid, .vid-head { grid-template-columns: 24px 44px minmax(180px, 1.3fr) minmax(170px, 1fr) 140px minmax(170px, 1.2fr); grid-template-areas: "radio thumb main specs status renders"; align-items: center; gap: 16px; }
  .vid { padding: 10px 14px; }
  .vid-head { display: grid; padding: 0 14px; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
  .vid-head span:nth-child(2) { grid-column: 2 / 4; }
  .vid-specs { flex-direction: column; gap: 0; }
  .vid-specs span:nth-child(4) { display: none; }
}

/* ---------- language ---------- */
.lang-field { position: relative; }
.lang-btn { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nat chev" "sub chev"; gap: 0 12px; align-items: center; text-align: left; padding: 10px 14px; min-height: 62px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease); }
.lang-btn:hover { border-color: var(--fg-3); }
.lang-btn[aria-expanded="true"] { border-color: var(--accent-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.lang-btn-nat { grid-area: nat; font: 650 var(--t-lg)/1.3 var(--font-body); }
.lang-btn-sub { grid-area: sub; font-size: var(--t-sm); color: var(--fg-3); }
.lang-btn > .i { grid-area: chev; color: var(--fg-2); }
.cap-lang { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
.cap-lang legend { padding: 0; margin-bottom: 8px; }
.radio-list { display: grid; gap: 8px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; min-height: 56px; transition: border-color var(--d-fast) var(--ease); }
.radio-card:hover { border-color: var(--line-strong); }
.radio-card input { width: 20px; height: 20px; accent-color: var(--accent); margin: 1px 0 0; flex: none; }
.radio-card > span { display: grid; gap: 2px; min-width: 0; }
.radio-card b { font-weight: 650; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.radio-card > span > span { font-size: var(--t-sm); color: var(--fg-3); }
.radio-card.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); }

.lp-pop { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; width: min(480px, 100%); height: min(500px, 62vh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-3); overflow: hidden; animation: menu-in var(--d-fast) var(--ease) both; }
.lp { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.lp-search { padding: 12px; border-bottom: 1px solid var(--line); flex: none; }
.lp-search > .i { left: 25px; }
.lp-list { overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 12px; flex: 1; min-height: 0; }
.lp-group { display: flex; justify-content: space-between; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); padding: 16px 10px 6px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.lp-group .mono { letter-spacing: 0; }
.lp-opt { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-flow: column; grid-auto-columns: auto; align-items: center; gap: 10px; min-height: 54px; padding: 6px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; }
.lp-opt:hover, .lp-opt:focus-visible { background: var(--surface-2); }
.lp-opt[aria-selected="true"] { background: var(--accent-soft); }
.lp-names { display: grid; min-width: 0; }
.lp-native { font-size: 16px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-en { font-size: 12.5px; color: var(--fg-3); }
.lp-script { font: 500 11px var(--font-mono); color: var(--fg-3); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); white-space: nowrap; }
.lp-check { width: 20px; color: var(--accent-ink); visibility: hidden; display: grid; }
.lp-opt[aria-selected="true"] .lp-check { visibility: visible; }
.lp-conf { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-2); }
.lp-conf .meter { width: 44px; }
.lp-opt mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; border-radius: 3px; }
.lp-empty { padding: 28px 12px; display: grid; gap: 4px; text-align: center; color: var(--fg-3); font-size: var(--t-sm); }
.lp-empty b { color: var(--fg); font-size: var(--t-md); }
.sheet.is-full { top: 0; max-height: none; height: 100%; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); animation-name: sheet-up; }
.sheet.is-full .sheet-grab { display: none; }
.lp-sheet .sheet-body { padding: 0; display: flex; flex-direction: column; }
.lp-sheet .lp-search { padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.lp-sheet .lp-search > .i { left: calc(var(--gutter-l) + 13px); }
.lp-sheet .lp-list { padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }

/* ---------- review additions ---------- */
.rv-tools { display: flex; align-items: center; gap: 2px; }
.rv-tools .saved { margin-right: 6px; }
.checklist { display: grid; gap: 8px; }
.check-item { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; min-height: 60px; }
.check-item:hover { border-color: var(--line-strong); }
.check-item b { display: block; font-weight: 650; }
.check-item > span > span { font-size: var(--t-sm); color: var(--fg-3); overflow-wrap: anywhere; }
.check-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.check-ic.filled { background: var(--ok-soft); color: var(--ok); }
.check-ic.skipped { background: var(--surface-2); color: var(--fg-3); }
.logo-mock { font: 800 18px var(--font-display); color: var(--fg); letter-spacing: -.04em; }
.photo-mock { width: 100%; height: 100%; background: linear-gradient(160deg, #E3B38A, #8C5A3C); }
@media (min-width: 1180px) {
  .app[data-route="review"] .actionbar, .app[data-route="styles"] .actionbar { display: none; }
  .app[data-route="review"] #view, .app[data-route="styles"] #view { padding-bottom: var(--s7); }
}
.rv-player .frame, .cz-preview .frame, .res-player .frame { cursor: default; }

/* ---------- style gallery ---------- */
.sg-layout { display: grid; gap: var(--s6); }
.sg-main { display: grid; gap: var(--s4); min-width: 0; align-content: start; }
.gen-status { display: grid; gap: 8px; max-width: 560px; }
.gen-row { display: flex; gap: 10px; align-items: center; font-size: var(--t-sm); color: var(--fg-2); }
.gen-row .spinner { color: var(--accent-ink); width: 16px; height: 16px; }
.gen-done { display: inline-flex; gap: 6px; align-items: center; font-size: var(--t-sm); color: var(--ok); font-weight: 600; }
.sg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sg-card { display: grid; gap: 10px; align-content: start; padding: 6px 6px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-med) var(--ease); }
.sg-card:hover { border-color: var(--line-strong); }
.sg-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.sg-media { position: relative; border-radius: 11px; overflow: hidden; aspect-ratio: 9 / 16; background: var(--surface-2); }
.sg-media .frame { width: 100%; border-radius: 11px; }
.sg-badge { position: absolute; left: 8px; top: 8px; z-index: 5; display: inline-flex; gap: 4px; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: rgba(10, 12, 16, .62); color: #fff; font: 600 11px var(--font-body); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sg-badge .i { width: 11px; height: 11px; }
.sg-badge.queued, .sg-badge.generating, .sg-badge.failed { display: none; }
.sg-play { position: absolute; right: 8px; bottom: 8px; z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(10, 12, 16, .62); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity var(--d-fast) var(--ease), transform var(--d-fast) var(--ease); }
.sg-play:active { transform: scale(.92); }
.sg-play:not(.is-playing) { width: 52px; height: 52px; right: 50%; bottom: 50%; transform: translate(50%, 50%); background: rgba(10, 12, 16, .7); }
.sg-play.is-playing { opacity: .8; }
@media (hover: hover) and (pointer: fine) {
  .sg-play.is-playing { opacity: 0; }
  .sg-card:hover .sg-play, .sg-play:focus-visible { opacity: 1; }
}
.sg-skel { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; padding: 12px; text-align: center; }
.sg-skel .sk { position: absolute; inset: 0; border-radius: 0; }
.sg-skel.queued .sk { animation: none; }
.sg-state { position: relative; display: inline-flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; color: var(--fg-2); padding: 6px 10px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-1); }
.sg-state .spinner { width: 14px; height: 14px; color: var(--accent-ink); }
.sg-skel.is-failed { background: var(--danger-soft); }
.sg-skel.is-failed .sg-state { color: var(--danger); }
.sg-skel .btn { position: relative; }
.sg-dots { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 5; display: flex; gap: 4px; }
.sg-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.sg-dots i.on { background: #fff; }
.sg-info { position: relative; display: grid; gap: 4px; padding: 0 4px; }
.sg-select { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; font-weight: 650; font-size: var(--t-md); }
.sg-select::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.sg-select:focus-visible { outline: none; }
.sg-select:focus-visible::after { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.sg-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: none; }
.sg-radio .i { width: 13px; height: 13px; stroke-width: 3; }
.sg-card.is-on .sg-radio { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sg-line { font-size: 12.5px; color: var(--fg-3); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sg-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.sg-meta .tag .i { width: 12px; height: 12px; }
.sg-regen { position: relative; z-index: 2; min-height: 32px; font-size: 12.5px; }
.sg-side { display: none; }
.sd { display: grid; gap: 14px; }
.sd-name { font-size: var(--t-2xl); }
.sd-preview .frame { width: min(190px, 50vw); margin: 0 auto; box-shadow: var(--shadow-2); }
.sd-lists { display: grid; gap: 14px; }
.mini-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--t-sm); }
.mini-list li { display: flex; gap: 8px; align-items: flex-start; }
.mini-list .i { color: var(--ok); margin-top: 2px; }
.mini-list.is-fixed li { color: var(--fg-2); }
.mini-list.is-fixed .i { color: var(--fg-3); }
@media (max-width: 719px) {
  .sg-card .tag:nth-child(2) { display: none; }
}
@media (min-width: 720px) {
  .sg-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; }
  .sd-lists { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1180px) {
  .sg-layout { grid-template-columns: minmax(0, 1fr) 344px; align-items: start; }
  .sg-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .sg-side .style-facts dd { font-size: 12.5px; }
  .sg-side { display: grid; gap: 16px; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; padding: 18px; }
  .sg-side-preview .frame { width: 168px; margin: 0 auto; box-shadow: var(--shadow-2); }
  .sg-side .sd-lists { grid-template-columns: 1fr; }
  .sg-side-foot { display: grid; gap: 8px; position: sticky; bottom: -18px; margin: 0 -18px -18px; padding: 12px 18px 18px; background: var(--surface); border-top: 1px solid var(--line); }
}

/* ---------- customize ---------- */
.cz { display: grid; gap: var(--s4); }
.cz-mini {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); z-index: 20;
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center;
  margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l));
  padding: 10px var(--gutter-r) 12px var(--gutter-l);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.cz-mini .frame { width: 92px; }
.cz-mini .rv-mini-body { gap: 10px; }
.cz-mini .seg button { min-height: 36px; }
.cz-preview { display: none; }
.compare .seg { width: 100%; }
.compare .seg button { flex: 1; justify-content: center; }
.cz-panel { min-width: 0; display: grid; gap: var(--s4); align-content: start; }
.cz-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 16px; }
.cz-title h1 { font-size: var(--t-2xl); }
.cz-head > .link { margin-right: auto; }
.cz-presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.cz-presets .select { width: auto; flex: 1 1 180px; min-height: 40px; padding-top: 6px; padding-bottom: 6px; font-size: var(--t-sm); }
.cz-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); padding-inline: var(--gutter-l) var(--gutter-r); }
.cz-tabs::-webkit-scrollbar { display: none; }
.cz-tab { flex: none; display: inline-flex; gap: 6px; align-items: center; min-height: 46px; padding: 0 12px; border: 0; background: none; color: var(--fg-2); font-weight: 600; font-size: var(--t-sm); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.cz-tab:hover { color: var(--fg); }
.cz-tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.cz-tab .tab-lock { opacity: .6; }
.cz-body { display: grid; gap: var(--s5); min-width: 0; }
.tab-title { font-size: var(--t-lg); }
.cz-changes { font-size: var(--t-sm); color: var(--fg-2); white-space: nowrap; }
.cz-changes b { color: var(--fg); }
.app[data-route="customize"] .actionbar { justify-content: flex-end; }

/* roles: shared look for legend, word chips and assign buttons */
.role-sample { display: grid; place-items: center; min-width: 36px; height: 32px; padding: 0 6px; border-radius: 8px; font-weight: 650; font-size: 14px; }
.r-big > .role-sample, .wchip.r-big { background: var(--fg); color: var(--bg); font-family: var(--font-display); font-weight: 800; letter-spacing: -.01em; }
.r-normal > .role-sample, .wchip.r-normal { background: var(--surface-2); color: var(--fg); }
.r-accent > .role-sample, .wchip.r-accent { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 65%, transparent); }
.r-hide > .role-sample, .wchip.r-hide { background: transparent; color: var(--fg-3); text-decoration: line-through; outline: 1.5px dashed var(--line-strong); outline-offset: -1.5px; }
.wd { display: grid; gap: var(--s4); }
.wd-intro { display: grid; gap: 4px; }
.role-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-tok { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; min-height: 58px; }
.role-tok:hover { border-color: var(--line-strong); }
.role-tok.is-locked { opacity: .55; cursor: not-allowed; border-style: dashed; }
.role-txt { display: grid; min-width: 0; }
.role-txt b { font-size: var(--t-sm); }
.role-txt span { font-size: 11.5px; color: var(--fg-3); line-height: 1.3; }
kbd { font: 500 11px var(--font-mono); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--fg-2); background: var(--surface-2); }
.ai-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--violet-soft); }
.ai-bar > .i { color: var(--violet); }
.ai-txt { flex: 1 1 200px; display: grid; min-width: 0; }
.ai-txt b { font-weight: 650; }
.ai-txt span { font-size: var(--t-sm); color: var(--fg-2); }
.ai-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-bar.is-quiet { background: var(--surface-2); }
.ai-bar.is-quiet > .i { color: var(--fg-3); }
.wd-selbar { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 8px); z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease); }
.wd-selbar.is-on { border-color: var(--accent); box-shadow: var(--shadow-2); }
.wd-seln { font-size: var(--t-sm); color: var(--fg-2); white-space: nowrap; padding-left: 4px; }
.wd-seln b { color: var(--fg); }
.wd-assign { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.rolebtn { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 0 12px 0 6px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: var(--t-sm); cursor: pointer; }
.rolebtn .role-sample { min-width: 30px; height: 30px; font-size: 13px; }
.rolebtn:not(:disabled):hover { border-color: var(--fg-3); }
.rolebtn:disabled { opacity: .45; cursor: default; }
.wd-lines { display: grid; }
.wd-line { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 4px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.wd-line:first-child { border-top: 0; }
.wd-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; min-width: 0; }
.wchip { position: relative; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 0; font-size: 15px; font-weight: 550; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; transition: transform var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease); }
.wchip.r-big { font-size: 16px; }
.wchip:hover { transform: translateY(-1px); }
.wchip.is-sel { box-shadow: 0 0 0 2.5px var(--accent), 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); transform: translateY(-1px); }
.wchip.r-accent.is-sel { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 65%, transparent), 0 0 0 2.5px var(--accent), 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); }
.wchip.is-sugg::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 2px var(--bg); }
.wd-help { padding-top: 4px; }
.fixed-box { padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line-strong); display: grid; gap: 6px; }
.fixed-box .eyebrow { display: flex; gap: 6px; align-items: center; }
.fixed-box ul { margin: 0; padding-left: 18px; font-size: var(--t-sm); color: var(--fg-2); display: grid; gap: 2px; }
.locked-panel { display: grid; justify-items: start; gap: 8px; padding: 20px; border-radius: 14px; background: var(--surface-2); }
.locked-panel > .i { color: var(--fg-3); }

@media (max-width: 719px) {
  .wd-selbar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 46; border-radius: 18px 18px 0 0; border-width: 1px 0 0; padding: 10px var(--gutter-r) calc(10px + env(safe-area-inset-bottom, 0px)) var(--gutter-l); transform: translateY(110%); box-shadow: var(--shadow-3); transition: transform var(--d-med) var(--ease); }
  .wd-selbar.is-on { transform: none; }
  .wd-assign { order: 3; flex-basis: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .rolebtn { flex-direction: column; justify-content: center; padding: 6px 4px; gap: 3px; min-height: 62px; font-size: 12px; }
  .wd-clear { margin-left: auto; }
  body.has-wsel .cz-bar { visibility: hidden; }
  .role-tok { grid-template-columns: auto minmax(0, 1fr); }
}

/* placement */
.pl { display: grid; gap: var(--s5); }
.pl-phone { position: relative; width: min(220px, 62vw); margin: 0 auto; border-radius: 24px; padding: 7px; background: #0B0D12; box-shadow: var(--shadow-2); }
.pl-phone .frame { width: 100%; border-radius: 17px; }
.pl-overlay { position: absolute; inset: 7px; border-radius: 17px; pointer-events: none; z-index: 5; overflow: hidden; }
.pl-face { position: absolute; left: 33%; right: 33%; top: 32%; height: 21%; border: 1.5px dashed rgba(255, 255, 255, .8); border-radius: 44%; }
.pl-face span { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font: 600 10px var(--font-body); font-style: normal; color: #fff; background: rgba(0, 0, 0, .55); padding: 1px 6px; border-radius: 4px; }
.pl-zone { position: absolute; left: 3%; right: 3%; height: 13%; transform: translateY(-50%); border-radius: 8px; border: 1.5px dashed rgba(255, 255, 255, .4); display: flex; align-items: flex-start; justify-content: flex-end; padding: 2px 5px; font: 650 9.5px var(--font-body); color: rgba(255, 255, 255, .8); }
.pl-zone.is-on { border: 2px solid #F5A524; background: rgba(245, 165, 36, .14); color: #fff; }
.pl-ui-r, .pl-ui-b { position: absolute; display: none; background: repeating-linear-gradient(45deg, rgba(255, 70, 70, .4) 0 5px, transparent 5px 10px); }
.pl-ui-r { right: 0; top: 46%; bottom: 15%; width: 15%; }
.pl-ui-b { left: 0; right: 0; bottom: 0; height: 13%; }
.show-safe .pl-ui-r, .show-safe .pl-ui-b { display: block; }
.pl-opts { display: grid; gap: 14px; min-width: 0; align-content: start; }
.range { width: 100%; accent-color: var(--accent); height: 30px; margin: 0; }
.range-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.range-head label { font-size: var(--t-sm); font-weight: 600; }
.range-head .mono { font-size: 13px; color: var(--fg-2); }
@media (min-width: 1000px) { .pl { grid-template-columns: 230px minmax(0, 1fr); align-items: start; } .pl-phone { width: 230px; } }

/* colors */
.colors { display: grid; gap: 16px; }
.palettes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.palette { display: grid; gap: 6px; padding: 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; justify-items: center; }
.palette:hover { border-color: var(--line-strong); }
.palette.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.palette-demo { width: 100%; height: 54px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 5px; background: linear-gradient(170deg, #C98E5A, #5A3622); font: 800 15px var(--font-display); color: var(--pt); }
.palette-demo .pa { background: var(--pc); color: #111; padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.palette-demo.is-custom { background: conic-gradient(from 20deg, #FF6B6B, #FFD25C, #7CF0B5, #7CC7FF, #C08BFF, #FF6B6B); color: #fff; }
.palette-demo.is-custom .i { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.palette-name { font-size: 12.5px; font-weight: 600; }
.color-fields { display: grid; gap: 10px; }
.color-row { display: grid; gap: 6px; }
.color-row label { font-size: var(--t-sm); }
.color-in { display: flex; gap: 8px; align-items: center; }
.color-in input[type="color"] { width: 46px; height: 46px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px; background: var(--surface); cursor: pointer; flex: none; }
.color-in .input { min-width: 0; text-transform: uppercase; }
.contrast { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); }
.contrast.is-low { background: var(--danger-soft); }
.contrast > div { flex: 1 1 200px; display: grid; min-width: 0; }
.contrast b { color: var(--ok); }
.contrast.is-low b { color: var(--danger); }
.contrast > div > span { font-size: var(--t-sm); color: var(--fg-2); }
.contrast-demo { width: 52px; height: 44px; border-radius: 8px; display: grid; place-items: center; font: 800 20px var(--font-display); flex: none; }
@media (min-width: 720px) { .color-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* sound / effects / advanced */
.sound, .effects, .advanced { display: grid; gap: 14px; }
.opt-card { display: grid; gap: 2px; padding: 4px 16px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.opt-card > .field { padding-top: 10px; }
.sub-toggles { border-top: 1px solid var(--line); margin-top: 10px; }
.sub-toggles .notify-row { padding-left: 12px; }
.fx-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; }
.fx-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--fg-2); }
.advanced .seg { flex-wrap: wrap; }

@media (min-width: 720px) {
  .cz-mini { display: none; }
  .cz { grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); gap: var(--s6); align-items: start; }
  .cz-preview { display: grid; gap: 12px; position: sticky; top: calc(var(--topbar-h) + 16px); }
  .cz-preview .frame { width: 100%; max-height: calc(100vh - 300px); width: auto; margin: 0 auto; box-shadow: var(--shadow-2); }
  .cz-tabs { margin-inline: 0; padding-inline: 0; }
}
@media (min-width: 1000px) {
  .role-legend { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cz-presets { width: auto; }
  .cz-presets .select { flex: 0 1 220px; }
}
@media (min-width: 1180px) {
  .cz { grid-template-columns: minmax(280px, 330px) minmax(0, 940px); justify-content: center; gap: var(--s8); }
}

/* ---------- polish pass after screenshot review ---------- */
.stepper a { text-decoration: none; }
.scrub { height: 36px; }
.range { height: 36px; }
.pl-zone { pointer-events: auto; cursor: pointer; background: transparent; margin: 0; }
.pl-zone:hover { border-color: rgba(255, 255, 255, .8); }
.pl-zone.is-on span { visibility: hidden; }
.sg-play span { font: 650 13px var(--font-body); }
.sg-play:not(.is-playing) { width: auto; height: 40px; right: 8px; bottom: 8px; transform: none; display: inline-flex; gap: 6px; padding: 0 14px 0 10px; border-radius: 99px; }
.sg-play .i { width: 16px; height: 16px; }
.res-grid > * { min-width: 0; }
@media (max-width: 719px) {
  .res-player .frame, .res-player .rv-controls { width: min(100%, 260px); }
  .res-actions .btn:not(.btn-primary) { font-size: var(--t-sm); min-height: 48px; padding: 0 10px; white-space: normal; text-align: center; line-height: 1.2; }
  .role-legend { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .role-tok { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 4px; padding: 8px 4px; min-height: 0; }
  .role-tok .role-txt span, .role-tok > .i { display: none; }
  .role-tok .role-txt b { font-size: 12px; }
  .cz-title .eyebrow { display: none; }
  .cz-title h1 { font-size: var(--t-xl); }
  .cz-head { align-items: center; }
  .cz, .rv, .sg-layout, .res-grid, .proc-grid, .new-grid { grid-template-columns: minmax(0, 1fr); }
  .cz-panel > * { min-width: 0; max-width: 100%; }
  .cz-tabs { margin-inline: 0; padding-inline: 0; }
  .cz-presets { flex-wrap: nowrap; gap: 6px; min-width: 0; }
  .cz-presets .select { flex: 1 1 0; min-width: 0; }
  .cz-presets .btn { flex: none; padding: 0 10px; }
  .cz-presets .icon-btn { width: 40px; }
}
@media (min-width: 720px) {
  .cz-bar .btn-grow { flex: none; min-width: 220px; }
  .app[data-route="customize"] .actionbar { justify-content: space-between; }
}
@media (min-width: 1000px) {
  .cz-presets { width: 100%; }
  .cz-presets .select { flex: 0 1 220px; min-width: 150px; }
  .cz-presets .btn { flex: none; }
}
