/* ══════════════════════════════════════════════════════════════════════════════
   Студия «Кадр» — дизайн-токены и компоненты редактора клипов.
   Палитра/типографика — из design handoff (high-fidelity).
   ══════════════════════════════════════════════════════════════════════════════ */
:root {
  --st-bg: #0b0b0d;
  --st-panel: #0e0e11;
  --st-card: #111114;
  --st-surface: #141418;
  --st-hover: #18181d;
  --st-selected: #1c1416;
  --st-line: #1c1c21;
  --st-line-card: #1f1f25;
  --st-line-input: #26262d;
  --st-line-dash: #2a2a32;
  --st-line-hover: #3a3a44;
  --st-text: #ececf1;
  --st-text-2: #c9c9d1;
  --st-text-3: #dcdce3;
  --st-muted: #8b8b95;
  --st-disabled: #5a5a64;
  --st-accent: #ff6b57;
  --st-accent-hover: #ff8a78;
  --st-on-accent: #0b0b0d;
  --st-wave: #3a3a48;
  --st-font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --st-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --st-g-a: linear-gradient(135deg, #3b1d2e, #7a2f3d 60%, #c4543f);
  --st-g-b: linear-gradient(135deg, #0f2a3a, #1f5a6e 60%, #3aa0a8);
  --st-g-c: linear-gradient(135deg, #2a1f3d, #4b2e7a 60%, #8a5ad6);
  --st-g-d: linear-gradient(135deg, #2b2a12, #6b6420 60%, #c9b03e);
  --st-g-e: linear-gradient(135deg, #1c1c22, #3a3a48 60%, #7c7c92);
  --st-g-f: linear-gradient(135deg, #1a2e1c, #2f6b3a 60%, #63b76c);
}

@keyframes st-pulse { 0%, 100% { opacity: .35 } 50% { opacity: 1 } }
@keyframes st-shimmer { 0% { background-position: 0 0 } 100% { background-position: 200% 0 } }
@keyframes st-spin { to { transform: rotate(360deg) } }

/* ── Каркас ─────────────────────────────────────────────────────────────────── */
body:has(> .st-shell), body:has(.st-shell) { margin: 0; height: 100vh; overflow: hidden; }
.st-shell ~ #blazor-error-ui, #blazor-error-ui { color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; color: #222; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.st-shell { display: flex; height: 100vh; width: 100%; overflow: clip; background: var(--st-bg); color: var(--st-text); font-family: var(--st-font); font-size: 13px; -webkit-font-smoothing: antialiased; }
.st-shell *, .st-shell *::before, .st-shell *::after { box-sizing: border-box; }
.st-shell button { font-family: inherit; }
.st-shell a { color: inherit; text-decoration: none; }
.st-shell a:hover { text-decoration: none; }
.st-shell ::-webkit-scrollbar { height: 8px; width: 8px; }
.st-shell ::-webkit-scrollbar-thumb { background: #2a2a30; border-radius: 4px; }
.st-shell .mono { font-family: var(--st-mono); }

.st-side { width: 220px; flex: none; border-right: 1px solid var(--st-line); display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; background: var(--st-panel); overflow-y: auto; }
.st-logo { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.st-logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--st-accent); display: grid; place-items: center; }
.st-logo-play { width: 0; height: 0; border-left: 9px solid var(--st-on-accent); border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 2px; }
.st-logo-text { font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.st-nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: none; background: transparent; color: var(--st-muted); cursor: pointer; text-align: left; font-size: 13px; font-weight: 500; width: 100%; }
.st-nav:hover { background: var(--st-hover); color: var(--st-text); }
.st-nav.is-active { background: var(--st-hover); color: var(--st-text); }
.st-nav.is-disabled { color: var(--st-disabled); cursor: default; }
.st-nav.is-disabled:hover { background: transparent; color: var(--st-disabled); }
.st-nav-sub { font-size: 12px; padding: 7px 10px; }
.st-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--st-line-dash); flex: none; }
.st-nav.is-active .st-dot { background: var(--st-accent); }
.st-side-sep { height: 1px; background: var(--st-line); margin: 10px 4px; }
.st-side-spacer { flex: 1; }
.st-limit { padding: 12px; border-radius: 10px; background: var(--st-surface); border: 1px solid var(--st-line-card); display: flex; flex-direction: column; gap: 8px; }
.st-limit-row { display: flex; justify-content: space-between; color: var(--st-muted); font-size: 11px; }
.st-limit-row .mono { color: var(--st-text); }
.st-limit-cost { margin-top: 2px; }
.st-limit-bar { height: 4px; border-radius: 2px; background: #22222a; overflow: hidden; }
.st-limit-bar > div { height: 100%; background: var(--st-accent); transition: width .4s; }
.st-limit-month { margin-top: 2px; }
.st-limit.is-over { border-color: rgba(255,107,87,.45); }
.st-limit.is-over .st-limit-month .mono { color: var(--st-accent); }
.st-limit-over { color: var(--st-accent); font-size: 11px; line-height: 1.35; }

/* ── Админка (/admin): плитки-итоги, компактная таблица пользователей с лимитами, детализация в модалке ── */
.st-admin { gap: 24px; }
.st-admin-flash { color: var(--st-text); font-size: 12px; background: rgba(99,183,108,.10); border: 1px solid rgba(99,183,108,.30); border-radius: 8px; padding: 8px 10px; }
.st-admin-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.st-admin-tile { background: var(--st-card); border: 1px solid var(--st-line-card); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-admin-tile-label { color: var(--st-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.st-admin-tile-value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.st-admin-tile-value.is-over { color: var(--st-accent); }
.st-admin-tile-date { font-size: 18px; }
.st-admin-tile-sub { color: var(--st-muted); font-size: 11px; line-height: 1.4; }
.st-admin-tiles-sm { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.st-admin-tiles-sm .st-admin-tile { padding: 10px 12px; background: var(--st-surface); }
.st-admin-tiles-sm .st-admin-tile-value { font-size: 20px; }
.st-admin-tablewrap { overflow-x: auto; border: 1px solid var(--st-line-card); border-radius: 12px; background: var(--st-card); }
.st-admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.st-admin-table th, .st-admin-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--st-line); vertical-align: middle; }
.st-admin-table th { color: var(--st-muted); font-weight: 500; font-size: 11px; white-space: nowrap; background: var(--st-surface); }
.st-admin-table th.num, .st-admin-table td.num { text-align: right; white-space: nowrap; }
.st-admin-table tbody tr:last-child td { border-bottom: none; }
.st-admin-table tbody tr:hover td { background: var(--st-hover); }
.st-admin-table tbody tr.is-inactive .st-admin-email { color: var(--st-disabled); text-decoration: line-through; }
.st-admin-user { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-admin-email { background: none; border: none; padding: 0; color: var(--st-text); font-weight: 500; font-size: 12px; font-family: inherit; cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.st-admin-email:hover { color: var(--st-accent); }
.st-admin-name { color: var(--st-muted); font-size: 11px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.st-admin-dim { color: var(--st-muted); }
.st-admin-month { display: flex; flex-direction: column; gap: 5px; min-width: 110px; }
.st-admin-month-row { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.st-admin-bar { height: 4px; border-radius: 2px; background: #22222a; overflow: hidden; }
.st-admin-bar > div { height: 100%; background: var(--st-accent); }
.st-admin-month.is-over .mono:first-child { color: var(--st-accent); }
.st-admin-limit { display: flex; gap: 6px; align-items: center; }
.st-admin-limit .st-input { width: 72px; text-align: right; }
.st-admin-toggle { white-space: nowrap; text-align: right; }
.st-modal.st-admin-modal { max-width: min(96vw, 960px); }
.st-admin-head-name { font-weight: 400; margin-left: 8px; }
.st-admin-modal .st-modal-head h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-admin-modal-loading { padding: 24px; }
.st-admin-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.st-admin-detail-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.st-admin-detail-title { color: var(--st-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }
.st-admin-modal .st-modal-body > * { flex: none; }   /* тело модалки — flex-колонка: блоки с фиксированной высотой (дни) не сжимать */
.st-admin-days { display: flex; align-items: flex-end; gap: 3px; height: 56px; padding: 0 2px; border-bottom: 1px solid var(--st-line-card); }
.st-admin-day { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.st-admin-day-bar { width: 100%; background: var(--st-accent); border-radius: 2px 2px 0 0; opacity: .85; min-height: 0; }
.st-admin-days-axis { display: flex; justify-content: space-between; font-size: 10px; }
.st-admin-mini { width: 100%; border-collapse: collapse; font-size: 11px; }
.st-admin-mini th, .st-admin-mini td { padding: 5px 8px; border-bottom: 1px solid var(--st-line); text-align: left; }
.st-admin-mini th { color: var(--st-disabled); font-weight: 500; }
.st-admin-mini th.num, .st-admin-mini td.num { text-align: right; white-space: nowrap; }
.st-admin-mini tbody tr:last-child td { border-bottom: none; }
.st-admin-model { overflow-wrap: anywhere; }
@media (max-width: 760px) { .st-admin-detail { grid-template-columns: 1fr; } }
.st-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px 0; color: var(--st-muted); font-size: 11px; }
.st-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-link { background: none; border: none; padding: 0; color: var(--st-muted); cursor: pointer; font: inherit; }
.st-link:hover { color: var(--st-text); }
.st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; overflow: clip; }

/* ── Кнопки / инпуты ────────────────────────────────────────────────────────── */
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; padding: 11px 18px; font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid transparent; background: transparent; color: var(--st-text); white-space: nowrap; line-height: 1; }
.st-btn:disabled { opacity: .5; cursor: default; }
.st-btn-accent { background: var(--st-accent); color: var(--st-on-accent); }
.st-btn-accent:hover:not(:disabled) { background: var(--st-accent-hover); }
.st-btn-outline { border-color: var(--st-line-input); background: var(--st-surface); font-weight: 500; }
.st-btn-outline:hover:not(:disabled) { border-color: var(--st-line-hover); }
.st-btn-ghost { border-color: var(--st-line-input); background: transparent; font-weight: 500; }
.st-btn-ghost:hover:not(:disabled) { border-color: var(--st-accent); color: var(--st-accent); }
.st-btn-text { color: var(--st-muted); padding: 11px 8px; font-weight: 500; }
.st-btn-text:hover:not(:disabled) { color: var(--st-text); }
.st-btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 8px; }
.st-btn-xs { padding: 5px 10px; font-size: 11px; border-radius: 6px; font-weight: 500; }
.st-btn-danger { color: var(--st-accent); }
.st-btn-block { width: 100%; }
.st-input, .st-textarea, .st-select { background: var(--st-bg); border: 1px solid var(--st-line-input); border-radius: 9px; padding: 10px 12px; color: var(--st-text); font-size: 13px; font-family: inherit; outline: none; width: 100%; }
.st-input:focus, .st-textarea:focus, .st-select:focus { border-color: var(--st-line-hover); }
.st-textarea { line-height: 1.45; resize: vertical; }
.st-select { appearance: auto; }
.st-input-sm { padding: 7px 10px; font-size: 12px; border-radius: 7px; }
.st-label { font-size: 11px; color: var(--st-muted); text-transform: uppercase; letter-spacing: .06em; }
.st-field { display: flex; flex-direction: column; gap: 8px; }
.st-error { color: var(--st-accent); font-size: 12px; background: rgba(255,107,87,.08); border: 1px solid rgba(255,107,87,.25); border-radius: 8px; padding: 8px 10px; line-height: 1.4; }
.st-note { color: var(--st-muted); font-size: 12px; line-height: 1.45; }
.st-tag { font-family: var(--st-mono); font-size: 10px; background: rgba(11,11,13,.75); color: var(--st-text); padding: 2px 6px; border-radius: 4px; }
.st-tag-accent { background: var(--st-accent); color: var(--st-on-accent); font-weight: 600; }
.st-tag-plain { font-family: inherit; }
.st-spinner { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--st-accent); border-radius: 50%; animation: st-spin .8s linear infinite; display: inline-block; }
.st-shimmer { position: absolute; inset: 0; background: linear-gradient(90deg, #141418 25%, #22222a 50%, #141418 75%); background-size: 200% 100%; animation: st-shimmer 1.4s linear infinite; display: grid; place-items: center; color: var(--st-muted); font-family: var(--st-mono); font-size: 11px; }
.st-file { display: inline-flex; }
.st-file input[type=file] { display: none; }

/* ── Экран «Проекты» ─────────────────────────────────────────────────────────── */
.st-projects { flex: 1; overflow: auto; padding: 40px 48px; display: flex; flex-direction: column; gap: 32px; }
.st-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.st-h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.st-sub { color: var(--st-muted); margin-top: 6px; }
.st-newpanel { border: 1px solid var(--st-line-input); border-radius: 14px; padding: 24px; background: var(--st-card); display: flex; flex-direction: column; gap: 18px; }
.st-panel-title { font-weight: 600; font-size: 15px; }
.st-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1100px) { .st-types { grid-template-columns: repeat(2, 1fr); } }
.st-type { text-align: left; padding: 16px; border-radius: 12px; border: 1px solid var(--st-line-input); background: var(--st-bg); color: var(--st-text); cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.st-type:hover { border-color: var(--st-accent); }
.st-type.is-selected { border-color: var(--st-accent); background: var(--st-selected); }
.st-type-dur { font-family: var(--st-mono); font-size: 11px; color: var(--st-accent); }
.st-type-name { font-weight: 600; font-size: 14px; }
.st-type-desc { color: var(--st-muted); font-size: 12px; line-height: 1.4; }
.st-newrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.st-newrow .st-input { flex: 1; min-width: 220px; }
.st-newrow .st-select { width: auto; }
.st-grid-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.st-pcard { text-align: left; padding: 0; border: 1px solid var(--st-line-card); border-radius: 14px; background: var(--st-card); color: var(--st-text); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.st-pcard:hover { border-color: var(--st-line-hover); }
.st-pcard-cover { aspect-ratio: 16/9; background: var(--st-g-e); position: relative; background-size: cover; background-position: center; }
.st-pcard-len { position: absolute; left: 10px; bottom: 10px; font-family: var(--st-mono); font-size: 11px; background: rgba(11,11,13,.7); padding: 3px 7px; border-radius: 5px; }
.st-pcard-kind { position: absolute; right: 10px; top: 10px; font-family: var(--st-mono); font-size: 10px; background: rgba(11,11,13,.7); padding: 3px 7px; border-radius: 5px; color: var(--st-text-2); }
.st-pcard-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.st-pcard-title { font-weight: 600; font-size: 14px; }
.st-pcard-meta { color: var(--st-muted); font-size: 12px; }
.st-pcard-x { position: absolute; right: 8px; bottom: 10px; background: transparent; border: none; color: var(--st-disabled); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.st-pcard-x:hover { color: var(--st-accent); background: var(--st-hover); }
.st-empty { color: var(--st-muted); padding: 40px; text-align: center; border: 1px dashed var(--st-line-dash); border-radius: 14px; }

/* ── Редактор: каркас ───────────────────────────────────────────────────────── */
.st-editor { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: clip; }
.st-ehead { height: 52px; flex: none; border-bottom: 1px solid var(--st-line); display: flex; align-items: center; padding: 0 20px; gap: 16px; }
.st-crumb { background: transparent; border: none; color: var(--st-muted); cursor: pointer; font-size: 13px; padding: 0; }
.st-crumb:hover { color: var(--st-text); }
.st-ehead-sep { color: var(--st-line-hover); }
.st-ehead-title { font-weight: 600; background: transparent; border: 1px solid transparent; color: var(--st-text); font-size: 13px; padding: 4px 6px; border-radius: 6px; min-width: 80px; max-width: 320px; font-family: inherit; }
.st-ehead-title:hover, .st-ehead-title:focus { border-color: var(--st-line-input); outline: none; background: var(--st-bg); }
.st-badge-mono { font-family: var(--st-mono); font-size: 11px; color: var(--st-muted); background: var(--st-surface); padding: 3px 8px; border-radius: 5px; }
.st-ehead-spacer { flex: 1; }
.st-seg { display: flex; background: var(--st-surface); border-radius: 8px; padding: 3px; gap: 2px; }
.st-seg-btn { border: none; border-radius: 6px; padding: 6px 14px; font-size: 12px; font-weight: 500; cursor: pointer; background: transparent; color: var(--st-muted); }
.st-seg-btn.is-active { background: var(--st-line-input); color: var(--st-text); }
.st-seg-btn:hover:not(.is-active) { color: var(--st-text); }
.st-tabbody { flex: 1; display: flex; min-height: 0; }

/* ── Медиабиблиотека (левая колонка редактора) ──────────────────────────────── */
.st-media { flex: 1 1 auto; min-width: 180px; overflow: hidden; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.st-media-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.st-sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.st-sec-title { font-weight: 600; font-size: 15px; }
.st-sec-hint { color: var(--st-muted); }
.st-sec-head .st-select { max-width: 320px; text-overflow: ellipsis; }
/* Плитки квадратные и мелкие — библиотека, а не раскадровка: кадр обрезается по центру. */
.st-grid-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; align-content: start; }
.st-mcard { position: relative; border-radius: 10px; border: 1px solid var(--st-line-card); background: var(--st-card); overflow: hidden; cursor: pointer; }
.st-mcard:hover { border-color: var(--st-line-hover); }
.st-mcard.is-selected, .st-mcard.is-on { border-color: var(--st-accent); box-shadow: 0 0 0 1px var(--st-accent); }
.st-mcard.is-dragging { opacity: .5; }
.st-mcover { position: relative; aspect-ratio: 1/1; background: var(--st-surface); background-size: cover; background-position: center; overflow: hidden; }
.st-mcover.is-audio { background: linear-gradient(160deg, #1d1d24, #121216); display: grid; place-items: center; }
.st-mcover .tl { position: absolute; top: 5px; left: 5px; }
.st-mcover .tr { position: absolute; top: 5px; right: 5px; }
.st-mcover .bl { position: absolute; bottom: 5px; left: 5px; }
.st-mcover .br { position: absolute; bottom: 5px; right: 5px; }
.st-mcover .st-tag { font-size: 9px; padding: 1px 4px; }
.st-mcover .st-cover-placeholder { font-size: 10px; padding: 4px; }
.st-mcover .st-shimmer { font-size: 10px; }
.st-mwave { font-size: 26px; color: var(--st-muted); line-height: 1; }
.st-mcard.is-on .st-mwave { color: var(--st-accent); }
.st-mcard-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 5px 4px; font-size: 10px; line-height: 1.2; color: var(--st-text-2);
  background: linear-gradient(transparent, rgba(11,11,13,.85)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-mcard-x { position: absolute; top: 4px; right: 4px; z-index: 3; width: 19px; height: 19px; padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  background: rgba(11,11,13,.8); color: var(--st-text-2); font-size: 10px; line-height: 1; opacity: 0; transition: opacity .12s; }
.st-mcard:hover .st-mcard-x, .st-mcard-x:focus-visible { opacity: 1; }
.st-mcard-x:hover:not(:disabled) { background: var(--st-accent); color: var(--st-on-accent); }
.st-mcard-add { aspect-ratio: 1/1; border-radius: 10px; border: 1px dashed var(--st-line-dash); background: transparent; color: var(--st-muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-family: inherit; }
.st-mcard-add span { font-size: 18px; line-height: 1; }
.st-mcard-add:hover { border-color: var(--st-accent); color: var(--st-accent); }
.st-cover-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--st-disabled); font-size: 12px; text-align: center; padding: 10px; }
.st-scard-err { position: absolute; inset: auto 0 0 0; background: rgba(255,107,87,.85); color: #0b0b0d; font-size: 10px; padding: 3px 6px; line-height: 1.3; }
.st-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.st-chip { font-size: 10px; color: var(--st-muted); background: var(--st-hover); padding: 2px 6px; border-radius: 4px; }
/* Оверлей «бросьте файлы»: растянут на всю прокручиваемую высоту, подпись липнет к середине экрана. */
.st-media-drop { display: none; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: rgba(11,11,13,.72); border: 2px dashed var(--st-accent); border-radius: 12px; }
.st-media.is-dragover .st-media-drop { display: block; }
.st-media-drop > div { position: absolute; inset: auto 0 45% 0; text-align: center; color: var(--st-accent); font-size: 13px; }

/* ── Сплиттер между библиотекой и монитором ─────────────────────────────────── */
.st-split { flex: 0 0 7px; align-self: stretch; cursor: col-resize; position: relative; background: var(--st-line); }
.st-split span { position: absolute; inset: 0 -4px; }
.st-split:hover, .st-split.is-dragging { background: var(--st-accent); }

/* ── Инспектор ──────────────────────────────────────────────────────────────── */
.st-inspector { width: 340px; flex: none; border-left: 1px solid var(--st-line); overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; background: var(--st-panel); }
.st-inspector > * { flex: none; }
.st-monitor { position: relative; border-radius: 10px; background: #000; overflow: hidden; flex: none; box-shadow: 0 0 0 1px var(--st-line-card); }
/* Колонка монитора: ширина задаётся сплиттером (--st-mon-w), высота ограничена областью над таймлайном. */
.st-moncol { flex: 0 0 var(--st-mon-w, 380px); width: var(--st-mon-w, 380px); display: flex; flex-direction: column; gap: 10px; padding: 14px 16px;
  background: var(--st-panel); align-items: center; min-width: 0; overflow: hidden; }
.st-monwrap { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.st-moncol .st-monitor.ar-9x16 { height: min(calc(100vh - 422px), calc((var(--st-mon-w, 380px) - 34px) * 16 / 9)); min-height: 180px; width: auto; aspect-ratio: 9/16; }
.st-moncol .st-monitor.ar-1x1 { height: min(calc(100vh - 422px), calc(var(--st-mon-w, 380px) - 34px)); min-height: 180px; width: auto; aspect-ratio: 1/1; }
.st-moncol .st-monitor.ar-16x9 { width: min(calc((100vh - 422px) * 16 / 9), calc(var(--st-mon-w, 380px) - 34px)); min-width: 200px; height: auto; aspect-ratio: 16/9; }
@media (max-width: 1280px) { .st-inspector { width: 300px; } .st-moncol { padding: 12px 10px; } }
.st-monitor video, .st-monitor img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: none; }
.st-monitor .is-shown { display: block; }
.st-monitor-empty { position: absolute; inset: 0; display: none; place-items: center; color: var(--st-disabled); font-family: var(--st-mono); font-size: 11px; }
.st-monitor-empty.is-shown { display: grid; }
.st-monitor-badge { position: absolute; top: 10px; left: 10px; font-family: var(--st-mono); font-size: 11px; background: rgba(11,11,13,.75); padding: 3px 7px; border-radius: 5px; z-index: 2; }
.st-mon-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 3; }
.st-mon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--st-line-card); background: rgba(11,11,13,.78); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center; padding: 0; }
.st-mon-btn:hover:not(:disabled) { background: var(--st-accent); border-color: var(--st-accent); }
.st-mon-btn:disabled { opacity: .35; cursor: default; }
.st-optrow { display: flex; gap: 6px; }
.st-opt { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid var(--st-line-input); background: transparent; color: var(--st-text); cursor: pointer; font-size: 12px; }
.st-opt.mono { font-family: var(--st-mono); }
.st-opt.is-on { border-color: var(--st-accent); background: var(--st-selected); }
.st-basestrip { display: flex; gap: 6px; overflow: auto; padding-bottom: 4px; }
.st-basethumb { flex: none; width: 72px; aspect-ratio: 16/9; border-radius: 6px; border: 2px solid transparent; background: var(--st-surface); background-size: cover; background-position: center; cursor: pointer; padding: 0; position: relative; }
.st-basethumb.is-portrait { width: 44px; aspect-ratio: 9/16; }
.st-basethumb.is-on { border-color: var(--st-accent); }
.st-basethumb span { position: absolute; left: 3px; top: 2px; font-family: var(--st-mono); font-size: 9px; text-shadow: 0 1px 2px #000; }
.st-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.st-actions .st-btn { padding: 11px; }
.st-actions-row { display: flex; gap: 6px; }
.st-actions-row .st-btn { flex: 1; }
.st-ins-title { display: flex; align-items: center; gap: 8px; }
.st-ins-title .st-sec-title { flex: 1; }
.st-ins-title .st-scene-model { flex: 1 1 120px; min-width: 0; max-width: 240px; font-family: var(--st-mono); font-size: 11px; padding: 4px 8px; color: var(--st-muted); }
.st-ins-title .st-scene-model.is-own { color: var(--st-text); border-color: var(--st-accent); }

/* ── Вкладка «Персонажи» ─────────────────────────────────────────────────────── */

/* ── Вкладка «Сценарий» ─────────────────────────────────────────────────────── */
.st-script { flex: 1; overflow: auto; padding: 28px; display: flex; flex-direction: column; gap: 20px; max-width: 900px; }
.st-lines { display: flex; flex-direction: column; gap: 2px; }
.st-line { display: grid; grid-template-columns: 70px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 9px; background: transparent; }
.st-line:hover { background: var(--st-surface); }
.st-line.is-active { background: var(--st-surface); }
.st-line-time { font-family: var(--st-mono); font-size: 11px; color: var(--st-accent); background: transparent; border: 1px solid transparent; border-radius: 5px; padding: 3px 4px; width: 66px; }
.st-line-time:focus { outline: none; border-color: var(--st-line-input); background: var(--st-bg); }
.st-line-text { font-size: 13px; line-height: 1.5; color: var(--st-text-3); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; font-family: inherit; resize: none; width: 100%; }
.st-line-text:focus { outline: none; border-color: var(--st-line-input); background: var(--st-bg); }
.st-line-actions { display: flex; gap: 4px; align-items: center; }
.st-line-btn { border: 1px solid var(--st-line-input); background: transparent; color: var(--st-muted); border-radius: 6px; padding: 5px 10px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.st-line-btn.is-accent { color: var(--st-accent); }
.st-line-btn:hover { border-color: var(--st-line-hover); color: var(--st-text); }
.st-line-x { border: none; background: transparent; color: var(--st-disabled); cursor: pointer; padding: 4px 6px; border-radius: 5px; }
.st-line-x:hover { color: var(--st-accent); }
.st-line-add { resize: none; }
.st-script-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.st-script-tools .st-input { flex: 1; min-width: 200px; }

/* ── Таймлайн ───────────────────────────────────────────────────────────────── */
.st-tl { flex: none; height: 342px; border-top: 1px solid var(--st-line); background: var(--st-panel); display: flex; flex-direction: column; transition: height .25s; position: relative; }
.st-tl.is-collapsed { height: 44px; }
.st-tl.is-collapsed .st-tl-scroll { visibility: hidden; }
.st-tl.is-collapsed .st-tl-itembar { display: none; }
.st-tl-bar { height: 44px; flex: none; display: flex; align-items: center; padding: 0 16px; gap: 12px; border-bottom: 1px solid var(--st-line); overflow: hidden; }
@media (max-width: 1400px) { .st-tl-info { display: none; } }
.st-tl-toggle { background: transparent; border: none; color: var(--st-muted); cursor: pointer; font-size: 12px; padding: 0; white-space: nowrap; }
.st-tl-toggle:hover { color: var(--st-text); }
.st-tl-vsep { width: 1px; height: 16px; background: var(--st-line-input); flex: none; }
.st-tl-play { width: 30px; height: 30px; border-radius: 50%; background: var(--st-accent); border: none; color: var(--st-on-accent); cursor: pointer; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.st-tl-play:hover { background: var(--st-accent-hover); }
.st-tl-time { font-family: var(--st-mono); font-size: 12px; color: var(--st-text); min-width: 130px; white-space: nowrap; }
.st-tl-time span { color: var(--st-muted); }
.st-tl-info { color: var(--st-muted); font-size: 12px; white-space: nowrap; }
.st-tl-info b { color: var(--st-text); font-family: var(--st-mono); font-weight: 400; }
.st-tl-spacer { flex: 1; }
.st-tl-actions { display: flex; gap: 6px; }
.st-tl-actions .st-btn-xs { border: 1px solid var(--st-line-input); background: transparent; color: var(--st-text); }
.st-tl-actions .st-btn-xs:hover:not(:disabled) { border-color: var(--st-line-hover); }
.st-tl-actions .st-btn-danger { color: var(--st-accent); }
.st-tl-zoom { display: flex; align-items: center; gap: 8px; color: var(--st-muted); font-size: 11px; white-space: nowrap; }
.st-tl-zoom input { width: 110px; accent-color: var(--st-accent); }
.st-tl-zoom button { border: 1px solid var(--st-line-input); background: transparent; color: var(--st-text); border-radius: 5px; padding: 2px 7px; font-size: 11px; cursor: pointer; font-family: var(--st-mono); line-height: 1.4; }
.st-tl-zoom button:hover { border-color: var(--st-line-hover); }
.st-tl-ruler canvas { position: absolute; left: 0; top: 0; height: 20px; }
.st-tl-scroll { flex: 1; overflow: auto hidden; position: relative; cursor: default; user-select: none; }
.st-tl-canvas { position: relative; height: 100%; min-height: 150px; }
.st-tl-ruler { height: 20px; position: relative; border-bottom: 1px solid var(--st-line); cursor: ew-resize; background: linear-gradient(180deg, rgba(255,255,255,.03), transparent); }
.st-tl-ruler:hover { background: linear-gradient(180deg, rgba(255,107,87,.10), transparent); }
.st-tl-tick { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--st-line-input); padding-left: 4px; font-family: var(--st-mono); font-size: 9px; color: var(--st-muted); line-height: 20px; white-space: nowrap; }
.st-tl-tick.is-minor { border-left-color: #1a1a20; height: 6px; top: 14px; }
.st-tl-track-video { position: relative; height: 64px; margin-top: 10px; background: transparent; border-top: 1px solid #16161a; border-bottom: 1px solid #16161a; }
.st-tl-track-video.is-overlay { height: 40px; margin-top: 6px; border-style: dashed; }
.st-tl-track-video.is-text { height: 30px; margin-top: 6px; border-style: dotted; }
.st-tl-track-video.is-text .st-tl-item { top: 3px; bottom: 3px; background: #1c1c28; border-color: #33334a; }
.st-tl-item.is-text .st-tl-item-label { font-family: inherit; font-size: 11px; top: 3px; }
.st-tl-keys { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.st-tl-keys polygon { fill: rgba(255,107,87,.22); }
.st-tl-keys polyline { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.st-tl-key { position: absolute; width: 9px; height: 9px; margin: -5px 0 0 -5px; background: #fff; border: 1px solid #0b0b0d; transform: rotate(45deg); cursor: pointer; z-index: 2; }
.st-tl-key:hover { background: var(--st-accent-hover, #ff8a78); }
.st-tl-key.is-selected { background: var(--st-accent); border-color: #fff; }
/* Громкость: голубая кривая без заливки и круглые маркеры (прозрачность — белая с заливкой и ромбики). */
.st-tl-keys.is-vol polyline { stroke: #7fd4ff; stroke-dasharray: 3 2; }
.st-tl-key.is-vol { background: #7fd4ff; border-radius: 50%; transform: none; width: 8px; height: 8px; margin: -4px 0 0 -4px; }
.st-tl-key.is-vol:hover { background: #b6e6ff; }
.st-tl-key.is-vol.is-selected { background: var(--st-accent); border-color: #fff; }
.st-tl-item-vol { position: absolute; left: 6px; bottom: 4px; font-family: var(--st-mono); font-size: 9px; color: #cfeeff; background: rgba(0,0,0,.55); padding: 1px 4px; border-radius: 3px; pointer-events: none; }
/* Панель выбранного фрагмента: высота фиксирована и строка есть всегда — таймлайн не смещается при выделении. */
.st-tl-itembar { display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-bottom: 1px solid var(--st-line); flex-wrap: nowrap; overflow: auto hidden; height: 42px; flex: none; scrollbar-width: thin; }
.st-tl-hint { font-size: 11px; color: var(--st-disabled); white-space: nowrap; }
.st-tl-itembar::-webkit-scrollbar { height: 6px; }
.st-tl-itembar::-webkit-scrollbar-thumb { background: var(--st-line-input); border-radius: 3px; }
.st-tl-itembar .st-btn-xs { border: 1px solid var(--st-line-input); background: transparent; color: var(--st-text); white-space: nowrap; }
.st-tl-itembar .st-btn-xs:hover:not(:disabled) { border-color: var(--st-line-hover); }
.st-tl-itembar .st-tl-keylabel { font-size: 11px; color: var(--st-muted); white-space: nowrap; }
.st-tl-textview { flex: 0 1 auto; max-width: 320px; padding: 5px 10px; font-size: 12px; border: 1px solid var(--st-line-input); border-radius: 7px; color: var(--st-text-2); background: var(--st-bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tl-color { width: 28px; height: 28px; padding: 0; border: 1px solid var(--st-line-input); border-radius: 6px; background: transparent; cursor: pointer; }
.st-tl-sel { width: auto; padding: 5px 8px; font-size: 11px; }
.st-tl-check { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--st-muted); white-space: nowrap; }
.st-mon-text { position: absolute; left: 6%; right: 6%; display: none; text-align: center; color: #fff; font-weight: 700; line-height: 1.15; white-space: pre-line; text-shadow: 0 2px 4px rgba(0,0,0,.75); z-index: 3; pointer-events: none; font-family: 'DejaVu Sans', Onest, system-ui, sans-serif; width: fit-content; max-width: 88%; margin: 0 auto; }
.st-mon-text.is-shown { display: block; }
.st-mon-text.pos-top { top: 8%; }
.st-mon-text.pos-center { top: 50%; transform: translateY(-50%); }
.st-mon-text.pos-bottom { bottom: 10%; }
.st-mon-text.al-left { text-align: left; margin-left: 0; }
.st-mon-text.al-right { text-align: right; margin-right: 0; }
.st-mon-text.is-box { background: rgba(0,0,0,.45); padding: .25em .5em; border-radius: .18em; text-shadow: none; }
.st-tl-track-video.is-overlay .st-tl-item { top: 3px; bottom: 3px; }
.st-tl-layer-hint { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 12px; font-size: 11px; color: var(--st-disabled); pointer-events: none; white-space: nowrap; overflow: hidden; }
.st-tl-item-op { position: absolute; right: 12px; top: 4px; font-family: var(--st-mono); font-size: 9px; color: #fff; background: rgba(0,0,0,.55); padding: 1px 4px; border-radius: 3px; pointer-events: none; }
.st-tl-beats { position: absolute; left: 0; top: 20px; height: calc(100% - 20px); pointer-events: none; }
.st-tl-beatsbtn { border: 1px solid var(--st-line-input); background: transparent; color: var(--st-muted); }
.st-tl-beatsbtn.is-active { color: var(--st-accent); border-color: var(--st-accent); }
.st-tl-op { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--st-muted); }
.st-tl-op input { width: 90px; accent-color: var(--st-accent); }
.st-tl-op b { font-family: var(--st-mono); color: var(--st-text); min-width: 32px; font-weight: 500; }
.st-monitor .st-mon-ov { background: transparent; z-index: 1; }
.st-tl-track-video.is-dragover { background: #121216; box-shadow: inset 0 0 0 1px var(--st-accent); }
.st-tl-item { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; background: var(--st-g-e); background-size: cover; background-position: center; border: 2px solid transparent; cursor: grab; overflow: hidden; box-shadow: 0 0 0 1px var(--st-bg); }
.st-tl-item.is-selected { border-color: #fff; }
.st-tl-item.is-moving { cursor: grabbing; opacity: .85; z-index: 3; }
.st-tl-item-label { position: absolute; left: 6px; top: 4px; font-family: var(--st-mono); font-size: 10px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); white-space: nowrap; pointer-events: none; }
.st-tl-item-sub { position: absolute; left: 6px; bottom: 4px; font-family: var(--st-mono); font-size: 9px; color: rgba(255,255,255,.75); text-shadow: 0 1px 2px rgba(0,0,0,.8); white-space: nowrap; pointer-events: none; }
.st-tl-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.st-tl-handle.l { left: 0; }
.st-tl-handle.r { right: 0; }
.st-tl-item:hover .st-tl-handle::after, .st-tl-item.is-selected .st-tl-handle::after { content: ''; position: absolute; top: 30%; bottom: 30%; left: 3px; width: 2px; border-radius: 1px; background: rgba(255,255,255,.7); }
.st-tl-gap { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; border: 1px dashed var(--st-line-dash); display: grid; place-items: center; font-size: 10px; color: var(--st-disabled); pointer-events: none; overflow: hidden; }
.st-tl-ghost { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; border: 2px dashed var(--st-accent); background: rgba(255,107,87,.15); pointer-events: none; display: none; }
.st-tl-ghost.is-shown { display: block; }
.st-tl-track-audio { position: relative; height: 48px; margin-top: 8px; background: transparent; border-top: 1px solid #16161a; border-bottom: 1px solid #16161a; overflow: hidden; }
.st-tl-track-audio canvas { position: absolute; left: 0; top: 0; height: 48px; }
.st-tl-audio-label { position: absolute; left: 8px; top: 4px; font-family: var(--st-mono); font-size: 9px; color: var(--st-muted); background: rgba(14,14,17,.8); padding: 1px 5px; border-radius: 3px; pointer-events: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tl-audio-empty { position: absolute; inset: 0; display: flex; align-items: center; gap: 10px; padding: 0 12px; color: var(--st-muted); font-size: 11px; }
.st-tl-audio-empty .st-btn-xs { border: 1px dashed var(--st-line-dash); background: transparent; color: var(--st-muted); }
.st-tl-audio-empty .st-btn-xs:hover { border-color: var(--st-accent); color: var(--st-accent); }
.st-tl-playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--st-accent); pointer-events: none; z-index: 4; }
.st-tl-playhead::before { content: ''; position: absolute; top: 0; left: -5px; width: 11px; height: 11px; background: var(--st-accent); border-radius: 2px; transform: rotate(45deg) translateY(-2px); }
.st-tl-audio-tools { position: absolute; right: 6px; top: 4px; display: flex; gap: 4px; z-index: 2; }
.st-tl-audio-tools .st-btn-xs { padding: 2px 6px; font-size: 10px; background: rgba(14,14,17,.85); border: 1px solid var(--st-line-input); color: var(--st-muted); }
.st-tl-audio-tools .st-btn-xs:hover { color: var(--st-text); border-color: var(--st-line-hover); }

/* ── Тост экспорта ──────────────────────────────────────────────────────────── */
/* ── Модалка студии (настройки надписи) ──────────────────────────── */
.st-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.66); display: flex; align-items: center; justify-content: center; padding: 4vh 16px; z-index: 60; overflow: auto; }
.st-modal { background: var(--st-panel); border: 1px solid var(--st-line-card); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 18px 60px rgba(0,0,0,.55); display: flex; flex-direction: column; max-height: 92vh; }
.st-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--st-line); }
.st-modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.st-modal-x { background: none; border: none; color: var(--st-muted); font-size: 13px; cursor: pointer; padding: 2px 6px; line-height: 1; }
.st-modal-x:hover { color: var(--st-text); }
.st-modal-body { padding: 14px 18px; overflow: hidden auto; display: flex; flex-direction: column; gap: 12px; }
.st-modal-body .st-textarea, .st-modal-body .st-input, .st-modal-body .st-select { box-sizing: border-box; }
.st-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--st-line); }
/* Плеер сцены: отдельная модалка со своим play/перемоткой — не мешаем таймлайну. */
.st-modal.st-player { max-width: min(96vw, 1040px); }
.st-player-media { background: #000; display: flex; align-items: center; justify-content: center; max-height: 70vh; min-height: 200px; }
.st-player-media video, .st-player-media img { max-width: 100%; max-height: 70vh; display: block; }
.st-player-media.is-portrait video, .st-player-media.is-portrait img { max-height: 74vh; }
.st-player-prompt { padding: 10px 18px 0; font-size: 12px; color: var(--st-text-2); max-height: 4.6em; overflow: auto; }
.st-player-empty { color: var(--st-muted); padding: 40px; font-size: 12px; }
.st-modal-foot .st-actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.st-fld { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.st-fld-label { width: 104px; flex: none; font-size: 11px; color: var(--st-muted); }
.st-fld-val { font-family: var(--st-mono); font-size: 11px; color: var(--st-text); min-width: 38px; }
.st-fld-hint { font-size: 11px; color: var(--st-disabled); }
.st-range { flex: 1; accent-color: var(--st-accent); }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip { border: 1px solid var(--st-line-input); background: transparent; color: var(--st-text-2); border-radius: 7px; padding: 6px 11px; font-size: 12px; cursor: pointer; }
.st-chip:hover:not(:disabled) { border-color: var(--st-line-hover); }
.st-chip.is-active { border-color: var(--st-accent); color: var(--st-text); background: var(--st-selected); }
.st-swatches { display: flex; align-items: center; gap: 6px; }
.st-swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--st-line-input); cursor: pointer; padding: 0; }
.st-swatch.is-active { box-shadow: 0 0 0 2px var(--st-accent); }
/* Кадр предпросмотра: размер шрифта в cqh — та же доля высоты кадра, что и в экспорте (drawtext). */
.st-tp { position: relative; container-type: size; background: #000; border: 1px solid var(--st-line-input); border-radius: 10px; overflow: hidden; margin: 0 auto; }
.st-tp.is-wide { width: 100%; aspect-ratio: 16 / 9; }
.st-tp.is-vertical { height: 260px; aspect-ratio: 9 / 16; }
.st-tp.is-square { height: 240px; aspect-ratio: 1; }
.st-tp-text { position: absolute; left: 6%; right: 6%; width: fit-content; max-width: 88%; margin: 0 auto; text-align: center; font-weight: 700; line-height: 1.15; white-space: pre-line; text-shadow: 0 2px 4px rgba(0,0,0,.75); }
.st-tp-text.pos-top { top: 8%; }
.st-tp-text.pos-center { top: 50%; transform: translateY(-50%); }
.st-tp-text.pos-bottom { bottom: 10%; }
.st-tp-text.al-left { text-align: left; margin-left: 0; }
.st-tp-text.al-right { text-align: right; margin-right: 0; }
.st-tp-text.is-box { background: rgba(0,0,0,.45); padding: .25em .5em; border-radius: .18em; text-shadow: none; }
.st-tl-stylebtn { border: 1px solid var(--st-line-input); background: transparent; color: var(--st-text); }
.st-tl-stylebtn:hover:not(:disabled) { border-color: var(--st-accent); color: var(--st-accent); }

.st-toast { position: fixed; bottom: 24px; right: 24px; background: var(--st-surface); border: 1px solid var(--st-line-input); border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.5); z-index: 50; max-width: 420px; }
.st-toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-accent); animation: st-pulse 1s infinite; flex: none; }
.st-toast-dot.is-done { animation: none; background: #63b76c; }
.st-toast-dot.is-err { animation: none; }
.st-toast-title { font-weight: 600; }
.st-toast-sub { color: var(--st-muted); font-size: 12px; line-height: 1.4; }
.st-toast-actions { display: flex; gap: 6px; margin-left: 6px; }
.st-toast-x { background: transparent; border: none; color: var(--st-muted); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.st-toast-x:hover { color: var(--st-text); }

/* ── Модалки поверх студии (переиспользуем vv-modal) ────────────────────────── */
.st-shell .vv-modal-overlay { z-index: 100; }
.st-shell .vv-modal { background: var(--st-card); border-color: var(--st-line-input); font-family: var(--st-font); }
.st-shell .vv-modal-head h3 { font-size: 15px; }
.st-shell .btn-approve { background: var(--st-accent); color: var(--st-on-accent); border-radius: 9px; }
.st-shell .btn-approve:hover { background: var(--st-accent-hover); }
.st-shell .btn-reject { background: var(--st-accent); color: var(--st-on-accent); border-radius: 9px; border: none; }
.st-shell .btn-link { color: var(--st-accent); }
.st-shell .muted { color: var(--st-muted); }
.st-shell .error { color: var(--st-accent); background: rgba(255,107,87,.08); border-color: rgba(255,107,87,.25); }

/* ── Экран загрузки / пустые состояния ───────────────────────────────────────── */
.st-loading { flex: 1; display: grid; place-items: center; color: var(--st-muted); }
.st-kbd { font-family: var(--st-mono); font-size: 10px; background: var(--st-hover); border: 1px solid var(--st-line-input); border-radius: 4px; padding: 1px 5px; color: var(--st-muted); }

/* ── Сцены-заглушки на таймлайне, генерация, кадр из видео ─────────────────── */
.st-tl-item.is-still { border-style: dashed; border-color: rgba(255,255,255,.35); }
.st-tl-item.is-still.is-selected { border-color: #fff; }
.st-tl-item.is-empty { background: repeating-linear-gradient(45deg, #1a1a20 0 6px, #141418 6px 12px); border-style: dashed; border-color: var(--st-line-dash); }
.st-tl-item.is-gen::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,20,24,.15) 25%, rgba(255,107,87,.4) 50%, rgba(20,20,24,.15) 75%); background-size: 200% 100%; animation: st-shimmer 1.4s linear infinite; pointer-events: none; }
.st-basethumb.is-clear { display: grid; place-items: center; font-size: 11px; color: var(--st-muted); border-style: dashed; border-color: var(--st-line-dash); }
.st-basethumb.is-last::after { content: '⏭'; position: absolute; right: 3px; bottom: 2px; font-size: 10px; text-shadow: 0 1px 2px #000; }

/* Опорные изображения сцены: полоска-дропзона (плитки библиотеки и файлы), + из библиотеки, ⬆ с диска */
.st-refstrip { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; min-height: 48px; border-radius: 8px; border: 1px dashed var(--st-line-dash); }
.st-refstrip.is-dragover { border-color: var(--st-accent); background: rgba(255,107,87,.08); }
.st-refthumb { position: relative; flex: none; width: 72px; aspect-ratio: 16/9; border-radius: 6px; border: 1px solid var(--st-line-card); background: var(--st-surface) center/cover no-repeat; overflow: hidden; }
.st-refstrip.is-portrait .st-refthumb { width: 44px; aspect-ratio: 9/16; }
.st-refthumb > span { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 3px; font-family: var(--st-mono); font-size: 8px; line-height: 1.3; color: #fff; background: rgba(0,0,0,.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-refthumb-x { position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 4px; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 10px; line-height: 1; cursor: pointer; padding: 0; opacity: 0; transition: opacity .12s; }
.st-refthumb:hover .st-refthumb-x { opacity: 1; }
.st-refadd { flex: none; width: 34px; height: 34px; border-radius: 8px; border: 1px dashed var(--st-line-dash); background: transparent; color: var(--st-muted); font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.st-refadd:hover:not(:disabled), .st-refadd.is-on { border-color: var(--st-accent); color: var(--st-accent); }
.st-refadd:disabled, .st-refadd:has(input:disabled) { opacity: .4; cursor: default; }
.st-refdrop-hint { display: none; position: absolute; inset: 0; place-items: center; border-radius: 8px; font-size: 11px; color: var(--st-accent); background: rgba(11,11,13,.72); pointer-events: none; }
.st-refstrip.is-dragover .st-refdrop-hint { display: grid; }
.st-check { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--st-text-2); cursor: pointer; }

/* Новая плитка из кадра: подсветка после создания; 📸 во время съёмки кадра */
.st-mcard.is-flash { animation: st-flash 1.8s ease-out; }
@keyframes st-flash { 0%, 55% { box-shadow: 0 0 0 3px var(--st-accent), 0 0 18px rgba(255,107,87,.7); } 100% { box-shadow: 0 0 0 1px var(--st-accent); } }
.st-mon-btn.is-busy { animation: st-pulse .9s ease-in-out infinite; }
@keyframes st-pulse { 50% { opacity: .45; } }
.st-endpreview { display: flex; align-items: center; gap: 10px; }
.st-endpreview .st-basethumb { cursor: default; }

/* Контекстное меню фрагментов таймлайна (правая кнопка) */
.st-ctx { position: fixed; z-index: 60; min-width: 210px; padding: 5px; border: 1px solid var(--st-line-card); border-radius: 10px; background: var(--st-panel); box-shadow: 0 14px 40px rgba(0,0,0,.55); font-family: var(--st-font); font-size: 12px; }
.st-ctx-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 7px 9px; border: none; border-radius: 7px; background: transparent; color: var(--st-text); font: inherit; text-align: left; cursor: pointer; }
.st-ctx-item:hover:not(:disabled) { background: var(--st-hover); }
.st-ctx-item:disabled { color: var(--st-disabled); cursor: default; }
.st-ctx-item.is-danger { color: var(--st-accent); }
.st-ctx-item i { font-style: normal; font-family: var(--st-mono); font-size: 10px; color: var(--st-muted); }
.st-ctx-item:disabled i { color: var(--st-disabled); }
.st-ctx-sep { height: 1px; margin: 4px 6px; background: var(--st-line); }

/* ── Экспорт клипа: миниатюра в шапке, прогресс, модалка ── */
.st-export-thumb { position: relative; height: 34px; width: 34px; flex: none; border-radius: 7px; overflow: hidden; border: 1px solid var(--st-line-input); background: #000; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--st-muted); font-size: 15px; }
.st-export-thumb.is-wide { width: 58px; }
.st-export-thumb.is-square { width: 34px; }
.st-export-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-export-thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; color: #fff; background: rgba(0,0,0,.28); opacity: 0; transition: opacity .12s; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.st-export-thumb:hover { border-color: var(--st-accent); }
.st-export-thumb:hover .st-export-thumb-play { opacity: 1; }
.st-export-mini { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--st-line-input); background: var(--st-surface); color: var(--st-text-2); font-size: 12px; cursor: pointer; white-space: nowrap; flex: none; }
.st-export-mini:hover { border-color: var(--st-accent); color: var(--st-text); }
.st-export-mini-bar { position: relative; display: inline-block; width: 72px; height: 5px; border-radius: 3px; background: var(--st-line-input); overflow: hidden; }
.st-export-mini-bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--st-accent); border-radius: 3px; transition: width .6s ease; }
.st-export-mini-txt { font-family: var(--st-mono); font-size: 11px; }
.st-toast-bar { width: 90px; align-self: center; }
.st-modal.st-export { max-width: 560px; }
.st-modal.st-export-view { max-width: min(96vw, 900px); }
.st-export-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12px; align-items: baseline; }
.st-export-fact { display: contents; }
.st-export-fact span { color: var(--st-muted); }
.st-export-fact b { font-weight: 600; color: var(--st-text); }
.st-export-notes { margin: 0; padding: 0 0 0 1.1em; font-size: 12px; color: var(--st-text-2); line-height: 1.45; display: flex; flex-direction: column; gap: 6px; }
.st-export-notes li.is-warn { color: #f2c46d; list-style: none; margin-left: -1.1em; }
.st-export-notes li.is-warn b { color: #f2c46d; }
.st-export-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 12px; color: var(--st-disabled); }
.st-export-steps li { display: inline-flex; align-items: center; gap: 6px; }
.st-export-step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-line-hover); flex: none; }
.st-export-steps li.is-current { color: var(--st-text); }
.st-export-steps li.is-current .st-export-step-dot { background: var(--st-accent); animation: st-pulse 1s infinite; }
.st-export-steps li.is-done { color: var(--st-text-2); }
.st-export-steps li.is-done .st-export-step-dot { background: #63b76c; }
.st-export-steps li.is-err { color: var(--st-text-2); }
.st-export-steps li.is-err .st-export-step-dot { background: var(--st-accent); }
.st-progress { position: relative; height: 10px; border-radius: 6px; background: var(--st-line-input); overflow: hidden; }
.st-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--st-accent), var(--st-accent-hover)); transition: width .7s ease; }
.st-progress-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); background-size: 200% 100%; animation: st-progress-shine 1.6s linear infinite; }
.st-progress.is-err .st-progress-fill { background: #5a2a2a; }
.st-progress.is-err .st-progress-fill::after, .st-progress.is-stopping .st-progress-fill::after { animation: none; }
.st-progress.is-stopping .st-progress-fill { background: var(--st-line-hover); }
@keyframes st-progress-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.st-export-status { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; }
.st-export-stage { color: var(--st-text); line-height: 1.4; }
.st-export-meta { color: var(--st-muted); font-family: var(--st-mono); font-size: 11px; white-space: nowrap; display: inline-flex; gap: 4px; }
.st-export-hint { font-size: 11px; color: var(--st-muted); line-height: 1.45; }
.st-export-hint-pad { padding: 8px 18px 0; }
.st-export-info { padding: 10px 18px 0; font-size: 12px; color: var(--st-text-2); display: flex; gap: 5px; flex-wrap: wrap; }
.st-export-confirm { font-size: 12px; color: var(--st-text-2); align-self: center; }
.st-modal.st-export-view .st-modal-foot { flex-wrap: wrap; }

/* Отрезок экспорта: два ползунка на одной дорожке + поля мм:сс. */
.st-export-range { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--st-line-input); border-radius: 10px; background: var(--st-surface); }
.st-export-range-head { display: flex; align-items: baseline; gap: 10px; font-size: 12px; color: var(--st-muted); flex-wrap: wrap; }
.st-export-range-head b { color: var(--st-text); font-family: var(--st-mono); font-weight: 600; }
.st-export-range-len { margin-left: auto; }
.st-export-range-reset { border: 1px solid var(--st-line-input); background: transparent; color: var(--st-text-2); cursor: pointer; }
.st-export-range-reset:hover:not(:disabled) { border-color: var(--st-accent); color: var(--st-accent); }
.st-dual { position: relative; height: 26px; }
.st-dual-track { position: absolute; left: 8px; right: 8px; top: 11px; height: 4px; border-radius: 2px; background: var(--st-line-hover); }
.st-dual-fill { position: absolute; top: 0; bottom: 0; background: var(--st-accent); border-radius: 2px; }
.st-dual input[type=range] { position: absolute; inset: 0; width: 100%; height: 26px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; pointer-events: none; }
.st-dual input[type=range]:focus { outline: none; }
.st-dual input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 26px; }
.st-dual input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--st-text); border: 2px solid var(--st-accent); margin-top: 5px; cursor: ew-resize; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.st-dual input[type=range]::-moz-range-track { background: transparent; }
.st-dual input[type=range]::-moz-range-thumb { pointer-events: auto; width: 12px; height: 12px; border-radius: 50%; background: var(--st-text); border: 2px solid var(--st-accent); cursor: ew-resize; }
.st-export-range-fields { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--st-muted); flex-wrap: wrap; }
.st-export-range-fields label { display: inline-flex; align-items: center; gap: 6px; }
.st-export-range-fields input { width: 66px; font-family: var(--st-mono); font-size: 12px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--st-line-input); background: var(--st-bg); color: var(--st-text); text-align: center; }
.st-export-range-fields input:focus { outline: none; border-color: var(--st-accent); }
.st-export-range-hint { flex: 1 1 100%; font-size: 11px; color: var(--st-disabled); line-height: 1.4; }

/* Модалка «новое изображение по кадру»: крупное превью опоры, слайдер таймкода, выбор опоры */
.st-modal.st-fim { max-width: 560px; }
.st-fim-preview { position: relative; background: #000; border-radius: 8px; border: 1px solid var(--st-line-card); display: flex; align-items: center; justify-content: center; height: 240px; overflow: hidden; }
.st-fim-preview.is-portrait { height: 320px; }
.st-fim-preview.is-dragover { border-color: var(--st-accent); }
.st-fim-preview video, .st-fim-preview img { max-width: 100%; max-height: 100%; display: block; object-fit: contain; }
.st-fim-empty { color: var(--st-muted); font-size: 12px; padding: 20px; text-align: center; }
.st-fim-seek { display: flex; align-items: center; gap: 10px; }
.st-fim-time { font-family: var(--st-mono); font-size: 11px; color: var(--st-text-2); white-space: nowrap; }
.st-fim-pick { display: flex; flex-direction: column; gap: 6px; }
.st-fim .st-basestrip { flex-wrap: wrap; overflow: visible; }
.st-fim-chip { border-color: var(--st-line-card); }
.st-fim-chip.is-on { border-color: var(--st-accent); box-shadow: 0 0 0 1px var(--st-accent); }
.st-fim-chip span { left: 0; right: 0; top: auto; bottom: 0; padding: 1px 3px; background: rgba(0,0,0,.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: none; }
