/* ATAS Studio. Брендбук ATAS: черный фон, фиолетовый #803CFF, Montserrat, регистр как в предложении. */
:root {
  --bg: #0b0b0f;
  --bg-2: #121218;
  --panel: #17171f;
  --panel-2: #1d1d27;
  --line: #2a2a36;
  --line-2: #363645;
  --text: #ecebf3;
  --text-2: #a9a8b8;
  --text-3: #74738a;
  --accent: #803cff;
  --accent-2: #9a63ff;
  --accent-bg: rgba(128, 60, 255, .14);
  --ok: #2fbf71;
  --ok-bg: rgba(47, 191, 113, .14);
  --warn: #f2b53a;
  --warn-bg: rgba(242, 181, 58, .14);
  --bad: #ff5c6c;
  --bad-bg: rgba(255, 92, 108, .14);
  --info: #4aa3ff;
  --info-bg: rgba(74, 163, 255, .14);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --side: 224px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
svg { width: 1em; height: 1em; flex: none; }
::selection { background: var(--accent); color: white; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 16px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 14px; height: 14px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--text-3); letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text-2);
  font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-bg); color: var(--text); }
.nav a.on svg { color: var(--accent-2); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav-sec { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); }
.nav .count { margin-left: auto; font-size: 11px; background: var(--accent); color: white; border-radius: 10px; padding: 0 7px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.me:hover { background: var(--panel); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--accent-2); flex: none; border: 1px solid var(--line-2); }
.avatar.claude { background: #3a2a1c; color: #f0a26b; border-color: #5a3d26; }
.me-name { font-weight: 600; font-size: 13px; }
.me-mail { font-size: 11px; color: var(--text-3); }
.main { min-width: 0; }
.page { padding: 24px 28px 60px; max-width: 1600px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow { flex: 1; }
.langs-filter { align-self: stretch; }
.langs-filter button { min-width: 38px; font-weight: 600; }
.langs-filter button.on { background: var(--accent-bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.sep { width: 1px; height: 22px; background: var(--line); }

/* ---------- элементы ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-weight: 500; cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--panel-2); border-color: #45455a; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #04130b; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 28px; }
.input, .select, .textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 8px 11px; outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
  linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat; }
label.field { display: flex; flex-direction: column; gap: 6px; }
label.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
label.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 18px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px;
  font-weight: 600; background: var(--panel-2); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.badge.lang { background: transparent; border-color: var(--line-2); color: var(--text); letter-spacing: .04em; }
.badge.PASS, .badge.done, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.WARN, .badge.queued { background: var(--warn-bg); color: var(--warn); }
.badge.FAIL, .badge.failed { background: var(--bad-bg); color: var(--bad); }
.badge.running { background: var(--info-bg); color: var(--info); }
.badge.canceled { color: var(--text-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.empty { padding: 50px 20px; text-align: center; color: var(--text-3); }
.empty svg { width: 34px; height: 34px; color: var(--line-2); margin-bottom: 8px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--text-2); font-weight: 500; border: 0; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11px; color: var(--text-3); margin-left: 4px; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; }
.seg button { border: 0; background: none; padding: 4px 11px; border-radius: 5px; color: var(--text-2); cursor: pointer; font-size: 12px;
  font-weight: 500; }
.seg button.on { background: var(--panel-2); color: var(--text); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--panel-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
kbd { font-family: var(--mono); font-size: 11px; background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 5px; }

/* ---------- всплывашки ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); padding: 11px 15px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow); max-width: 420px; animation: up .18s ease-out; }
.toast.bad { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.overlay { position: fixed; inset: 0; background: rgba(4, 4, 8, .7); display: grid; place-items: center; z-index: 50;
  padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; width: min(560px, 100%); box-shadow: var(--shadow);
  max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { width: min(820px, 100%); }
.modal-head { padding: 18px 20px 0; display: flex; align-items: center; }
.modal-body { padding: 18px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.menu { position: absolute; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 4px; z-index: 40; min-width: 190px; }
.menu button { display: flex; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 5px;
  cursor: pointer; align-items: center; gap: 8px; }
.menu button:hover { background: var(--panel); }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 70% -10%, rgba(128, 60, 255, .22), transparent 60%), var(--bg); }
.login .card { width: min(380px, 100%); padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.login .brand { padding: 0 0 6px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---------- доска ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.lane { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column;
  max-height: calc(100vh - 150px); min-height: 160px; flex: 1 1 280px; min-width: 260px; max-width: 360px; }
.lane.lane-empty { flex: 0 0 auto; min-width: 150px; }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.lane-head .n { color: var(--text-3); font-weight: 500; }
.lane-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 60px; }
.lane-body > * { flex: none; }
.lane.drop { border-color: var(--accent); background: rgba(128, 60, 255, .06); }
[hidden] { display: none !important; }
/* каталог заданий: второй вид доски */
.page-head .seg button svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.catalog { display: flex; flex-direction: column; gap: 14px; max-width: 1500px; }
.cat-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.cat-row { display: grid; grid-template-columns: 112px minmax(220px, 1.4fr) minmax(0, 2fr) auto; gap: 16px; align-items: center;
  padding: 10px 14px; cursor: pointer; border-top: 1px solid var(--line); }
.cat-row:first-child { border-top: 0; }
.cat-row:hover { background: var(--panel-2); }
.cat-thumb { position: relative; width: 112px; aspect-ratio: 16 / 9; border-radius: 6px; background: var(--bg-2) center / cover no-repeat;
  display: grid; place-items: center; color: var(--text-3); }
.cat-thumb svg { width: 20px; height: 20px; }
.cat-thumb .dur { position: absolute; right: 4px; bottom: 4px; font-size: 10px; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .7); color: #fff; }
.cat-main { min-width: 0; }
.cat-title { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-sub { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.cat-langs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cat-lang { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line-2);
  font-size: 12px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.cat-lang:hover { border-color: var(--accent); color: var(--text); }
.cat-lang .dot { width: 7px; height: 7px; border-radius: 50%; }
.cat-lang b { color: var(--text); font-weight: 600; letter-spacing: .03em; }
.cat-lang .ind svg { width: 12px; height: 12px; }
.cat-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--text-2); white-space: nowrap; justify-self: end; }
.cat-group { display: flex; flex-direction: column; gap: 8px; }
.cat-group-head { font-weight: 600; font-size: 13px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.cat-group-head .n { color: var(--text-3); font-weight: 500; }
@media (max-width: 1000px) {
  .cat-row { grid-template-columns: 88px minmax(0, 1fr); }
  .cat-thumb { width: 88px; }
  .cat-langs, .cat-meta { grid-column: 1 / -1; justify-self: start; }
}
/* подборки */
.sc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: 16px; align-items: start; }
.sc-cat { position: sticky; top: 16px; gap: 10px; max-height: calc(100vh - 32px); }
.sc-cat-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.select.sm { height: 30px; font-size: 12px; padding-top: 0; padding-bottom: 0; }
.sc-cat-list { overflow: auto; min-height: 120px; margin: 0 -8px; padding: 0 8px; display: flex; flex-direction: column; gap: 2px; }
.sc-cat-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.sc-cat-row:hover { background: var(--panel-2); }
.sc-cat-row.on { background: var(--accent-bg); border-color: rgba(128, 60, 255, .25); }
.sc-cat-row input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; margin: 0; }
.sc-cat-row .badge.lang .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
@media (max-width: 1100px) { .sc-layout { grid-template-columns: 1fr; } .sc-cat { position: static; max-height: 70vh; } }
.sc-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.sc-item.dragging { opacity: .45; }
.sc-item.over { border-color: var(--accent); }
.sc-grip { cursor: grab; color: var(--text-3); width: 16px; text-align: center; user-select: none; letter-spacing: -2px; }
.sc-grip svg { width: 14px; height: 14px; }
.sc-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-item .chip .dot, .sc-hit .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.sc-found { display: flex; flex-direction: column; gap: 2px; }
.sc-hit { display: flex; align-items: center; gap: 8px; text-align: left; padding: 7px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); cursor: pointer; font: inherit; }
.sc-hit:hover { background: var(--panel-2); }
.sc-hit svg { width: 14px; height: 14px; color: var(--accent); }
.lane-head .fold { margin-left: auto; width: 24px; height: 24px; opacity: .45; }
.lane-head .fold svg { width: 14px; height: 14px; }
.lane:hover .lane-head .fold, .lane-head .fold:focus-visible { opacity: 1; }
/* свернутая колонка: узкая полоска, название сверху вниз */
.lane.collapsed { flex: 0 0 44px; min-width: 44px; max-width: 44px; min-height: 280px; }
.lane.collapsed .lane-head { flex-direction: column; padding: 10px 0; gap: 10px; cursor: pointer; height: 100%; }
.lane.collapsed .lane-head .lbl { writing-mode: vertical-rl; }
.lane.collapsed .lane-head .fold { order: -1; margin: 0; opacity: 1; }
.lane.collapsed:hover { border-color: var(--line-2); }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; overflow: hidden;
  transition: border-color .12s, transform .12s; }
.vcard:hover { border-color: var(--line-2); transform: translateY(-1px); }
.vcard.dragging { opacity: .4; }
.vcard .cover { aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; position: relative; border-bottom: 1px solid var(--line); }
.vcard .cover .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .75); font-size: 11px; padding: 1px 6px;
  border-radius: 4px; font-variant-numeric: tabular-nums; }
