/* Ernur Post — светлая тема */
:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --subtle: #f4f4f5;
  --line: #e7e7ea;
  --line-strong: #d4d4d8;
  --text: #0f0f12;
  --text-2: #52525b;
  --text-3: #8b8b94;
  --brand: #fe2c55;
  --focus: rgba(15, 15, 18, .12);
  --blue: #2563eb;

  --amber-bg: #fef6e0; --amber-fg: #a15c00; --amber-dot: #f5a300;
  --blue-bg: #e9f0ff;  --blue-fg: #1d4ed8;  --blue-dot: #3b76f6;
  --violet-bg: #f1ecff; --violet-fg: #6231d6; --violet-dot: #7c4dff;
  --green-bg: #e6f6ec; --green-fg: #137a3c; --green-dot: #1ea355;
  --red-bg: #fdecec;   --red-fg: #c42b2b;   --red-dot: #e5484d;
  --gray-bg: #f1f1f3;  --gray-fg: #5d5d66;  --gray-dot: #a1a1aa;

  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
  --shadow-xs: 0 1px 2px rgba(16, 16, 20, .05);
  --shadow-sm: 0 1px 3px rgba(16, 16, 20, .06), 0 1px 2px rgba(16, 16, 20, .04);
  --shadow-md: 0 6px 16px -4px rgba(16, 16, 20, .10), 0 2px 4px -2px rgba(16, 16, 20, .06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 16, 20, .22);
  --sidebar: 236px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; color: var(--text); }
button { font: inherit; }
.icon { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
[hidden] { display: none !important; }

/* ——— каркас ——— */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--surface) var(--sidebar), transparent 0); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 650; font-size: 15px; letter-spacing: -.02em; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff;
  background: var(--text); box-shadow: 2px 2px 0 var(--brand);
}
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r);
  color: var(--text-2); font-weight: 500; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--subtle); color: var(--text); }
.nav-item.on { background: var(--subtle); color: var(--text); }
.nav-item .icon { color: var(--text-3); }
.nav-item.on .icon { color: var(--text); }
.nav-item .count { margin-left: auto; }
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center;
  font-size: 11.5px; font-weight: 600; background: var(--text); color: #fff; font-variant-numeric: tabular-nums;
}
.count.red { background: var(--red-dot); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 14px 8px 4px; border-top: 1px solid var(--line); }
.me b { font-weight: 550; font-size: 13.5px; }
.me form { margin: 0 0 0 auto; }

.main { min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 36px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 650; line-height: 1.25; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.crumbs { display: flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; margin-bottom: 6px; }
.crumbs a { display: inline-flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--text); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row form, .inline { margin: 0; display: inline-flex; }
.spacer { flex: 1; }

/* ——— кнопки ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs);
  transition: background .12s, border-color .12s, box-shadow .12s, opacity .12s;
}
.btn:hover { background: var(--subtle); }
.btn:focus-visible, .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.btn.primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn.primary:hover { background: #27272a; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--subtle); color: var(--text); }
.btn.danger { color: var(--red-fg); }
.btn.danger:hover { background: var(--red-bg); border-color: #f5c2c2; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: var(--r); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-xs);
}
.icon-btn:hover { background: var(--subtle); color: var(--text); }
.icon-btn.plain { border-color: transparent; box-shadow: none; background: transparent; }
/* второе нажатие подтверждает опасное действие */
.icon-btn.armed { width: auto; padding: 0 10px; color: var(--red-fg); background: var(--red-bg); font-size: 12.5px; font-weight: 600; }
.menu-item.armed { background: var(--red-bg); }

/* ——— поля ——— */
.input, .select {
  width: 100%; height: 34px; padding: 0 11px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; box-shadow: var(--shadow-xs);
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 9px 11px; line-height: 1.5; resize: none; min-height: 84px; display: block; }
.input:focus, .select:focus { outline: none; border-color: var(--text-3); box-shadow: 0 0 0 3px var(--focus); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8b94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
}
.select.auto { width: auto; }
.input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 550; color: var(--text); }
.field small { color: var(--text-3); font-size: 12.5px; }
.error-text { color: var(--red-fg); font-size: 12.5px; }
.warn-text { color: var(--amber-fg); }

