h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── VideoVsem base ──────────────────────────────────────────────────────── */
:root { --vv-accent: #6d28d9; --vv-bg: #0f1115; --vv-card: #1a1d24; --vv-text: #e8e8ea; --vv-muted: #9aa0aa; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, "Segoe UI", Roboto, sans-serif; background: var(--vv-bg); color: var(--vv-text); }
a { color: #b794f6; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1.25rem; background: #14161c; border-bottom: 1px solid #262a33; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--vv-text); }
.topnav { display: flex; align-items: center; gap: 1rem; }
.topnav .user { color: var(--vv-muted); }
.inline-form { display: inline; margin: 0; }
.linklike { background: none; border: none; color: #b794f6; cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { text-decoration: underline; }

.content { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.lead { color: var(--vv-muted); max-width: 60ch; }
.card { background: var(--vv-card); border: 1px solid #262a33; border-radius: 12px; padding: 1.25rem; margin-top: 1rem; }
.auth-note { color: var(--vv-muted); padding: 1.5rem; }

.data-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.data-table th, .data-table td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid #262a33; }
.data-table th { color: var(--vv-muted); font-weight: 600; }

.auth-card { max-width: 380px; margin: 3rem auto; background: var(--vv-card); border: 1px solid #262a33; border-radius: 12px; padding: 1.75rem; }
.auth-card h1 { margin-top: 0; }
.auth-form { display: flex; flex-direction: column; gap: .85rem; }
.auth-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--vv-muted); }
.auth-form input { padding: .55rem .65rem; border-radius: 8px; border: 1px solid #3a3f4b; background: #0f1115; color: var(--vv-text); font-size: 1rem; }
.auth-form button, .auth-card button[type=submit] { margin-top: .35rem; padding: .6rem; border: none; border-radius: 8px; background: var(--vv-accent); color: white; font-size: 1rem; cursor: pointer; }
.auth-form button:hover { background: #7c3aed; }
.muted { color: var(--vv-muted); font-size: .9rem; margin-top: 1rem; }
.error { color: #ff6b6b; background: #3a1d1d; border: 1px solid #5c2b2b; border-radius: 8px; padding: .5rem .75rem; }

/* ── Pipeline ─────────────────────────────────────────────────────────────── */
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row label { flex: 1; min-width: 140px; }
/* Ссылко-кнопка: и <a>, и <button> выглядят одинаково (без нативного светлого фона в тёмной теме). */
.btn-link { display: inline-block; margin-top: .5rem; background: none; border: none; padding: 0; font: inherit; cursor: pointer; color: #b794f6; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: #f87171; }
.btn-link:disabled { opacity: .5; cursor: default; text-decoration: none; }
.clickable { cursor: pointer; }
.clickable:hover td { background: #20242d; }

.stage-list { list-style: none; padding: 0; margin: 1.25rem 0; display: flex; flex-direction: column; gap: .6rem; }
.stage { background: var(--vv-card); border: 1px solid #262a33; border-left: 4px solid #3a3f4b; border-radius: 10px; padding: .9rem 1.1rem; }
.stage-idle { opacity: .55; }
.stage-await { border-left-color: #d97706; }
.stage-done { border-left-color: #16a34a; }
.stage-gen { border-left-color: #2563eb; }
.stage-rej { border-left-color: #dc2626; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.stage-title { font-weight: 600; }
.badge { font-size: .78rem; padding: .15rem .5rem; border-radius: 999px; border: 1px solid #3a3f4b; color: var(--vv-muted); white-space: nowrap; }
.badge-await { color: #fbbf24; border-color: #7c5312; }
.badge-done { color: #4ade80; border-color: #1f5f33; }
.badge-gen { color: #60a5fa; border-color: #1e3a8a; }
.badge-rej { color: #f87171; border-color: #7f1d1d; }
.artifact { white-space: pre-wrap; word-break: break-word; background: #0f1115; border: 1px solid #262a33; border-radius: 8px; padding: .75rem; margin: .7rem 0 0; font-family: inherit; font-size: .92rem; color: #d6d8dd; }
.approve-box { margin-top: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.approve-box textarea { width: 100%; padding: .55rem .65rem; border-radius: 8px; border: 1px solid #3a3f4b; background: #0f1115; color: var(--vv-text); font: inherit; }
.btn-approve { padding: .5rem .9rem; border: none; border-radius: 8px; background: #16a34a; color: #fff; cursor: pointer; }
.btn-approve:hover { background: #15803d; }
.btn-reject { padding: .5rem .9rem; border: none; border-radius: 8px; background: #b45309; color: #fff; cursor: pointer; }
.btn-reject:hover { background: #92400e; }
button:disabled { opacity: .6; cursor: default; }

/* ── Project panels (accordion + stepper) ─────────────────────────────────── */
.project-head h1 { margin-bottom: .25rem; }
.gen-banner { background:#11233f; border:1px solid #2563eb; color:#bfdbfe; border-radius:8px; padding:.5rem .85rem; margin:.75rem 0; }

.stepper { display:flex; gap:.4rem; flex-wrap:wrap; margin:1rem 0 .25rem; }
.step { width:30px; height:30px; border-radius:50%; border:1px solid #3a3f4b; background:#1a1d24; color:var(--vv-muted); cursor:pointer; font-weight:600; }
.step:hover { border-color:#6d28d9; }
.step-done { background:#16a34a; color:#fff; border-color:#16a34a; }
.step-await { background:#d97706; color:#fff; border-color:#d97706; }
.step-gen { background:#2563eb; color:#fff; border-color:#2563eb; }
.step-rej { background:#dc2626; color:#fff; border-color:#dc2626; }

.panels { display:flex; flex-direction:column; gap:.55rem; margin-top:.5rem; }
.panel { background:var(--vv-card); border:1px solid #262a33; border-left:4px solid #3a3f4b; border-radius:10px; overflow:hidden; }
.panel-await { border-left-color:#d97706; }
.panel-done { border-left-color:#16a34a; }
.panel-gen { border-left-color:#2563eb; }
.panel-rej { border-left-color:#dc2626; }
.panel-idle { opacity:.7; }
.panel-header { width:100%; display:flex; align-items:center; gap:.75rem; padding:.8rem 1rem; background:none; border:none; color:var(--vv-text); cursor:pointer; font-size:1rem; text-align:left; }
.panel-header:hover { background:#20242d; }
.panel-num { width:26px; height:26px; flex:0 0 26px; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; background:#0f1115; border:1px solid #3a3f4b; font-size:.85rem; color:var(--vv-muted); }
.panel-title { font-weight:600; flex:1; }
.panel-header .chev { color:var(--vv-muted); font-size:.8rem; }
.panel-body { padding:0 1rem 1rem 1rem; }
.usage { color:var(--vv-muted); font-size:.8rem; margin-top:.6rem; padding-top:.5rem; border-top:1px solid #262a33; }

/* ── Chat ─────────────────────────────────────────────────────────────────── */
.chat { display:flex; flex-direction:column; gap:.6rem; margin:1rem 0; max-height:62vh; overflow-y:auto; padding:.6rem; background:#14161c; border:1px solid #262a33; border-radius:12px; }
.msg { display:flex; }
.msg-user { justify-content:flex-end; }
.msg-ai { justify-content:flex-start; }
.bubble { max-width:82%; padding:.6rem .85rem; border-radius:12px; white-space:pre-wrap; word-break:break-word; line-height:1.45; }
.msg-user .bubble { background:#6d28d9; color:#fff; border-bottom-right-radius:4px; }
.msg-ai .bubble { background:#1f242d; color:var(--vv-text); border-bottom-left-radius:4px; }
.toolcard { max-width:88%; background:#16202e; border:1px solid #2563eb; border-radius:12px; padding:.7rem .85rem; }
.toolcard.tool-pending { border-color:#d97706; }
.toolcard.tool-done { border-color:#16a34a; }
.toolcard.tool-declined { border-color:#5c2b2b; opacity:.85; }
.tool-q { margin-bottom:.5rem; }
.chat-input { display:flex; gap:.5rem; align-items:flex-end; margin-top:.5rem; }
.chat-input textarea { flex:1; padding:.55rem .65rem; border-radius:8px; border:1px solid #3a3f4b; background:#0f1115; color:var(--vv-text); font:inherit; resize:vertical; }
.chat-input button { padding:.6rem 1.1rem; border:none; border-radius:8px; background:var(--vv-accent); color:#fff; cursor:pointer; }
.chat-input button:hover { background:#7c3aed; }

/* ── Фото-референсы на вход модели (карточка generate_image в чате) ────────── */
.ref-tray { margin:.1rem 0 .55rem; padding:.5rem .55rem; background:#10151d; border:1px dashed #2f6f4f; border-radius:10px; }
.ref-tray-label { font-size:.8rem; color:#9fd6b8; margin-bottom:.45rem; }
.ref-tray-hint { font-size:.74rem; margin:.45rem 0 0; }
.ref-thumbs { display:flex; flex-wrap:wrap; gap:.6rem; }
.ref-thumb { position:relative; width:72px; }
.ref-thumb img { width:72px; height:72px; object-fit:cover; border-radius:8px; border:2px solid #16a34a; display:block; }
.ref-thumb.off img { border-color:#3a3f4b; filter:grayscale(1) brightness(.55); }
.ref-thumb-name { display:block; font-size:.68rem; text-align:center; margin-top:.15rem; color:var(--vv-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ref-thumb-x { position:absolute; top:-7px; right:-7px; width:21px; height:21px; border-radius:50%; border:none; cursor:pointer; font-size:.72rem; line-height:1; color:#fff; background:#16a34a; }
.ref-thumb.off .ref-thumb-x { background:#4b5563; }
.ref-thumb-swap { position:absolute; top:-7px; left:-7px; width:21px; height:21px; border-radius:50%; border:none; cursor:pointer; font-size:.62rem; line-height:1; background:#1f2937; color:#cbd5e1; }
.ref-thumb.add { width:72px; }
.ref-thumb-addbtn { width:72px; height:72px; border:1px dashed #3a3f4b; border-radius:8px; background:#0f1115; color:var(--vv-muted); cursor:pointer; font-size:.7rem; line-height:1.2; }
.ref-thumb-x:disabled, .ref-thumb-swap:disabled, .ref-thumb-addbtn:disabled { opacity:.5; cursor:default; }
.ref-menu { margin:.5rem 0 .1rem; display:flex; flex-direction:column; gap:.3rem; background:#0f1115; border:1px solid #2f6f4f; border-radius:10px; padding:.4rem; }
.ref-menu-item { display:flex; align-items:center; gap:.5rem; width:100%; text-align:left; margin:0; background:#161b22; border:1px solid #2a2f3a; border-radius:8px; padding:.32rem .45rem; color:#e5e7eb; font:inherit; font-size:.82rem; cursor:pointer; }
.ref-menu-item:hover:not(:disabled) { border-color:#34d399; }
.ref-menu-item:disabled { opacity:.5; cursor:default; }
.ref-menu-item img { width:34px; height:34px; object-fit:cover; border-radius:6px; border:1px solid #3a3f4b; flex:0 0 auto; }

/* ── Media (character image / video) ──────────────────────────────────────── */
.char-img { max-width:320px; width:100%; border-radius:10px; margin:.6rem 0; display:block; border:1px solid #262a33; }
.result-video { max-width:100%; border-radius:10px; margin:.6rem 0; display:block; background:#000; }
.settings-row { margin:.5rem 0; }
.settings-row label { color:var(--vv-muted); font-size:.9rem; }
.settings-row select { margin-left:.4rem; padding:.3rem .5rem; background:#0f1115; color:var(--vv-text); border:1px solid #3a3f4b; border-radius:6px; }

/* ── Character roster ─────────────────────────────────────────────────────── */
.roster { margin:1rem 0; }
.roster h2 { margin-bottom:.5rem; }
.roster-grid { display:flex; gap:.75rem; flex-wrap:wrap; }
.char-card { width:160px; background:var(--vv-card); border:1px solid #262a33; border-radius:10px; padding:.5rem; }
.char-card img { width:100%; height:140px; object-fit:cover; border-radius:8px; }
.char-noimg { width:100%; height:140px; display:flex; align-items:center; justify-content:center; background:#0f1115; border:1px dashed #3a3f4b; border-radius:8px; color:var(--vv-muted); font-size:.85rem; }
.char-name { font-weight:600; margin:.4rem 0 .2rem; }
.char-pers { color:var(--vv-muted); font-size:.82rem; max-height:5.4em; overflow:hidden; }

/* ── Episodes (series) ────────────────────────────────────────────────────── */
.episodes-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:1.25rem 0 .5rem; }
.episodes-head h2 { margin:0; }
.episodes-grid { display:flex; gap:.85rem; flex-wrap:wrap; align-items:flex-start; }
.ep-card { width:220px; background:var(--vv-card); border:1px solid #262a33; border-radius:12px; padding:.55rem; position:relative; }
.ep-card.portrait { width:184px; }
.ep-thumb { width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:8px; background:#000; display:block; }
.ep-card.portrait .ep-thumb { aspect-ratio:9/16; }
/* Видео не кропаем (object-fit:contain): 9:16 в портретной карточке заполняет кадр целиком, не обрезаясь. */
video.ep-thumb { object-fit:contain; }
.ep-thumb-empty { display:flex; align-items:center; justify-content:center; font-size:2rem; background:#0f1115; border:1px dashed #3a3f4b; }
.ep-card-title { font-weight:600; margin:.45rem 0 .15rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ep-card-status { color:var(--vv-muted); font-size:.82rem; margin-bottom:.3rem; }

.legacy-stages { margin:1.5rem 0; border:1px solid #262a33; border-radius:10px; padding:.5rem .8rem; background:#101218; }
.legacy-stages > summary { cursor:pointer; color:var(--vv-muted); font-size:.9rem; }
.legacy-stages[open] > summary { margin-bottom:.6rem; }

/* ── Episode chat (two-pane) ──────────────────────────────────────────────── */
.episode-layout { display:flex; gap:1rem; align-items:flex-start; }
.episode-main { flex:1; min-width:0; }
.episode-side { width:300px; flex:0 0 300px; background:var(--vv-card); border:1px solid #262a33; border-radius:12px; padding:.85rem; position:sticky; top:1rem; }
.episode-side h3 { margin:0 0 .6rem; }
.ep-field { margin:.45rem 0; }
.ep-field > span { display:block; color:var(--vv-muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; }
.ep-plot { white-space:pre-wrap; font-size:.9rem; max-height:8em; overflow:auto; }
.ep-status { margin-top:.7rem; padding-top:.55rem; border-top:1px solid #262a33; }
.ep-make { width:100%; margin-top:.7rem; }
.episode-side label.btn-link { display:inline-block; margin-top:.4rem; cursor:pointer; }
@media (max-width:820px) { .episode-layout { flex-direction:column; } .episode-side { width:100%; flex-basis:auto; position:static; } }

/* ── Episode workspace: горизонтальная лента разделов + чат/панель ─────────── */
.ep-workspace { margin-top:.5rem; }
.ep-strip { display:flex; gap:.5rem; align-items:center; overflow-x:auto; padding:.55rem; margin-bottom:.5rem; background:#14161c; border:1px solid #262a33; border-radius:12px; }
/* Группа «Персонажи»: карточки героев + кнопка «➕ Добавить» в одной рамке */
.ep-group { display:flex; flex-direction:column; gap:.25rem; flex:0 0 auto; padding:.3rem .35rem; border:1px dashed #4a3a6b; border-radius:12px; background:#16131f; }
.ep-group-lbl { font-size:.64rem; color:#b9a7e0; text-transform:uppercase; letter-spacing:.04em; padding-left:.15rem; }
.ep-group-tiles { display:flex; gap:.4rem; }
.ep-tile { flex:0 0 auto; display:flex; flex-direction:column; align-items:center; gap:.28rem; width:78px; padding:.45rem .35rem; background:#1a1d24; border:1px solid #3a3f4b; border-radius:10px; color:var(--vv-text); cursor:pointer; font-size:.72rem; }
.ep-tile:hover:not(:disabled) { border-color:#7c3aed; }
.ep-tile.on { background:#2a1d4f; border-color:#7c3aed; }
.ep-tile:disabled { opacity:.55; cursor:default; }
.ep-tile-ico { height:42px; display:flex; align-items:center; justify-content:center; font-size:1.45rem; line-height:1; }
.ep-tile-thumb { width:42px; height:42px; object-fit:cover; border-radius:8px; border:1px solid #3a3f4b; }
/* Несколько фото одного героя в эпизоде: компактная сетка мини-превью внутри плитки. */
.ep-tile-thumbs { position:relative; width:42px; height:42px; display:flex; flex-wrap:wrap; gap:2px; align-content:flex-start; overflow:hidden; }
.ep-tile-thumbs img { width:20px; height:20px; object-fit:cover; border-radius:4px; border:1px solid #3a3f4b; }
.ep-tile-more { position:absolute; right:0; bottom:0; background:#7c3aed; color:#fff; font-size:.58rem; font-weight:700; border-radius:6px; padding:0 3px; line-height:1.35; }
.ep-tile-lbl { max-width:74px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ep-tile-new { border-style:dashed; }
.ep-tile-studio { border-color:#7c3aed; color:#e5d6ff; }
.ep-tile-studio:hover { background:#1a1430; }
.ep-strip-spacer { flex:1 1 auto; }
/* Кнопка запуска рендера в ленте разделов: всегда на виду, с ценой и длительностью. */
.ep-tile-render { width:auto; min-width:118px; padding:.45rem .7rem; background:linear-gradient(90deg,#2563eb,#7c3aed); border:none; color:#fff; font-weight:700; }
.ep-tile-render:hover:not(:disabled) { filter:brightness(1.12); border:none; }
.ep-tile-render:disabled { opacity:.5; }
.ep-tile-render .ep-tile-lbl { max-width:none; }
.ep-tile-render.is-busy { background:#1a1d24; border:1px solid #7c3aed; color:#e5d6ff; font-weight:600; cursor:default; }
.ep-tile-sub { font-size:.7rem; opacity:.9; white-space:nowrap; }
.ep-strip-add { flex:0 0 auto; align-self:center; padding:.5rem .75rem; background:#1a1d24; border:1px dashed #7c3aed; border-radius:10px; color:#e5d6ff; cursor:pointer; white-space:nowrap; font-size:.82rem; }
.ep-strip-add:hover:not(:disabled) { background:#2a1d4f; }
.ep-strip-add:disabled { opacity:.5; cursor:default; }
/* «Видео» — панель рендера во всю ширину (бывшая боковая панель эпизода) */
.ep-panel { width:auto; max-width:860px; position:static; }

/* ── Модалка «＋ Добавить медиа» (AddMediaModal) ───────────────────────────── */
.addm-note { font-size:.82rem; margin:.1rem 0 .6rem; }
.addm-row { display:flex; align-items:center; justify-content:space-between; gap:.7rem; padding:.55rem 0; border-top:1px solid #262a33; }
.addm-kind { font-size:.9rem; }
.addm-actions { display:flex; gap:.4rem; flex-wrap:wrap; justify-content:flex-end; }
.addm-up { cursor:pointer; }

/* ── Панель управления активным разделом (над чатом): герои / сцена / кадры ── */
.ctx-bar { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; margin:.2rem 0 .5rem; padding:.5rem .65rem; background:#14161c; border:1px solid #262a33; border-radius:10px; }
.ctx-bar-title { flex:1 1 100%; color:var(--vv-muted); font-size:.8rem; }
.ctx-thumb { width:54px; height:54px; object-fit:cover; border-radius:8px; border:1px solid #3a3f4b; }
.ctx-hero-img { width:48px; height:48px; object-fit:cover; border-radius:50%; border:1px solid #7c3aed; }
.ctx-hero-meta { display:flex; flex-direction:column; line-height:1.2; }
.ctx-hero-meta .muted { font-size:.76rem; }
.ctx-bar-actions { display:flex; gap:.4rem; flex-wrap:wrap; margin-left:auto; }
.scene-multi-bar { align-items:flex-start; }
.scene-ref-grid { flex:1 1 260px; margin:0; }
.scene-ref-cell img { border-color:#38bdf8; }
.ctx-frames { gap:1.2rem; }
.ctx-frame { display:flex; flex-direction:column; align-items:flex-start; gap:.2rem; }
.ctx-frame-actions { display:flex; gap:.35rem; flex-wrap:wrap; margin-top:.15rem; }

/* Ручной пул фото на вход модели (Seedance/Grok): несколько сцен и несколько фото одного героя */
.ref-pool { padding:.6rem .7rem; background:#0f1115; border:1px solid #262a33; border-radius:10px; }
.ref-pool-grid { display:flex; flex-wrap:wrap; gap:.45rem; margin:.45rem 0 .2rem; }
.ref-pool-cell { position:relative; width:74px; display:flex; flex-direction:column; gap:.12rem; }
.ref-pool-cell img { width:74px; height:74px; object-fit:cover; border-radius:8px; border:1px solid #7c3aed; display:block; }
.ref-pool-cell span { color:var(--vv-muted); font-size:.66rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:center; }
.ref-pool-cell button { position:absolute; top:-7px; right:-7px; width:21px; height:21px; border:none; border-radius:50%; background:#3a1d1d; color:#fca5a5; cursor:pointer; line-height:1; }
.ref-hero-list { display:flex; flex-direction:column; gap:.45rem; margin-top:.55rem; padding-top:.55rem; border-top:1px solid #262a33; }
.ref-hero-row { display:flex; align-items:center; gap:.5rem; }
.ref-hero-row > span { width:96px; flex:0 0 96px; color:var(--vv-muted); font-size:.78rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ref-hero-row > div { display:flex; flex-wrap:wrap; gap:.3rem; }
.ref-hero-img { width:42px; height:42px; padding:0; border:1px solid #3a3f4b; border-radius:8px; background:#0f1115; cursor:pointer; overflow:hidden; }
.ref-hero-img:hover:not(:disabled) { border-color:#7c3aed; }
.ref-hero-img img { width:100%; height:100%; object-fit:cover; display:block; }
.ref-hero-img:disabled { opacity:.45; cursor:default; }

/* Карточки героев эпизода в разделе «Персонаж»: миниатюра + имя + ✕/＋ */
.hero-cards { display:flex; flex-wrap:wrap; gap:.5rem; }
.hero-card { display:inline-flex; align-items:center; gap:.4rem; padding:.25rem .4rem .25rem .3rem; border:1px solid #3a3f4b; border-radius:999px; background:#1a1d24; }
.hero-card.sel { border-color:#7c3aed; background:#2a1d4f; }
.hero-card-img { width:30px; height:30px; border-radius:50%; object-fit:cover; border:1px solid #7c3aed; }
.hero-card-noimg { width:30px; height:30px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:#0f1115; font-size:1rem; }
.hero-card-name { font-size:.86rem; color:var(--vv-text); }
.hero-card-x { border:none; background:#3a3f4b; color:#fff; border-radius:50%; width:20px; height:20px; line-height:1; cursor:pointer; font-size:.78rem; padding:0; flex:0 0 auto; }
.hero-card-x:hover:not(:disabled) { background:#7c3aed; }
.hero-card.sel .hero-card-x { background:#6d28d9; }
.hero-card-x:disabled { opacity:.5; cursor:default; }

/* Голосовой режим (раздел «Сценарий») */
.voice-bar { flex-wrap:wrap; }
.voice-start { padding:.5rem .9rem; border:none; border-radius:10px; background:linear-gradient(90deg,#6d28d9,#2563eb); color:#fff; font-weight:700; cursor:pointer; }
.voice-start:hover:not(:disabled) { filter:brightness(1.1); }
.voice-start:disabled { opacity:.5; cursor:default; }
.voice-select { width:auto; min-width:170px; margin-top:0; }
.voice-hint { flex:1 1 100%; font-size:.78rem; margin-top:.2rem; }
.voice-live { font-weight:700; color:#fca5a5; }
.voice-cost { font-size:.82rem; }
.voice-reset { border-color:#7f1d1d !important; color:#fca5a5 !important; }
.voice-reset:hover:not(:disabled) { background:#3f1d1d !important; }

/* Кнопка запуска финального рендера — приметная (открывает окно подтверждения) */
.ep-render-cta { width:100%; margin:.7rem 0 .25rem; padding:.7rem 1rem; border:none; border-radius:10px; background:linear-gradient(90deg,#2563eb,#7c3aed); color:#fff; font-weight:700; font-size:1rem; cursor:pointer; }
.ep-render-cta:hover:not(:disabled) { filter:brightness(1.12); }
.ep-render-cta:disabled { opacity:.5; cursor:default; }

/* Страница проекта: заголовок + «Редактировать», поля редактора, пагинация эпизодов */
.project-title-row { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; }
.project-title-row h1 { margin:0; }
.edit-label { display:block; color:var(--vv-muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; margin-bottom:.2rem; }
.edit-area { width:100%; box-sizing:border-box; background:#0f1115; border:1px solid #3a3f4b; border-radius:8px; color:var(--vv-text); font:inherit; padding:.55rem .65rem; resize:vertical; }
.edit-area:focus, .ep-select:focus { outline:none; border-color:#7c3aed; }
.episodes-more { display:flex; align-items:center; gap:.9rem; margin:1rem 0 .5rem; }

/* ── Render status (live, with timer) ─────────────────────────────────────── */
.render-box { margin-top:.7rem; padding:.7rem .75rem; background:#11233f; border:1px solid #2563eb; border-radius:10px; }
.render-row { display:flex; align-items:center; gap:.5rem; }
.render-title { font-weight:600; color:#bfdbfe; flex:1; }
.render-timer { font-variant-numeric:tabular-nums; font-weight:700; color:#fff; background:#1e3a8a; padding:.1rem .45rem; border-radius:6px; }
.render-spinner { width:16px; height:16px; flex:0 0 16px; border:2px solid #3b5bdb; border-top-color:#fff; border-radius:50%; animation:vv-spin .8s linear infinite; }
@keyframes vv-spin { to { transform:rotate(360deg); } }
.render-bar { margin:.55rem 0 .35rem; height:5px; background:#0f1115; border-radius:4px; overflow:hidden; }
.render-bar span { display:block; height:100%; width:35%; border-radius:4px; background:linear-gradient(90deg,#2563eb,#7c3aed); animation:vv-slide 1.4s ease-in-out infinite; }
@keyframes vv-slide { 0% { margin-left:-35%; } 100% { margin-left:100%; } }
.render-hint { color:var(--vv-muted); font-size:.78rem; }
.render-done { margin-top:.7rem; color:#34d399; font-weight:600; }

/* ── Модалка предпросмотра рендера (что уйдёт в Veo) ───────────────────────── */
.vv-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.66); display:flex; align-items:flex-start; justify-content:center; padding:3vh 1rem; z-index:1000; overflow:auto; }
.vv-modal { background:var(--vv-card); border:1px solid #3a3f4b; border-radius:14px; width:100%; max-width:680px; box-shadow:0 18px 60px rgba(0,0,0,.5); display:flex; flex-direction:column; max-height:94vh; }
.vv-modal-head { display:flex; align-items:center; justify-content:space-between; padding:.85rem 1.1rem; border-bottom:1px solid #262a33; }
.vv-modal-head h3 { margin:0; font-size:1.1rem; }
.vv-modal-x { background:none; border:none; color:var(--vv-muted); font-size:1.05rem; cursor:pointer; padding:.2rem .45rem; line-height:1; }
.vv-modal-x:hover:not(:disabled) { color:#fff; }
.vv-modal-body { padding:.9rem 1.1rem; overflow:auto; }
.vv-modal-foot { padding:.85rem 1.1rem; border-top:1px solid #262a33; }
.vv-modal-foot .form-row { gap:.6rem; }
.vv-modal-foot .btn-approve, .vv-modal-foot .btn-reject { flex:0 0 auto; padding:.5rem 1.15rem; }
.vv-modal-warn { color:#fbbf24; font-size:.83rem; margin-bottom:.6rem; }
.vv-plan-meta { display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:.7rem; }
.vv-pill { background:#0f1115; border:1px solid #262a33; border-radius:999px; padding:.2rem .6rem; font-size:.8rem; color:var(--vv-muted); }
.vv-pill b { color:var(--vv-text); }
.vv-pill-cost { border-color:#3b5bdb; color:#bfdbfe; }
.vv-plan-refs { margin-bottom:.4rem; }
.vv-ref-label { display:block; color:var(--vv-muted); font-size:.76rem; text-transform:uppercase; letter-spacing:.03em; margin-bottom:.3rem; }
.vv-ref-thumbs { display:flex; flex-wrap:wrap; gap:.4rem; }
.vv-ref-thumbs img { width:54px; height:54px; object-fit:cover; border-radius:8px; border:1px solid #3a3f4b; }
.vv-ref-thumbs img.vv-ref-scene { border-color:#7c3aed; }
.vv-pass { background:#0f1115; border:1px solid #262a33; border-radius:10px; padding:.6rem .7rem; margin-top:.55rem; }
.vv-pass-head { display:flex; align-items:center; gap:.45rem; flex-wrap:wrap; margin-bottom:.4rem; }
.vv-pass-num { font-weight:700; color:#bfdbfe; }
.vv-pass-sec { font-variant-numeric:tabular-nums; background:#1e3a8a; color:#fff; border-radius:6px; padding:.05rem .45rem; font-size:.8rem; }
.vv-pass-tag { font-size:.72rem; color:var(--vv-muted); background:#1a1d24; border:1px solid #3a3f4b; border-radius:999px; padding:.05rem .5rem; }
.vv-pass-final { color:#fcd34d; border-color:#a16207; }
.vv-pass-prompt { white-space:pre-wrap; font-size:.84rem; color:#d6d8dd; line-height:1.42; }
.vv-tabs { display:flex; gap:.4rem; margin:.2rem 0 .5rem; }
.vv-tab { flex:1; padding:.4rem .5rem; border:1px solid #3a3f4b; background:#0f1115; color:var(--vv-muted); border-radius:8px; cursor:pointer; font-size:.82rem; }
.vv-tab:hover { border-color:#7c3aed; }
.vv-tab.on { background:#2a1d4f; border-color:#7c3aed; color:#e5d6ff; font-weight:600; }

/* ── Режим картинок (референсы ↔ кадры) + аудио-блок ───────────────────────── */
.ep-mode { display:flex; gap:.4rem; margin:.3rem 0; }
.ep-mode-btn { flex:1; padding:.4rem .5rem; border:1px solid #3a3f4b; background:#0f1115; color:var(--vv-muted); border-radius:8px; cursor:pointer; font-size:.82rem; }
.ep-mode-btn:hover:not(:disabled) { border-color:#7c3aed; }
.ep-mode-btn.on { background:#2a1d4f; border-color:#7c3aed; color:#e5d6ff; font-weight:600; }
.ep-mode-hint { font-size:.78rem; margin:.2rem 0 .35rem; }
.ep-subfield { color:var(--vv-muted); font-size:.76rem; text-transform:uppercase; letter-spacing:.03em; margin:.35rem 0 .25rem; }
.ep-frames { display:flex; gap:.5rem; }
.ep-frame { flex:1; min-width:0; }
.vv-audio { margin:.5rem 0; padding:.5rem .6rem; background:#0f1115; border:1px solid #262a33; border-radius:10px; }
.vv-audio-head { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; flex-wrap:wrap; margin-bottom:.35rem; }
.vv-audio-source { color:var(--vv-muted); font-size:.76rem; line-height:1.35; max-width:520px; }
.vv-audio-body { white-space:pre-wrap; font-family:inherit; font-size:.82rem; color:var(--vv-text); margin:.25rem 0 0; }
.vv-trunc-warn { margin:.5rem 0; padding:.5rem .65rem; background:#2a210f; border:1px solid #8a6d1f; border-radius:10px; color:#f5d97a; font-size:.83rem; line-height:1.45; }
.vv-pass-edit { width:100%; box-sizing:border-box; background:#0b0d11; border:1px solid #3a3f4b; border-radius:8px; color:#d6d8dd; font-size:.84rem; line-height:1.42; padding:.45rem .55rem; font-family:inherit; resize:vertical; }
.vv-pass-edit:focus { outline:none; border-color:#7c3aed; }
.vv-audio-edit { min-height:118px; border-color:#4c3b72; background:#0c0d12; }
.vv-pass-editfoot { display:flex; align-items:center; gap:.6rem; margin-top:.35rem; flex-wrap:wrap; }
.vv-len { font-size:.74rem; color:var(--vv-muted); font-variant-numeric:tabular-nums; }
.vv-len.over { color:#f5b14a; font-weight:600; }
.vv-save-btn { font-size:.78rem; padding:.22rem .6rem; background:#2a1d4f; border:1px solid #7c3aed; color:#e5d6ff; border-radius:8px; cursor:pointer; }
.vv-save-btn:hover { background:#3a2a6a; }
.vv-save-btn:disabled { opacity:.5; cursor:default; }
.vv-saved { font-size:.74rem; color:#7ee787; }

/* Онлайн-видеоредактор входного ролика */
.vv-video-editor { max-width:980px; }
.ve-title { color:var(--vv-muted); font-size:.82rem; margin-bottom:.45rem; }
.ve-video { width:100%; max-height:50vh; border-radius:10px; background:#000; display:block; }
.ve-progress { display:flex; align-items:center; gap:.65rem; margin:.65rem 0 0; padding:.65rem .75rem; border:1px solid #2563eb; border-radius:8px; background:#10213b; color:#dbeafe; }
.ve-progress .render-spinner { width:20px; height:20px; flex:0 0 20px; }
.ve-progress div { display:flex; flex-direction:column; gap:.08rem; min-width:0; }
.ve-progress b { color:#fff; font-size:.9rem; }
.ve-progress span:not(.render-spinner) { color:#aebbd0; font-size:.78rem; line-height:1.3; }
.ve-error { margin:.65rem 0 0; padding:.55rem .7rem; border:1px solid #7f1d1d; border-radius:8px; background:#2a1113; color:#fecaca; font-size:.84rem; line-height:1.35; }
.ve-tools { display:grid; grid-template-columns:minmax(0, 1.5fr) minmax(260px, .75fr); gap:.75rem; margin-top:.75rem; align-items:stretch; }
.ve-tool { background:#0f1115; border:1px solid #262a33; border-radius:10px; padding:.65rem .7rem; min-width:0; }
.ve-trim-tool { display:flex; flex-direction:column; }
.ve-tool-head { display:flex; align-items:center; justify-content:space-between; gap:.6rem; margin-bottom:.35rem; }
.ve-tool-head span { color:var(--vv-muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; }
.ve-tool-head b { color:#e5d6ff; font-size:.84rem; font-variant-numeric:tabular-nums; }
.ve-timebar { display:flex; align-items:center; gap:.35rem; flex-wrap:wrap; margin:.05rem 0 .45rem; color:var(--vv-muted); font-size:.8rem; font-variant-numeric:tabular-nums; }
.ve-timebar b { color:#fff; font-size:.92rem; }
.ve-timebar-sep { color:#4b5563; }
.ve-timebar-total { margin-left:auto; color:#8f96a3; }
.ve-timeline-shell { display:flex; flex-direction:column; gap:.38rem; }
.ve-timeline { position:relative; height:78px; border:1px solid #343a46; border-radius:8px; background:linear-gradient(#171b22, #101319); overflow:hidden; touch-action:none; user-select:none; cursor:crosshair; outline:none; }
.ve-timeline:focus-visible { box-shadow:0 0 0 2px rgba(124,58,237,.5); border-color:#7c3aed; }
.ve-timeline.is-disabled { opacity:.62; cursor:default; }
.ve-ticks { position:absolute; inset:0; pointer-events:none; }
.ve-tick { position:absolute; top:0; bottom:0; width:1px; background:#2b303b; }
.ve-tick.minor { top:26px; background:#242934; opacity:.9; }
.ve-tick.major { background:#414959; }
.ve-tick.major i { position:absolute; top:7px; left:5px; color:#9ba3af; font-style:normal; font-size:.68rem; white-space:nowrap; font-variant-numeric:tabular-nums; }
.ve-selection { position:absolute; top:31px; height:30px; min-width:0; border:1px solid #9b7cf5; border-radius:7px; background:rgba(124,58,237,.28); box-shadow:0 0 0 1px rgba(124,58,237,.22), inset 0 0 0 1px rgba(255,255,255,.05); cursor:grab; }
.ve-selection:active { cursor:grabbing; }
.ve-selection.is-outside { display:none; }
.ve-selection-fill { position:absolute; inset:0 10px; min-width:4px; background:linear-gradient(90deg, rgba(139,92,246,.2), rgba(59,130,246,.24)); }
.ve-handle { position:absolute; top:-7px; width:18px; height:42px; padding:0; border:1px solid #c4b5fd; border-radius:6px; background:#8b5cf6; cursor:ew-resize; z-index:2; box-shadow:0 8px 18px rgba(0,0,0,.35); }
.ve-handle:disabled { cursor:default; }
.ve-handle::before { content:""; position:absolute; inset:9px 7px; border-left:1px solid rgba(255,255,255,.75); border-right:1px solid rgba(255,255,255,.75); }
.ve-handle-start { left:-9px; }
.ve-handle-end { right:-9px; }
.ve-playhead { position:absolute; top:0; bottom:0; width:2px; background:#f8fafc; box-shadow:0 0 0 1px rgba(0,0,0,.28), 0 0 14px rgba(255,255,255,.45); pointer-events:none; }
.ve-playhead::before { content:""; position:absolute; left:50%; top:0; transform:translateX(-50%); border-left:5px solid transparent; border-right:5px solid transparent; border-top:8px solid #f8fafc; }
.ve-overview { position:relative; height:20px; border:1px solid #303642; border-radius:5px; background:#151922; overflow:hidden; cursor:pointer; touch-action:none; }
.ve-overview-selection { position:absolute; top:3px; bottom:3px; min-width:8px; border-radius:4px; background:rgba(139,92,246,.7); cursor:grab; z-index:2; }
.ve-overview-window { position:absolute; top:0; bottom:0; min-width:12px; border:1px solid #e5d6ff; border-radius:4px; background:rgba(255,255,255,.07); box-shadow:0 0 0 999px rgba(0,0,0,.22); pointer-events:none; }
.ve-zoom-row { display:flex; align-items:center; gap:.45rem; margin:.48rem 0 .15rem; flex-wrap:wrap; color:var(--vv-muted); font-size:.78rem; }
.ve-zoom-controls { display:flex; gap:.25rem; }
.ve-icon-btn { width:30px; height:28px; display:inline-flex; align-items:center; justify-content:center; padding:0; border:1px solid #3a3f4b; border-radius:7px; background:#171b23; color:#d6d8dd; font-weight:700; cursor:pointer; }
.ve-icon-btn:hover:not(:disabled) { border-color:#7c3aed; color:#fff; background:#211a38; }
.ve-icon-btn:disabled { opacity:.5; cursor:default; }
.ve-icon-wide { width:42px; font-size:.72rem; }
.ve-zoom-value { color:#e5d6ff; font-weight:700; min-width:42px; font-variant-numeric:tabular-nums; }
.ve-view-range { margin-left:auto; font-variant-numeric:tabular-nums; }
.ve-limit-warn { color:#fbbf24; }
.ve-action-row { margin-top:auto; }
@media (max-width:720px) {
  .vv-video-editor { max-width:100%; }
  .ve-video { max-height:42vh; }
  .ve-tools { grid-template-columns:1fr; }
  .ve-timebar-total, .ve-view-range { margin-left:0; flex:1 1 100%; }
  .ve-timeline { height:72px; }
}

/* ── Узкая модалка + выбор фото героя ─────────────────────────────────────── */
.vv-modal-narrow { max-width:440px; }
.vv-modal-full { max-width:1100px; width:96vw; height:92vh; max-height:92vh; }

/* ── Мини-редактор изображения (поворот/обрезка краёв) ─────────────────────── */
.vved-toolbar { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; margin-bottom:.6rem; }
.vved-stage { position:relative; width:100%; height:62vh; background:#0b0d11; border:1px solid #262a33; border-radius:10px; overflow:hidden; display:flex; align-items:center; justify-content:center; touch-action:none; user-select:none; }
.vved-img { max-width:100%; max-height:100%; object-fit:contain; display:block; transform-origin:center center; pointer-events:none; }
.vved-frame { position:absolute; box-sizing:border-box; border:2px solid var(--vv-accent); box-shadow:0 0 0 9999px rgba(0,0,0,.55); }
.vved-edge { position:absolute; }
.vved-edge-top, .vved-edge-bottom { left:0; right:0; height:20px; cursor:ns-resize; }
.vved-edge-top { top:-10px; }
.vved-edge-bottom { bottom:-10px; }
.vved-edge-left, .vved-edge-right { top:0; bottom:0; width:20px; cursor:ew-resize; }
.vved-edge-left { left:-10px; }
.vved-edge-right { right:-10px; }
.vved-edge::after { content:""; position:absolute; background:var(--vv-accent); border-radius:2px; }
.vved-edge-top::after, .vved-edge-bottom::after { left:50%; top:50%; transform:translate(-50%,-50%); width:36px; height:3px; }
.vved-edge-left::after, .vved-edge-right::after { top:50%; left:50%; transform:translate(-50%,-50%); width:3px; height:36px; }
.vved-actions { display:flex; gap:.6rem; align-items:center; margin-top:.7rem; }

/* ── Вложение фото к сообщению чата (вписать героя в сцену/фон) ─────────────── */
.attach-bar { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; margin:.3rem 0 .35rem; }
.attach-up { cursor:pointer; }
.attach-chip { display:inline-flex; align-items:center; gap:.4rem; background:#1f242d; border:1px solid #3a3f4b; border-radius:8px; padding:.25rem .45rem; font-size:.8rem; color:var(--vv-text); }
.attach-chip img { width:34px; height:34px; object-fit:cover; border-radius:5px; display:block; }
.attach-chip button { background:none; border:none; color:var(--vv-muted); cursor:pointer; font-size:.9rem; padding:0 .15rem; line-height:1; }
.attach-chip button:hover { color:#f87171; }
.pick-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:.5rem; }
.pick-cell { position:relative; padding:0; border:2px solid #3a3f4b; border-radius:10px; overflow:hidden; background:#0f1115; cursor:pointer; aspect-ratio:1/1; display:flex; align-items:center; justify-content:center; color:var(--vv-muted); }
.pick-cell img { width:100%; height:100%; object-fit:cover; display:block; }
.pick-cell:hover:not(:disabled) { border-color:#7c3aed; }
.pick-cell.on { border-color:#34d399; box-shadow:0 0 0 2px rgba(52,211,153,.35) inset; }
.pick-cell .pick-check { position:absolute; top:4px; right:4px; background:#059669; color:#fff; border-radius:999px; width:20px; height:20px; display:flex; align-items:center; justify-content:center; font-size:.8rem; }
.pick-none { font-size:.82rem; text-align:center; line-height:1.2; }

/* ── Пикер «Выбрать из архива» / библиотека изображений ───────────────────── */
.vv-modal-wide { max-width:880px; }
.arch-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; justify-content:space-between; margin-bottom:.55rem; }
.arch-tabs { display:flex; flex-wrap:wrap; gap:.3rem; }
.arch-tab { background:#0f1115; border:1px solid #262a33; color:var(--vv-muted); border-radius:999px; padding:.28rem .7rem; font-size:.8rem; cursor:pointer; }
.arch-tab:hover:not(:disabled) { color:#fff; }
.arch-tab.on { border-color:#7c3aed; color:#c4b5fd; }
.arch-scope { display:flex; align-items:center; gap:.35rem; font-size:.82rem; color:var(--vv-muted); cursor:pointer; white-space:nowrap; }
.arch-search { width:100%; box-sizing:border-box; margin-bottom:.7rem; padding:.45rem .6rem; background:#1a1d24; color:var(--vv-text); border:1px solid #3a3f4b; border-radius:8px; }
.arch-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:.6rem; }
.arch-cell { position:relative; padding:0; border:2px solid #3a3f4b; border-radius:10px; overflow:hidden; background:#0f1115; cursor:pointer; display:flex; flex-direction:column; text-align:left; }
.arch-cell:hover:not(:disabled) { border-color:#7c3aed; }
.arch-cell:disabled { opacity:.6; cursor:default; }
.arch-thumb { width:100%; aspect-ratio:1/1; object-fit:cover; display:block; background:#000; }
.arch-badge { position:absolute; top:5px; left:5px; background:rgba(0,0,0,.62); border-radius:7px; padding:.05rem .3rem; font-size:.82rem; }
.arch-cap { padding:.3rem .4rem; font-size:.72rem; color:var(--vv-text); line-height:1.25; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.arch-date { display:block; color:var(--vv-muted); font-size:.68rem; }
.arch-foot { display:flex; align-items:center; justify-content:space-between; gap:.6rem; margin-top:.7rem; }

/* ── Страница «Архив» ──────────────────────────────────────────────────────── */
.arch-page-tabs { display:flex; gap:.4rem; margin:.8rem 0 1rem; }
.arch-page-tabs .arch-tab { padding:.4rem 1rem; font-size:.9rem; }
.arch-vid-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:1rem; }
.arch-vid-card { background:var(--vv-card); border:1px solid #262a33; border-radius:12px; padding:.6rem; display:flex; flex-direction:column; gap:.35rem; }
.arch-vid-card video { width:100%; border-radius:8px; background:#000; max-height:380px; }
.arch-vid-card video.portrait { max-height:460px; object-fit:contain; }
.arch-vid-title { font-weight:600; font-size:.92rem; }
.arch-vid-meta { font-size:.76rem; color:var(--vv-muted); }
.arch-vid-actions { display:flex; align-items:center; gap:.5rem; margin-top:.15rem; }
.arch-badge-cur { color:#34d399; }
.arch-badge-old { color:var(--vv-muted); }
.arch-confirm { font-size:.82rem; color:#fbbf24; }
.arch-confirm .form-row { margin-top:.3rem; gap:.5rem; }
.arch-cell-static { cursor:default; }
.arch-cell-static:hover { border-color:#3a3f4b; }
.arch-cell-del { position:absolute; top:5px; right:5px; background:rgba(0,0,0,.62); border:none; color:#fff; border-radius:7px; padding:.05rem .35rem; font-size:.82rem; cursor:pointer; }
.arch-cell-del:hover:not(:disabled) { background:#b91c1c; }
.arch-cell-confirm { position:absolute; inset:auto 0 0 0; display:flex; gap:.4rem; justify-content:center; padding:.35rem; background:rgba(0,0,0,.78); }

/* ── Настройки видео на странице эпизода (модель + слайдер длительности) ───── */
.ep-settings { padding:.6rem .7rem; background:#0f1115; border:1px solid #262a33; border-radius:10px; }
.ep-select { width:100%; margin-top:.3rem; padding:.35rem .4rem; background:#1a1d24; color:var(--vv-text); border:1px solid #3a3f4b; border-radius:8px; }
.dur-range { width:100%; margin:.35rem 0 .15rem; accent-color:#7c3aed; }
.dur-ticks { display:flex; justify-content:space-between; font-size:.74rem; color:var(--vv-muted); font-variant-numeric:tabular-nums; }
.dur-tick.on { color:#c4b5fd; font-weight:700; }
.dur-current { color:var(--vv-text); }
.ep-hint { font-size:.76rem; margin:.45rem 0 0; }
.settings-note { margin:.4rem 0 0; }

/* фишки героев: миниатюра выбранного фото + кнопка смены фото */
.hero-chip-wrap { display:inline-flex; align-items:center; gap:.15rem; }
.hero-chip-img { width:22px; height:22px; border-radius:50%; object-fit:cover; margin-right:.1rem; border:1px solid #7c3aed; }
.hero-chip-img.dim { opacity:.4; filter:grayscale(1); border-color:#3a3f4b; }
.hero-chip-photo { border:1px solid #3a3f4b; background:#1a1d24; color:var(--vv-text); border-radius:8px; padding:.18rem .4rem; cursor:pointer; font-size:.85rem; line-height:1; }
.hero-chip-photo:hover:not(:disabled) { border-color:#7c3aed; }

/* анимированная плитка рендера на карточке эпизода (серия) */
.ep-thumb-render { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.5rem; position:relative; background:#11233f; border:1px solid #2563eb; }
.ep-thumb-render .render-spinner { width:26px; height:26px; border-width:3px; flex:none; }
.ep-thumb-timer { font-variant-numeric:tabular-nums; font-weight:700; color:#fff; background:#1e3a8a; padding:.12rem .55rem; border-radius:6px; }
.ep-thumb-bar { position:absolute; left:0; right:0; bottom:0; height:4px; background:#0f1115; overflow:hidden; }
.ep-thumb-bar > span { display:block; height:100%; width:35%; background:linear-gradient(90deg,#2563eb,#7c3aed); animation:vv-slide 1.4s ease-in-out infinite; }

/* шапка списка сериалов: заголовок + кнопка «Новый сериал» */
.projects-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin-bottom:1rem; }
.projects-head h1 { margin:0; }

/* ── Стоимость ────────────────────────────────────────────────────────────── */
.grand-total { font-size:1.05rem; margin:.25rem 0 1.25rem; }
.cost-breakdown { font-size:.82rem; margin-top:-.35rem; }
.ep-card-cost { color:var(--vv-muted); font-size:.8rem; margin-bottom:.3rem; }
.ep-card-foot { display:flex; align-items:center; gap:.35rem; }
.ep-foot-spacer { flex:1; }
.ep-icon-btn { background:none; border:none; padding:.15rem .4rem; cursor:pointer; color:var(--vv-muted); font-size:1.05rem; line-height:1; border-radius:6px; }
.ep-icon-btn:hover { background:#20242d; color:var(--vv-text); }
.ep-icon-btn:disabled { opacity:.5; cursor:default; }
.ep-menu-backdrop { position:fixed; inset:0; z-index:40; }
.ep-menu { position:absolute; right:.55rem; bottom:2.5rem; z-index:41; min-width:160px; background:#1f242d; border:1px solid #3a3f4b; border-radius:10px; padding:.3rem; box-shadow:0 12px 30px rgba(0,0,0,.45); display:flex; flex-direction:column; gap:.1rem; }
.ep-menu-item { display:flex; align-items:center; gap:.5rem; width:100%; text-align:left; background:none; border:none; color:var(--vv-text); cursor:pointer; font:inherit; padding:.45rem .55rem; border-radius:7px; }
.ep-menu-item:hover { background:#2a2f3a; text-decoration:none; }
.ep-menu-item:disabled { opacity:.5; cursor:default; }
.ep-menu-item.danger { color:#f87171; }
.ep-menu-item.danger:hover { background:#3a1d1d; }
.ep-del-confirm { font-size:.82rem; color:#fca5a5; }
.ep-del-confirm .form-row { margin-top:.3rem; gap:.5rem; }
.ep-cost { margin-top:.85rem; padding-top:.55rem; border-top:1px solid #262a33; }
.ep-script { margin-top:.7rem; padding:.6rem .7rem; background:#0f1115; border:1px solid #262a33; border-radius:8px; white-space:pre-wrap; font-size:.85rem; color:#d6d8dd; max-height:16em; overflow:auto; }

/* выбор героев кликом */
.hero-chips { display:flex; flex-wrap:wrap; gap:.35rem; margin-top:.3rem; }
.hero-chip { display:inline-flex; align-items:center; gap:.3rem; padding:.2rem .55rem; border-radius:999px; border:1px solid #3a3f4b; background:#1a1d24; color:var(--vv-text); cursor:pointer; font-size:.85rem; }
.hero-chip:hover { border-color:#6d28d9; }
.hero-chip.sel { background:#2a1d4f; border-color:#7c3aed; }
.hero-chip-x { color:var(--vv-muted); font-weight:700; }
.hero-chip.sel .hero-chip-x { color:#c4b5fd; }

/* описание для Instagram */
.ig-caption { margin-top:.3rem; padding:.6rem .7rem; background:#0f1115; border:1px solid #262a33; border-radius:8px; white-space:pre-wrap; font-size:.86rem; color:#e5d6ff; user-select:all; }

/* Варианты надписи поверх видео (вирусный хук) — по строке, с кнопкой копирования */
.ig-overlays { margin-top:.3rem; display:flex; flex-direction:column; gap:.35rem; }
.ig-overlay-row { display:flex; align-items:center; gap:.5rem; padding:.45rem .6rem; background:#0f1115; border:1px solid #262a33; border-radius:8px; }
.ig-overlay-text { flex:1; font-size:.92rem; font-weight:600; color:#ffe9a8; user-select:all; }
.ig-overlay-copy { flex:none; }

/* ── Персонажи: шапка с кнопкой + галереи ─────────────────────────────────── */
.roster-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin-bottom:.5rem; }
.roster-head h2 { margin:0; }
.char-card-click { cursor:pointer; transition:border-color .12s, transform .12s; }
.char-card-click:hover { border-color:#7c3aed; transform:translateY(-2px); }
.char-edit-hint { color:var(--vv-accent); font-size:.78rem; margin-top:.35rem; }
.char-card-add { width:160px; min-height:200px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.5rem; background:var(--vv-card); border:1px dashed #3a3f4b; border-radius:10px; color:var(--vv-muted); cursor:pointer; }
.char-card-add:hover { border-color:#7c3aed; }
.char-card-add-ico { font-size:1.6rem; }
.char-card-create { width:160px; min-height:200px; display:flex; align-items:center; justify-content:center; border-style:dashed; }
.char-studio-editor { margin-top:.4rem; }

/* ── Редактор персонажа ───────────────────────────────────────────────────── */
.char-editor-workspace { margin-top:.5rem; }
.char-editor-tabs { margin-bottom:.55rem; }
.char-editor-tab { width:104px; }
.char-editor-tab .ep-tile-lbl { max-width:96px; }
.char-editor-panel { align-items:flex-start; margin-bottom:.5rem; }
.char-editor-panel .ctx-bar-title { flex:1 1 100%; }
.char-tab-note { margin:0; font-size:.82rem; line-height:1.45; }
.char-desc-grid { width:100%; display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:.75rem; }
.char-desc-grid .ep-field { margin:0; }
.char-desc-form { width:100%; }
.char-desc-form textarea { padding:.55rem .65rem; border-radius:8px; border:1px solid #3a3f4b; background:#0f1115; color:var(--vv-text); font:inherit; resize:vertical; }
.char-editor-actions { width:100%; display:flex; align-items:center; gap:.7rem; flex-wrap:wrap; }
.char-editor-actions .ep-mode-btn { flex:0 0 auto; }
.char-delete-confirm { flex:1 1 100%; margin-top:.1rem; }
.char-editor-layout { margin-top:.25rem; }
.char-editor-layout.no-side { display:block; }
.char-editor-layout.no-side .episode-main { width:100%; }
.char-photo-side { border-color:#8a5b18; }
.char-photo-side h3 { margin-bottom:.7rem; }
.char-voice-panel { align-items:flex-start; }
.char-voice-grid { width:100%; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:.55rem .7rem; align-items:start; }
.char-voice-row { gap:.4rem; align-items:center; margin:0; }
.char-voice-row .ep-select { margin-top:0; }
.char-voice-row .ep-mode-btn { flex:0 0 auto; white-space:nowrap; }
.char-custom-voice { flex:1 1 180px; min-width:160px; }
.char-range { display:flex; flex-direction:column; gap:.25rem; color:var(--vv-muted); font-size:.8rem; }
.char-range input { width:100%; }
.char-voice-status { margin:.1rem 0; }
.char-voice-audio { width:100%; height:34px; margin:.1rem 0; }
.char-style-editor { grid-column:1 / -1; padding:.65rem .75rem; background:#0f1115; border:1px solid #262a33; border-radius:10px; }
.char-style-head { display:flex; align-items:flex-start; justify-content:space-between; gap:.7rem; flex-wrap:wrap; margin-bottom:.55rem; }
.char-style-head .ep-mode-btn { flex:0 0 auto; }
.char-style-title { font-weight:700; color:var(--vv-text); }
.char-style-hint { color:var(--vv-muted); font-size:.8rem; line-height:1.35; margin-top:.1rem; }
.char-style-input { margin-top:0; }
.char-style-warning { margin-top:.35rem; color:#fbbf24; font-size:.8rem; }
.char-style-current { margin-top:.35rem; color:var(--vv-muted); font-size:.8rem; }
.char-style-current b { color:#e5d6ff; }
.char-style-presets { display:grid; grid-template-columns:repeat(auto-fit, minmax(132px, 1fr)); gap:.4rem; margin-top:.55rem; }
.char-style-preset { min-height:52px; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:.12rem; padding:.42rem .55rem; background:#171b23; border:1px solid #343a46; border-radius:8px; color:var(--vv-text); cursor:pointer; text-align:left; font:inherit; }
.char-style-preset:hover:not(:disabled) { border-color:#7c3aed; }
.char-style-preset.on { background:#2a1d4f; border-color:#7c3aed; box-shadow:0 0 0 1px #7c3aed55; }
.char-style-preset small { color:var(--vv-muted); font-size:.72rem; line-height:1.2; }
.char-style-preset.on small { color:#c4b5fd; }
.editor-gallery { display:flex; flex-wrap:wrap; gap:.75rem; margin:.5rem 0 1rem; }
.editor-img { width:200px; background:var(--vv-card); border:1px solid #262a33; border-radius:10px; padding:.5rem; }
.editor-img.is-primary { border-color:#7c3aed; box-shadow:0 0 0 1px #7c3aed; }
.editor-img img { width:100%; height:200px; object-fit:cover; border-radius:8px; display:block; }
.img-badge { color:#c4b5fd; font-size:.78rem; margin-top:.35rem; font-weight:600; }
.img-note { color:var(--vv-muted); font-size:.8rem; margin-top:.35rem; }
.img-actions { display:flex; gap:.6rem; margin-top:.4rem; }
.base-row { display:flex; align-items:center; gap:.6rem; margin:.3rem 0 .6rem; }
.base-thumb { width:48px; height:48px; object-fit:cover; border-radius:6px; border:1px solid #7c3aed; }
.candidate { max-width:360px; }

/* чат-редактор персонажа: выбранное фото + мини-галерея */
.editing-preview { width:100%; max-height:240px; object-fit:contain; border-radius:10px; border:2px solid #f59e0b; background:#0f1115; display:block; }
.editor-mini-gallery { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.35rem; }
.mini-wrap { position:relative; }
.mini-thumb { width:60px; height:60px; object-fit:cover; border-radius:7px; border:2px solid #3a3f4b; cursor:pointer; display:block; }
.mini-wrap.is-primary .mini-thumb { border-color:#7c3aed; }
.mini-wrap.editing .mini-thumb { border-color:#f59e0b; box-shadow:0 0 0 2px #f59e0b55; }
/* Фото, прикреплённое к эпизоду (мультивыбор): зелёная рамка + бейдж. */
.mini-wrap.in-episode .mini-thumb { border-color:#22c55e; box-shadow:0 0 0 2px #22c55e55; }
.mini-ep-badge { position:absolute; top:2px; left:2px; background:#16a34a; color:#fff; font-size:.58rem; font-weight:700; border-radius:5px; padding:1px 4px; pointer-events:none; }
.mini-actions { display:flex; justify-content:center; gap:.3rem; margin-top:.15rem; }
.mini-actions .btn-link { font-size:.85rem; padding:0; }
.char-gallery { display:flex; gap:.25rem; flex-wrap:wrap; margin:.35rem 0 .1rem; }
.char-thumb { width:34px; height:34px; object-fit:cover; border-radius:5px; border:1px solid #3a3f4b; }
.char-thumb.is-primary { border-color:#7c3aed; box-shadow:0 0 0 1px #7c3aed; }
@media (max-width:720px) {
    .char-editor-tab { width:88px; }
    .char-voice-grid { grid-template-columns:1fr; }
}
/* студия персонажей (боковая панель) */
.studio-char { padding:.5rem 0; border-bottom:1px solid #262a33; }
.studio-gallery { display:flex; gap:.3rem; flex-wrap:wrap; margin-top:.35rem; }
.studio-thumb { width:54px; height:54px; object-fit:cover; border-radius:6px; border:1px solid #3a3f4b; }
.studio-thumb.is-primary { border-color:#7c3aed; box-shadow:0 0 0 1px #7c3aed; }

/* ── Поздравления ──────────────────────────────────────────────────────────── */
.occ-emoji { font-size:1.4rem; }
.greeting-grid { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:1rem; align-items:start; }
@media (max-width:860px) { .greeting-grid { grid-template-columns:1fr; } }
.fieldlabel { display:flex; align-items:center; gap:.5rem; color:var(--vv-muted); font-size:.76rem; text-transform:uppercase; letter-spacing:.03em; margin:.85rem 0 .25rem; }
.greeting-message { padding:.6rem .7rem; background:#0f1115; border:1px solid #262a33; border-radius:8px; font-size:.95rem; color:var(--vv-text); white-space:pre-wrap; margin:0; }
.greeting-caption { padding:.6rem .7rem; background:#0f1115; border:1px solid #262a33; border-radius:8px; white-space:pre-wrap; font-size:.88rem; color:#e5d6ff; user-select:all; margin:0; }
.greeting-overlays { list-style:none; padding:0; margin:.25rem 0 0; display:flex; flex-direction:column; gap:.3rem; }
.greeting-overlays li { display:flex; align-items:center; gap:.5rem; padding:.4rem .6rem; background:#0f1115; border:1px solid #262a33; border-radius:8px; font-weight:600; color:#ffe9a8; }
.greeting-overlays li button { margin-left:auto; }
.greeting-prompt { margin-top:.85rem; color:var(--vv-muted); }
.greeting-prompt summary { cursor:pointer; font-size:.82rem; }
.greeting-prompt p { white-space:pre-wrap; font-size:.84rem; color:#d6d8dd; margin:.4rem 0 0; }
.greeting-regen { display:flex; flex-direction:column; gap:.4rem; margin-top:1rem; padding-top:.85rem; border-top:1px solid #262a33; }
.greeting-regen textarea { width:100%; box-sizing:border-box; padding:.5rem .6rem; background:#0f1115; border:1px solid #3a3f4b; border-radius:8px; color:var(--vv-text); font:inherit; resize:vertical; }
.greeting-photo { display:flex; align-items:center; gap:.7rem; margin-bottom:.5rem; }
.greeting-photo img { width:72px; height:72px; object-fit:cover; border-radius:10px; border:1px solid #7c3aed; }
.greeting-video { width:100%; border-radius:10px; background:#000; max-height:60vh; display:block; }
.greeting-video.portrait { max-height:72vh; object-fit:contain; }
.render-status { font-size:1.05rem; }
.render-status b { font-variant-numeric:tabular-nums; color:#fff; }
.btn-secondary { padding:.5rem .9rem; border:1px solid #3a3f4b; border-radius:8px; background:#1a1d24; color:var(--vv-text); cursor:pointer; }
.btn-secondary:hover:not(:disabled) { border-color:#7c3aed; }
.btn-copy { background:none; border:1px solid #3a3f4b; border-radius:7px; color:#b794f6; cursor:pointer; font-size:.78rem; padding:.12rem .45rem; }
.btn-copy:hover:not(:disabled) { border-color:#7c3aed; }
.btn-copy:disabled { opacity:.5; cursor:default; }

/* ── Пресеты сцены ─────────────────────────────────────────────────────────── */
.preset-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(165px,1fr)); gap:.7rem; margin-top:1rem; }
.preset-card { display:flex; flex-direction:column; gap:.35rem; margin-top:0; padding:.55rem; }
.preset-thumb { width:100%; aspect-ratio:9/16; max-height:185px; object-fit:cover; border-radius:8px; background:#000; }
.preset-thumb-empty { display:flex; align-items:center; justify-content:center; font-size:1.8rem; color:#3a3f4b; border:1px dashed #3a3f4b; }
.preset-name { font-weight:600; font-size:.88rem; }
.preset-meta { font-size:.72rem; color:var(--vv-muted); }
.preset-warn { font-size:.78rem; color:#fbbf24; }
.preset-actions { display:flex; align-items:center; gap:.45rem; flex-wrap:wrap; margin-top:auto; }
.preset-actions .btn-approve { padding:.32rem .6rem; font-size:.8rem; }
.preset-actions .btn-link { font-size:.8rem; }
.preset-make { display:flex; flex-direction:column; gap:.4rem; margin-top:.35rem; padding-top:.5rem; border-top:1px solid #262a33; }
.preset-make input[type=text], .preset-make input:not([type]) { padding:.45rem .55rem; border-radius:8px; border:1px solid #3a3f4b; background:#0f1115; color:var(--vv-text); font:inherit; }
.preset-cat { font-size:.72rem; color:#c4b5fd; background:#241b3a; border:1px solid #4a3a6b; border-radius:999px; padding:.05rem .5rem; align-self:flex-start; }
.cat-tabs { display:flex; flex-wrap:wrap; gap:.4rem; margin:1rem 0 .25rem; }
.cat-tab { background:#0f1115; border:1px solid #262a33; color:var(--vv-muted); border-radius:999px; padding:.3rem .75rem; font-size:.84rem; cursor:pointer; }
.cat-tab:hover { color:#fff; border-color:#3a3f4b; }
.cat-tab.on { border-color:#7c3aed; color:#c4b5fd; background:#1e1730; }

/* ── Главная: плашки разделов ──────────────────────────────────────────────── */
.home-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:1rem; margin-top:1.25rem; }
.home-tile { display:flex; flex-direction:column; gap:.5rem; background:var(--vv-card); border:1px solid #262a33; border-radius:14px; padding:1.25rem; color:var(--vv-text); text-decoration:none; transition:border-color .12s, transform .12s; }
.home-tile:hover { border-color:#7c3aed; transform:translateY(-2px); }
.home-tile-ico { font-size:2.1rem; line-height:1; }
.home-tile-title { font-size:1.18rem; font-weight:700; }
.home-tile-desc { color:var(--vv-muted); font-size:.9rem; line-height:1.5; flex:1; }
.home-tile-go { color:#b794f6; font-weight:600; font-size:.9rem; margin-top:.15rem; }
.home-extra { margin-top:1.25rem; }
.home-extra a { color:#b794f6; }

/* ── Многочастный ролик: редактор частей ───────────────────────────────────── */
.parts-editor { margin-top:.5rem; }
.parts-head h3 { margin:0 0 .2rem; }
.part-card { background:var(--vv-card); border:1px solid #262a33; border-radius:12px; padding:.6rem .7rem; margin:.55rem 0; }
.part-card-head { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.part-ord { flex:0 0 auto; width:1.5rem; height:1.5rem; display:flex; align-items:center; justify-content:center; border-radius:50%; background:#241b3a; border:1px solid #4a3a6b; color:#c4b5fd; font-size:.8rem; font-weight:700; }
.part-kind { font-size:.82rem; color:var(--vv-muted); }
.part-title { flex:1 1 140px; min-width:120px; font-weight:600; }
input.part-title { padding:.3rem .5rem; }
.part-status { font-size:.74rem; padding:.05rem .5rem; border-radius:999px; border:1px solid #3a3f4b; color:var(--vv-muted); }
.part-status-ok { color:#86efac; border-color:#2f5d3f; background:#16241b; }
.part-status-err { color:#fca5a5; border-color:#5d2f2f; background:#241616; }
.part-status-wip { color:#fcd34d; border-color:#5d4a2f; background:#241f16; }
.part-prompt { width:100%; box-sizing:border-box; margin-top:.45rem; padding:.45rem .55rem; resize:vertical; }
.part-dur-lbl { display:inline-flex; align-items:center; gap:.35rem; margin-top:.45rem; font-size:.82rem; }
.part-dur { width:4.5rem; padding:.25rem .4rem; }
.part-slot { display:flex; align-items:center; gap:.5rem; margin-top:.5rem; }
.part-slides { display:flex; flex-wrap:wrap; gap:.45rem; margin-top:.5rem; align-items:center; }
.part-slide { position:relative; display:inline-flex; flex-direction:column; align-items:center; }
.part-thumb { width:64px; height:64px; object-fit:cover; border-radius:8px; border:1px solid #3a3f4b; display:block; }
.part-add-photo { margin-top:0; }
.part-vid { width:100%; max-width:280px; border-radius:10px; background:#000; display:block; margin-top:.4rem; }
.parts-add { display:flex; align-items:center; gap:.7rem; flex-wrap:wrap; margin-top:.6rem; padding-top:.55rem; border-top:1px solid #262a33; }

/* ── Наложенная аудиодорожка ───────────────────────────────────────────────── */
.ep-overlay-audio { margin-top:.7rem; padding-top:.6rem; border-top:1px solid #262a33; }
.ep-overlay-player { width:100%; height:34px; margin:.35rem 0; }
.ep-overlay-controls { display:flex; flex-direction:column; gap:.25rem; }
.ep-overlay-controls input[type=range] { width:100%; }
.ep-overlay-actions { display:flex; align-items:center; gap:.9rem; margin-top:.3rem; }

/* ── Аудио-архив (модал выбора дорожки) ────────────────────────────────────── */
.arch-audio-list { display:flex; flex-direction:column; gap:.5rem; }
.arch-audio-row { display:flex; align-items:center; gap:.6rem; padding:.45rem .55rem; background:#0f1115; border:1px solid #262a33; border-radius:10px; }
.arch-audio-pick { flex:0 0 auto; margin-top:0; padding:.25rem .6rem; border:1px solid #4a3a6b; border-radius:7px; }
.arch-audio-meta { flex:0 1 auto; min-width:120px; }
.arch-audio-title { font-weight:600; font-size:.9rem; }
.arch-audio-player { flex:1 1 auto; height:34px; min-width:160px; }

/* ── Редактор пресета (форма по дизайну) ───────────────────────────────────── */
.pe-head { display:flex; align-items:flex-start; gap:14px; margin:.4rem 0 1rem; }
.pe-clap { font-size:30px; line-height:1.1; }
.pe-title { width:100%; background:none; border:none; border-bottom:1px dashed transparent; color:var(--vv-text); font-size:1.7rem; font-weight:800; letter-spacing:-.02em; padding:.1rem 0; }
.pe-title:hover, .pe-title:focus { border-bottom-color:#3a3f4b; outline:none; }
.pe-sub { display:flex; align-items:center; gap:12px; margin-top:.4rem; color:var(--vv-muted); font-size:.86rem; flex-wrap:wrap; }
.pe-pill { font-size:.72rem; padding:.1rem .5rem; border-radius:999px; background:#16241b; border:1px solid #2f5d3f; color:#86efac; }
.pe-strip { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; background:var(--vv-card); border:1px solid #262a33; border-radius:16px; padding:.6rem .7rem; margin-bottom:1rem; }
.pe-chip { display:inline-flex; align-items:center; gap:.35rem; padding:.4rem .7rem; border-radius:10px; background:#0f1115; border:1px solid #2c313c; color:var(--vv-muted); font-size:.85rem; text-decoration:none; }
a.pe-chip:hover { border-color:#3a3f4b; color:var(--vv-text); }
.pe-chip.on { background:linear-gradient(180deg,#7c5cff,#6346d8); border-color:#7c5cff; color:#fff; }
.pe-grow { flex:1; }
.pe-dur { font-family:"JetBrains Mono",monospace; color:var(--vv-muted); font-size:.85rem; }
.pe-scenario { background:var(--vv-card); border:1px solid #262a33; border-radius:16px; padding:1rem 1.1rem; margin-bottom:1.1rem; }
.pe-ta { width:100%; box-sizing:border-box; min-height:96px; padding:.6rem .7rem; background:#0f1115; border:1px solid #3a3f4b; border-radius:10px; color:var(--vv-text); font:inherit; resize:vertical; }
.pe-dur-row { display:flex; align-items:center; gap:.5rem; margin-top:.7rem; color:var(--vv-muted); font-size:.85rem; }
.pe-dur-input { width:5rem; }
.pe-bar { position:sticky; bottom:0; display:flex; align-items:center; gap:.9rem; flex-wrap:wrap; margin-top:1.2rem; padding:.8rem 1rem; background:rgba(16,18,23,.92); backdrop-filter:blur(16px); border-top:1px solid #262a33; border-radius:14px 14px 0 0; }
.pe-bar-info b { color:var(--vv-text); }

/* карточки персонажей пресета (префикс pchar- чтобы не конфликтовать с .char-*) */
.pchar-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; margin:.4rem 0 1rem; }
.pchar-card { position:relative; background:var(--vv-card); border:1px solid #262a33; border-radius:16px; padding:16px; }
.pchar-card.client { border-color:rgba(124,92,255,.4); box-shadow:inset 0 0 0 1px rgba(124,92,255,.18); }
.pchar-del { position:absolute; top:10px; right:10px; background:none; border:none; color:var(--vv-muted); cursor:pointer; font-size:1rem; line-height:1; }
.pchar-del:hover { color:#ff8a8a; }
.pchar-top { display:flex; gap:12px; align-items:flex-start; }
.pchar-portrait { position:relative; width:72px; height:72px; flex:0 0 auto; border-radius:14px; overflow:hidden; display:flex; align-items:center; justify-content:center; font-size:1.8rem; background:repeating-linear-gradient(135deg,#1a1d24,#1a1d24 6px,#161922 6px,#161922 12px); border:1px solid #2c313c; }
.pchar-portrait img { width:100%; height:100%; object-fit:cover; }
.pchar-ph-tag { position:absolute; left:0; right:0; bottom:0; font-size:.6rem; text-align:center; padding:1px 0; background:rgba(8,9,12,.7); color:var(--vv-muted); }
.pchar-id { flex:1; display:flex; flex-direction:column; gap:.35rem; min-width:0; }
.pchar-name, .pchar-role { width:100%; box-sizing:border-box; background:#0f1115; border:1px solid #3a3f4b; border-radius:8px; color:var(--vv-text); font:inherit; padding:.35rem .5rem; }
.pchar-name { font-weight:700; }
.pchar-role { color:var(--vv-muted); font-size:.85rem; }
.pchar-seg { display:flex; gap:3px; margin-top:.7rem; padding:3px; background:#0f1115; border:1px solid #2c313c; border-radius:10px; }
.pchar-seg button { flex:1; padding:.4rem .3rem; background:none; border:none; border-radius:8px; color:var(--vv-muted); cursor:pointer; font:inherit; font-size:.82rem; }
.pchar-seg button.on { background:linear-gradient(180deg,#7c5cff,#6346d8); color:#fff; }
.pchar-client-block { margin-top:.7rem; padding:.7rem .8rem; background:rgba(124,92,255,.07); border:1px solid rgba(124,92,255,.25); border-radius:12px; }
.pchar-cb-head { font-size:.82rem; font-weight:600; color:#c4b5fd; margin-bottom:.5rem; }
.pchar-field { display:flex; flex-direction:column; gap:.2rem; margin-top:.4rem; }
.pchar-field span { font-size:.72rem; color:var(--vv-muted); text-transform:uppercase; letter-spacing:.03em; }
.pchar-field input { background:#0f1115; border:1px solid #3a3f4b; border-radius:8px; color:var(--vv-text); font:inherit; padding:.4rem .5rem; }
.pchar-foot-ai { margin-top:.7rem; font-size:.8rem; color:var(--vv-muted); line-height:1.4; }
.pchar-foot-ai a { color:#b794f6; }
.pchar-add { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.3rem; min-height:120px; border:1px dashed #3a3f4b; border-radius:16px; background:none; color:var(--vv-muted); cursor:pointer; font:inherit; }
.pchar-add:hover { border-color:#7c5cff; color:var(--vv-text); }
.pchar-add-plus { font-size:1.5rem; }

/* ── Билдер поздравления (лента из пресетов) ───────────────────────────────── */
.page-head { display:flex; align-items:flex-start; gap:14px; margin:.4rem 0 1rem; }
.page-head h1 { margin:0; }
.who { background:var(--vv-card); border:1px solid #262a33; border-radius:16px; padding:1rem 1.1rem; margin-bottom:1.1rem; }
.gen-banner.ok { background:#16241b; border-color:#2f5d3f; color:#bdf0c8; }
.gen-banner.err { background:#241616; border-color:#5d2f2f; color:#fca5a5; }
.empty { display:flex; flex-direction:column; align-items:center; gap:.5rem; text-align:center; padding:2.2rem 1rem; border:1px dashed #3a3f4b; border-radius:16px; color:var(--vv-muted); }
.empty .e { font-size:2.4rem; }
.empty h3 { margin:.2rem 0 0; color:var(--vv-text); }
.add-preset { display:flex; align-items:center; justify-content:center; gap:.5rem; width:100%; box-sizing:border-box; margin-top:.7rem; padding:.85rem; border:1px dashed #3a3f4b; border-radius:14px; background:none; color:var(--vv-muted); cursor:pointer; font:inherit; }
.add-preset:hover { border-color:#7c5cff; color:var(--vv-text); }
.add-preset .plus { font-size:1.2rem; }
.btn-gen { padding:.7rem 1.2rem; border:none; border-radius:10px; background:linear-gradient(180deg,#7c5cff,#6346d8); color:#fff; font-weight:700; cursor:pointer; box-shadow:0 12px 30px -10px rgba(124,92,255,.7); }
.btn-gen.dis, .btn-gen:disabled { background:#2a2f3a; color:var(--vv-muted); box-shadow:none; cursor:default; }
.genbar { position:sticky; bottom:0; margin-top:1.2rem; background:rgba(16,18,23,.92); backdrop-filter:blur(16px); border-top:1px solid #262a33; }
.genbar .inner { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; padding:.8rem .2rem; }
.genbar .grow { flex:1; }
.genbar .l1 { font-weight:600; }
.genbar .l2 { font-size:.84rem; color:#f0c269; }
.genbar .l2.ready { color:#7bd88f; }
.genbar .gtotal { font-family:"JetBrains Mono",monospace; color:var(--vv-muted); }

/* блок одного пресета в ленте */
.pblock { background:var(--vv-card); border:1px solid #262a33; border-radius:20px; padding:1rem 1.1rem; margin:.7rem 0; }
.pblock.done { border-color:#2f5d3f; }
.pblock-head { display:flex; align-items:center; gap:.8rem; padding-bottom:.7rem; border-bottom:1px solid #262a33; }
.pblock-thumb { width:48px; height:48px; flex:0 0 auto; display:flex; align-items:center; justify-content:center; font-size:1.5rem; border-radius:12px; background:repeating-linear-gradient(135deg,#241b3a,#241b3a 6px,#1e1730 6px,#1e1730 12px); border:1px solid #4a3a6b; }
.pblock-meta { flex:1; min-width:0; }
.pblock-seq { font-family:"JetBrains Mono",monospace; font-size:.7rem; color:var(--vv-muted); letter-spacing:.06em; }
.pblock-nm { font-weight:800; }
.pblock-right { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.pblock-dur { font-family:"JetBrains Mono",monospace; font-size:.8rem; color:var(--vv-muted); }
.pblock-status { font-size:1rem; }
.pblock-body { display:flex; flex-wrap:wrap; gap:14px; margin-top:.8rem; }
.gbadge { font-size:.74rem; padding:.1rem .55rem; border-radius:999px; border:1px solid #3a3f4b; }
.gbadge.ok { color:#86efac; border-color:#2f5d3f; background:#16241b; }
.gbadge.need { color:#f0c269; border-color:#5d4a2f; background:#241f16; }
.cslot { display:flex; flex-direction:column; gap:.35rem; }
.cslot-top { font-size:.82rem; }
.cslot-hint { font-family:"JetBrains Mono",monospace; font-size:.72rem; color:var(--vv-muted); }
.ai-fixed { display:flex; align-items:center; gap:.4rem; padding:.5rem .7rem; align-self:flex-start; border-radius:10px; background:#0f1115; border:1px solid #2c313c; color:var(--vv-muted); font-size:.84rem; }

/* фото-слот клиента */
.gslot { position:relative; width:118px; height:118px; border-radius:14px; overflow:hidden; }
.gslot-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.2rem; width:100%; height:100%; border:1px dashed #3a3f4b; border-radius:14px; cursor:pointer; color:var(--vv-muted); text-align:center; padding:.3rem; }
.gslot-empty:hover { border-color:#7c5cff; color:var(--vv-text); }
.gslot-plus { font-size:1.4rem; }
.gslot-lab { font-size:.72rem; line-height:1.1; }
.gslot.filled { border:1px solid #2f5d3f; }
.gslot img { width:100%; height:100%; object-fit:cover; display:block; }
.gslot-rm { position:absolute; top:4px; right:4px; width:22px; height:22px; border:none; border-radius:50%; background:rgba(8,9,12,.75); color:#fff; cursor:pointer; font-size:.8rem; line-height:1; }
.gslot-repl { position:absolute; left:0; right:0; bottom:0; text-align:center; font-size:.72rem; padding:2px 0; background:rgba(8,9,12,.7); color:#fff; cursor:pointer; }

/* модал пикера пресетов */
.gov { position:fixed; inset:0; z-index:60; background:rgba(8,9,12,.74); backdrop-filter:blur(4px); display:flex; align-items:center; justify-content:center; padding:1rem; }
.gpick { width:720px; max-width:100%; max-height:86vh; overflow:auto; background:var(--vv-card); border:1px solid #2c313c; border-radius:22px; padding:1.2rem 1.3rem; box-shadow:var(--shadow); }
.gpick-head { display:flex; align-items:center; gap:.6rem; }
.gpick-head h3 { margin:0; flex:1; }
.gpick-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.7rem; margin-top:.6rem; }
@media (max-width:620px){ .gpick-grid { grid-template-columns:1fr; } }
.gpick-item { display:flex; align-items:center; gap:.7rem; text-align:left; padding:.7rem; background:#0f1115; border:1px solid #2c313c; border-radius:14px; color:var(--vv-text); cursor:pointer; font:inherit; }
.gpick-item:hover { border-color:#7c5cff; }
.gpick-thumb { width:46px; height:46px; flex:0 0 auto; display:flex; align-items:center; justify-content:center; font-size:1.4rem; border-radius:10px; background:repeating-linear-gradient(135deg,#241b3a,#241b3a 6px,#1e1730 6px,#1e1730 12px); border:1px solid #4a3a6b; }
.gpick-meta { flex:1; min-width:0; }
.gpick-nm { font-weight:700; }
.gpick-ds { font-size:.8rem; }
.gpick-c { font-family:"JetBrains Mono",monospace; font-size:.72rem; color:#c4b5fd; margin-top:.15rem; }
.gpick-dur { font-family:"JetBrains Mono",monospace; font-size:.8rem; color:var(--vv-muted); }