.vcard .body { padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; }
.vcard .title { font-weight: 600; font-size: 13px; line-height: 1.35; }
.vcard .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.vcard .ind { display: inline-flex; align-items: center; gap: 4px; }
.vcard .ind svg { width: 13px; height: 13px; }
.vcard .ind.hot { color: var(--warn); }
.vcard .ind.job { color: var(--info); }
.vcard .turn { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.vcard .turn svg { width: 13px; height: 13px; flex: none; }
.vcard .turn.you { color: var(--accent-2); }
.vcard .turn.claude, .vcard .turn.other { color: var(--text-3); font-weight: 500; }
.vcard .turn.job { color: var(--info); font-weight: 500; }
.vcard .ind.job { color: var(--info); }
.vcard .ind.job svg { width: 13px; height: 13px; }
.lchip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line-2);
  color: var(--text-2); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.lchip.on { border-color: var(--text-3); color: var(--text); }
.lchip:hover { border-color: var(--accent); text-decoration: none; }
.lchip .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.btn.on { border-color: var(--accent); color: var(--text); }

/* ---------- страница ролика ---------- */
.vhead { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.crumbs a { color: var(--text-3); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--line-2); font-weight: 600; font-size: 12px; cursor: pointer; }
.langs { display: flex; gap: 6px; }
.langs a { padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-2); font-weight: 600; font-size: 12px;
  letter-spacing: .04em; }