/* переключатель */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13.5px; color: var(--text-2); }
.switch input { appearance: none; -webkit-appearance: none; margin: 0; width: 34px; height: 20px; border-radius: 10px;
  background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked { background: var(--text); }
.switch input:checked::after { transform: translateX(14px); }
.switch input:focus-visible { box-shadow: 0 0 0 3px var(--focus); outline: none; }

/* ——— бейджи статусов ——— */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--gray-bg); color: var(--gray-fg);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gray-dot); }
.badge.plain::before { display: none; }
.s-review { background: var(--amber-bg); color: var(--amber-fg); } .s-review::before { background: var(--amber-dot); }
.s-ready { background: var(--blue-bg); color: var(--blue-fg); } .s-ready::before { background: var(--blue-dot); }
.s-planned, .s-sending, .s-scheduled { background: var(--violet-bg); color: var(--violet-fg); }
.s-planned::before, .s-sending::before, .s-scheduled::before { background: var(--violet-dot); }
.s-published { background: var(--green-bg); color: var(--green-fg); } .s-published::before { background: var(--green-dot); }
.s-failed { background: var(--red-bg); color: var(--red-fg); } .s-failed::before { background: var(--red-dot); }
.badge .spin { color: inherit; }
.badge:has(.spin)::before { display: none; }

