/* Avatar Studio (/avatar.html). Shell tokens only (--zs-*), dark default, light via data-zs-theme. */
.av {
  --av-radius: 14px;
  --av-radius-s: 10px;
  --av-gap: 20px;
  --av-aside: 360px;
  --av-bar-h: 64px;
  --av-ok: #34d399;
  color: var(--zs-text);
  font-family: var(--zs-font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
html[data-zs-theme="light"] .av { --av-ok: #047857; }
.av *, .av *::before, .av *::after, .av-dialog, .av-dialog * { box-sizing: border-box; }
body { background: var(--zs-bg); }
.av [hidden], .av-dialog [hidden], .av-toast[hidden] { display: none !important; }
.av h1, .av h2, .av h3, .av-dialog h2, .av-dialog h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; color: var(--zs-text); }
.av p, .av-dialog p { margin: 0; }
.av-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.av svg, .av-dialog svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- buttons ---------- */
.av-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--av-radius-s);
  border: 1px solid transparent; background: none; color: var(--zs-text);
  font: 600 14px/1 var(--zs-font); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background .14s, border-color .14s, color .14s, opacity .14s;
  -webkit-tap-highlight-color: transparent;
}
.av-btn:focus-visible, .av-icon-btn:focus-visible, .av-link:focus-visible, .av [role=tab]:focus-visible,
.av-presenter-pick:focus-visible, .av-brand:focus-visible, .av-chip:focus-visible, .av-version:focus-visible,
.av-project-link:focus-visible, .av-project-row:focus-visible, .av-toast-action:focus-visible { outline: none; box-shadow: var(--zs-ring); }
.av-btn:disabled { opacity: .45; cursor: not-allowed; }
.av-primary { background: var(--zs-primary-strong); color: var(--zs-on-primary); }
.av-primary:not(:disabled):hover { background: var(--zs-primary); }
.av-secondary { background: var(--zs-bg-2); border-color: var(--zs-border-2); }
.av-secondary:not(:disabled):hover { background: var(--zs-bg-3); }
.av-ghost { color: var(--zs-text-2); }
.av-ghost:not(:disabled):hover { background: var(--zs-bg-2); color: var(--zs-text); }
.av-danger { background: var(--zs-danger); color: #fff; }
.av-danger:not(:disabled):hover { filter: brightness(1.08); }
.av-btn-meta { font-weight: 500; opacity: .82; padding-left: 8px; border-left: 1px solid currentColor; border-left-color: color-mix(in srgb, currentColor 35%, transparent); }
.av-btn-meta:empty { display: none; }
.av-icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--av-radius-s); border: 1px solid transparent; background: none;
  color: var(--zs-text-2); font: 500 20px/1 var(--zs-font); cursor: pointer;
}
.av-icon-btn:not(:disabled):hover { background: var(--zs-bg-2); color: var(--zs-text); }
.av-icon-btn:disabled { opacity: .3; cursor: default; }
.av-icon-danger:not(:disabled):hover { color: var(--zs-danger); }
.av-link {
  padding: 0; border: 0; background: none; color: var(--zs-primary); font: inherit; font-weight: 550;
  text-align: left; cursor: pointer; border-radius: 4px; text-underline-offset: 3px;
}
.av-link:hover { text-decoration: underline; }

/* ---------- form controls ---------- */
.av-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0 0 16px; border: 0; padding: 0; }
.av-field:last-child { margin-bottom: 0; }
.av-field > label, .av-field > legend, .av-label, .av-label-row > label { font-size: 13px; font-weight: 600; color: var(--zs-text-2); padding: 0; }
.av-field > legend { margin-bottom: 8px; }
.av-legend-note { font-weight: 450; color: var(--zs-text-3); margin-left: 6px; }
.av-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.av-count { font-size: 12px; color: var(--zs-text-3); font-variant-numeric: tabular-nums; }
.av-input, .av textarea, .av-dialog textarea, .av-title {
  width: 100%; min-height: 42px; padding: 10px 12px; border-radius: var(--av-radius-s);
  border: 1px solid var(--zs-border-2); background: var(--zs-bg); color: var(--zs-text);
  font: 400 15px/1.45 var(--zs-font); transition: border-color .14s, box-shadow .14s;
}
.av textarea, .av-dialog textarea { resize: vertical; min-height: 64px; }
select.av-input { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--zs-text-3) 50%), linear-gradient(135deg, var(--zs-text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.av-input::placeholder, .av textarea::placeholder, .av-dialog .av-input::placeholder { color: var(--zs-text-3); }
.av-input:focus, .av textarea:focus, .av-title:focus { outline: none; border-color: var(--zs-primary); box-shadow: 0 0 0 3px var(--zs-primary-soft); }
.av-input:disabled, .av textarea:disabled { opacity: .6; cursor: not-allowed; }
.av [aria-invalid="true"] { border-color: var(--zs-danger); }
.av-input-small { width: auto; min-height: 34px; padding: 6px 30px 6px 10px; font-size: 13px; }
.av-help { font-size: 13px; color: var(--zs-text-3); }
.av-help:empty { display: none; }
.av-help[data-tone="danger"], .av [data-tone="danger"].av-scene-time { color: var(--zs-danger); }
.av-help[data-tone="warning"] { color: var(--zs-amber); }
.av-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.av-row > .av-field { margin-bottom: 0; }
.av-row-tight { margin-bottom: 0; }
.av-static { min-height: 42px; display: flex; align-items: center; color: var(--zs-text-2); font-size: 14px; }
.av-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--zs-text); min-height: 42px; padding-top: 10px; }
.av-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--zs-primary-strong); flex: none; cursor: pointer; }
.av-consent { padding: 12px 14px; border: 1px solid var(--zs-border-2); border-radius: var(--av-radius-s); background: var(--zs-bg-2); font-size: 13px; line-height: 1.5; color: var(--zs-text-2); margin: 4px 0 0; }
.av-range { display: flex; align-items: center; gap: 12px; min-height: 42px; }
.av-range input { flex: 1; accent-color: var(--zs-primary-strong); min-width: 0; }
.av-range output { min-width: 56px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.av-inline-alert {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--av-radius-s); font-size: 14px;
  background: color-mix(in srgb, var(--zs-danger) 12%, transparent); color: var(--zs-text);
  border: 1px solid color-mix(in srgb, var(--zs-danger) 35%, transparent);
}
.av-inline-alert a { color: var(--zs-primary); font-weight: 600; }
.av-field-error { font-size: 12px; color: var(--zs-danger); }

/* ---------- loading and gate ---------- */
.av-loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 70vh; color: var(--zs-text-2); }
.av-spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--zs-border-2); border-top-color: var(--zs-primary); animation: av-spin .8s linear infinite; flex: none; }
@keyframes av-spin { to { transform: rotate(360deg); } }
.av-loading-inline { display: flex; align-items: center; gap: 10px; color: var(--zs-text-2); padding: 20px 0; }
.av-gate { max-width: 480px; margin: 0 auto; min-height: 72vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 40px 24px; }
.av-gate-mark { width: 64px; height: 64px; border-radius: 20px; margin-bottom: 8px; background: var(--zs-primary-soft); position: relative; }
.av-gate-mark::after { content: ''; position: absolute; inset: 20px 24px 20px 26px; background: var(--zs-primary); clip-path: polygon(0 0, 100% 50%, 0 100%); border-radius: 2px; }
.av-gate[data-kind="offline"] .av-gate-mark, .av-gate[data-kind="error"] .av-gate-mark { background: color-mix(in srgb, var(--zs-amber) 16%, transparent); }
.av-gate[data-kind="offline"] .av-gate-mark::after, .av-gate[data-kind="error"] .av-gate-mark::after { background: var(--zs-amber); clip-path: none; inset: 18px 30px 26px; border-radius: 2px; box-shadow: 0 12px 0 -1px var(--zs-amber); }
.av-gate h1 { font-size: 24px; }
.av-gate p { color: var(--zs-text-2); }
.av-gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }

/* ---------- library ---------- */
.av-library { max-width: 1120px; margin: 0 auto; padding: 40px 32px 64px; }
.av-lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.av-lib-head h1 { font-size: 30px; margin: 4px 0 8px; }
.av-lib-head p { color: var(--zs-text-2); max-width: 560px; }
.av-eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .08em; color: var(--zs-primary); }
.av-lib-tools { margin-bottom: 20px; max-width: 360px; }
.av-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.av-project-card { padding: 0; overflow: hidden; }
.av-project-link { display: flex; flex-direction: column; gap: 8px; padding: 14px; color: inherit; text-decoration: none; border-radius: var(--av-radius); height: 100%; }
.av-project-link:hover { background: var(--zs-bg-3); }
.av-poster { aspect-ratio: 16 / 10; border-radius: var(--av-radius-s); background: linear-gradient(160deg, var(--zs-primary-soft), var(--zs-bg-3)); display: grid; place-items: center; color: var(--zs-primary); margin-bottom: 4px; }
.av-poster svg { width: 28px; height: 28px; opacity: .8; }
.av-poster { overflow: hidden; }
.av-poster.has-image { aspect-ratio: 4 / 5; background: #000; }
.av-poster img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.av-project-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--zs-text-3); }
.av-meta > * + *::before { content: '·'; margin-right: 10px; color: var(--zs-text-3); }
.av-meta > .av-pill + *::before, .av-meta > .av-pill::before { content: none; }
.av-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--zs-primary-soft); color: var(--zs-primary); white-space: nowrap; }
.av-pill[data-status="review"] { background: color-mix(in srgb, var(--zs-amber) 16%, transparent); color: var(--zs-amber); }
.av-pill[data-status="approved"], .av-pill-ok { background: color-mix(in srgb, var(--av-ok) 16%, transparent); color: var(--av-ok); }
.av-pill[data-status="archived"], .av-pill-quiet { background: var(--zs-bg-3); color: var(--zs-text-2); }

/* ---------- empty states ---------- */
.av-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px; border: 1px dashed var(--zs-border-2); border-radius: var(--av-radius); color: var(--zs-text-2); font-size: 14px; }
.av-empty strong { color: var(--zs-text); font-size: 15px; }
.av-empty .av-btn { margin-top: 8px; }
.av-empty-wide { grid-column: 1 / -1; align-items: center; text-align: center; padding: 56px 24px; }
.av-empty-wide p { max-width: 440px; }
.av-empty-mark { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--zs-primary-soft); color: var(--zs-primary); margin-bottom: 8px; }
.av-empty-mark svg { width: 26px; height: 26px; }