.langs a.on { background: var(--accent); border-color: var(--accent); color: white; }
.langs a:hover { text-decoration: none; border-color: var(--accent); }

.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 18px; align-items: start; }
.stage { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* плеер с таймлайном прилипает к верху окна, шаги прокручиваются под ним */
.stage-stick { position: sticky; top: var(--lang-top, 0px); z-index: 4; display: flex; flex-direction: column; gap: 10px; background: var(--bg);
  margin-top: -10px; padding: 10px 0 12px; box-shadow: 0 14px 14px -14px rgba(0, 0, 0, .9); }
.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  width: min(100%, calc(var(--ph, 52vh) * 16 / 9)); margin: 0 auto; }
.controls .chip { height: 28px; }
.controls .hints { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.player-size button { padding: 3px 9px; font-family: var(--mono); }
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player canvas, .player .regions { position: absolute; inset: 0; width: 100%; height: 100%; }
.player .regions { pointer-events: none; }
.player .regions .r { position: absolute; border: 2px solid var(--warn); border-radius: 4px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .25); }
.player canvas.drawing { cursor: crosshair; }
.draw-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .8); padding: 6px 12px;
  border-radius: 20px; font-size: 12px; pointer-events: none; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.time { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; color: var(--text-2); min-width: 120px; }
