:root {
  --bg: #0e0f11;
  --panel: #17181b;
  --panel-2: #1d1f23;
  --panel-3: #25282d;
  --line: #2a2d33;
  --line-2: #363a41;
  --text: #e8eaed;
  --muted: #8b9099;
  --accent: #22d3c5;
  --accent-ink: #062b28;
  --danger: #ff5d5d;
  --warn: #ffb547;
  --ok: #3ddc84;
  --clip-video: #1c3a52;
  --clip-video-b: #2d6a96;
  --clip-text: #6b3e12;
  --clip-text-b: #d7842b;
  --clip-audio: #123f37;
  --clip-audio-b: #26a189;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  font-size: 13px;
  color: var(--text);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
#app { height: 100%; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.pad { padding: 4px 12px 8px; }
.grow { flex: 1; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
kbd { background: var(--panel-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }

/* --------------------------------------------------------- кнопки */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel-3); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #2e3238; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-3); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.block { width: calc(100% - 24px); margin: 6px 12px; justify-content: center; white-space: normal; height: auto; min-height: 30px; padding: 5px 10px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: 0; background: transparent; cursor: pointer; color: #c9ccd2; text-decoration: none; }
.icon-btn:hover { background: var(--panel-3); color: #fff; }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn.on { color: var(--accent); }
.icon-btn.solid { background: rgba(0,0,0,.65); }
.chip { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 20px; padding: 3px 10px; cursor: pointer; font-size: 12px; }
.chip:hover { border-color: var(--accent); }
.segmented { display: inline-flex; background: var(--panel); border: 1px solid var(--line-2); border-radius: 7px; padding: 2px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 4px 9px; border-radius: 5px; cursor: pointer; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; }
.segmented button.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.segmented.big button { padding: 6px 16px; font-size: 13px; }
.mini-select { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; height: 28px; padding: 0 6px; font-size: 12px; }
.input { width: 100%; height: 34px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel); padding: 0 10px; outline: none; }
.input:focus { border-color: var(--accent); }
.spinner { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 4px; background: var(--panel-3); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: var(--accent); transition: width .3s; }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; height: 100%; color: var(--muted); }

/* --------------------------------------------------------- уведомления и окна */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; align-items: center; pointer-events: none; }
.toast { background: #2b2e34; border: 1px solid var(--line-2); padding: 9px 14px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.4); transition: opacity .3s, transform .3s; max-width: 560px; }
.toast.ok { border-color: #1f6f4a; }
.toast.error { border-color: var(--danger); background: #3a1f22; }
.toast.warn { border-color: var(--warn); }
.toast.hide { opacity: 0; transform: translateY(8px); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 900; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); max-width: calc(100vw - 32px); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; padding: 14px 16px 6px; }
.modal-title { flex: 1; font-size: 15px; font-weight: 600; }
.modal-body { padding: 8px 16px 12px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; align-items: center; gap: 12px; }
.form-row > label { width: 130px; color: var(--muted); flex: none; }
.field label { display: block; color: var(--muted); margin-bottom: 6px; }
.inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.warn-box { background: #3a2a10; border: 1px solid var(--warn); color: #ffd99a; padding: 10px 14px; border-radius: 8px; margin: 0 28px 14px; }

/* --------------------------------------------------------- страница проектов */
.projects-page { height: 100%; overflow: auto; }
.pp-head { display: flex; align-items: center; gap: 10px; padding: 22px 28px 16px; }
.brand { display: flex; gap: 12px; align-items: center; }
.logo { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }
.brand-name { font-size: 18px; font-weight: 700; }
.pp-bar { display: flex; align-items: center; gap: 10px; padding: 0 28px 16px; }
.bulk { display: flex; align-items: center; gap: 8px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; padding: 0 28px 40px; }
.proj-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: visible; position: relative; }
.proj-card.selected { border-color: var(--accent); }
.pc-thumb { aspect-ratio: 4 / 5; background: #000; border-radius: 10px 10px 0 0; overflow: hidden; position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pc-thumb:hover img { opacity: .85; }
.pc-badge, .pc-dur { position: absolute; bottom: 8px; background: rgba(0,0,0,.7); padding: 2px 7px; border-radius: 5px; font-size: 11px; }
.pc-badge { left: 8px; }
.pc-dur { right: 8px; }
.pc-info { display: flex; align-items: center; gap: 8px; padding: 10px; }
.pc-text { flex: 1; min-width: 0; }
.pc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-more { position: relative; }
.card-menu { display: none; position: absolute; right: 0; bottom: 30px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px; min-width: 190px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.pc-more:hover .card-menu, .pc-more:focus-within .card-menu { display: block; }
.card-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 5px; cursor: pointer; }
.card-menu button:hover { background: var(--panel-3); }
.card-menu button.danger { color: var(--danger); }
.thumb-ph { width: 100%; height: 100%; background: linear-gradient(135deg, #1b1d21, #23262b); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 70px 20px; color: var(--muted); text-align: center; }
.empty-state .big { font-size: 17px; color: var(--text); font-weight: 600; }

/* --------------------------------------------------------- редактор */
.editor { display: flex; flex-direction: column; height: 100%; }
.topbar { height: 50px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.name-input { background: transparent; border: 1px solid transparent; border-radius: 6px; height: 32px; padding: 0 8px; font-size: 14px; font-weight: 600; min-width: 140px; max-width: 360px; width: 26vw; outline: none; }
.name-input:hover { border-color: var(--line-2); }
.name-input:focus { border-color: var(--accent); background: var(--panel-2); }
.tpl-badge { background: #4a3410; color: #ffc46b; border-radius: 5px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.save-ind { font-size: 11.5px; color: var(--muted); padding: 3px 8px; border-radius: 10px; background: var(--panel-2); }
.save-ind.saved::before { content: "● "; color: var(--ok); }
.save-ind.dirty::before, .save-ind.saving::before { content: "● "; color: var(--warn); }
.save-ind.error { color: var(--danger); }
.q-count:not(:empty) { background: var(--accent); color: var(--accent-ink); border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.workspace { flex: 1; min-height: 0; display: flex; }
.pane { background: var(--panel); min-width: 0; min-height: 0; }
.pane.left { width: 300px; flex: none; border-right: 1px solid var(--line); display: flex; }
.pane.right { width: 300px; flex: none; border-left: 1px solid var(--line); overflow-y: auto; }
.pane.center { flex: 1; display: flex; flex-direction: column; background: var(--bg); }
.pane.bottom { height: 300px; flex: none; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.h-divider { height: 5px; flex: none; cursor: row-resize; background: var(--bg); }
.h-divider:hover { background: var(--accent); }

/* ---- медиатека */
.library { display: flex; width: 100%; min-height: 0; }
.library.drop { outline: 2px dashed var(--accent); outline-offset: -4px; }
.lib-tabs { width: 64px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 6px 0; gap: 2px; }
.lib-tab { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; cursor: pointer; color: var(--muted); font-size: 11px; }
.lib-tab:hover { color: var(--text); }
.lib-tab.active { color: var(--accent); }
.lib-body { flex: 1; overflow-y: auto; min-width: 0; padding-bottom: 20px; }
.lib-head { display: flex; align-items: center; padding: 12px 12px 8px; gap: 8px; }
.lib-title { flex: 1; font-weight: 600; }
.lib-empty { margin: 12px; border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 28px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; color: var(--text); }
.lib-empty:hover { border-color: var(--accent); }
.uploads .upload-row { margin: 0 12px 10px; }
.media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px; }
.media-item { cursor: grab; min-width: 0; }
.media-item.processing, .media-item.error { cursor: default; }
.m-thumb { aspect-ratio: 1; background: #000; border-radius: 7px; overflow: hidden; position: relative; border: 1px solid var(--line); }
.media-item:hover .m-thumb { border-color: var(--accent); }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.m-dur { position: absolute; right: 5px; bottom: 5px; background: rgba(0,0,0,.72); padding: 1px 5px; border-radius: 4px; font-size: 10.5px; }
.m-used { position: absolute; left: 5px; bottom: 5px; background: var(--accent); color: var(--accent-ink); width: 16px; height: 16px; border-radius: 50%; font-size: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.m-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(0,0,0,.6); font-size: 11px; }
.m-status.err { color: var(--danger); }
.m-actions { position: absolute; top: 5px; right: 5px; display: none; gap: 4px; }
.media-item:hover .m-actions { display: flex; }
.m-name { font-size: 11.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c3c6cc; }
.audio-list, .tpl-list { display: flex; flex-direction: column; gap: 6px; padding: 0 12px; }
.audio-item, .tpl-item { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; cursor: grab; }
.audio-item:hover, .tpl-item:hover { border-color: var(--line-2); }
.tpl-item { cursor: default; }
.tpl-item img, .tpl-item .thumb-ph { width: 40px; height: 52px; object-fit: cover; border-radius: 5px; flex: none; }
.a-main { flex: 1; min-width: 0; }
.a-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 4px 12px 8px; }
.preset-card { position: relative; background: #000 linear-gradient(135deg, #2a2d35, #15161a); border: 1px solid var(--line); border-radius: 8px; padding: 14px 6px 6px; cursor: pointer; text-align: center; }
.preset-card:hover { border-color: var(--accent); }
.preset-sample { display: inline-block; padding: 4px 8px; font-size: 15px; }
.preset-name { font-size: 11px; color: var(--muted); margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-del { position: absolute; top: 2px; right: 2px; display: none; }
.preset-card:hover .preset-del { display: inline-flex; }

/* ---- плеер */
.player-wrap { flex: 1; min-height: 0; display: flex; background: var(--bg); }
.player-wrap:fullscreen { background: #000; }
.preview-stage { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.preview-stage.zoomed { overflow: auto; align-items: flex-start; justify-content: flex-start; }
.preview-stage.zoomed .preview-frame { margin: 12px; }
.preview-frame { position: relative; flex: none; box-shadow: 0 0 0 1px var(--line-2); background: #000; }
.preview-canvas { width: 100%; height: 100%; display: block; }
.preview-overlay { position: absolute; inset: 0; overflow: hidden; cursor: default; }
.sel-box { position: absolute; border: 1px solid var(--accent); outline: 1px solid rgba(0,0,0,.35); cursor: move; pointer-events: none; }
.sel-handle { position: absolute; right: -7px; bottom: -7px; width: 13px; height: 13px; background: #fff; border-radius: 50%; border: 2px solid var(--accent); cursor: nwse-resize; pointer-events: auto; }
.transport { height: 46px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 12px; background: var(--panel); border-top: 1px solid var(--line); }
.tc { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); min-width: 170px; }
.tc-now { color: var(--accent); }
.play-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fff; color: #000; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin: 0 6px; }
.play-btn:hover { background: var(--accent); }
.transport .mini-select { margin-left: 4px; }

/* ---- инспектор */
.inspector { padding-bottom: 30px; }
.insp-head { padding: 14px 14px 10px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); }
.insp-section { padding: 10px 14px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.insp-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.insp-row { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.insp-row > label { width: 92px; flex: none; color: #c3c6cc; font-size: 12px; }
.insp-row.check { cursor: pointer; }
.insp-row.check > span { font-size: 12px; }
.insp-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }
.num-wrap { display: flex; align-items: center; gap: 3px; }
.num { width: 54px; height: 26px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; text-align: right; font-size: 12px; }
.num.wide { width: 74px; }
.unit { color: var(--muted); font-size: 11px; min-width: 10px; }
.color { width: 42px; height: 26px; padding: 0; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel-2); cursor: pointer; }
.text-area { width: 100%; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 8px; resize: vertical; outline: none; font-size: 13px; }
.text-area:focus { border-color: var(--accent); }
.grow-select { flex: 1; min-width: 0; }
.quick-row { display: flex; gap: 6px; flex-wrap: wrap; }
.hint-list { display: flex; flex-direction: column; gap: 6px; }
.hint { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #c3c6cc; }

/* ---- таймлайн */
.timeline { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.tl-toolbar { height: 38px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.tl-toolbar .sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 6px; }
.tl-time { font: 11.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.zoom-range { width: 110px; accent-color: var(--accent); }
.tl-scroll { flex: 1; overflow: auto; position: relative; min-height: 0; }
.tl-inner { position: relative; min-height: 100%; }
.tl-ruler { position: sticky; top: 0; z-index: 6; display: flex; background: var(--panel); border-bottom: 1px solid var(--line); cursor: ew-resize; }
.tl-corner { position: sticky; left: 0; z-index: 7; background: var(--panel); flex: none; border-right: 1px solid var(--line); }
.tl-ruler-canvas { display: block; flex: none; }
.tl-rows { padding: 6px 0 40px; }
.tl-row { display: flex; margin-bottom: 4px; }
.tl-head { position: sticky; left: 0; z-index: 5; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; align-items: center; gap: 2px; padding: 0 4px 0 10px; }
.tl-track-name { flex: 1; min-width: 0; font-size: 11.5px; color: #b6bac1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; }
.tl-row.main .tl-track-name { color: #fff; font-weight: 600; }
.tl-track-btns { display: flex; opacity: .55; }
.tl-row:hover .tl-track-btns, .tl-track-btns .on { opacity: 1; }
.tl-lane { flex: 1; position: relative; background: rgba(255,255,255,.025); }
.tl-row.main .tl-lane { background: rgba(255,255,255,.045); }
.tl-row.locked .tl-lane { background: repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 6px, transparent 6px 12px); }
.tl-row.hidden-track .clip { opacity: .35; }
.tl-row.muted-track.type-audio .clip { opacity: .45; }
.clip { position: absolute; top: 1px; bottom: 1px; border-radius: 5px; overflow: hidden; cursor: grab; border: 1px solid; user-select: none; }
.clip.type-video, .clip.type-image { background: var(--clip-video); border-color: var(--clip-video-b); }
.clip.type-text { background: var(--clip-text); border-color: var(--clip-text-b); }
.clip.type-audio { background: var(--clip-audio); border-color: var(--clip-audio-b); }
.clip.selected { border-color: #fff; box-shadow: 0 0 0 1px #fff inset; z-index: 2; }
.clip.dragging { opacity: .85; pointer-events: none; z-index: 10; }
.clip.overlap { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger) inset; }
.clip.missing { background: #3a1f22; border-color: var(--danger); }
.clip.locked { cursor: default; }
.clip.muted .clip-canvas { opacity: .4; }
.clip-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.clip-label { position: absolute; left: 6px; top: 2px; right: 6px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.9); pointer-events: none; }
.clip.type-text .clip-label { top: 50%; transform: translateY(-50%); }
.clip-handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 3; }
.clip-handle.left { left: 0; }
.clip-handle.right { right: 0; }
.clip.selected .clip-handle { background: rgba(255,255,255,.85); }
.clip.selected .clip-handle.left { border-radius: 4px 0 0 4px; }
.clip.selected .clip-handle.right { border-radius: 0 4px 4px 0; }
.clip-fade { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.clip-fade.in { left: 0; background: linear-gradient(to bottom right, rgba(0,0,0,.55) 50%, transparent 50%); }
.clip-fade.out { right: 0; background: linear-gradient(to bottom left, rgba(0,0,0,.55) 50%, transparent 50%); }
.tl-playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: #fff; z-index: 8; pointer-events: none; }
.tl-playhead-head { position: sticky; top: 0; width: 11px; height: 14px; margin-left: -5px; background: #fff; clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); }
.tl-drop-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--muted); pointer-events: none; font-size: 13px; padding-left: 168px; }
.tl-drop-marker { position: absolute; width: 2px; background: var(--accent); display: none; z-index: 9; pointer-events: none; }
.timeline.is-dragging .clip { cursor: grabbing; }

/* ---- очередь экспорта */
.queue-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100vw; background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -10px 0 40px rgba(0,0,0,.45); transform: translateX(105%); transition: transform .25s; z-index: 800; display: flex; flex-direction: column; }
.queue-panel.open { transform: none; }
.q-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.q-title { font-weight: 600; font-size: 14px; }
.q-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.q-item { display: flex; align-items: flex-start; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.q-item.error { border-color: #6b2a2e; }
.q-item input[type=checkbox], .cb-ph { margin-top: 3px; width: 14px; flex: none; }
.q-main { flex: 1; min-width: 0; }
.q-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-status { font-size: 11.5px; white-space: nowrap; color: var(--muted); padding-top: 2px; }
.q-status.done { color: var(--ok); }
.q-status.error { color: var(--danger); }
.q-status.running { color: var(--accent); }
.q-actions { display: flex; }
.q-error { white-space: pre-wrap; font: 11px ui-monospace, Menlo, monospace; color: #ffb3b3; background: #2a1618; padding: 6px; border-radius: 5px; margin: 6px 0 0; max-height: 140px; overflow: auto; }

@media (max-width: 1180px) {
  .pane.left { width: 250px; }
  .pane.right { width: 260px; }
}

/* --------------------------------------------------------- разделы приложения */
.page { height: 100%; overflow: auto; display: flex; flex-direction: column; }
.page-body { padding: 0 28px 40px; display: flex; flex-direction: column; gap: 16px; }
.page-bar { display: flex; align-items: center; gap: 12px; padding: 4px 28px 16px; }
.page-bar h1 { font-size: 20px; margin: 0; font-weight: 700; }
.app-header { display: flex; align-items: center; gap: 14px; padding: 16px 28px; flex: none; }
.app-nav { display: flex; gap: 2px; margin-left: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.nav-btn { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.nav-btn:hover { color: var(--text); }
.nav-btn.on { background: var(--panel-3); color: var(--text); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 3px; border: 1px solid var(--line); border-radius: 20px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.user-name { font-size: 12px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projects-page .pp-bar { padding-top: 4px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card.narrow { max-width: 760px; }
.card-head { display: flex; align-items: flex-start; gap: 12px; }
.card-title { font-size: 15px; font-weight: 600; }
.empty-inline { color: var(--muted); padding: 24px 4px; text-align: center; }
.inline-warn { margin: 0; }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); }
.err-text { color: var(--danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.tag { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 10px; background: var(--panel-3); color: var(--muted); margin-left: 6px; vertical-align: middle; }
.tag.voice { background: #123f37; color: #7fe3cf; margin-left: 0; }
.tag.text { background: #4a2d10; color: #ffc27a; margin-left: 0; }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 12px; padding: 0; }
.input.sm { height: 30px; font-size: 12.5px; }
.ghost-input { background: transparent; border-style: dashed; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.label-row { display: flex; align-items: center; margin-bottom: 6px; }
.label-row label { margin: 0; }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn.danger-ghost:hover { background: #3a1f22; }
.block-btn { width: 100%; justify-content: center; }
.num-label { min-width: 46px; text-align: right; font: 12px ui-monospace, Menlo, monospace; color: var(--muted); }
.pad0 { padding: 0 2px; }
.insp-section.flat { border: 1px solid var(--line); border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table.compact td, .table.compact th { padding: 5px 6px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--panel-2); }
.row-actions { white-space: nowrap; text-align: right; }

/* ---- генератор */
.voicegen { display: flex; flex-direction: column; gap: 12px; }
.voicegen.compact { gap: 10px; }
.vg-grid { display: grid; grid-template-columns: 1fr 200px; gap: 12px; }
.vg-grid.compact { grid-template-columns: 1fr; gap: 10px; }
.vg-vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.voicegen .field label { font-size: 12px; margin-bottom: 4px; }
.vg-actions { display: flex; align-items: center; gap: 8px; }
.vg-actions.wrap { flex-wrap: wrap; }
.vg-result { border: 1px solid #1f6f4a; background: #10241b; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.vg-result-head { display: flex; align-items: center; gap: 6px; color: var(--ok); }
.vg-result-head b { color: var(--text); }
.vg-audio { width: 100%; height: 36px; }
.vo-audio { height: 32px; width: 260px; flex: none; }
.vo-list { display: flex; flex-direction: column; gap: 6px; }
.vo-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.vo-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geo-badge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 44px; padding: 4px 6px; border-radius: 7px; background: var(--panel-3); font-weight: 700; font-size: 13px; gap: 1px; }
.geo-badge.big { position: absolute; left: 6px; top: 6px; font-size: 14px; background: rgba(0,0,0,.75); }
.tpl-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.tpl-side { display: flex; flex-direction: column; gap: 6px; }
.tpl-row { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 9px 11px; cursor: pointer; }
.tpl-row:hover { border-color: var(--line-2); }
.tpl-row.on { border-color: var(--accent); }
.tpl-variants { display: flex; flex-direction: column; gap: 10px; }
.tpl-variant { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; }
.tpl-variant .geo-badge { align-items: flex-start; background: transparent; padding: 6px 0; }
.key-row .input { max-width: 420px; }
.quota { margin-top: 8px; max-width: 520px; }
.el-status { display: flex; flex-direction: column; gap: 2px; }

/* ---- мастер GEO */
.wizard { display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 220px); overflow: auto; padding-right: 4px; }
.wizard-foot { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: 12px; }
.wz-step { display: flex; gap: 14px; }
.wz-num { width: 26px; height: 26px; border-radius: 50%; background: var(--panel-3); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; font-size: 12px; }
.wz-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.wz-title { font-weight: 600; font-size: 14px; }
.geo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.geo-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 11px; cursor: pointer; }
.geo-chip.on { border-color: var(--accent); background: rgba(34,211,197,.08); }
.wz-elements { display: flex; flex-direction: column; gap: 10px; }
.wz-el { border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: var(--panel-2); display: flex; flex-direction: column; gap: 10px; }
.wz-el.keep { opacity: .65; }
.wz-el-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wz-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.wz-cell-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.text-area.cell { font-size: 12.5px; }
.text-area.edited { border-color: #8a6bff; }
.text-area.bad { border-color: var(--danger); }

/* ---- результаты GEO */
.batch-list { display: flex; flex-direction: column; gap: 10px; }
.batch-item { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.batch-item.warn { border-color: #6b5320; }
.batch-item.error { border-color: #6b2a2e; }
.bi-thumb { width: 84px; height: 110px; flex: none; border-radius: 8px; overflow: hidden; position: relative; background: #000; }
.bi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.bi-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bi-voices { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bi-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.q-status.warnst { color: var(--warn); }
.warn-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; color: #ffd99a; font-size: 12px; }
.warn-list .ico { color: var(--warn); vertical-align: -2px; }

/* ---- вход */
.login-page { height: 100%; display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.logo.big { width: 48px; height: 48px; border-radius: 12px; }
.login-title { font-size: 18px; font-weight: 700; }
.login-err { color: var(--danger); font-size: 12.5px; min-height: 16px; }

@media (max-width: 1100px) {
  .nav-btn span { display: none; }
  .hide-sm { display: none; }
  .tpl-layout { grid-template-columns: 1fr; }
}
.tpl-badge.geo { background: #12324a; color: #8fd0ff; text-decoration: none; }

/* ---- клип хука на таймлайне */
.clip.hookclip { background: #3a1f5c; border-color: #b57cff; }

/* ---- озвучка: подход, хуки, основная */
.pane.left { width: 330px; }
.vp { display: flex; flex-direction: column; gap: 10px; }
.vp-form { display: flex; flex-direction: column; gap: 8px; }
.vp-form .field label { font-size: 12px; margin-bottom: 4px; }
.vp-two { display: grid; grid-template-columns: 96px 1fr; gap: 8px; }
.vp-main { font-size: 12.5px; }
.vp-sub { margin: 6px 0 0; font-size: 12.5px; }
.vp-list { display: flex; flex-direction: column; gap: 6px; }
.vp-row { border: 1px solid var(--line); border-radius: 8px; padding: 6px 7px; background: var(--panel-2); display: flex; flex-direction: column; gap: 5px; }
.vp-row.active { border-color: #b57cff; box-shadow: inset 3px 0 0 #b57cff; }
.vp-row.main { border-style: dashed; }
.vp-row-head { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.vp-row-head input[type=radio] { accent-color: #b57cff; margin: 0; }
.vp-code { font-size: 12.5px; letter-spacing: .02em; }
.vp-row-head .muted.small { white-space: nowrap; }
.vp-hook { font-size: 12px; min-height: 44px; }
.vp-st { font-size: 10.5px; padding: 1px 7px; border-radius: 9px; white-space: nowrap; }
.vp-st:empty { display: none; }
.vp-st.wait { background: var(--panel-3); color: var(--muted); }
.vp-st.run { background: #12324a; color: #8fd0ff; }
.vp-st.done { background: #10241b; color: var(--ok); }
.vp-st.error { background: #3a1f22; color: var(--danger); cursor: help; }
.vp .btn.block { width: 100%; margin: 2px 0; }
.vp-sync { padding: 10px; }
.hv-exp { display: flex; align-items: center; cursor: pointer; }
.hv-exp input { margin: 0; }
@media (max-width: 1180px) { .pane.left { width: 290px; } }
.vp-sync .mini-select { max-width: 170px; }
.warn-box.err { border-color: var(--danger); background: #3a1f22; color: #ffc9c9; } .warn-box .link-btn { margin-left: 4px; }
.version-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 2000; background: #5a1d22; color: #ffd6d6; padding: 9px 16px; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--danger); }

/* {product}: предпросмотр текста для озвучки */
.vp-preview { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.vp-preview:empty { display: none; }
.vp-pv-label { font-size: 11px; color: var(--muted, #8a8f98); text-transform: uppercase; letter-spacing: .03em; }
.vp-pv-text { padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); white-space: pre-wrap; font-size: 12.5px; line-height: 1.45; }
.vp-pv-text.bad { border-color: var(--danger); }
.vp-hook-pv { margin-top: 3px; white-space: pre-wrap; }
.vp-hook-pv:empty { display: none; }
mark.pv-sub { background: rgba(80,200,120,.22); color: inherit; border-radius: 3px; padding: 0 2px; }
mark.pv-bad { background: rgba(255,80,80,.25); color: inherit; border-radius: 3px; padding: 0 2px; }
.vp-preview .btn.sm { align-self: flex-start; }
.pn-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pn-table td, .pn-table th { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.07); text-align: left; }
.pn-table th { font-weight: 600; color: var(--muted, #8a8f98); font-size: 11px; text-transform: uppercase; }
.pn-add { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; } .pn-add .input { flex: 1; min-width: 160px; }
.nowrap { white-space: nowrap; }
.vp-st.need { background: #2f2814; color: #f0c25a; }
.vp-st.changed { background: #2f2814; color: #f0c25a; cursor: help; }
.vp-tplstate { margin: 4px 0 8px; line-height: 1.5; }
.vp-tplstate:empty { display: none; }
.vp-geo-warn { display: flex; flex-direction: column; gap: 4px; }
.vp-geo-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
/* Шаблоны: язык = основной текст + 6 хуков */
.tpl-lang { border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.tpl-lang-head { display: flex; align-items: center; gap: 8px; }
.tpl-hooks { display: grid; grid-template-columns: 52px 1fr; gap: 4px 8px; align-items: center; }
.tpl-hooks b { font-size: 11px; color: var(--muted, #8a8f98); }
.tpl-fix { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* --------------------------------------------------------- компоновка как в CapCut
   Отдельные панели с зазорами; боковые панели шире, плеер компактнее; верх ~60% высоты, таймлайн во всю ширину. */
.editor { background: #0a0b0c; }
.workspace { gap: 6px; padding: 6px 6px 0; }
.pane.left, .pane.right, .pane.center, .pane.bottom { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pane.left { width: clamp(280px, 25vw, 480px); }
.pane.right { width: clamp(280px, 27vw, 540px); overflow-y: auto; }
.pane.center { background: var(--panel); }
.player-wrap { background: #08090a; }
.preview-stage { padding: 0; }
.transport { border-top: 1px solid var(--line); height: 44px; }
.pane.bottom { height: clamp(220px, 38vh, 440px); margin: 0 6px 6px; }
.h-divider { height: 6px; background: transparent; margin: 0 6px; border-radius: 3px; }
.h-divider:hover { background: var(--accent); }
.media-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
@media (max-width: 1100px) {
  .pane.left { width: 260px; }
  .pane.right { width: 270px; }
  .tc { min-width: 120px; }
}
@media (max-height: 760px) {
  .pane.bottom { height: clamp(200px, 34vh, 320px); }
}
@media (max-width: 960px) {
  .pane.left { width: 230px; }
  .pane.right { width: 230px; }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------------- папки проектов */
.pp-search-wrap { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; color: var(--muted); }
.pp-search-wrap .pp-search { border: 0; background: transparent; width: 200px; padding-left: 0; }
.pp-search-wrap:focus-within { border-color: var(--accent); }
.pp-crumbs { display: flex; align-items: center; gap: 8px; padding: 0 28px 14px; font-size: 15px; }
.pp-crumbs:empty { display: none; }
.crumb-link { border: 0; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.crumb-link:hover { color: var(--text); background: var(--panel-2); }
.crumb-sep { color: var(--line-2); }
.crumb-cur { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.crumb-cur .ico { color: #f0c25a; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 0 28px 18px; }
.folder-grid:empty { display: none; }
.folder-card { display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px 4px 4px; transition: border-color .12s, background .12s; }
.folder-card:hover { border-color: var(--line-2); background: var(--panel-2); }
.fc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; cursor: pointer; }
.fc-icon { width: 44px; height: 44px; flex: none; border-radius: 9px; background: rgba(240,194,90,.12); color: #f0c25a; display: flex; align-items: center; justify-content: center; }
.fc-text { min-width: 0; }
.fc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-card.drop-over, .crumb-link.drop-over { border-color: var(--accent); background: rgba(34,211,197,.12); color: var(--text); }
.dnd-active .folder-card { border-style: dashed; border-color: var(--line-2); }
.proj-card[draggable="true"] { cursor: grab; }
.proj-card.dragging { opacity: .45; }
.pc-folder { display: flex; align-items: center; gap: 4px; color: #f0c25a; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pp-crumbs .card-menu { bottom: auto; top: 30px; }
.move-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.move-list.tall { max-height: 380px; }
.move-opt { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.move-opt:hover { background: var(--panel-3); }
.move-opt.on { background: rgba(34,211,197,.12); }
.move-opt .ico { color: var(--muted); }
/* список шаблонов: строка + меню ••• */
.tpl-row { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 0; cursor: default; }
.tpl-row-main { flex: 1; min-width: 0; padding: 9px 11px; cursor: pointer; }
.tpl-row .card-menu { bottom: auto; top: 30px; }

/* --------------------------------------------------------- панель «Озвучка»: поля строго в своих колонках */
.vp { container-type: inline-size; min-width: 0; }
.vp-form, .vp-form .field, .vp-two > .field { min-width: 0; }
.vp-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; }
.vp-form select, .vp-form input, .vp-form textarea {
  display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
}
.vp-form select, .vp-form input { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-form select.mini-select { height: 32px; padding-right: 22px; }
.vp-form .label-row { gap: 8px; min-width: 0; }
.vp-form .label-row label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-form .label-row .muted { white-space: nowrap; }
/* Узкая панель — GEO и «Товар» друг под другом */
@container (max-width: 220px) {
  .vp-two { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------- стили текста: папки и меню */
.preset-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.preset-card .ts-more { position: absolute; top: 2px; right: 2px; opacity: 0; transition: opacity .1s; }
.preset-card:hover .ts-more, .preset-card .ts-more:focus-within { opacity: 1; }
.preset-card .ts-more .card-menu { bottom: auto; top: 26px; right: 0; text-align: left; }
.preset-card[draggable="true"] { cursor: pointer; }
.preset-card.dragging { opacity: .45; }
.preset-card.drop-over, .ts-crumbs .crumb-link.drop-over { border-color: var(--accent); background: rgba(34,211,197,.12); }
.ts-folder { background: var(--panel-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 86px; padding: 10px 6px; }
.ts-folder-icon { color: #f0c25a; }
.ts-folder-name { color: var(--text); font-weight: 600; margin-top: 2px; }
.ts-crumbs { display: flex; align-items: center; gap: 6px; padding: 0 12px 8px; font-size: 13px; }
.ts-crumbs .crumb-link { font-size: 13px; }
.ts-empty { grid-column: 1 / -1; padding: 14px 4px; }
.style-editor .se-preview { min-height: 110px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: linear-gradient(135deg, #3a3f4a, #15161a); padding: 16px; }
.style-editor .se-sample { white-space: pre-line; max-width: 100%; }
.style-editor .se-rows { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.style-editor .insp-row input[type=range] { width: 160px; }
.lib-head { flex-wrap: wrap; row-gap: 6px; }
.lib-head .btn { white-space: nowrap; }

/* ---------- Панель текста в стиле CapCut: подписи слева, управление справа ---------- */
.pane.right { overflow-x: hidden; }
.inspector { container-type: inline-size; min-width: 0; }
.inspector .insp-row { min-width: 0; }
.inspector .insp-row > select { flex: 1; min-width: 0; }
.inspector.is-text .insp-row > label { width: 100px; }
.text-area.big { min-height: 84px; font-size: 14px; line-height: 1.35; }
.tgl-group { display: inline-flex; gap: 4px; flex: none; }
.tgl { width: 32px; height: 28px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted);
  border-radius: 6px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tgl:hover { color: var(--text); border-color: #4a4f58; }
.tgl.on { background: var(--accent); border-color: var(--accent); color: #062421; font-weight: 700; }
.tgl-group.pattern .tgl b, .tgl-group.pattern .tgl i, .tgl-group.pattern .tgl u { font-family: Georgia, "Times New Roman", serif; font-size: 15px; }
.tgl-group.caps .tgl { font-weight: 600; letter-spacing: .02em; }
@container (max-width: 250px) {
  .inspector .insp-row > label, .inspector.is-text .insp-row > label { width: 74px; font-size: 11.5px; }
  .inspector .num { width: 46px; }
  .tgl { width: 28px; }
  .inspector .segmented button { padding: 4px 6px; }
}
.se-chk { display: inline-flex; align-items: center; gap: 3px; font-family: Georgia, serif; }

/* ---------- Раздел «Тени» ---------- */
.sh-head { display: flex; align-items: center; gap: 6px; }
.sh-label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--text); font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.sh-label input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.sh-toggle svg { transition: transform .15s; }
.shadow-sec.collapsed .sh-toggle svg { transform: rotate(-90deg); }
.shadow-sec.collapsed .sh-body { display: none; }
.sh-body { display: flex; flex-direction: column; gap: 8px; }
.shadow-sec.off .sh-body { opacity: .5; }
.num.hex { width: 76px; text-align: left; font-family: ui-monospace, Menlo, monospace; text-transform: lowercase; }

/* Боковые маркеры ширины текстовой плашки */
.sel-side { display: none; position: absolute; top: 50%; width: 8px; height: 22px; margin-top: -11px; background: #fff;
  border: 1.5px solid var(--accent); border-radius: 4px; cursor: ew-resize; pointer-events: auto; }
.sel-box.text .sel-side { display: block; }
.sel-side.left { left: -5px; }
.sel-side.right { right: -5px; }
.auto-only { display: flex; flex-direction: column; gap: 8px; }
.fixed-width .auto-only { display: none; }

/* Групповое выделение текстов в плеере (служебные рамки, в экспорт не попадают) */
.sel-multi { position: absolute; inset: 0; pointer-events: none; }
.sel-item { position: absolute; border: 1.5px solid var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,.45); pointer-events: none; }
.sel-group { position: absolute; border: 1px dashed var(--accent); background: rgba(34,211,197,.04); cursor: move; pointer-events: auto; }
.pv-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pv-info { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.pv-info b { color: var(--text); font-weight: 600; }

/* «Настройки ролика» */
.setup-block { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.setup-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.setup-row > label { width: 110px; flex: none; color: #c3c6cc; font-size: 12px; padding-top: 6px; }
.setup-ctrl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.setup-ctrl select, .setup-ctrl input { width: 100%; min-width: 0; }
.setup-block.compact .setup-row > label { width: 92px; }
.setup-note { line-height: 1.35; }
@container (max-width: 250px) { .setup-row { flex-direction: column; gap: 3px; } .setup-row > label { padding-top: 0; } }
@container (max-width: 250px) { .inspector .insp-row:has(> .segmented) { flex-wrap: wrap; } .inspector .insp-row:has(> .segmented) > .grow { display: none; } }

/* Вкладка «Проект» слева; пустое состояние правой панели */
.proj-panel { container-type: inline-size; min-width: 0; }
.proj-panel .insp-row { min-width: 0; }
@container (max-width: 250px) { .proj-panel .insp-row:has(> .segmented) { flex-wrap: wrap; } .proj-panel .insp-row:has(> .segmented) > .grow { display: none; } }
.insp-empty { padding: 16px 14px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
.proj-panel .segmented { flex-wrap: wrap; max-width: 100%; }
.proj-panel select { max-width: 100%; min-width: 0; }
@container (max-width: 250px) {
  .proj-panel .insp-section { padding-left: 10px; padding-right: 10px; }
  .proj-panel .insp-row { flex-wrap: wrap; row-gap: 4px; }
  .proj-panel .insp-row > label { width: 100%; }
  .proj-panel .insp-row > .grow { display: none; }
  .proj-panel .insp-row > select { flex: 1 1 100%; }
}
.proj-panel .insp-row.stack { flex-direction: column; align-items: stretch; gap: 6px; }
.proj-panel .insp-row.stack > label { width: auto; }
.proj-panel .insp-row.stack > .segmented { display: flex; flex-wrap: nowrap; }
.proj-panel .insp-row.stack > .segmented button { flex: 1; justify-content: center; padding: 5px 0; min-width: 0; }

/* Хук по месяцам */
.inspector .insp-row.stack, .text-type-row { flex-direction: column; align-items: stretch; gap: 6px; }
.text-type-row > label { width: auto !important; }
.text-type { display: flex; }
.text-type button { flex: 1; justify-content: center; }
.mh-rows { display: flex; flex-direction: column; gap: 5px; }
.mh-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.mh-month { flex: none; width: 46px; height: 28px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); color: var(--muted); font: 600 11.5px ui-monospace, Menlo, monospace; cursor: pointer; }
.mh-month.on { background: var(--accent); border-color: var(--accent); color: #062421; }
.mh-text { flex: 1; min-width: 0; }
.mh-text.edited { border-color: #8a6bff; }
.mh-info { color: var(--muted); }
.mh-info b { color: var(--text); }

/* Перевод плашек */
.i18n-status { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 50; background: var(--panel-3); border: 1px solid var(--line-2);
  border-radius: 20px; padding: 6px 14px; font-size: 12.5px; display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.35); max-width: 90vw; }
.i18n-status[hidden] { display: none; }
.i18n-status.err { border-color: var(--danger); }
.i18n-row { display: flex; flex-direction: column; gap: 6px; }
.i18n-info { color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.i18n-geo { border: 1px solid var(--line-2); border-radius: 10px; padding: 1px 7px; font-size: 11px; }
.i18n-geo.on { border-color: var(--accent); color: var(--text); }
.i18n-status.warn { border-color: var(--warn); }
.proj-retranslate { white-space: normal; max-width: 100%; text-align: left; }
/* Хук по месяцам: состояние перевода у каждого месяца */
.mh-field { position: relative; flex: 1; min-width: 0; display: flex; }
.mh-field .mh-text { padding-right: 52px; }
.mh-mark { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--muted); pointer-events: none; }
.mh-mark.stale, .mh-mark.missing, .mh-mark.manualStale { color: #f0b429; }
.mh-mark.manual { color: #a993ff; }
.mh-text.auto { border-color: var(--line-2); }
.mh-text.stale { border-color: #b8892a; }
.mh-upd { flex: none; }
.mh-src { color: var(--muted); margin: 2px 0 6px; line-height: 1.4; }
.mh-src b { color: var(--text); }
.mh-upd[hidden], .quick-row .btn[hidden] { display: none; }
/* Очередь экспорта: группы пакетного экспорта (один запуск = одна группа = один ZIP) */
.q-group { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 8px 9px; display: flex; flex-direction: column; gap: 7px; }
.q-group.error { border-color: #6b2a2e; }
.q-group.running { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.q-ghead { display: flex; align-items: flex-start; gap: 6px; }
.q-ghead .q-name { font-size: 14px; }
.q-toggle { flex: none; margin-top: -2px; }
.q-gzip { padding-left: 30px; }
.q-gzip .btn { gap: 6px; text-decoration: none; }
.q-gzip .btn[disabled] { opacity: .55; cursor: default; }
.q-gitems { display: flex; flex-direction: column; gap: 4px; padding-left: 30px; }
.q-item.sub { background: var(--panel); padding: 6px 8px; }
.q-item.sub .q-name { font-weight: 500; font-size: 12.5px; }
/* Вкладка «Аудио»: папки (GEO и свои) */
.af-list { display: flex; flex-direction: column; gap: 6px; }
.af-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; min-width: 0; }
.af-row:hover { border-color: var(--line-2); background: color-mix(in srgb, var(--panel-2) 85%, #fff 4%); }
.af-row.drop, .crumb-link.drop { outline: 2px solid var(--accent); outline-offset: 1px; }
.af-row.none .af-icon { color: var(--muted); }
.af-icon { flex: none; color: var(--accent); display: flex; }
.af-row .a-main { flex: 1; min-width: 0; }
.af-name { font-weight: 600; }
.af-crumbs { align-items: center; }
.af-empty { padding: 14px 4px; }
/* «Настройки текстовых плашек для GEO» в панели «Проект» */
.geo-layout { margin: 4px 0 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.gl-title { font-size: 12px; font-weight: 600; color: var(--text); }
.geo-layout .insp-row.check { padding: 0; }
.gl-status { line-height: 1.45; }
.geo-layout .btn[hidden] { display: none; }
.geo-layout .quick-row { flex-wrap: wrap; }
.geo-layout .btn { white-space: normal; text-align: left; max-width: 100%; height: auto; min-height: 28px; }
.geo-layout .insp-row.check span { white-space: normal; min-width: 0; }
/* «Видеомонтаж для GEO» — как блок настроек плашек */
.geo-video { margin: 4px 0 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.geo-video .insp-row.check { padding: 0; }
.geo-video .btn[hidden] { display: none; }
.geo-video .quick-row { flex-wrap: wrap; }
.geo-video .btn { white-space: normal; text-align: left; max-width: 100%; height: auto; min-height: 28px; }
.geo-video .insp-row.check span { white-space: normal; min-width: 0; }
.geo-music { margin: 4px 0 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.geo-music .insp-row.check { padding: 0; }
.geo-music .btn[hidden] { display: none; }
.geo-music .quick-row { flex-wrap: wrap; }
.geo-music .btn { white-space: normal; text-align: left; max-width: 100%; height: auto; min-height: 28px; }
.geo-music .insp-row.check span { white-space: normal; min-width: 0; }
/* «Голоса GEO»: голоса сгруппированы по GEO */
.gv-table tr.gv-geo td { background: var(--panel-2); border-top: 1px solid var(--line-2); padding: 8px 10px; }
.gv-geo-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gv-code { font-size: 14px; min-width: 32px; }
.gv-def .icon-btn { font-size: 15px; color: var(--muted); }
.gv-def .icon-btn.on { color: #f0b429; }
.gv-gender { white-space: nowrap; }
/* «Озвучка»: голоса только текущего GEO + фильтр по полу */
.vp-gender { margin: 2px 0 6px; }
.vp-gender button { font-size: 11.5px; }
.vp-novoices a { color: var(--accent); }
.tpl-hooks .input.tpl-new-month { border-color: #b8892a; }