/* ---------- workspace bar ---------- */
.av-workspace { padding-bottom: 48px; }
.av-bar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
  height: 64px; padding: 0 24px; background: var(--zs-bg-glass); border-bottom: 1px solid var(--zs-border);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.av-projects-btn { flex: none; gap: 8px; border: 1px solid var(--zs-border-2); background: var(--zs-bg-2); color: var(--zs-text); font-weight: 600; }
.av-projects-btn:hover { border-color: var(--zs-primary); }
.av-projects-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--zs-primary); color: var(--zs-on-primary); font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.av-projects-count:empty { display: none; }
.av-projects-btn svg { width: 18px; height: 18px; }
.av-projects-btn .av-projects-chevron { width: 14px; height: 14px; }
.av-title-wrap { position: relative; flex: 1 1 auto; min-width: 0; max-width: 440px; }
.av-title { min-height: 40px; padding: 8px 10px; font-size: 16px; font-weight: 600; border-color: transparent; background: transparent; text-overflow: ellipsis; }
.av-title:hover { border-color: var(--zs-border-2); }
.av-title-wrap .av-field-error { position: absolute; left: 10px; top: 100%; margin-top: -2px; white-space: nowrap; }
.av-status-select select { min-height: 34px; padding: 6px 30px 6px 12px; border-radius: 999px; border: 1px solid var(--zs-border-2); background-color: var(--zs-bg-2); color: var(--zs-text); font: 600 13px var(--zs-font); appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--zs-text-3) 50%), linear-gradient(135deg, var(--zs-text-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.av-status-select select:focus-visible { outline: none; box-shadow: var(--zs-ring); }
.av-save { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--zs-text-2); white-space: nowrap; }
.av-save-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--av-ok); flex: none; }
.av-save[data-state="pending"] .av-save-dot, .av-save[data-state="saving"] .av-save-dot, .av-save[data-state="locked"] .av-save-dot { background: var(--zs-primary); animation: av-pulse 1.2s ease-in-out infinite; }
.av-save[data-state="offline"] .av-save-dot, .av-save[data-state="conflict"] .av-save-dot { background: var(--zs-amber); }
.av-save[data-state="error"] .av-save-dot { background: var(--zs-danger); }
.av-save[data-state="error"] { color: var(--zs-danger); }
@keyframes av-pulse { 50% { opacity: .35; } }
.av-save-retry { min-height: 32px; padding: 0 10px; }
.av-banner { margin: 12px 24px 0; padding: 10px 14px; border-radius: var(--av-radius-s); font-size: 14px; border: 1px solid color-mix(in srgb, var(--zs-amber) 35%, transparent); background: color-mix(in srgb, var(--zs-amber) 10%, transparent); }
.av-banner[data-tone="danger"] { border-color: color-mix(in srgb, var(--zs-danger) 35%, transparent); background: color-mix(in srgb, var(--zs-danger) 10%, transparent); }
.av-banner[data-tone="info"] { border-color: var(--zs-border-2); background: var(--zs-bg-2); }

/* ---------- tabs ---------- */
.av-tabs { display: flex; gap: 4px; padding: 12px 24px 0; max-width: calc(760px + var(--av-aside) + 24px + 48px); margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.av-tabs::-webkit-scrollbar { display: none; }
.av [role=tab] {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 999px; background: none; color: var(--zs-text-2);
  font: 600 14px/1 var(--zs-font); white-space: nowrap; cursor: pointer; flex: none;
}
.av [role=tab]:hover { color: var(--zs-text); background: var(--zs-bg-2); }
.av [role=tab][aria-selected="true"] { background: var(--zs-primary-soft); color: var(--zs-text); border-color: color-mix(in srgb, var(--zs-primary) 40%, transparent); }
.av-tab-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; background: var(--zs-bg-3); color: var(--zs-text-2); }
[aria-selected="true"] > .av-tab-n { background: var(--zs-primary-strong); color: var(--zs-on-primary); }
.av-tab-short { display: none; }
.av-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--zs-amber); display: none; }
.av [role=tab]:not([data-issues="0"]):not([data-issues=""]) .av-dot { display: inline-block; }
.av [role=tab]:not([data-issues]) .av-dot { display: none; }

/* ---------- layout ---------- */
.av-layout { display: grid; grid-template-columns: minmax(0, 760px) var(--av-aside); gap: 24px; justify-content: center; align-items: start; padding: 16px 24px 0; }
.av-editor { min-width: 0; }
.av-editor.is-locked .av-panel:not(#avPanel-preview) .av-card:not(:has(.av-composer)) { opacity: .7; }
.av-panel { display: flex; flex-direction: column; gap: 16px; outline: none; }
.av-card { background: var(--zs-bg-2); border: 1px solid var(--zs-border); border-radius: var(--av-radius); padding: 20px; min-width: 0; }
.av-card:empty { display: none; }
.av-card-head { margin-bottom: 16px; }
.av-card-head h2 { font-size: 17px; margin-bottom: 4px; }
.av-card-head p { font-size: 14px; color: var(--zs-text-2); }
.av-card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.av-head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.av-aside { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 96px); overflow: auto; scrollbar-width: thin; }

/* ---------- preview frame ---------- */
.av-frame { position: relative; aspect-ratio: 9 / 16; width: 100%; border-radius: 18px; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, var(--zs-primary-soft), transparent 60%), #0b0b1c; border: 1px solid var(--zs-border); display: grid; place-items: center; }
.av-aside .av-frame { max-height: min(569px, calc(100vh - 320px)); width: auto; margin: 0 auto; height: min(569px, calc(100vh - 320px)); min-height: 360px; }
.av-frame video, .av-frame-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.av-frame-photo { opacity: .92; }
.av-frame-empty { color: rgba(255, 255, 255, .28); }
.av-frame-empty svg { width: 56px; height: 56px; stroke-width: 1.4; }
.av-frame-caption { position: absolute; left: 10%; right: 10%; bottom: 18%; text-align: center; color: #fff; font: 700 17px/1.3 var(--zs-font); text-shadow: 0 2px 10px rgba(0, 0, 0, .75); }
.av-frame-tag { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: rgba(255, 255, 255, .9); font-size: 12px; font-weight: 600; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.av-frame[data-state="ready"] .av-frame-tag { display: none; }
.av-preview-inline:empty { display: none; }
.av-preview-inline .av-frame { max-width: 360px; max-height: 60vh; margin: 0 auto; width: auto; height: min(60vh, 640px); }
.av-ready { background: var(--zs-bg-2); border: 1px solid var(--zs-border); border-radius: var(--av-radius); padding: 14px 16px; font-size: 14px; }
.av-ready ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.av-ready li::marker { color: var(--zs-amber); }
.av-ready .av-link { font-size: 13.5px; font-weight: 500; color: var(--zs-text); }
.av-ready-title { font-weight: 650; }
.av-ready-ok { display: flex; align-items: center; gap: 8px; color: var(--av-ok); font-weight: 600; }
.av-mini-job:empty { display: none; }
.av-mini-job { background: var(--zs-bg-2); border: 1px solid var(--zs-border); border-radius: var(--av-radius); padding: 14px 16px; }

/* ---------- thread ---------- */
.av-thread { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 680px; overflow: auto; }
.av-thread-empty { color: var(--zs-text-3); font-size: 14px; }
.av-msg { padding: 12px 14px; border-radius: var(--av-radius-s); background: var(--zs-bg); border: 1px solid var(--zs-border); font-size: 14px; }
.av-msg-user { background: var(--zs-primary-soft); border-color: transparent; }
.av-msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.av-msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; font-size: 13px; }
.av-msg-head time { color: var(--zs-text-3); font-size: 12px; }
.av-msg.is-failed { border-color: color-mix(in srgb, var(--zs-danger) 40%, transparent); }
.av-msg.is-pending { opacity: .75; }
.av-composer textarea { min-height: 84px; }
.av-composer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.av-composer-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- scenes ---------- */
.av-scenes-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 8px 4px 0; }
.av-scenes-head h2 { font-size: 17px; }
.av-length { display: flex; gap: 12px; font-size: 13px; color: var(--zs-text-2); font-variant-numeric: tabular-nums; }
.av-length-now { font-weight: 650; color: var(--zs-text); }
.av-length-now[data-tone="warning"] { color: var(--zs-amber); }
.av-scenes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.av-scenes:empty { display: none; }
.av-scene { padding: 16px 18px 18px; }
.av-scene-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.av-scene-head h3 { font-size: 15px; white-space: nowrap; }
.av-scene-time { font-size: 13px; color: var(--zs-text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.av-scene-tools { margin-left: auto; display: flex; gap: 2px; }
.av-scene-tools .av-icon-btn { width: 36px; height: 36px; }
.av-add-scene { align-self: flex-start; }
.av-add-scene svg { width: 16px; height: 16px; }

/* ---------- presenters, voices, brands ---------- */
.av-presenters, .av-brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.av-presenter { position: relative; display: flex; flex-direction: column; gap: 4px; }
.av-presenter-pick, .av-brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; width: 100%; min-width: 0;
  border-radius: var(--av-radius-s); border: 1px solid var(--zs-border-2); background: var(--zs-bg); color: var(--zs-text);
  font: inherit; text-align: left; cursor: pointer; transition: border-color .14s, background .14s;
}
.av-presenter-pick:not(:disabled):hover, .av-brand:hover { border-color: var(--zs-primary); }
.av-presenter-pick[aria-checked="true"], .av-brand[aria-checked="true"] { border-color: var(--zs-primary); background: var(--zs-primary-soft); box-shadow: inset 0 0 0 1px var(--zs-primary); }
.av-presenter-pick:disabled { cursor: not-allowed; opacity: .55; }
.av-presenter-photo { width: 100%; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--zs-bg-3); display: grid; place-items: center; color: var(--zs-text-3); }
.av-presenter-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-presenter-photo svg { width: 32px; height: 32px; }
.av-presenter-name, .av-brand-name { font-weight: 600; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-presenter-archive { font-size: 12.5px; padding: 2px 4px; align-self: flex-start; color: var(--zs-text-2); }
.av-presenter-note { grid-column: 1 / -1; }
.av-presenters > .av-empty { grid-column: 1 / -1; }
.av-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.av-choice { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--av-radius-s); border: 1px solid var(--zs-border-2); background: var(--zs-bg); cursor: pointer; transition: border-color .14s, background .14s; }
.av-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.av-choice:hover { border-color: var(--zs-primary); }
.av-choice.is-selected { border-color: var(--zs-primary); background: var(--zs-primary-soft); box-shadow: inset 0 0 0 1px var(--zs-primary); }
.av-choice:has(input:focus-visible) { box-shadow: var(--zs-ring); }
.av-choice-name { font-weight: 600; font-size: 14px; }
.av-voice-note { grid-column: 1 / -1; }
.av-brand-logo { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--zs-bg-3); display: grid; place-items: center; overflow: hidden; font-weight: 700; font-size: 20px; color: var(--zs-text-2); }
.av-brand-logo img { max-width: 80%; max-height: 70%; object-fit: contain; }
.av-brand-none { font-size: 22px; color: var(--zs-text-3); }
.av-swatches { display: flex; gap: 4px; min-height: 12px; }
.av-swatches span { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--zs-border-2); }
.av-brands > .av-help { grid-column: 1 / -1; }