.timeline { position: relative; height: 74px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; user-select: none; overflow: hidden; }
.tl-steps { position: absolute; left: 0; right: 0; top: 18px; height: 34px; }
.tl-step { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--bg); background: var(--panel-2); overflow: hidden;
  padding: 3px 6px; font-size: 11px; color: var(--text-2); white-space: nowrap; text-overflow: ellipsis; }
.tl-step:nth-child(even) { background: #22222e; }
.tl-step.on { background: var(--accent-bg); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.tl-step .voice { position: absolute; left: 0; bottom: 0; height: 4px; background: rgba(154, 99, 255, .55); }
.tl-step.edited { box-shadow: inset 0 2px 0 var(--warn); }
.tl-qa { position: absolute; left: 0; right: 0; top: 4px; height: 10px; }
.tl-qa .b { position: absolute; top: 0; height: 100%; border-radius: 2px; }
.tl-qa .b.WARN { background: rgba(242, 181, 58, .55); }
.tl-qa .b.FAIL { background: rgba(255, 92, 108, .6); }
.tl-chapters { position: absolute; left: 0; right: 0; bottom: 3px; height: 16px; font-size: 10px; color: var(--text-3); }
.tl-chapters span { position: absolute; padding-left: 5px; border-left: 1px solid var(--line-2); white-space: nowrap; }
.tl-pins { position: absolute; left: 0; right: 0; top: 2px; height: 14px; }
.tl-pin { position: absolute; width: 12px; height: 12px; margin-left: -6px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--warn); border: 2px solid var(--bg); cursor: pointer; }
.tl-pin.done { background: var(--ok); }
.tl-head { position: absolute; top: 0; bottom: 0; width: 2px; background: white; pointer-events: none; box-shadow: 0 0 6px rgba(255, 255, 255, .6); }
.tl-hover { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .35); pointer-events: none; }
.tl-tip { position: absolute; top: -2px; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 4px; padding: 0 5px; font-size: 10px; font-family: var(--mono); pointer-events: none; }