/* ——— аватар ——— */
.avatar {
  --h: 220; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 650; letter-spacing: .02em; color: hsl(var(--h) 55% 32%); background: hsl(var(--h) 70% 92%);
}
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.who { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ——— сегменты-вкладки ——— */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.segments { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: #ececef; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.segments::-webkit-scrollbar { display: none; }
.segments a {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 7px;
  color: var(--text-2); font-weight: 550; font-size: 13.5px; white-space: nowrap; transition: background .12s, color .12s;
}
.segments a:hover { color: var(--text); }
.segments a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segments a em { font-style: normal; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.segments a.on em { color: var(--text-2); }
.segments a.alert em { color: var(--red-fg); }
.stat-line { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }

/* в работе: монтаж и очередь */
.work { margin-bottom: 20px; overflow: hidden; }
.work > summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 13.5px; cursor: pointer; list-style: none; user-select: none; }
.work > summary::-webkit-details-marker { display: none; }
.work[open] > summary { border-bottom: 1px solid var(--line); }
.work > summary b { font-weight: 600; }
.work-sum { margin-left: auto; color: var(--text-2); font-size: 12.5px; }
.work[open] .work-sum { visibility: hidden; }
.work .chev { color: var(--text-3); transition: transform .15s; }
.work:not([open]) .chev { transform: rotate(-90deg); }
.work-row { display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.work-row:last-child { border-bottom: 0; }
.work-row .thumb { width: 30px; height: 44px; border-radius: 5px; background: #111 center / cover no-repeat; flex: none; }
.work-row .grow { flex: 1; min-width: 0; display: grid; gap: 1px; }
.work-row .grow b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-row .grow small { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-state { width: 180px; flex: none; display: grid; gap: 6px; }
.work-label { font-size: 12.5px; color: var(--text-2); }
.work-row.done .work-label { color: var(--green-fg); }
.bar.idle i { width: 30% !important; background: var(--line-strong); animation: idle 1.4s ease-in-out infinite; }
@keyframes idle { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
.spin { animation: spin .9s linear infinite; color: var(--text-3); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ——— пустые состояния ——— */
.empty {
  display: grid; justify-items: center; gap: 6px; padding: 56px 24px; text-align: center; grid-column: 1 / -1;
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
}
.empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--subtle); color: var(--text-2); margin-bottom: 8px; }
.empty h3 { font-size: 15px; font-weight: 600; }
.empty p { margin: 0; color: var(--text-2); max-width: 380px; }
.empty .btn { margin-top: 12px; }

/* ——— таблицы ——— */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { height: 38px; padding: 0 14px; text-align: left; font-size: 12px; font-weight: 550; color: var(--text-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { height: 60px; padding: 8px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafafb; }
.table .thumb { width: 30px; height: 44px; border-radius: 5px; background: #111 center / cover no-repeat; display: block; }
.url { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); max-width: min(440px, 100%); }
.url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url:hover { color: var(--blue); }

/* ——— календарь ——— */
.cal-wrap { overflow-x: auto; }
table.cal { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.cal th, .cal td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 10px; vertical-align: top; text-align: left; }
.cal tr > :last-child { border-right: 0; }
.cal tbody tr:last-child > * { border-bottom: 0; }
.cal thead th { height: 56px; vertical-align: middle; font-weight: 400; }
.cal thead th:first-child { width: 210px; }
.day { display: flex; align-items: center; gap: 8px; }
.day small { font-size: 12px; font-weight: 550; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.day b { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; font-size: 14px; font-weight: 600; }
.cal thead th.today .day b { background: var(--brand); color: #fff; }
.cal thead th.today .day small { color: var(--brand); }
.cal td.today { background: #fdfcfd; }
.acc { display: flex; align-items: center; gap: 10px; }
.acc b { display: block; font-weight: 600; font-size: 13.5px; }
.acc small { color: var(--text-3); font-size: 12px; font-weight: 400; }
.slot {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 6px; border-radius: 7px; font-size: 12.5px;
  background: var(--gray-bg); color: var(--gray-fg); overflow: hidden; white-space: nowrap; border-left: 3px solid var(--gray-dot);
}
.slot:hover { filter: brightness(.97); }
.slot time { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.slot span { overflow: hidden; text-overflow: ellipsis; }
.slot::before { display: none; }
.slot.s-published { border-left-color: var(--green-dot); background: var(--green-bg); }
.slot.s-planned, .slot.s-sending, .slot.s-scheduled { border-left-color: var(--violet-dot); background: var(--violet-bg); }
.cell { display: flex; flex-wrap: wrap; gap: 4px; min-height: 26px; }
.cell .slot { flex: 1 0 100%; margin: 0; }
/* свободное время — тихое, чтобы 20+ аккаунтов не рябили; при наведении становится кнопкой */
.free-slot { height: 24px; padding: 0 7px; border-radius: 6px; border: 1px solid transparent; background: #f5f5f6;
  color: var(--text-3); font: inherit; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s; }
.free-slot:hover, .free-slot:focus-visible { outline: none; border-color: var(--line-strong); color: var(--text); background: var(--surface); box-shadow: var(--shadow-xs); }
.cal thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.cal tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.cal td, .cal th { padding: 8px; }
.cal-wrap { max-height: calc(100vh - 220px); }
.legend-item { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; margin-left: 6px; }
.legend-item .free-slot { pointer-events: none; }
.cal tr.paused th .acc { opacity: .5; }
.page-head .btn .count { margin-left: 2px; background: var(--subtle); color: var(--text); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.agenda { display: none; }
.agenda-day { margin-bottom: 18px; }
.agenda-day h3 { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 8px; }
.agenda-day.today h3 { color: var(--brand); }
.agenda-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.agenda-row:last-child { border-bottom: 0; }
.agenda-row time { font-weight: 650; font-variant-numeric: tabular-nums; width: 42px; }
.agenda-row .grow { flex: 1; min-width: 0; }
.agenda-row .grow b { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-row .grow small { color: var(--text-3); }
.agenda-day h3 .faint { font-weight: 400; }

/* ——— список видео ——— */
.vlist td { height: 76px; }
.vcell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.vtext { min-width: 0; flex: 1; }
.vlist .thumb { flex: none; position: relative; display: grid; place-items: center; width: 40px; height: 64px; padding: 0; border: 0; border-radius: 6px;
  background: #111 center / cover no-repeat; color: #fff; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.vlist .thumb.play .icon { opacity: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); transition: opacity .12s; }
.vlist .thumb.play:hover .icon, .vlist .thumb.play:focus-visible .icon { opacity: 1; }
.vlist .thumb.play:hover { box-shadow: 0 0 0 2px var(--text); }
.vlist .c-name { width: 100%; max-width: 0; white-space: normal; }
.vlist .c-name .name { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vlist .c-name .line { display: block; color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.vlist .c-name .line.error-text { color: var(--red-fg); }
.vlist .c-name .line.warn-text { color: var(--amber-fg); }
.vlist .mobile-meta { display: none !important; }
.vlist .c-act { text-align: right; width: 1%; }
.vlist .c-act form { display: inline-flex; margin: 0; }
.vlist tbody tr[data-href] { cursor: pointer; }
dialog.preview { padding: 0; border: 0; background: none; overflow: visible; max-width: none; max-height: none; }
.zoom-stage { height: min(92vh, 1920px); max-width: calc(100vw - 32px); border-radius: 12px; }
dialog.preview::backdrop { background: rgba(10, 10, 12, .72); }
dialog.preview video { display: block; height: min(88vh, 860px); max-width: calc(100vw - 32px); aspect-ratio: 9 / 16; object-fit: contain;
  background: #000; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); outline: none; }

/* ——— шапка объекта ——— */
.obj-head { margin-bottom: 24px; position: relative; }
.crumbs .sep { color: var(--line-strong); margin: 0 2px; }
.obj-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.obj-main { min-width: 0; }
.obj-main h1 { font-size: 24px; font-weight: 650; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--text-2); font-size: 13.5px; }
.meta-row > span + span:not(.chip)::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); margin-right: 14px; vertical-align: middle; }
.meta-row .chip + span::before { display: none !important; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 550; font-size: 13px; }
.chip .icon { color: var(--text-3); }
.obj-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.obj-actions form { margin: 0; }

details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px; padding: 6px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.menu-pop form { margin: 0; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: none;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--text); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--subtle); }
.menu-item.danger { color: var(--red-fg); }
.menu-item.danger:hover { background: var(--red-bg); }

.stepper { margin-top: 20px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.stepper ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.stepper li { position: relative; display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13.5px; font-weight: 550; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; margin: 0 12px 0 2px; border-radius: 1px; background: var(--line); }
.stepper li.done::after { background: var(--text); }
.step-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 650;
  background: var(--subtle); color: var(--text-3); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.stepper li.done { color: var(--text-2); }
.stepper li.done .step-dot { background: var(--text); border-color: var(--text); color: #fff; }
.stepper li.current { color: var(--text); }
.stepper li.current .step-dot { background: var(--surface); border: 2px solid var(--text); color: var(--text); box-shadow: 0 0 0 4px var(--focus); }
.stepper li.error { color: var(--red-fg); }
.stepper li.error .step-dot { background: var(--red-dot); border-color: var(--red-dot); color: #fff; box-shadow: 0 0 0 4px var(--red-bg); }
.step-label { white-space: nowrap; }
.step-hint { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; }
.stepper.has-error .step-hint { color: var(--red-fg); overflow-wrap: anywhere; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-head h3 { font-size: 14px; font-weight: 600; margin: 0; }

/* ——— страница видео ——— */
.detail { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }
.player { width: 100%; aspect-ratio: 9 / 16; border-radius: var(--r-xl); background: #111; object-fit: contain; display: grid; place-items: center;
  color: #8b8b94; box-shadow: var(--shadow-md); font-size: 13px; text-align: center; padding: 0; }
.player.placeholder { position: relative; overflow: hidden; padding: 24px; background: var(--subtle); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.player.placeholder.has-thumb { background: #111 center / cover no-repeat; color: #fff; box-shadow: var(--shadow-md); }
.player.placeholder.has-thumb::before { content: ""; position: absolute; inset: 0; background: rgba(12, 12, 14, .64); backdrop-filter: blur(8px); }
.ph-body { position: relative; display: grid; justify-items: center; gap: 8px; max-width: 230px; }
.ph-body b { font-weight: 600; font-size: 14px; }
.ph-body small { font-size: 12.5px; opacity: .72; line-height: 1.45; }
.ph-body .bar { width: 160px; background: var(--line); }
.has-thumb .ph-body .bar { background: rgba(255, 255, 255, .22); }
.has-thumb .ph-body .bar i { background: #fff; }
.ph-body .btn { margin-top: 6px; }
.caption-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.stack { display: grid; gap: 16px; align-content: start; }
.section { padding: 18px 20px; }
.section > h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.props { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px 16px; margin: 0; font-size: 13.5px; }
.props dt { color: var(--text-3); }
.props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.alert-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--red-bg); color: var(--red-fg); font-size: 13.5px; overflow-wrap: anywhere; }
.alert-box .icon { margin-top: 2px; }
.alert-strip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 14px; border-radius: var(--r-lg);
  background: var(--red-bg); color: var(--red-fg); font-size: 13.5px; }
.alert-strip span { flex: 1; }
.alert-strip b { font-weight: 600; }
.mobile-only { display: none !important; }
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .chev { margin-left: auto; color: var(--text-3); transition: transform .15s; transform: rotate(-90deg); }
details.more[open] > summary .chev { transform: none; }
details.more > .inner { margin-top: 14px; }
pre.log { margin: 0; padding: 12px 14px; background: var(--subtle); border-radius: var(--r); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); white-space: pre-wrap; max-height: 280px; overflow: auto; }

/* ——— настройки ——— */
.settings-section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.settings-section:first-of-type { border-top: 0; padding-top: 4px; }
.settings-section > header h2 { font-size: 15px; font-weight: 600; }
.settings-section > header p { margin: 6px 0 12px; color: var(--text-2); font-size: 13.5px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { font-weight: 600; }
.list-row small { display: block; color: var(--text-3); font-size: 12.5px; }
.list-row form { margin: 0; display: flex; align-items: center; gap: 18px; }
#programs .list-row { padding-top: 8px; padding-bottom: 8px; }
.list-row.clickable { cursor: pointer; transition: background .12s; }
.list-row.clickable:hover { background: #fafafb; }
.picker { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); transition: border-color .12s, background .12s; }
.picker.is-empty { border-style: dashed; border-color: var(--line-strong); background: #fbfbfc; cursor: pointer; }
.picker.is-empty:hover, .picker.over { border-color: var(--text-3); background: var(--subtle); }
.picker-thumb { position: relative; width: 36px; height: 64px; padding: 0; border: 0; border-radius: 6px; background: var(--subtle); overflow: hidden; flex: none;
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.picker-thumb:disabled { cursor: default; }
.picker-thumb:not(:disabled):hover { box-shadow: 0 0 0 2px var(--text); }
.picker-thumb:empty::after { content: ""; width: 14px; height: 14px; border: 2px solid var(--line-strong); border-radius: 3px; }
.picker-thumb video, .picker-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #111; }
.picker-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.picker-text b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-text small { color: var(--text-3); font-size: 12.5px; }
.picker label.btn { flex: none; }
.pthumb { position: relative; width: 27px; height: 48px; border-radius: 6px; overflow: hidden; background: #111; flex: none; }
.pthumb video, .pthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.list-row.off .pthumb, .list-row.off .grow { opacity: .45; }
.list-row.paused .avatar, .list-row.paused .grow { opacity: .5; }
/* последняя видимая строка без нижней линии — даже когда часть строк скрыта поиском */
[data-account-rows] { overflow: hidden; }
[data-account-rows] .list-row { margin-bottom: -1px; }
.list-tools { margin-bottom: 12px; flex-wrap: nowrap; }
.search { position: relative; flex: 1; min-width: 0; display: block; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 32px; min-width: 0; }
.mode-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
.mode-card .icon-wrap { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--amber-bg); color: var(--amber-fg); flex: none; }
.mode-card.ok .icon-wrap { background: var(--green-bg); color: var(--green-fg); }
.mode-card.bad .icon-wrap { background: var(--red-bg); color: var(--red-fg); }
.mode-card.bad { border-color: #f5c9c9; }
.mode-card b { font-weight: 600; }
.mode-card p { margin: 3px 0 0; color: var(--text-2); font-size: 13.5px; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--subtle); padding: 1px 5px; border-radius: 4px; }

/* ——— модальное окно ——— */
dialog.modal {
  width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-xl); background: var(--surface);
  color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(15, 15, 18, .38); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.modal-head h2 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 18px 20px 20px; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfbfc; border-radius: 0 0 var(--r-xl) var(--r-xl); }
.drop {
  display: grid; justify-items: center; gap: 6px; padding: 34px 20px; border-radius: var(--r-lg); cursor: pointer; text-align: center;
  border: 1.5px dashed var(--line-strong); background: #fbfbfc; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--text-3); background: var(--subtle); }
.drop .empty-icon { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.drop b { font-weight: 600; }
.drop small { color: var(--text-3); }
.or-sep { display: flex; align-items: center; gap: 10px; margin: -4px 0; color: var(--text-3); font-size: 12.5px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.links-box { display: grid; gap: 8px; }
.links-box textarea.input { min-height: 64px; }
.links-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.links-msg { color: var(--red-fg); font-size: 12.5px; min-width: 0; }

/* ——— окно «В план» ——— */
dialog.modal.wide { width: min(560px, calc(100vw - 32px)); }
.sched-video { margin: -8px 0 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-step { display: grid; gap: 10px; }
.field-label { font-size: 13px; font-weight: 550; }
.segments.small { flex: none; padding: 2px; }
.segments.small a { height: 30px; padding: 0 10px; font-size: 13px; }
.pick-list { display: grid; max-height: min(300px, 38vh); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: var(--surface); font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: #fafafb; }
.pick.on { background: var(--subtle); box-shadow: inset 3px 0 0 var(--text); }
.pick:disabled { cursor: not-allowed; opacity: .5; }
.pick-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.pick-main b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-main small { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-side { flex: none; color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pick-next { display: none !important; }
.pick-thumb { width: 27px; height: 48px; border-radius: 5px; background: #111 center / cover no-repeat; flex: none; }
.pick-empty { padding: 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.pick.chosen { border: 1px solid var(--line); border-radius: var(--r-lg); cursor: default; }
.pick.chosen:hover { background: var(--surface); }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chip { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface);
  font: inherit; font-size: 13px; font-weight: 550; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.slot-chip:hover { background: var(--subtle); }
.slot-chip.on { background: var(--text); border-color: var(--text); color: #fff; }
.slot-chip.now { border-color: var(--brand); color: var(--brand); }
.slot-chip.now.on { background: var(--brand); color: #fff; }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: var(--r); background: var(--amber-bg); color: var(--amber-fg); font-size: 13px; }
.note .icon { margin-top: 2px; }
.sched-summary { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* весь экран — зона сброса файлов */
.drop-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(247,247,248,.86); backdrop-filter: blur(3px); pointer-events: none; }
.drop-overlay div { display: grid; justify-items: center; gap: 10px; padding: 40px 56px; border: 2px dashed var(--text-3); border-radius: 20px; background: var(--surface); font-weight: 600; font-size: 15px; box-shadow: var(--shadow-lg); }

/* ——— загрузки и уведомления ——— */
.uploads { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 340px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.uploads header { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 14px; font-weight: 600; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.uploads header .tools { display: flex; gap: 2px; }
.uploads header .icon-btn { width: 28px; height: 28px; }
.uploads header small { display: block; font-weight: 400; color: var(--text-3); font-size: 12px; }
.uploads.collapsed .items, .uploads.collapsed footer { display: none; }
.uploads.collapsed .collapse .icon { transform: rotate(180deg); }
.uploads .items { max-height: 280px; overflow-y: auto; overflow-x: hidden; }
.uploads footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fbfbfc; }
.up { display: grid; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.up:last-child { border-bottom: 0; }
.up .line { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.up b { flex: 1; min-width: 0; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up small { flex: none; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.up .msg { font-size: 12.5px; color: var(--red-fg); overflow-wrap: anywhere; }
.up .msg:empty { display: none; }
.up small.ok { color: var(--green-fg); }
.up small.bad { color: var(--red-fg); }
.up.failed .bar i { background: var(--red-dot); }
.bar { height: 4px; border-radius: 2px; background: var(--subtle); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--text); border-radius: 2px; transition: width .2s; }
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-lg); background: var(--text); color: #fff;
  box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast 4.5s forwards; }
.toast.error { background: var(--red-fg); animation-duration: 8s; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 5%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; visibility: hidden; } }

/* ——— вход ——— */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth form { width: min(380px, 100%); display: grid; gap: 12px; padding: 32px 28px 28px; box-shadow: var(--shadow-md); }
.auth .logo { justify-content: center; padding: 0 0 10px; font-size: 17px; }
.auth h1 { font-size: 19px; font-weight: 650; text-align: center; }
.auth p { margin: -6px 0 8px; color: var(--text-2); text-align: center; font-size: 13.5px; }
.auth .input, .auth .btn { height: 42px; }

/* ——— телефон ——— */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; background: none; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30; flex-direction: row; justify-content: space-around;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); gap: 0;
  }
  .sidebar .logo, .sidebar-foot { display: none; }
  .nav-item { flex-direction: column; height: auto; gap: 3px; padding: 6px 16px; font-size: 11.5px; position: relative; background: none !important; }
  .nav-item .icon { width: 22px; height: 22px; }
  .nav-item .count { position: absolute; top: 0; left: 50%; margin-left: 4px; height: 17px; min-width: 17px; padding: 0 5px; font-size: 10.5px; }
  .page { padding: 20px 16px 100px; }
  .page-head { margin-bottom: 16px; align-items: center; }
  .page-head h1 { font-size: 20px; }
  .page-head p { display: none; }
  .alert-strip.mobile-only { display: flex !important; }
  .detail { grid-template-columns: 1fr; gap: 20px; }
  /* плеер не больше ~⅔ экрана — подпись и кнопки видны без долгой прокрутки */
  .detail .player { height: min(62vh, 520px); width: auto; max-width: 100%; margin: 0 auto; }
  .meta-row { gap: 6px 12px; }
  .meta-row > span + span:not(.chip)::before { display: none; }
  .settings-section { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 22px 0; }
  .list-row { flex-wrap: wrap; }
  /* «Постить» — в углу строки, два выбора — поровну на всю ширину */
  #accounts .list-row { position: relative; }
  #accounts .list-row .grow { padding-right: 104px; }
  #accounts .list-row form { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #accounts .list-row form .select { width: 100%; }
  #accounts .list-row .switch { position: absolute; top: 18px; right: 16px; }
  #programs .list-row { flex-wrap: nowrap; }
  #programs .list-row form { margin-left: auto; }
  .switch-text { display: none; }
  .uploads { left: 12px; right: 12px; width: auto; bottom: 84px; }
  .toolbar .stat-line { display: none; }
  .vlist .c-hide, .vlist thead { display: none; }
  .vlist .mobile-meta { display: block !important; }
  .vlist td { height: auto; padding: 10px 12px; }
  .vlist .c-act .btn { padding: 0 10px; }
  .pick-side, .sched-summary { display: none; }
  .pick-next { display: block !important; color: var(--text-2) !important; }
  .obj-title { flex-direction: column; }
  /* «Ещё» — в правом верхнем углу, рядом с крошками; одна кнопка не занимает отдельную строку */
  .obj-actions details.menu { position: absolute; top: -12px; right: 0; }
  .obj-title:has(.obj-actions > details.menu:only-child) { gap: 0; }
  .obj-main h1 { font-size: 20px; white-space: normal; }
  .stepper { padding: 14px; }
  .stepper ol { grid-template-columns: repeat(5, auto); justify-content: space-between; }
  .stepper li:not(:last-child)::after { display: none; }
  .stepper li { flex-direction: column; gap: 6px; font-size: 11px; }
  .step-label { white-space: normal; text-align: center; }
  .work-state { width: 96px; }
  .work-row { gap: 10px; padding-left: 12px; }
  .cal-wrap, .legend { display: none; }
  .agenda { display: block; }
}

/* ——— монтаж: режим рекламы и улучшение картинки ——— */
[data-tune] { display: grid; gap: 16px; }
[data-tune] > h3 { margin-bottom: -2px; }
.tune { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.tune-shot { display: grid; gap: 8px; }
/* сцена: кадр ролика и слои текста поверх, в долях от 1080×1920 */
.stage { position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden; background: #111; }
.stage > img[data-base] { display: block; width: 100%; height: 100%; object-fit: contain; transition: opacity .15s; }
.stage.loading > img[data-base] { opacity: .55; }
.stage .layer { position: absolute; }
.stage .layer img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage .layer.blur { -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.tune-frame { width: 100%; padding: 0; border: 0; border-radius: var(--r-lg); cursor: zoom-in; }
.tune-tag { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(15, 15, 18, .72); color: #fff; font-size: 12px; font-weight: 600; }
.tune-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tune-bar [data-before] { touch-action: none; user-select: none; -webkit-user-select: none; }
.sliders { display: grid; gap: 12px; align-content: start; justify-items: start; }
.slider { display: grid; grid-template-columns: 110px minmax(0, 1fr) 36px; align-items: center; gap: 10px; width: 100%; font-size: 13.5px; color: var(--text-2); }
.slider input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 0; background: none; cursor: pointer; }
.slider input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
.slider input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
.slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.slider input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.slider input[type=range]:focus-visible { outline: none; }
.slider input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--focus); }
.slider input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--focus); }
.slider output { text-align: right; color: var(--text); }
.tune-foot { display: flex; justify-content: flex-end; }
@media (max-width: 640px) {
  .tune { grid-template-columns: 1fr; }
  .tune-shot { width: min(100%, 260px); justify-self: center; }
  .slider { grid-template-columns: 96px minmax(0, 1fr) 32px; }
}

/* ——— редактор текста на видео ——— */
dialog.modal.editor { width: min(1080px, calc(100vw - 32px)); }
.editor-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; padding: 18px 20px; max-height: calc(100vh - 150px); overflow-y: auto; }
.ed-stage-wrap { display: grid; gap: 10px; align-content: start; }
.ed-stage { height: min(68vh, 720px); border-radius: var(--r-lg); touch-action: none; user-select: none; -webkit-user-select: none; }
.ed-stage .layer { cursor: move; outline: 1px dashed rgba(255, 255, 255, .7); outline-offset: -1px; touch-action: none; }
.ed-stage .layer.off { opacity: .35; }
.ed-stage .layer.selected { outline: 2px solid var(--blue); opacity: 1; }
.ed-stage .h { position: absolute; display: none; width: 14px; height: 14px; border: 2px solid var(--blue); border-radius: 50%; background: #fff; }
.ed-stage .layer.selected .h { display: block; }
.ed-stage .h.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.ed-stage .h.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.ed-stage .h.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.ed-stage .h.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.slider.ed-time { grid-template-columns: minmax(0, 1fr) 48px; }
.ed-panel { display: grid; gap: 14px; align-content: start; min-width: 0; }
.ed-layers { display: grid; gap: 6px; }
.ed-layers:empty { display: none; }
.ed-layer { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.ed-layer.on { border-color: var(--text); box-shadow: var(--shadow-sm); }
.ed-layer b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.ed-layer small { flex: none; color: var(--text-3); }
.ed-props { display: grid; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ed-props .field small { margin-top: -2px; }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.swatch { width: 44px; height: 34px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.ed-times { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.ed-times[hidden] { display: none; }
.ed-times label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.ed-times .input { width: 76px; }
.ed-props [data-remove] { justify-self: start; }
@media (max-width: 760px) {
  dialog.modal.editor { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  dialog.modal.editor .modal-foot { border-radius: 0; }
  .editor-body { grid-template-columns: 1fr; gap: 16px; max-height: calc(100dvh - 128px); padding: 0 16px 12px; }
  /* кадр прилипает сверху: правишь текст — сразу видно результат */
  .ed-stage-wrap { position: sticky; top: 0; z-index: 2; margin: 0 -16px; padding: 12px 16px 10px; background: var(--surface);
    box-shadow: 0 8px 12px -12px rgba(16, 16, 20, .25); }
  .ed-stage { height: 38dvh; justify-self: center; }
}

/* окно загрузки: с монтажом / готовый ролик */
.up-modes { justify-self: start; }
.up-pane { display: grid; gap: 16px; }
.up-switches { display: grid; gap: 10px; }
.pick.check input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--text); cursor: inherit; }
.pick.check:has(input:checked) { background: var(--subtle); }
.pick.check:has(input:disabled) { cursor: not-allowed; opacity: .5; }
.picker [data-rd-name] { white-space: nowrap; }
.field > span em { font-style: normal; }