/* ---------- jobs ---------- */
.av-job { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.av-job p { color: var(--zs-text-2); }
.av-job-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.av-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; }
.av-status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--zs-text-3); }
.av-status[data-tone="progress"]::before { background: var(--zs-primary); animation: av-pulse 1.2s ease-in-out infinite; }
.av-status[data-tone="success"]::before { background: var(--av-ok); }
.av-status[data-tone="warning"]::before { background: var(--zs-amber); }
.av-status[data-tone="danger"]::before { background: var(--zs-danger); }
.av-progress { height: 6px; border-radius: 999px; background: var(--zs-bg-3); overflow: hidden; }
.av-progress span { display: block; height: 100%; border-radius: inherit; background: var(--zs-primary-strong); transition: width .4s var(--zs-ease); min-width: 4px; }
.av-issues { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--zs-text-2); }
.av-refund { color: var(--av-ok) !important; font-weight: 600; }
.av-job-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.av-job-actions svg { width: 16px; height: 16px; }
.av-job-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.av-job-list > li { padding: 14px 0; border-top: 1px solid var(--zs-border); }
.av-job-list > li:first-child { border-top: 0; padding-top: 0; }
.av-job-mini .av-job-head .av-meta { display: none; }

/* ---------- mobile action bar (shown below 1100px) ---------- */
.av-actionbar { display: none; }

/* ---------- dialogs ---------- */
.av-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 820px); padding: 0; border: 1px solid var(--zs-border-2);
  border-radius: 18px; background: var(--zs-bg-2); color: var(--zs-text); box-shadow: var(--zs-shadow);
  font-family: var(--zs-font); font-size: 15px; line-height: 1.5; overflow: hidden;
}
.av-dialog[open] { display: flex; flex-direction: column; animation: av-in .2s var(--zs-ease); }
.av-dialog > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.av-dialog::backdrop { background: var(--zs-scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes av-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.av-dialog-small { width: min(420px, calc(100vw - 32px)); }
.av-dialog-side { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(420px, 100vw); border-radius: 0; border-width: 0 0 0 1px; }
.av-dialog-side[open] { animation: av-side .24s var(--zs-ease); }
@keyframes av-side { from { transform: translateX(24px); opacity: 0; } }
.av-dialog-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--zs-border); }
.av-dialog-head h2 { font-size: 17px; flex: 1; min-width: 0; }
.av-dialog-body { padding: 16px 20px; overflow: auto; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.av-dialog-body > .av-field { margin-bottom: 4px; }
.av-dialog-body > p { color: var(--zs-text-2); font-size: 14px; }
.av-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--zs-border); }
.av-foot-split { justify-content: space-between; }
.av-dialog .av-row { margin-bottom: 0; }
.av-project-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.av-project-row { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--av-radius-s); background: none; color: var(--zs-text); font: inherit; text-align: left; cursor: pointer; }
.av-project-row strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-project-row:hover { background: var(--zs-bg-3); }
.av-project-row.is-current { background: var(--zs-primary-soft); }

/* history */
.av-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.av-version { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--av-radius-s); background: none; color: var(--zs-text); font: inherit; text-align: left; cursor: pointer; }
.av-version:hover { background: var(--zs-bg-3); }
.av-version.is-current { background: var(--zs-primary-soft); }
.av-version-n { font-weight: 600; }
.av-version-summary { font-size: 13px; color: var(--zs-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.av-ro-title { font-size: 18px; overflow-wrap: anywhere; }
.av-ro { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.av-ro dt { font-size: 12px; font-weight: 600; color: var(--zs-text-3); text-transform: uppercase; letter-spacing: .04em; }
.av-ro dd { margin: 2px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.av-ro-scenes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.av-ro-scenes li { padding: 12px; border-radius: var(--av-radius-s); background: var(--zs-bg); border: 1px solid var(--zs-border); display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.av-ro-scenes p { white-space: pre-wrap; overflow-wrap: anywhere; }
.av-ro-caption { color: var(--zs-text-2); font-size: 13px; }

/* conflicts */
.av-conflict { border: 1px solid var(--zs-border-2); border-radius: var(--av-radius-s); padding: 12px; margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.av-conflict legend { padding: 0 6px; font-weight: 600; font-size: 14px; }
.av-conflict-opt { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--zs-border); background: var(--zs-bg); cursor: pointer; min-width: 0; position: relative; }
.av-conflict-opt input { position: absolute; top: 12px; right: 12px; accent-color: var(--zs-primary-strong); }
.av-conflict-opt:has(input:checked) { border-color: var(--zs-primary); background: var(--zs-primary-soft); }
.av-conflict-opt:has(input:focus-visible) { box-shadow: var(--zs-ring); }
.av-conflict-side { font-size: 12px; font-weight: 650; color: var(--zs-text-2); text-transform: uppercase; letter-spacing: .04em; }
.av-conflict-value { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 140px; overflow: auto; }
.av-conflict-value em { color: var(--zs-text-3); }

/* quote */
.av-quote { width: 100%; border-collapse: collapse; font-size: 14px; }
.av-quote th, .av-quote td { padding: 7px 0; text-align: left; font-weight: 450; border-bottom: 1px solid var(--zs-border); vertical-align: top; }
.av-quote td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 12px; }
.av-quote tbody th > span + span { margin-left: 10px; }
.av-quote tbody th > .av-pill { vertical-align: 1px; }
.av-q-group th { padding-top: 12px; font-size: 12px; font-weight: 650; color: var(--zs-text-3); text-transform: uppercase; letter-spacing: .05em; }
.av-quote tfoot th, .av-quote tfoot td { font-weight: 700; font-size: 16px; border-bottom: 0; padding-top: 12px; }
.av-balance { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: var(--av-radius-s); background: var(--zs-bg); font-size: 14px; color: var(--zs-text-2) !important; }
.av-balance strong { color: var(--zs-text); font-variant-numeric: tabular-nums; }
.av-balance[data-tone="danger"] strong { color: var(--zs-danger); }
.av-ack { padding: 12px 14px; border-radius: var(--av-radius-s); border: 1px solid color-mix(in srgb, var(--zs-amber) 40%, transparent); background: color-mix(in srgb, var(--zs-amber) 9%, transparent); font-size: 14px; }
.av-ack .av-check { padding-top: 8px; min-height: 0; font-weight: 600; }

/* uploads */
.av-drop { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px dashed var(--zs-border-2); border-radius: var(--av-radius); cursor: pointer; background: var(--zs-bg); transition: border-color .14s, background .14s; }
.av-drop:hover { border-color: var(--zs-primary); background: var(--zs-primary-soft); }
.av-drop:has(input:focus-visible) { box-shadow: var(--zs-ring); }
.av-drop-preview { width: 84px; aspect-ratio: 3 / 4; flex: none; border-radius: 10px; overflow: hidden; background: var(--zs-bg-3); display: grid; place-items: center; color: var(--zs-text-3); }
.av-drop-preview img { width: 100%; height: 100%; object-fit: cover; }
.av-drop-small .av-drop-preview { width: 72px; aspect-ratio: 16 / 9; }
.av-drop-small .av-drop-preview img { object-fit: contain; }
.av-drop-text { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--zs-text-2); }
.av-drop-text strong { font-size: 15px; color: var(--zs-text); }
.av-upload-logo { display: flex; flex-direction: column; gap: 10px; }
.av-colors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.av-color { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--zs-border-2); border-radius: 10px; background: var(--zs-bg); }
.av-color input { width: 34px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; }
.av-color-remove { width: 26px; height: 26px; font-size: 16px; }
.av-color-add { min-height: 36px; }
.av-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.av-chip { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--zs-border-2); background: var(--zs-bg); color: var(--zs-text-2); font: 550 13px var(--zs-font); cursor: pointer; }
.av-chip[aria-pressed="true"] { background: var(--zs-primary-soft); border-color: var(--zs-primary); color: var(--zs-text); }
.av-chip:disabled { opacity: .4; cursor: not-allowed; }

/* toast */
.av-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1500;
  display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 12px; background: var(--zs-text); color: var(--zs-bg);
  font: 500 14px/1.4 var(--zs-font); box-shadow: var(--zs-shadow); animation: av-in .2s var(--zs-ease);
}
.av-toast-action { border: 0; background: none; color: var(--zs-primary-strong); font: 700 14px var(--zs-font); cursor: pointer; white-space: nowrap; padding: 4px; border-radius: 6px; }