.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 14px; padding: 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .12s, background .12s; }
.step.on { border-color: var(--accent); background: #1b1726; }
.step.edited { border-color: rgba(242, 181, 58, .55); }
.step .thumb { width: 176px; aspect-ratio: 16 / 9; border-radius: 6px; background: #000 center / cover no-repeat; cursor: pointer;
  position: relative; border: 1px solid var(--line); }
.step .thumb .t { position: absolute; left: 5px; bottom: 5px; background: rgba(0, 0, 0, .78); font-size: 11px; padding: 0 5px;
  border-radius: 4px; font-family: var(--mono); }
.step .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.step .sid { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.step .chapter { font-size: 11px; font-weight: 600; color: var(--accent-2); text-transform: uppercase; letter-spacing: .04em; }
.step .action { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: flex-start; }
.step .action svg { width: 13px; height: 13px; flex: none; margin-top: 3px; }
.say { font-size: 15px; line-height: 1.55; padding: 6px 8px; margin: 0 -8px; border-radius: 6px; cursor: text; border: 1px solid transparent; }
.say:hover { background: var(--bg-2); border-color: var(--line); }
.say .w.on { background: var(--accent); color: white; border-radius: 3px; box-shadow: 0 0 0 2px var(--accent); }
.say.ro { cursor: default; }
.say.ro:hover { background: none; border-color: transparent; }
.say.empty { color: var(--text-3); font-style: italic; font-size: 13px; }
.say-edit { font-size: 15px; }
.fit { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); margin-top: 6px; }
.fit .bar { width: 120px; height: 5px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.fit .bar i { display: block; height: 100%; background: var(--ok); }
.fit.over .bar i { background: var(--bad); }
.fit.near .bar i { background: var(--warn); }
.fit.over { color: var(--bad); }
.recog { font-size: 12px; color: var(--warn); margin-top: 4px; display: flex; gap: 6px; }
.recog svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.step .tools { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; opacity: .7; }
.step:hover .tools { opacity: 1; }
.draftbar { position: sticky; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: #241c37; border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); }
.draftbar .grow { font-weight: 500; }
.jobbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--info-bg); border: 1px solid rgba(74, 163, 255, .35);
  border-radius: var(--radius); }
.jobbar.failed { background: var(--bad-bg); border-color: rgba(255, 92, 108, .4); }
.jobbar pre { margin: 6px 0 0; white-space: pre-wrap; font-size: 11px; color: var(--text-2); max-height: 120px; overflow: auto; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--info); border-radius: 50%;
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.rpanel { position: sticky; top: calc(var(--lang-top, 0px) + 14px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  max-height: calc(100vh - 28px - var(--lang-top, 0px)); display: flex; flex-direction: column; min-height: 400px; }
.rpanel .tabs { padding: 0 6px; margin: 0; flex-wrap: wrap; row-gap: 0; }   /* пять вкладок: вторая строка вместо прокрутки */
.rpanel .tabs button { padding: 11px 9px; font-size: 13px; }
.fit svg { width: 13px; height: 13px; }
.rpanel-body { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.composer { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); }
.composer .textarea { min-height: 64px; background: var(--panel); }
.composer .opts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel); font-size: 11px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chip.on { border-color: var(--accent); color: var(--text); background: var(--accent-bg); }
.chip svg { width: 12px; height: 12px; }
.chip.t { font-family: var(--mono); }
.comment { display: flex; gap: 10px; }
.comment .avatar { width: 28px; height: 28px; font-size: 11px; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.comment .c-head b { font-weight: 600; }
.comment .c-text { margin-top: 4px; white-space: pre-wrap; word-wrap: break-word; }
.comment.resolved .c-text { color: var(--text-3); }
.comment .c-tools { display: flex; gap: 2px; margin-top: 4px; }
.thread { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-2); }
.thread.focus { border-color: var(--accent); }
.thread.resolved { opacity: .62; }
.replies { margin-left: 38px; display: flex; flex-direction: column; gap: 10px; }
.qa-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qa-item:last-child { border: 0; }
.md { line-height: 1.6; font-size: 13px; }
.md h1 { font-size: 17px; margin: 0 0 10px; }
.md h2 { font-size: 15px; margin: 18px 0 8px; }
.md h3 { font-size: 13px; margin: 14px 0 6px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md code { font-family: var(--mono); font-size: 12px; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--bg-2); padding: 10px; border-radius: 6px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; width: 100%; margin: 0 0 12px; font-size: 12px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--line-2); color: var(--text-2); }