/* ---------- tablet: no aside, inline preview, action bar ---------- */
@media (max-width: 1099px) {
  .av-layout { grid-template-columns: minmax(0, 760px); }
  .av-aside { display: none; }
  .av-workspace { padding-bottom: calc(var(--av-bar-h) + 32px + env(safe-area-inset-bottom)); }
  .av-actionbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: calc(var(--av-bar-h) + env(safe-area-inset-bottom)); padding: 0 16px env(safe-area-inset-bottom);
    background: var(--zs-bg-glass); border-top: 1px solid var(--zs-border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .av-actionbar .av-btn { min-height: 44px; padding: 0 20px; }
  .av-actionbar-note { font-size: 13px; color: var(--zs-text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .av-toast { bottom: calc(var(--av-bar-h) + 16px + env(safe-area-inset-bottom)); }
}
@media (min-width: 769px) and (max-width: 1099px) {
  .av-actionbar { left: var(--zs-side-rail); }
  html:not([data-zs-side="collapsed"]) .av-actionbar { left: var(--zs-side-w); }
}

/* ---------- phone ---------- */
@media (max-width: 768px) {
  .av { font-size: 15px; }
  .av-library { padding: 24px 16px 48px; }
  .av-lib-head { flex-direction: column; align-items: stretch; gap: 16px; }
  .av-lib-head h1 { font-size: 24px; }
  .av-lib-tools { max-width: none; }
  .av-grid { grid-template-columns: 1fr; }
  .av-bar { top: calc(var(--zs-mtop-h) + env(safe-area-inset-top)); height: 56px; padding: 0 8px 0 4px; gap: 4px; }
  .av-projects-btn { padding: 0 8px; gap: 5px; }
  .av-status-select, .av-quote-btn { display: none; }
  .av-title { font-size: 15px; padding: 8px 6px; }
  .av-save { margin-left: 0; font-size: 0; gap: 0; padding: 0 8px; }
  .av-save-dot { width: 10px; height: 10px; }
  .av-save-retry { font-size: 13px; }
  .av-banner { margin: 8px 16px 0; }
  .av-tabs { position: sticky; top: calc(var(--zs-mtop-h) + 56px + env(safe-area-inset-top)); z-index: 39; background: var(--zs-bg); padding: 8px 16px; gap: 6px; border-bottom: 1px solid var(--zs-border); }
  .av [role=tab] { min-height: 44px; padding: 0 14px; }
  .av-tab-long { display: none; }
  .av-tab-short { display: inline; }
  .av-tab-n { display: none; }
  .av-layout { padding: 12px 16px 0; gap: 16px; }
  .av-card { padding: 16px; border-radius: 12px; }
  .av-row { grid-template-columns: 1fr; gap: 0; margin-bottom: 0; }
  .av-row > .av-field { margin-bottom: 16px; }
  .av-card .av-row:last-child > .av-field:last-child { margin-bottom: 0; }
  .av-card-head-row { flex-direction: column; align-items: stretch; }
  .av-head-actions { justify-content: flex-start; }
  .av-composer-row { flex-direction: column; align-items: stretch; }
  .av-composer-actions { margin-left: 0; }
  .av-composer-actions .av-btn { flex: 1; min-height: 44px; }
  .av-scenes-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .av-scene { padding: 14px; }
  .av-scene-head { flex-wrap: wrap; row-gap: 6px; }
  .av-scene-tools .av-icon-btn { width: 40px; height: 40px; }
  .av-presenters, .av-brands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .av-choice-grid { grid-template-columns: 1fr 1fr; }
  .av-input, .av textarea, .av-dialog textarea { font-size: 16px; } /* no iOS zoom on focus */
  .av-preview-inline .av-frame { height: min(60vh, 560px); }

  /* dialogs become bottom sheets */
  .av-dialog, .av-dialog-small, .av-dialog-side {
    width: 100vw; max-width: 100vw; margin: auto 0 0; height: auto; max-height: calc(100dvh - 24px);
    border-radius: 18px 18px 0 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom);
  }
  .av-dialog[open], .av-dialog-side[open] { animation: av-sheet .26s var(--zs-ease); }
  .av-dialog-side { height: calc(100dvh - 24px); }
  .av-dialog-head { position: relative; padding-top: 20px; }
  .av-dialog-head::before { content: ''; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--zs-border-2); }
  .av-dialog-foot .av-btn { min-height: 44px; flex: 1; }
  .av-dialog-foot > div { flex: 1; display: flex; }
  .av-dialog-foot > div .av-btn { flex: 1; }
  .av-conflict { grid-template-columns: 1fr; }
  .av-drop-preview { width: 64px; }
  .av-toast { left: 16px; right: 16px; transform: none; max-width: none; }
}
@keyframes av-sheet { from { transform: translateY(40px); opacity: .4; } }
@media (max-width: 380px) {
  .av-choice-grid { grid-template-columns: 1fr; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .av *, .av-dialog, .av-dialog *, .av-toast { animation: none !important; transition: none !important; }
  .av-spinner { animation: av-spin 1.6s linear infinite !important; }
}

/* ================= Simple flow (js/avatar-create.js): My videos + one project screen ================= */
.ac-lightbox, .ac-lightbox * { box-sizing: border-box; }
.ac-home { max-width: 1120px; margin: 0 auto; padding: 40px 32px 72px; }
.ac-home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.ac-home-head h1 { font-size: 30px; margin: 4px 0 8px; }
.ac-home-head p { color: var(--zs-text-2); max-width: 520px; }
.ac-new { min-height: 44px; padding: 0 18px; }
.ac-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.ac-card { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; border-radius: var(--av-radius); outline: none; }
.ac-card-cover {
  position: relative; display: grid; place-items: center; aspect-ratio: 9 / 16; border-radius: var(--av-radius); overflow: hidden;
  background: linear-gradient(160deg, var(--zs-bg-2), var(--zs-bg-3)); border: 1px solid var(--zs-border); color: var(--zs-text-3);
  transition: border-color .16s, transform .2s var(--zs-ease), box-shadow .2s;
}
.ac-card-cover svg { width: 34px; height: 34px; stroke-width: 1.5; }
.ac-card-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ac-card:hover .ac-card-cover { border-color: var(--zs-border-2); transform: translateY(-2px); box-shadow: var(--zs-shadow); }
.ac-card:focus-visible .ac-card-cover { box-shadow: var(--zs-ring); }
.ac-card-body { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; min-width: 0; }
.ac-card-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-card-date { font-size: 13px; color: var(--zs-text-3); }
.ac-home-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 72px 24px; border: 1px dashed var(--zs-border-2); border-radius: 20px; background: var(--zs-bg-2); }
.ac-home-empty h2 { font-size: 20px; }
.ac-home-empty p { color: var(--zs-text-2); max-width: 400px; margin-bottom: 8px; }
.ac-empty-art { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--zs-primary-soft); color: var(--zs-primary); margin-bottom: 6px; }
.ac-empty-art svg { width: 28px; height: 28px; }

/* project screen */
.ac-project { padding-bottom: 64px; }
.ac-bar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
  height: 64px; padding: 0 24px; background: var(--zs-bg-glass, var(--zs-bg)); border-bottom: 1px solid var(--zs-border);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.ac-back { flex: none; padding: 0 12px 0 8px; }
.ac-title {
  flex: 1 1 auto; min-width: 0; max-width: 480px; min-height: 40px; padding: 8px 10px; border-radius: var(--av-radius-s);
  border: 1px solid transparent; background: transparent; color: var(--zs-text); font: 600 16px/1.3 var(--zs-font); text-overflow: ellipsis;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.ac-title:hover { border-color: var(--zs-border-2); }
.ac-title:focus { outline: none; border-color: var(--zs-primary); background: var(--zs-bg); box-shadow: 0 0 0 3px var(--zs-primary-soft); }
.ac-title::placeholder { color: var(--zs-text-3); }
.ac-save { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; font-size: 13px; color: var(--zs-text-3); white-space: nowrap; }
.ac-save-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--av-ok); transition: background .2s; }
.ac-save[data-state="dirty"] .ac-save-dot, .ac-save[data-state="saving"] .ac-save-dot { background: var(--zs-amber); animation: ac-pulse 1s ease-in-out infinite; }
.ac-save[data-state="error"] { color: var(--zs-danger); }
.ac-save[data-state="error"] .ac-save-dot { background: var(--zs-danger); }
.ac-save-retry { min-height: 34px; padding: 0 10px; }

.ac-layout { max-width: 1180px; margin: 0 auto; padding: 32px 32px 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.ac-steps { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ac-step { background: var(--zs-bg-2); border: 1px solid var(--zs-border); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.ac-step-head { display: flex; align-items: flex-start; gap: 14px; }
.ac-step-head > div { flex: 1; min-width: 0; }
.ac-step-head h2 { font-size: 18px; margin-bottom: 4px; }
.ac-step-head p { color: var(--zs-text-2); font-size: 14px; }
.ac-step-n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--zs-primary-soft); color: var(--zs-primary); font-weight: 700; font-size: 14px; }
.ac-count { flex: none; font-size: 13px; font-weight: 600; color: var(--zs-text-2); padding: 4px 10px; border-radius: 999px; background: var(--zs-bg-3); }

.ac-consent { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--zs-bg); border: 1px solid var(--zs-border-2); font-size: 14px; cursor: pointer; }
.ac-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--zs-primary-strong); flex: none; cursor: pointer; }
.ac-field-error { color: var(--zs-danger); font-size: 13px; font-weight: 500; }
.ac-help { color: var(--zs-text-3); font-size: 13px; }

.ac-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 168px; padding: 24px; border-radius: 14px; border: 1.5px dashed var(--zs-border-2); background: var(--zs-bg);
  cursor: pointer; transition: border-color .16s, background .16s;
}
.ac-drop:hover { border-color: var(--zs-primary); }
.ac-drop.is-over { border-color: var(--zs-primary); background: var(--zs-primary-soft); }
.ac-drop.is-busy { opacity: .6; pointer-events: none; }
.ac-drop.is-compact { flex-direction: row; min-height: 0; padding: 14px 16px; text-align: left; justify-content: flex-start; }
.ac-drop.is-compact .ac-drop-text { flex: 1; }
.ac-drop.is-compact .ac-drop-icon { width: 36px; height: 36px; }
.ac-drop-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--zs-primary-soft); color: var(--zs-primary); }
.ac-drop-text { display: flex; flex-direction: column; gap: 2px; }
.ac-drop-text strong { font-size: 15px; font-weight: 600; }
.ac-drop-text span { font-size: 13px; color: var(--zs-text-3); }
.ac-drop-small { min-height: 0; flex-direction: row; justify-content: space-between; text-align: left; padding: 14px 16px; }

.ac-uploads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ac-uploads:empty { display: none; }
.ac-up { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 12px; border-radius: 10px; background: var(--zs-bg); border: 1px solid var(--zs-border); font-size: 13px; }
.ac-up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ac-up-status { color: var(--zs-text-3); font-variant-numeric: tabular-nums; }
.ac-up-bar, .ac-progress { grid-column: 1 / -1; display: block; height: 4px; border-radius: 4px; background: var(--zs-bg-3); overflow: hidden; }
.ac-up-fill, .ac-progress > span { display: block; height: 100%; width: 0; background: var(--zs-primary); border-radius: inherit; transition: width .2s; }
.ac-up.is-done .ac-up-status { color: var(--av-ok); }
.ac-up.is-error { border-color: color-mix(in srgb, var(--zs-danger) 45%, transparent); }
.ac-up-error { grid-column: 1; color: var(--zs-danger); }
.ac-up.is-error .ac-up-name { grid-column: 1; }
.ac-up-dismiss { grid-column: 2; grid-row: 1 / span 2; border: 0; background: none; color: var(--zs-text-3); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.ac-up-dismiss:hover { color: var(--zs-text); background: var(--zs-bg-2); }

.ac-thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ac-thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--zs-bg-3); }
.ac-thumb-open { all: unset; position: absolute; inset: 0; cursor: zoom-in; display: block; }
.ac-thumb-open:focus-visible { box-shadow: inset var(--zs-ring); border-radius: 12px; }
.ac-thumb-open img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s var(--zs-ease); }
.ac-thumb:hover .ac-thumb-open img { transform: scale(1.04); }
.ac-thumb-missing { display: grid; place-items: center; width: 100%; height: 100%; color: var(--zs-text-3); }
.ac-thumb-badge { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px 3px 5px; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ac-thumb-badge svg { width: 11px; height: 11px; }
.ac-thumb-remove {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.62); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s;
}
.ac-thumb-remove svg { width: 14px; height: 14px; }
.ac-thumb:hover .ac-thumb-remove, .ac-thumb:focus-within .ac-thumb-remove { opacity: 1; }
.ac-thumb-remove:hover { background: var(--zs-danger); }
.ac-thumb-remove:focus-visible { opacity: 1; outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--zs-primary); }
@media (hover: none) { .ac-thumb-remove { opacity: 1; } }