/* ---------- ТЗ и сценарий ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.form-grid .col { gap: 16px; }
.outputs { display: grid; grid-template-columns: 1fr; gap: 8px; }
.script-table td.say-cell { width: 55%; }
.lang-row { display: grid; grid-template-columns: 54px 1fr 1fr; gap: 8px; align-items: center; }

/* ---------- версии и сравнение ---------- */
.versions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ver { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ver.pick { border-color: var(--accent); }
.ver .cover { aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; cursor: pointer; }
.ver .body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.diff del { background: var(--bad-bg); color: #ffb3bb; text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.diff ins { background: var(--ok-bg); color: #9df0c4; text-decoration: none; border-radius: 3px; padding: 0 2px; }

/* ---------- библиотека ---------- */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lib .card { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.lib img { width: 100%; border-radius: 6px; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.lib audio { width: 100%; height: 34px; }

.history .h { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.history .h .when { color: var(--text-3); font-size: 12px; white-space: nowrap; min-width: 120px; }
.token-box { font-family: var(--mono); font-size: 12px; background: var(--bg-2); border: 1px dashed var(--accent); padding: 12px;
  border-radius: var(--radius-sm); word-break: break-all; }

@media (max-width: 1180px) {
  .review { grid-template-columns: 1fr; }
  .rpanel { position: static; max-height: none; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --side: 0px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; flex-direction: row; padding: 6px; z-index: 30;
    border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; }
  .brand, .side-foot { display: none; }
  .nav { display: flex; flex-direction: row !important; gap: 2px; }
  .controls .dim.small, .player-size { display: none; }
  .controls { flex-wrap: wrap; gap: 6px; }
  .player { width: 100%; }
  .review > * { min-width: 0; }
  .vhead h1 { font-size: 19px; }
  .nav a span, .nav-sec { display: none; }
  .page { padding: 16px 16px 90px; }
  .step { grid-template-columns: 1fr; }
  .step .thumb { width: 100%; }
  .compare { grid-template-columns: 1fr; }
}
.stress { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding-left: 2px; }
.stress .dim { margin-right: 6px; }
.stress .l { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 26px; font-size: 14px;
  color: var(--text-3); }
.stress button.l { border: 1px solid var(--line-2); background: var(--panel); color: var(--text); border-radius: 5px; cursor: pointer;
  padding: 0 4px; font: inherit; font-size: 14px; }
.stress button.l:hover { border-color: var(--accent); }
.stress button.l.on { background: var(--accent); border-color: var(--accent); color: white; font-weight: 700; }

/* шапка ролика закреплена: кнопки статуса и переход к другим роликам всегда под рукой */
.lang-top { position: sticky; top: 0; z-index: 6; background: var(--bg); margin: -24px -28px 0; padding: 14px 28px 2px;
  border-bottom: 1px solid transparent; }
.lang-top .vhead { margin-bottom: 10px; align-items: center; }
.lang-top h1 { font-size: 22px; margin: 0; }
.vnav { display: inline-flex; align-items: center; gap: 2px; margin-left: 12px; vertical-align: middle; }
.vnav .btn { height: 24px; font-size: 12px; }
.vnav .btn svg { width: 14px; height: 14px; }
.vnav .btn[disabled] { opacity: .35; cursor: default; }
.badge.waiting { background: var(--panel); border: 1px dashed var(--line-2); color: var(--text-2); gap: 6px; }
.badge.waiting svg { width: 14px; height: 14px; }
.vnav .btn .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.vnav .btn .dim { color: var(--text-3); }
.menu.switcher { width: 400px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto; z-index: 40; padding-top: 0; }
/* колонки доски вкладками: в списке - карточки выбранной, клик по карточке переводит листание в эту колонку */
.menu.switcher .sw-tabs { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 4px;
  background: var(--panel-2); border-bottom: 1px solid var(--line); }
.menu.switcher .sw-tabs .sw-tab { width: auto; display: inline-flex; gap: 6px; padding: 4px 8px; border-radius: 6px; font-size: 12px;
  border: 1px solid var(--line); }
.menu.switcher .sw-tabs .sw-tab.on { background: var(--accent-bg); border-color: var(--accent); }
.menu.switcher .sw-tabs .sw-tab.empty { opacity: .45; }
.menu.switcher .sw-tabs .sw-tab .dot { width: 8px; height: 8px; border-radius: 50%; }
.menu.switcher .sw-tabs .sw-tab .n { color: var(--text-3); }
.menu.switcher .sw-list { padding-top: 4px; }
.menu.switcher .sw-group { display: flex; align-items: center; gap: 7px; padding: 8px 10px 4px; font-size: 11px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.menu.switcher .sw-group .dot { width: 8px; height: 8px; border-radius: 50%; }
.menu.switcher button { gap: 8px; align-items: center; }
.menu.switcher button.on { background: var(--accent-bg); }
@media (max-width: 760px) {
  .lang-top { margin: -16px -16px 0; padding: 10px 16px 2px; position: static; }   /* на телефоне шапка с кнопками съела бы треть экрана */
  .lang-top h1 { font-size: 17px; }
  .stage-stick { top: 0; }
}

/* ---------- подключить Claude ---------- */
.connect { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.connect pre.prompt { margin: 0; white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; max-height: 60vh;
  overflow: auto; user-select: all; }
.connect .need { margin: 0; padding-left: 18px; color: var(--text-2); line-height: 1.7; }
.connect-approve { max-width: 560px; margin: 40px auto; gap: 12px; text-align: left; }
.connect-approve .ok-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--ok-bg, rgba(46, 204, 113, .15));
  color: var(--ok); display: flex; align-items: center; justify-content: center; }
.connect-approve .ok-mark svg { width: 24px; height: 24px; }
.mono { font-family: var(--mono); }
@media (max-width: 1180px) { .connect { grid-template-columns: 1fr; } }

/* ---------- правила ---------- */
.rules-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.rules-grid .doc { max-height: calc(100vh - 220px); overflow: auto; }
.rule-card.rejected, .rule-card.removed { opacity: .6; }
details > summary.h2like { cursor: pointer; font-size: 17px; font-weight: 600; margin-top: 6px; }
td.pron { font-weight: 600; }
@media (max-width: 1180px) { .rules-grid { grid-template-columns: 1fr; } }
.series-rules { min-height: 260px; resize: vertical; line-height: 1.55; }
.lib-card { padding: 14px; display: flex; flex-direction: column; gap: 8px; }

/* простой вид просмотра: служебное (номера шагов, действия, место под голос, распознавание) - по кнопке «Подробности» */
.review.simple .step .sid, .review.simple .step .action, .review.simple .fit:not(.over), .review.simple .recog, .review.simple .tl-qa { display: none; }
.review.simple .tl-step { color: transparent; }
details.more > summary { cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 600; list-style: none; }
details.more > summary::before { content: '▸ '; color: var(--text-3); }
details.more[open] > summary::before { content: '▾ '; }
details.more > summary::-webkit-details-marker { display: none; }
.shots-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1180px) { .shots-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .tl-chapters, .take-note { display: none; }
  .take-note + * { margin-left: auto; }
}

.tpl-prev { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; display: block; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tpl-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.tpl-card .tpl-prev { border-radius: 0; }
.pub-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pub-cover { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); min-width: 0; }
.pub-cover.picked { border-color: var(--ok); }
.pub-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; }
.pub-shorts { display: flex; flex-direction: column; gap: 14px; }
.pub-short { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.pub-short video { width: 200px; aspect-ratio: 9 / 16; border-radius: 10px; background: #000; }
.pub-ph { aspect-ratio: 16 / 9; border-radius: 8px; border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--text-3); font-size: 12px; }
.pub-ph.tall { aspect-ratio: 9 / 16; width: 200px; }
@media (max-width: 760px) { .pub-short { grid-template-columns: 1fr; } .pub-short video, .pub-ph.tall { width: 160px; } }

/* произношение: вкладка справа, кнопка над выделенным словом, подчеркнутые слова в тексте */
.sel-pop { position: fixed; z-index: 50; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 16px; border: 0; background: var(--accent); color: white; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); white-space: nowrap; }
.sel-pop svg { width: 15px; height: 15px; }
.say .w.pr { text-decoration: underline dotted var(--accent); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.say ::selection { background: var(--accent); color: white; }
.pron-help { padding: 10px 12px; border-radius: 8px; background: var(--accent-bg); color: var(--text-2); line-height: 1.5; }
.pron-help b { color: var(--text); }
.pron-item { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); }
.pron-item.fresh { border-color: var(--accent); }
.pron-item .row { gap: 8px; }
.pron-item .input { min-width: 0; flex: 1; }
.pron-word { font-size: 15px; word-break: break-word; }

/* YouTube: настройки каналов и заливка */
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.yt-chan.on { border-color: rgba(47, 191, 113, .35); }
.yt-steps { margin: 0; padding-left: 18px; color: var(--text-2); display: grid; gap: 4px; }
.yt-uri { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line-2); font-size: 12px;
  overflow-wrap: anywhere; min-width: 0; }
.yt-more summary { cursor: pointer; color: var(--text-2); }
.yt-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.yt-cover { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: var(--radius-sm); border: 2px solid var(--line-2);
  background: var(--bg-2); color: var(--text-2); cursor: pointer; text-align: left; min-width: 0; }
.yt-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; display: block; }
.yt-cover span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-cover.on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px var(--accent-bg); }
.yt-cover.add { align-items: center; justify-content: center; border-style: dashed; min-height: 110px; }
.yt-desc { font-family: inherit; line-height: 1.45; }
.yt-up { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-2); gap: 6px; }
.yt-bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.yt-bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.yt-card div.field { display: flex; flex-direction: column; gap: 6px; }
.yt-card div.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