.ac-voice-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ac-voice-actions .av-btn[aria-pressed="true"] { border-color: var(--zs-primary); background: var(--zs-primary-soft); color: var(--zs-text); }
.ac-recorder { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 14px; background: var(--zs-bg); border: 1px solid var(--zs-border-2); }
.ac-rec-btn { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--zs-border-2); background: var(--zs-bg-2); cursor: pointer; transition: border-color .15s, transform .15s; }
.ac-rec-btn span { width: 22px; height: 22px; border-radius: 50%; background: #ef4444; transition: border-radius .18s, width .18s, height .18s; }
.ac-rec-btn:hover { border-color: #ef4444; }
.ac-rec-btn:focus-visible { outline: none; box-shadow: var(--zs-ring); }
.ac-recorder[data-state="recording"] .ac-rec-btn { border-color: #ef4444; animation: ac-ring 1.6s ease-out infinite; }
.ac-recorder[data-state="recording"] .ac-rec-btn span { width: 18px; height: 18px; border-radius: 4px; }
.ac-rec-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ac-rec-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--zs-text-2); }
.ac-rec-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--zs-text); }
.ac-rec-meter { display: block; height: 6px; border-radius: 6px; background: var(--zs-bg-3); overflow: hidden; }
.ac-rec-meter span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--av-ok), var(--zs-amber)); transform: scaleX(0); transform-origin: left; transition: transform .08s linear; }
.ac-recorder audio { width: 100%; height: 40px; }
.ac-rec-done { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-drop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ac-drop-actions .av-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ac-cam { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--zs-bg); border: 1px solid var(--zs-border-2); }
.ac-cam-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #0b0b10; }
.ac-cam-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b0b10; }
#acCamLive { transform: scaleX(-1); }
.ac-cam-badge { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ac-cam-badge span:first-child { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: ac-blink 1s steps(2, start) infinite; }
.ac-cam-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: #e5e7eb; font-size: 14px; line-height: 1.5; }
.ac-cam-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ac-cam-label { flex: 1; min-width: 180px; margin: 0; font-size: 14px; color: var(--zs-text-2); }
.ac-cam .ac-rec-btn:disabled { opacity: .45; cursor: default; border-color: var(--zs-border-2); }
.ac-cam[data-state="recording"] .ac-rec-btn { border-color: #ef4444; animation: ac-ring 1.6s ease-out infinite; }
.ac-cam[data-state="recording"] .ac-rec-btn span { width: 18px; height: 18px; border-radius: 4px; }
.ac-cam[data-state="done"] .ac-rec-btn { display: none; }
.ac-cam[data-state="error"] .ac-rec-btn, .ac-cam[data-state="error"] .ac-cam-label { display: none; }
.ac-cam-close { margin-left: auto; }
@keyframes ac-blink { to { visibility: hidden; } }
@media (max-width: 768px) { .ac-cam-stage { aspect-ratio: 3 / 4; } .ac-drop-actions .av-btn { flex: 1 1 100%; } }
@media (prefers-reduced-motion: reduce) { .ac-cam-badge span:first-child { animation: none; } }

.ac-voices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ac-voice { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 12px; border: 1px solid var(--zs-border-2); background: var(--zs-bg); transition: border-color .15s, background .15s; }
.ac-voice.is-selected { border-color: var(--zs-primary); background: var(--zs-primary-soft); }
.ac-voice input { width: 18px; height: 18px; margin: 0; accent-color: var(--zs-primary-strong); cursor: pointer; flex: none; }
.ac-voice input:focus-visible { outline: none; box-shadow: var(--zs-ring); border-radius: 50%; }
.ac-voice label { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.ac-voice label strong { font-size: 14px; font-weight: 600; }
.ac-voice-meta { font-size: 12px; color: var(--zs-text-3); }
.ac-voice-play, .ac-voice-remove { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; transition: background .15s, color .15s; }
.ac-voice-play { background: var(--zs-primary-strong); color: var(--zs-on-primary); }
.ac-voice-play svg { width: 14px; height: 14px; }
.ac-voice-remove { background: none; color: var(--zs-text-3); }
.ac-voice-remove:hover { background: var(--zs-bg-2); color: var(--zs-danger); }
.ac-voice-play:focus-visible, .ac-voice-remove:focus-visible { outline: none; box-shadow: var(--zs-ring); }

.ac-field { position: relative; display: flex; flex-direction: column; gap: 6px; }
.ac-field > label, .ac-label { font-size: 14px; font-weight: 600; color: var(--zs-text); }
.ac-field textarea { min-height: 128px; }
.ac-char { position: absolute; right: 10px; bottom: 8px; font-size: 12px; color: var(--zs-text-3); pointer-events: none; }
.ac-char:empty { display: none; }
.ac-url { position: relative; }
.ac-url svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--zs-text-3); width: 16px; height: 16px; pointer-events: none; }
.ac-url .av-input { padding-left: 36px; }
.ac-url .av-input[aria-invalid="true"] { border-color: var(--zs-danger); }
.ac-dur { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ac-dur-chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--zs-border-2); background: var(--zs-bg); color: var(--zs-text-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.ac-dur-chip:hover { border-color: var(--zs-primary); color: var(--zs-text); }
.ac-dur-chip[aria-checked="true"] { border-color: var(--zs-primary); background: var(--zs-primary-soft); color: var(--zs-text); font-weight: 600; }
.ac-dur-chip:focus-visible { outline: none; box-shadow: var(--zs-ring); }
.ac-aspect .ac-dur-chip { display: inline-flex; align-items: center; gap: 8px; }
.ac-aspect-ico { display: inline-block; flex: none; height: 14px; width: calc(14px * var(--w) / var(--h)); max-width: 22px; max-height: 14px; border: 1.5px solid currentColor; border-radius: 3px; opacity: .7; }
.ac-aspect-ico[style*="--w:16"] { width: 22px; height: 12.4px; }
.ac-aspect .ac-dur-chip[aria-checked="true"] .ac-aspect-ico { opacity: 1; color: var(--zs-primary-strong); }
.ac-remake { display: flex; flex-direction: column; gap: 16px; padding: 16px; border-radius: 14px; border: 1px solid var(--zs-border-2); background: var(--zs-bg); }
.ac-remake[hidden] { display: none; }
.ac-remake .ac-field[hidden] { display: none; }
.ac-chips-wrap .ac-dur-chip, .ac-mode .ac-dur-chip { height: auto; min-height: 38px; padding: 8px 14px; line-height: 1.3; text-align: left; white-space: normal; max-width: 100%; }
.ac-dur-own { position: relative; display: inline-flex; align-items: center; }
.ac-dur-own .av-input { width: 112px; min-height: 38px; padding: 0 40px 0 14px; border-radius: 999px; font-size: 14px; -moz-appearance: textfield; }
.ac-dur-own .av-input::-webkit-outer-spin-button, .ac-dur-own .av-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ac-dur-own > span { position: absolute; right: 14px; font-size: 13px; color: var(--zs-text-3); pointer-events: none; }
.ac-dur-own.is-active .av-input { border-color: var(--zs-primary); background: var(--zs-primary-soft); font-weight: 600; }
.ac-dur-own .av-input[aria-invalid="true"] { border-color: var(--zs-danger); }
.ac-ref { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1px solid var(--zs-border-2); background: var(--zs-bg); }
.ac-ref-video { width: 120px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: #000; flex: none; }
.ac-ref-info { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.ac-ref-info span { color: var(--zs-text-3); font-size: 13px; }
.ac-ref-remove { margin-top: 6px; align-self: flex-start; padding: 0 10px 0 8px; min-height: 34px; }

.ac-cta { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 4px 0 0; }
.ac-create { min-height: 54px; font-size: 16px; border-radius: 14px; box-shadow: 0 8px 24px -10px var(--zs-primary-strong); }
.ac-create:disabled { box-shadow: none; }
.ac-cta-note { text-align: center; font-size: 13px; color: var(--zs-text-2); min-height: 1.4em; }
.ac-cta-note[data-tone="muted"] { color: var(--zs-text-3); }

/* preview column */
.ac-preview { position: sticky; top: 88px; }
.ac-stage { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 20px; background: var(--zs-bg-2); border: 1px solid var(--zs-border); }
.ac-stage h2 { font-size: 15px; }
.ac-frame { position: relative; aspect-ratio: 9 / 16; max-height: calc(100vh - 260px); margin: 0 auto; width: 100%; border-radius: 16px; overflow: hidden; background: var(--zs-bg-3); border: 1px solid var(--zs-border); }
.ac-stage[data-state="result"] .ac-frame { background: #000; max-height: calc(100vh - 340px); }
.ac-result-video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.ac-frame-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; color: var(--zs-text-2); font-size: 13px; }
.ac-frame-empty svg { width: 32px; height: 32px; stroke-width: 1.5; color: var(--zs-text-3); margin-bottom: 4px; }
.ac-frame-empty strong { font-size: 15px; color: var(--zs-text); }
.ac-frame-empty.is-failed svg { color: var(--zs-danger); }
.ac-orb { width: 48px; height: 48px; border-radius: 50%; margin-bottom: 6px; background: conic-gradient(from 0deg, var(--zs-primary), transparent 70%); -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%); mask: radial-gradient(circle, transparent 55%, #000 57%); animation: ac-spin 1.1s linear infinite; }
.ac-result-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ac-result-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-result-meta { font-size: 13px; color: var(--zs-text-3); font-variant-numeric: tabular-nums; }
.ac-note-box { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--zs-border); }
.ac-note-box label { font-size: 14px; font-weight: 600; }
.ac-note-box textarea { min-height: 76px; }
.ac-note-box .av-btn { align-self: flex-start; }
.ac-steps-log { padding-top: 14px; border-top: 1px solid var(--zs-border); }
.ac-steps-log h3 { font-size: 13px; color: var(--zs-text-2); font-weight: 600; margin-bottom: 10px; }
.ac-steps-log ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow: auto; scrollbar-width: thin; }
.ac-steps-log li { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.ac-steps-log time { color: var(--zs-text-3); font-variant-numeric: tabular-nums; padding-top: 1px; }
.ac-steps-log p { color: var(--zs-text-2); white-space: pre-line; overflow-wrap: anywhere; }
.ac-steps-log li.is-live p { color: var(--zs-text); font-weight: 500; }
.ac-steps-log ol { padding-left: 16px; }
.ac-steps-log li { position: relative; }
.ac-steps-log li::before { content: ''; position: absolute; left: -15px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--zs-bg-2); border: 2px solid var(--zs-border); box-sizing: border-box; }
.ac-steps-log li:not(:last-child)::after { content: ''; position: absolute; left: -12px; top: 15px; bottom: -8px; width: 2px; border-radius: 2px; background: var(--zs-border); }
.ac-steps-log li.is-live::before { background: #10b981; border-color: #10b981; animation: ac-live 1.8s ease-out infinite; }
.ac-steps-log li.is-live { animation: ac-rise .55s cubic-bezier(.2, .7, .2, 1) both; }

/* «Making your video»: the person's own media under a moving light, six stages, elapsed time */
.ac-stage[data-state="busy"] .ac-frame { background: #0b0b12; border-color: transparent; box-shadow: 0 24px 48px -28px rgba(15, 10, 40, .55); }
.ac-busy { position: absolute; inset: 0; overflow: hidden; isolation: isolate; color: #fff;
  background: radial-gradient(90% 60% at 15% 0%, color-mix(in srgb, var(--zs-primary) 55%, transparent) 0%, transparent 70%), radial-gradient(90% 60% at 100% 100%, rgba(20, 150, 170, .45) 0%, transparent 65%), #0b0b12; }
.ac-busy::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 6, 12, .78) 0%, rgba(6, 6, 12, .18) 36%, rgba(6, 6, 12, .12) 66%, rgba(6, 6, 12, .66) 100%); }
.ac-busy-bg { position: absolute; inset: -14%; z-index: -3; }
.ac-busy-bg img, .ac-busy-faces img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.6s ease; }
.ac-busy-bg img { filter: blur(26px) saturate(1.4) brightness(.62); animation: ac-kb 16s ease-in-out infinite alternate; }
.ac-busy img.is-on { opacity: 1; }
.ac-busy-dots { position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: .55;
  background-image: radial-gradient(rgba(255, 255, 255, .7) 1px, transparent 1.5px); background-size: 13px 13px;
  -webkit-mask: radial-gradient(closest-side, #000, transparent) 0 0 / 80% 55% no-repeat; mask: radial-gradient(closest-side, #000, transparent) 0 0 / 80% 55% no-repeat;
  animation: ac-dots 11s ease-in-out infinite alternate; }
.ac-busy-sweep { position: absolute; inset: -40% -60%; z-index: 0; pointer-events: none;
  background: linear-gradient(112deg, transparent 44%, rgba(255, 255, 255, .09) 49%, rgba(255, 255, 255, .16) 50%, rgba(255, 255, 255, .09) 51%, transparent 56%);
  animation: ac-sweep 5.5s cubic-bezier(.45, 0, .2, 1) infinite; }
.ac-busy-top { position: absolute; top: 0; left: 0; right: 0; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 22px 22px 0; text-align: left; }
.ac-busy-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .74); }
.ac-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; animation: ac-live 1.8s ease-out infinite; }
.ac-busy-top strong { font-size: 21px; line-height: 1.22; font-weight: 650; letter-spacing: -.012em; color: #fff; text-wrap: balance; text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
.ac-busy-step { margin: 0; font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .76); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; animation: ac-rise .7s cubic-bezier(.2, .7, .2, 1) .1s both; }
.ac-busy-subject { position: absolute; left: 50%; top: 57%; z-index: 1; width: min(48%, 230px); aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; translate: -50% -50%;
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .16), 0 0 50px -10px color-mix(in srgb, var(--zs-primary) 70%, transparent); animation: ac-float 7s ease-in-out infinite; }
.ac-busy-faces { position: absolute; inset: 0; background: #15151d; }
.ac-busy-scan { position: absolute; left: 0; right: 0; top: 0; height: 40%; mix-blend-mode: screen; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--zs-primary) 10%, transparent) 60%, color-mix(in srgb, var(--zs-primary) 32%, transparent) 94%, color-mix(in srgb, var(--zs-primary) 40%, #fff) 99.4%, transparent 100%);
  animation: ac-scan 3.4s cubic-bezier(.55, 0, .45, 1) infinite; }
.ac-busy-corners { position: absolute; inset: 10px; pointer-events: none; --c: rgba(255, 255, 255, .9);
  background: linear-gradient(var(--c) 0 0) 0 0 / 16px 2px, linear-gradient(var(--c) 0 0) 0 0 / 2px 16px, linear-gradient(var(--c) 0 0) 100% 0 / 16px 2px, linear-gradient(var(--c) 0 0) 100% 0 / 2px 16px,
    linear-gradient(var(--c) 0 0) 0 100% / 16px 2px, linear-gradient(var(--c) 0 0) 0 100% / 2px 16px, linear-gradient(var(--c) 0 0) 100% 100% / 16px 2px, linear-gradient(var(--c) 0 0) 100% 100% / 2px 16px;
  background-repeat: no-repeat; }
.ac-busy > .ac-orb { position: absolute; left: 50%; top: 56%; width: 56px; height: 56px; margin: -28px 0 0 -28px; z-index: 1; background: conic-gradient(from 0deg, #fff, transparent 70%); }
.ac-busy-pill { position: absolute; left: 50%; bottom: 18px; z-index: 1; translate: -50% 0; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px 8px 12px; border-radius: 999px; white-space: nowrap;
  background: rgba(18, 18, 26, .42); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); border: 1px solid rgba(255, 255, 255, .16);
  font-size: 12.5px; font-weight: 500; color: #fff; font-variant-numeric: tabular-nums; }
.ac-busy-pill svg, .ac-track-mail svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ac-busy-pill svg { width: 14px; height: 14px; opacity: .85; }
.ac-track { display: flex; flex-direction: column; gap: 12px; }
.ac-track-bar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.ac-track-bar li { display: block; min-width: 0; }
.ac-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ac-track-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: -4px; font-size: 13px; }
.ac-track-meta strong { font-weight: 600; color: var(--zs-text); }
.ac-track-meta span { color: var(--zs-text-3); }
.ac-track-seg { display: block; position: relative; height: 5px; border-radius: 99px; overflow: hidden; background: var(--zs-border); transition: background .4s ease; }
.ac-track-bar li.is-done .ac-track-seg { background: var(--zs-primary); }
.ac-track-bar li.is-now .ac-track-seg { background: color-mix(in srgb, var(--zs-primary) 28%, var(--zs-border)); }
.ac-track-bar li.is-now .ac-track-seg::after { content: ''; position: absolute; inset: 0; width: 55%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--zs-primary) 60%, color-mix(in srgb, var(--zs-primary) 40%, #fff)); animation: ac-seg 1.8s cubic-bezier(.45, 0, .2, 1) infinite; }
.ac-track-times { list-style: none; margin: -6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; font-size: 11.5px; line-height: 1; color: var(--zs-text-3); font-variant-numeric: tabular-nums; }
.ac-track-times li { min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; }
.ac-track-times li.is-done { color: var(--zs-text-2); }
.ac-track-times li.is-now { color: var(--zs-primary); font-weight: 600; }
.ac-social { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--zs-bg-3); }
.ac-social[hidden] { display: none; }
.ac-social-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ac-social-head h3 { font-size: 13.5px; font-weight: 600; margin: 0; }
.ac-social-copy { padding: 6px 12px; font-size: 13px; }
.ac-social-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ac-social-copy.is-done { color: var(--zs-success, #10b981); }
.ac-social-caption { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--zs-text); white-space: pre-line; user-select: text; }
.ac-social-tags { margin: 0; font-size: 13px; line-height: 1.6; color: var(--zs-primary); word-break: break-word; user-select: text; }
.ac-timing { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--zs-bg-3); }
.ac-timing[hidden] { display: none; }
.ac-timing-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.ac-timing-head svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--zs-primary); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ac-timing-head strong { font-weight: 600; color: var(--zs-text); font-variant-numeric: tabular-nums; }
.ac-timing-head span { color: var(--zs-text-3); font-size: 12.5px; }
.ac-timing-head span:empty { display: none; }
.ac-timing-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px 14px; }
.ac-timing-stages li { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--zs-text-3); }
.ac-timing-stages b { font-weight: 500; color: var(--zs-text-2); font-variant-numeric: tabular-nums; }
.ac-track-mail { display: flex; align-items: center; gap: 9px; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--zs-bg-3); font-size: 12.5px; line-height: 1.4; color: var(--zs-text-2); }
.ac-track-mail svg { width: 16px; height: 16px; color: var(--zs-primary); }
@keyframes ac-live { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); } 100% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } }
@keyframes ac-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ac-kb { from { transform: scale(1.04) translate(-2%, -1.5%); } to { transform: scale(1.18) translate(2%, 2%); } }
@keyframes ac-dots { 0% { -webkit-mask-position: 0 0; mask-position: 0 0; } 50% { -webkit-mask-position: 100% 40%; mask-position: 100% 40%; } 100% { -webkit-mask-position: 20% 100%; mask-position: 20% 100%; } }
@keyframes ac-sweep { 0% { transform: translateX(-38%); } 70%, 100% { transform: translateX(38%); } }
@keyframes ac-float { 50% { translate: -50% calc(-50% - 7px); } }
@keyframes ac-scan { from { transform: translateY(-100%); } to { transform: translateY(250%); } }
@keyframes ac-seg { from { transform: translateX(-100%); } to { transform: translateX(190%); } }

.ac-lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 900px); max-height: 92vh; overflow: visible; }
.ac-lightbox::backdrop { background: var(--zs-scrim, rgba(0,0,0,.72)); }
.ac-lightbox-media img, .ac-lightbox-media video { display: block; max-width: min(92vw, 900px); max-height: 86vh; border-radius: 14px; background: #000; }
.ac-lightbox-close { position: absolute; top: -14px; right: -14px; z-index: 1; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--zs-bg); color: var(--zs-text); cursor: pointer; box-shadow: var(--zs-shadow); }
.ac-lightbox-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ac-lightbox-close:focus-visible { outline: none; box-shadow: var(--zs-ring); }

@keyframes ac-pulse { 50% { opacity: .35; } }
@keyframes ac-ring { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); } 100% { box-shadow: 0 0 0 14px rgba(239,68,68,0); } }
@keyframes ac-shimmer { to { background-position: -250% 0, 0 0; } }
@keyframes ac-spin { to { transform: rotate(360deg); } }

@media (max-width: 1023px) {
  .ac-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding: 24px 24px 0; }
}
@media (max-width: 860px) {
  .ac-layout { grid-template-columns: 1fr; padding: 16px 16px 0; gap: 16px; }
  .ac-preview { position: static; }
  .ac-frame { max-width: 320px; max-height: none; }
  .ac-stage[data-state="result"] .ac-frame { max-height: none; }
  .ac-stage[data-state="empty"] .ac-frame { max-width: none; aspect-ratio: auto; min-height: 150px; }
}
@media (max-width: 768px) {
  .ac-home { padding: 24px 16px 56px; }
  .ac-home-head { flex-direction: column; align-items: stretch; gap: 16px; }
  .ac-home-head h1 { font-size: 26px; }
  .ac-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .ac-bar { top: calc(var(--zs-mtop-h) + env(safe-area-inset-top)); height: 56px; padding: 0 8px 0 4px; gap: 4px; }
  .ac-back span { display: none; }
  .ac-back { padding: 0 10px; }
  .ac-title { font-size: 15px; }
  .ac-save { font-size: 12px; }
  .ac-step { padding: 18px 16px; border-radius: 16px; gap: 14px; }
  .ac-step-head h2 { font-size: 17px; }
  .ac-step-head { flex-wrap: wrap; column-gap: 12px; row-gap: 8px; }
  .ac-step-head > div { flex-basis: calc(100% - 42px); }
  .ac-count { order: 3; margin-left: 42px; }
  .ac-drop.is-compact { flex-wrap: wrap; }
  .ac-drop.is-compact .ac-drop-text { flex-basis: calc(100% - 48px); }
  .ac-drop.is-compact .av-btn { flex-basis: 100%; }
  .ac-drop { min-height: 140px; padding: 20px 16px; }
  .ac-drop-small { flex-direction: column; align-items: stretch; text-align: center; }
  .ac-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ac-recorder { padding: 14px; gap: 12px; }
  .ac-ref-video { width: 96px; }
  .ac-voice-actions .av-btn { flex: 1; }
}
@media (max-width: 380px) {
  .ac-save #acSaveText { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ac-orb, .ac-save-dot, .ac-recorder[data-state="recording"] .ac-rec-btn, .ac-busy *, .ac-track-seg::after, .ac-steps-log li, .ac-steps-log li::before { animation: none !important; }
  .ac-busy-scan, .ac-busy-sweep { display: none; }
  .ac-busy img { transition: none; }
  .ac-card-cover, .ac-thumb-open img { transition: none; }
}

/* Card without a finished video: say so instead of an anonymous grey tile */
.ac-card-cover:not(.has-image) { grid-auto-flow: row; align-content: center; gap: 10px; }
.ac-card-cover-note { font-size: 12.5px; font-weight: 500; color: var(--zs-text-3); letter-spacing: .01em; }

/* Delete: on the card (hover / always on touch) and in the project bar */
.ac-card-item { position: relative; }
.ac-card-delete {
  position: absolute; top: 8px; right: 8px; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 10px; background: rgba(15, 15, 20, .62); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: scale(.92); transition: opacity .16s, transform .16s, background .16s;
}
.ac-card-delete svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ac-card-item:hover .ac-card-delete, .ac-card-item:focus-within .ac-card-delete { opacity: 1; transform: none; }
.ac-card-delete:hover { background: #dc2626; }
.ac-card-delete:focus-visible { opacity: 1; outline: none; box-shadow: var(--zs-ring); }
@media (hover: none) { .ac-card-delete { opacity: 1; transform: none; } }
.ac-delete { flex: none; color: var(--zs-text-2); }
.ac-delete svg { width: 17px; height: 17px; }
.ac-delete:hover { color: #dc2626; }
@media (max-width: 768px) { .ac-delete span { display: none; } .ac-delete { padding: 0 10px; } }

/* ================= Stage 2 redesign (10.11.2026): wide two-row layout per design/concept-v1 =================
   Row 1: page head. Row 2: «You on camera» | «Your voice». Row 3: «What the video is about» | sticky preview + CTA.
   .ac-steps is display:contents so the three steps and the aside share one grid. Tokens only (--zs-*). */
.ac-project { --ac-card: var(--zs-bg); --ac-well: var(--zs-rail); --ac-arw: 9; --ac-arh: 16; --ac-aspect-label: "9:16"; }
html[data-zs-theme="dark"] .ac-project { --ac-card: var(--zs-bg-2); --ac-well: var(--zs-bg); }
.ac-project:has(#acAspect [data-aspect="16:9"][aria-checked="true"]) { --ac-arw: 16; --ac-arh: 9; --ac-aspect-label: "16:9"; }
.ac-project:has(#acAspect [data-aspect="1:1"][aria-checked="true"]) { --ac-arw: 1; --ac-arh: 1; --ac-aspect-label: "1:1"; }
.ac-project:has(#acAspect [data-aspect="4:5"][aria-checked="true"]) { --ac-arw: 4; --ac-arh: 5; --ac-aspect-label: "4:5"; }

/* top bar */
.ac-project .ac-bar { padding: 0 28px; gap: 12px; }
.ac-project .ac-back { color: var(--zs-text-2); font-weight: 500; }
.ac-project .ac-back::after { content: ''; width: 1px; height: 20px; margin-left: 10px; background: var(--zs-border); }
.ac-project .ac-title { font-size: 15px; }
.ac-project .ac-save[data-state="saved"] { color: var(--av-ok); }

/* grid */
.ac-project .ac-layout {
  max-width: 1400px; padding: 24px 32px 0; gap: 20px; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, .2fr) 340px;
}
.ac-project .ac-steps { display: contents; }
.ac-page-head { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: -4px; }
.ac-project .ac-page-head h1 { font-size: 24px; line-height: 1.25; letter-spacing: -.02em; font-weight: 650; }
.ac-page-head p { font-size: 14px; color: var(--zs-text-3); }
.ac-step-media { grid-column: 1; grid-row: 2; align-self: stretch; }
.ac-step-voice { grid-column: 2 / -1; grid-row: 2; align-self: stretch; }
.ac-step-story { grid-column: 1 / 3; grid-row: 3; container-type: inline-size; }
.ac-project .ac-preview { grid-column: 3; grid-row: 3; position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* step cards */
.ac-project .ac-step { background: var(--ac-card); border: 1px solid var(--zs-border); border-radius: 14px; padding: 20px 22px 22px; gap: 14px; }
.ac-project .ac-step-head { gap: 12px; }
.ac-project .ac-step-head h2 { font-size: 17px; line-height: 28px; margin-bottom: 2px; }
.ac-project .ac-step-head p { font-size: 14px; color: var(--zs-text-3); line-height: 1.5; }
.ac-project .ac-step-n { position: relative; width: 28px; height: 28px; border-radius: 8px; background: var(--zs-bg-2); color: var(--zs-text-2); font-size: 13px; font-weight: 600; }
.ac-step-media:has(#acMediaGrid:not([hidden])) .ac-step-n,
.ac-step-voice:has(#acVoices:not([hidden])) .ac-step-n { color: transparent; background: color-mix(in srgb, var(--av-ok) 14%, transparent); }
.ac-step-media:has(#acMediaGrid:not([hidden])) .ac-step-n::after,
.ac-step-voice:has(#acVoices:not([hidden])) .ac-step-n::after {
  content: ''; position: absolute; inset: 0; background: var(--av-ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.ac-project .ac-count { background: var(--zs-bg-2); }
.ac-project .ac-consent { background: var(--ac-well); border-color: var(--zs-border); border-radius: 10px; }

/* step 1: media */
.ac-project .ac-drop { background: var(--ac-well); border: 1px dashed var(--zs-border-2); border-radius: 12px; min-height: 152px; padding: 20px; }
.ac-project .ac-drop:hover, .ac-project .ac-drop.is-over { border-color: var(--zs-primary-strong); }
.ac-project .ac-drop.is-over { background: var(--zs-primary-soft); }
.ac-project .ac-drop-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--ac-card); border: 1px solid var(--zs-border); color: var(--zs-text-2); }
.ac-project .ac-drop-text strong { font-size: 14px; }
.ac-project .ac-drop.is-compact { flex-wrap: wrap; gap: 12px; min-height: 0; padding: 12px 14px; }
.ac-project .ac-drop.is-compact .ac-drop-text { flex: 1 1 200px; min-width: 0; }
.ac-project .ac-drop.is-compact .ac-drop-actions { justify-content: flex-start; }
.ac-project .ac-drop-actions .av-btn, .ac-project .ac-voice-actions .av-btn { min-height: 38px; padding: 0 14px; font-weight: 500; background: var(--ac-card); border-color: var(--zs-border-2); }
.ac-project .ac-drop-actions .av-btn:not(:disabled):hover, .ac-project .ac-voice-actions .av-btn:not(:disabled):hover { background: var(--zs-bg-2); }
.ac-project .ac-thumbs { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.ac-project .ac-thumb { border-radius: 10px; border: 1px solid var(--zs-border); }

/* step 2: voice */
.ac-project .ac-step-voice { display: flex; flex-direction: column; }
.ac-wave { display: block; margin-top: auto; color: var(--zs-text-3); opacity: .5; }
.ac-wave svg { display: block; width: 100%; height: 36px; fill: currentColor; stroke: none; }
.ac-step-voice:has(#acVoices:not([hidden])) .ac-wave, .ac-step-voice:has(#acRecorder:not([hidden])) .ac-wave { display: none; }
.ac-project .ac-voice-actions { gap: 8px; }
.ac-project .ac-recorder, .ac-project .ac-voice { background: var(--ac-well); border-color: var(--zs-border); border-radius: 12px; }
.ac-project .ac-voice.is-selected { background: var(--zs-primary-soft); border-color: var(--zs-primary-strong); }

/* step 3: fields */
.ac-project .ac-step-story { gap: 18px; }
.ac-project .ac-field { gap: 7px; }
.ac-project .ac-field > label, .ac-project .ac-label { font-size: 14px; font-weight: 600; }
.ac-project .ac-help { font-size: 13px; line-height: 1.5; }
.ac-project .ac-field textarea { min-height: 112px; border-radius: 10px; }
.ac-project .ac-url .av-input { border-radius: 10px; }

/* chips: segmented rectangles instead of pills */
.ac-project .ac-dur-chip {
  min-height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--zs-border); background: var(--ac-well);
  color: var(--zs-text); font-size: 14px; font-weight: 500;
}
.ac-project .ac-dur-chip:hover { border-color: var(--zs-border-2); background: var(--zs-bg-2); color: var(--zs-text); }
.ac-project .ac-dur-chip[aria-checked="true"] { border-color: var(--zs-primary-strong); background: var(--zs-primary-soft); color: var(--zs-primary); font-weight: 600; }
html[data-zs-theme="dark"] .ac-project .ac-dur-chip[aria-checked="true"] { color: var(--zs-text); }

/* duration: six equal chips + own seconds (≥120 px) */
.ac-project #acDur { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-project #acDur .ac-dur-chip { flex: 1 0 60px; white-space: nowrap; }
.ac-project .ac-dur-own { flex: 0 0 auto; margin-left: 4px; }
.ac-project .ac-dur-own .av-input { width: 136px; min-height: 40px; border-radius: 9px; padding: 0 44px 0 14px; font-size: 14px; background: var(--ac-card); }
.ac-project .ac-dur-own.is-active .av-input { border-color: var(--zs-primary-strong); background: var(--zs-primary-soft); }

/* format: four cards with frame icon + two lines */
.ac-project .ac-aspect { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ac-project .ac-aspect .ac-dur-chip { justify-content: flex-start; gap: 10px; min-height: 58px; padding: 8px 12px; text-align: left; background: var(--ac-card); }
.ac-project .ac-aspect .ac-dur-chip[aria-checked="true"] { background: var(--zs-primary-soft); }
.ac-project .ac-aspect-ico { height: 18px; width: calc(18px * var(--w) / var(--h)); max-width: 26px; max-height: 18px; border-width: 1.5px; border-radius: 3px; opacity: .75; }
.ac-project .ac-aspect-ico[style*="--w:16"] { width: 24px; height: 13.5px; }
.ac-project .ac-aspect-ico[style*="--w:1;"] { width: 16px; height: 16px; }
.ac-aspect-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ac-aspect-txt b { font-size: 14px; font-weight: 600; }
.ac-aspect-txt small { font-size: 12.5px; font-weight: 400; color: var(--zs-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-project .ac-aspect .ac-dur-chip[aria-checked="true"] small { color: var(--zs-text-2); }

/* video mode: two option cards; remake options: stacked radio rows */
.ac-project .ac-mode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ac-project .ac-mode .ac-dur-chip { min-height: 46px; padding: 10px 14px; text-align: left; justify-content: flex-start; background: var(--ac-card); }
.ac-project .ac-mode .ac-dur-chip[aria-checked="true"] { background: var(--zs-primary-soft); }
.ac-project .ac-remake { background: var(--ac-well); border: 1px solid var(--zs-border); border-radius: 12px; padding: 16px; gap: 18px; }
.ac-project .ac-chips-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.ac-project .ac-chips-wrap .ac-dur-chip { position: relative; display: flex; align-items: center; min-height: 42px; padding: 9px 12px 9px 38px; text-align: left; background: var(--ac-card); line-height: 1.35; }
.ac-project .ac-chips-wrap .ac-dur-chip::before { content: ''; position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; border: 1.5px solid var(--zs-border-2); background: var(--zs-bg); box-sizing: border-box; }
.ac-project .ac-chips-wrap .ac-dur-chip[aria-checked="true"]::before { border: 5px solid var(--zs-primary-strong); background: var(--zs-on-primary); }
.ac-project .ac-remake .av-input { background: var(--ac-card); }

/* example: link + upload side by side when the card is wide enough */
.ac-refs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@container (min-width: 640px) { .ac-refs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; } }
.ac-project .ac-drop-small { min-height: 46px; flex-wrap: wrap; gap: 8px 12px; padding: 8px 8px 8px 14px; border-radius: 10px; }
.ac-project .ac-drop-small .ac-drop-text { flex: 1 1 150px; min-width: 0; }
.ac-project .ac-drop-small .ac-drop-text strong { font-size: 13.5px; font-weight: 500; }
.ac-project .ac-drop-small .ac-drop-text span { font-size: 12px; }
.ac-project .ac-drop-small .av-btn { min-height: 34px; padding: 0 12px; font-size: 13px; font-weight: 500; background: var(--ac-card); border-color: var(--zs-border-2); }
.ac-project .ac-ref { background: var(--ac-well); border-color: var(--zs-border); }

/* preview column */
.ac-project .ac-stage { background: var(--zs-bg-2); border: 1px solid var(--zs-border); border-radius: 14px; padding: 16px; gap: 14px; }
html[data-zs-theme="dark"] .ac-project .ac-stage { background: var(--ac-card); }
.ac-project .ac-stage h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.ac-project .ac-stage h2::after { content: var(--ac-aspect-label); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--zs-border-2); background: var(--ac-card); font-size: 12px; font-weight: 500; color: var(--zs-text-2); font-variant-numeric: tabular-nums; }
.ac-project .ac-stage[data-state="busy"] h2::after { content: none; }
.ac-project .ac-frame {
  --ac-fh: clamp(300px, calc(100vh - 300px), 640px);
  aspect-ratio: var(--ac-arw) / var(--ac-arh); width: min(100%, calc(var(--ac-fh) * var(--ac-arw) / var(--ac-arh))); max-height: none;
  border-radius: 12px; background: var(--ac-card); border: 1px solid var(--zs-border);
}
.ac-project .ac-stage[data-state="empty"] .ac-frame, .ac-project .ac-stage[data-state="failed"] .ac-frame { --ac-fh: clamp(240px, calc(100vh - 440px), 420px); }
.ac-project .ac-stage[data-state="busy"] .ac-frame { --ac-arw: 9; --ac-arh: 16; }
.ac-project .ac-stage[data-state="result"] .ac-frame { max-height: none; }
.ac-project .ac-frame-empty { color: var(--zs-text-3); }
.ac-project .ac-frame-empty svg { width: 42px; height: 42px; padding: 10px; border-radius: 11px; border: 1px solid var(--zs-border); background: var(--ac-well); color: var(--zs-text-2); stroke-width: 1.6; }
.ac-project .ac-frame-empty strong { font-size: 14px; line-height: 1.35; }
.ac-project .ac-cta { padding: 0; gap: 8px; }
.ac-project .ac-create { min-height: 52px; border-radius: 12px; font-size: 15px; box-shadow: none; gap: 10px; }
.ac-project .ac-create svg { width: 18px; height: 18px; transition: transform .18s var(--zs-ease); }
.ac-project .ac-create:not(:disabled):hover svg { transform: translateX(3px); }
.ac-project .ac-create:disabled { opacity: 1; background: var(--zs-bg-3); color: var(--zs-text-3); }
.ac-project .ac-cta-note { font-size: 13px; line-height: 1.45; }
.ac-project .ac-cta-note[data-tone="ok"] { color: var(--av-ok); }

/* medium widths (rail sidebar) */
@media (max-width: 1099px) {
  .ac-project .ac-layout { grid-template-columns: minmax(0, 1fr) minmax(0, .15fr) 300px; padding: 20px 24px 0; gap: 16px; }
}
@media (max-width: 899px) {
  .ac-project .ac-layout { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 0; gap: 14px; }
  .ac-page-head, .ac-step-media, .ac-step-voice, .ac-step-story, .ac-project .ac-preview { grid-column: 1; grid-row: auto; }
  .ac-project .ac-preview { position: static; }
  .ac-project .ac-stage[data-state="empty"] .ac-frame, .ac-project .ac-stage[data-state="failed"] .ac-frame { --ac-fh: 360px; max-width: none; min-height: 0; }
  .ac-project .ac-stage[data-state="empty"] .ac-frame { aspect-ratio: var(--ac-arw) / var(--ac-arh); }
  .ac-project .ac-frame { --ac-fh: 520px; max-width: 100%; }
}
@media (max-width: 768px) {
  .ac-project .ac-bar { padding: 0 8px 0 4px; gap: 4px; }
  .ac-project .ac-back::after { margin-left: 6px; }
  .ac-project .ac-back { padding: 0 6px 0 10px; }
  .ac-page-head { flex-direction: column; align-items: flex-start; gap: 2px; margin: 4px 0 2px; }
  .ac-project .ac-page-head h1 { font-size: 22px; }
  .ac-page-head p { font-size: 13px; }
  .ac-project .ac-step { padding: 16px; border-radius: 14px; }
  .ac-project .ac-step-head > div { flex-basis: calc(100% - 40px); }
  .ac-project .ac-count { margin-left: 40px; }
  .ac-project .ac-drop-actions .av-btn { flex: 1 1 100%; }
  .ac-project .ac-voice-actions .av-btn { flex: 1 1 0; }
  .ac-project #acDur { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ac-project .ac-dur-own { grid-column: 1 / -1; justify-self: start; margin: 2px 0 0; }
  .ac-project .ac-dur-own .av-input { width: 148px; }
  .ac-project .ac-aspect { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-project .ac-aspect .ac-dur-chip { padding: 8px 10px; gap: 8px; }
  .ac-aspect-txt small { font-size: 12px; }
  .ac-project .ac-drop-small { flex-direction: row; align-items: center; text-align: left; }
  .ac-project .ac-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
  .ac-project .ac-mode { grid-template-columns: minmax(0, 1fr); }
  .ac-project .ac-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .ac-project .ac-create svg { transition: none; } }
html[data-zs-theme="dark"] .ac-project .ac-step-n, html[data-zs-theme="dark"] .ac-project .ac-count { background: var(--zs-bg-3); }

/* Readable studio conversations in the saved dark theme. */
html[data-zs-theme="dark"] .av {
  --zs-text: #ffffff;
  --zs-text-2: #e5e7ef;
  --zs-text-3: #c3c7d6;
}
html[data-zs-theme="dark"] .ac-steps-log p { color: var(--zs-text); }
html[data-zs-theme="dark"] .ac-note-box textarea {
  border-color: #626b85;
  background: #161b2b;
}
