/* ============================================================================
   «Подборка видео» для чатов (Алекс 01.12.2026, Izi.CRM #5418) — стили video-library.js (window.VLIB), классы vl-*.
   Акцент: lk — синий CRM, sale.iziexpert.kg — оранжевый «IZI Продажи» (html[data-host="sale"]); светлая и тёмная тема.
   Слои: подборка 99960, окна предпросмотра и управления 99970 — ниже уведомлений (100000) и окна подтверждения (100100).
   Метка слева у строк «обрабатывается» / «не получилось» — ровная планка внутри с отступом 22 % (ui-polish).
   ============================================================================ */
.vl-pop, .vl-ov, .vl-backdrop {
    --vl-acc: #074783; --vl-acc-soft: rgba(7, 71, 131, .07); --vl-acc-soft2: rgba(7, 71, 131, .13); --vl-ring: rgba(7, 71, 131, .2);
    --vl-btn: #074783; --vl-btn-h: #0a5aa3;
    --vl-bg: var(--card-bg, #fff); --vl-bg2: var(--surface-bg, #f8f9fa); --vl-text: var(--text-color, #202124); --vl-muted: var(--text-muted, #5f6368);
    --vl-line: var(--border-color, #dadce0); --vl-line-soft: rgba(15, 23, 42, .08); --vl-hover: var(--hover-bg, #f1f3f4);
    --vl-danger: var(--danger-color, #d93025); --vl-danger-soft: rgba(217, 48, 37, .08); --vl-warn: var(--warning-color, #e37400); --vl-warn-soft: rgba(227, 116, 0, .09);
    --vl-thumb: #111827;
    --vl-shadow: 0 24px 60px rgba(15, 23, 42, .22), 0 4px 12px rgba(15, 23, 42, .08);
    --vl-shadow-card: 0 10px 24px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .08);
    --vl-aud-c: #074783; --vl-aud-c-bg: rgba(7, 71, 131, .08); --vl-aud-l: #c4471f; --vl-aud-l-bg: rgba(240, 100, 62, .1);
}
body[data-theme="dark"] .vl-pop, body[data-theme="dark"] .vl-ov, body[data-theme="dark"] .vl-backdrop {
    --vl-acc: #4a9eff; --vl-acc-soft: rgba(74, 158, 255, .1); --vl-acc-soft2: rgba(74, 158, 255, .18); --vl-ring: rgba(74, 158, 255, .32);
    --vl-btn: #2563eb; --vl-btn-h: #3b82f6;
    --vl-line-soft: rgba(255, 255, 255, .07); --vl-danger-soft: rgba(248, 113, 113, .12); --vl-warn-soft: rgba(251, 191, 36, .1);
    --vl-thumb: #0b1220;
    --vl-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .35);
    --vl-shadow-card: 0 10px 24px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
    --vl-aud-c: #8cc4ff; --vl-aud-c-bg: rgba(74, 158, 255, .14); --vl-aud-l: #ffab91; --vl-aud-l-bg: rgba(255, 138, 101, .14);
}
html[data-host="sale"] .vl-pop, html[data-host="sale"] .vl-ov, html[data-host="sale"] .vl-backdrop {
    --vl-acc: #e0562f; --vl-acc-soft: rgba(240, 100, 62, .08); --vl-acc-soft2: rgba(240, 100, 62, .15); --vl-ring: rgba(240, 100, 62, .24);
    --vl-btn: #ea5d36; --vl-btn-h: #d64f2a;
}
html[data-host="sale"] body[data-theme="dark"] .vl-pop, html[data-host="sale"] body[data-theme="dark"] .vl-ov, html[data-host="sale"] body[data-theme="dark"] .vl-backdrop {
    --vl-acc: #ff8a65; --vl-acc-soft: rgba(255, 138, 101, .1); --vl-acc-soft2: rgba(255, 138, 101, .18); --vl-ring: rgba(255, 138, 101, .3);
    --vl-btn: #ea5d36; --vl-btn-h: #f06a43;
}
.vl-pop *, .vl-ov *, .vl-pop *::before, .vl-ov *::before, .vl-pop *::after, .vl-ov *::after { box-sizing: border-box; }
.vl-i { display: block; flex: 0 0 auto; }

/* ── кнопка у поля ввода ── */
.vl-cbtn.is-on { color: #e0562f; }
.chat-input-area .vl-cbtn.is-on { background: rgba(7, 71, 131, .1); color: #074783; }
body[data-theme="dark"] .chat-input-area .vl-cbtn.is-on { background: rgba(74, 158, 255, .16); color: #8cc4ff; }
.lp-chat-attach.vl-cbtn.is-on, .adv-inbox-attach.vl-cbtn.is-on { background: rgba(240, 100, 62, .12); color: #e0562f; border-color: rgba(240, 100, 62, .35); }
body[data-theme="dark"] .lp-chat-attach.vl-cbtn.is-on, body[data-theme="dark"] .adv-inbox-attach.vl-cbtn.is-on { color: #ff8a65; }
.vl-cbtn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(7, 71, 131, .22); }
html[data-host="sale"] .vl-cbtn:focus-visible { box-shadow: 0 0 0 3px rgba(240, 100, 62, .26); }
.chat-input-area .vl-cbtn svg { display: block; }

/* ── подборка над полем ввода ── */
.vl-pop {
    position: fixed; z-index: 99960; display: flex; flex-direction: column; min-height: 260px;
    background: var(--vl-bg); color: var(--vl-text); border: 1px solid var(--vl-line); border-radius: 16px; box-shadow: var(--vl-shadow);
    font-size: 13.5px; line-height: 1.45; overflow: hidden; transform-origin: bottom left; animation: vl-pop-in .16s ease-out;
}
@keyframes vl-pop-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.vl-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 10px 16px; }
.vl-title { flex: none; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.vl-title .vl-i { color: var(--vl-acc); }
.vl-count { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--vl-bg2); color: var(--vl-muted); font-size: 11.5px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.vl-count:empty { display: none; }
.vl-head-acts { display: contents; }
.vl-pop.is-empty .vl-search { visibility: hidden; }
.vl-pop.is-sheet.is-empty .vl-search { display: none; }
.vl-search {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px;
    border: 1px solid var(--vl-line); border-radius: 10px; background: var(--vl-bg2); color: var(--vl-muted); cursor: text;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.vl-search:focus-within { border-color: var(--vl-acc); box-shadow: 0 0 0 3px var(--vl-ring); background: var(--vl-bg); }
.vl-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--vl-text); font: inherit; font-size: 13.5px; padding: 0; }
.vl-search input::placeholder { color: var(--vl-muted); opacity: .85; }
.vl-search input::-webkit-search-cancel-button { cursor: pointer; }
.vl-iconbtn {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
    border: 0; border-radius: 10px; background: transparent; color: var(--vl-muted); cursor: pointer; transition: background .15s ease, color .15s ease;
}
.vl-iconbtn:hover { background: var(--vl-hover); color: var(--vl-text); }
.vl-iconbtn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--vl-ring); color: var(--vl-text); }
.vl-iconbtn:disabled { opacity: .45; cursor: default; }

.vl-chips {
    display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; flex: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%);
}
.vl-chips::-webkit-scrollbar { display: none; }
.vl-chips[hidden] { display: none; }
.vl-chip {
    flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--vl-line); background: var(--vl-bg); color: var(--vl-text); font: inherit; font-size: 12.5px; font-weight: 500;
    cursor: pointer; white-space: nowrap; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.vl-chip b { font-size: 11.5px; font-weight: 600; color: var(--vl-muted); font-variant-numeric: tabular-nums; }
.vl-chip .vl-i { color: var(--vl-muted); }
.vl-chip:hover { background: var(--vl-hover); }
.vl-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--vl-ring); }
.vl-chip.is-on { background: var(--vl-acc-soft2); border-color: transparent; color: var(--vl-acc); font-weight: 600; }
.vl-chip.is-on b, .vl-chip.is-on .vl-i { color: var(--vl-acc); }

.vl-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 16px 16px; scrollbar-gutter: stable; }
.vl-group + .vl-group { margin-top: 16px; }
.vl-gh { display: flex; align-items: center; gap: 7px; margin: 4px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--vl-muted); }
.vl-gh b { padding: 0 6px; border-radius: 999px; background: var(--vl-bg2); font-size: 11px; font-weight: 600; line-height: 18px; font-variant-numeric: tabular-nums; }
.vl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px 12px; }

.vl-card {
    display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 0; border: 0; border-radius: 12px;
    background: transparent; color: var(--vl-text); font: inherit; text-align: left; cursor: pointer;
}
.vl-card:focus-visible { outline: none; }
.vl-thumb {
    position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--vl-thumb);
    isolation: isolate; transition: transform .18s ease, box-shadow .18s ease;
}
.vl-thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--vl-line-soft); pointer-events: none; z-index: 5; }
.vl-thumb img, .vl-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vl-thumb.is-img img { object-fit: cover; }
.vl-thumb video { opacity: 0; transition: opacity .2s ease; }
.vl-thumb.is-playing video { opacity: 1; }
.vl-card:hover .vl-thumb { transform: translateY(-2px); box-shadow: var(--vl-shadow-card); }
.vl-card:focus-visible .vl-thumb { box-shadow: 0 0 0 3px var(--vl-ring), var(--vl-shadow-card); }
.vl-card:active .vl-thumb { transform: translateY(0) scale(.99); }
.vl-noposter { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .55); }
.vl-dur, .vl-kind {
    position: absolute; bottom: 6px; z-index: 3; padding: 1px 6px; border-radius: 6px; background: rgba(9, 13, 22, .72); color: #fff;
    font-size: 11px; font-weight: 600; line-height: 17px; font-variant-numeric: tabular-nums; letter-spacing: .01em; pointer-events: none;
}
.vl-dur { right: 6px; }
.vl-kind { left: 6px; }
.vl-new {
    position: absolute; top: 6px; left: 6px; z-index: 3; padding: 1px 7px; border-radius: 999px; background: var(--vl-btn); color: #fff;
    font-size: 10.5px; font-weight: 700; line-height: 17px; letter-spacing: .02em; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); pointer-events: none;
}
.vl-play {
    position: absolute; left: 50%; top: 50%; z-index: 3; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
    display: grid; place-items: center; background: rgba(255, 255, 255, .94); color: var(--vl-btn); box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
    opacity: 0; transform: scale(.88); transition: opacity .16s ease, transform .16s ease; pointer-events: none;
}
.vl-play .vl-i, .vl-play svg { margin-left: 2px; }
.vl-thumb.is-img .vl-play svg { margin-left: 0; }
.vl-card:hover .vl-play, .vl-card:focus-visible .vl-play { opacity: 1; transform: none; }
.vl-thumb.is-playing .vl-play { opacity: 0; transform: scale(.9); }
.vl-mute {
    position: absolute; top: 6px; right: 6px; z-index: 3; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(9, 13, 22, .62); color: #fff; opacity: 0; transition: opacity .16s ease; pointer-events: none;
}
.vl-thumb.is-playing .vl-mute { opacity: 1; }
.vl-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; height: 3px; background: rgba(255, 255, 255, .22); opacity: 0; transition: opacity .16s ease; pointer-events: none; }
.vl-bar i { display: block; height: 100%; width: 0; background: var(--vl-acc); }
.vl-thumb.is-playing .vl-bar { opacity: 1; }
.vl-ct { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0 2px; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.vl-cm { display: block; padding: 0 2px; margin-top: -2px; font-size: 12px; color: var(--vl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-newtx { color: var(--vl-acc); font-weight: 600; }

.vl-sk .vl-card { cursor: default; }
.vl-sk .vl-thumb, .vl-sk-line {
    background: linear-gradient(90deg, var(--vl-bg2) 25%, var(--vl-hover) 37%, var(--vl-bg2) 63%); background-size: 400% 100%;
    animation: vl-shimmer 1.3s ease infinite;
}
.vl-sk-line { display: block; height: 11px; width: 80%; border-radius: 6px; margin-left: 2px; }
.vl-sk-line.is-short { width: 46%; height: 9px; }
@keyframes vl-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

.vl-foot {
    flex: none; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 9px 16px; border-top: 1px solid var(--vl-line);
    background: var(--vl-bg2); color: var(--vl-muted); font-size: 12.5px;
}
.vl-foot b { color: var(--vl-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vl-foot-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-foot-sub::before { content: '·'; margin-right: 6px; }

.vl-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px 36px; text-align: center; color: var(--vl-muted); font-size: 13px; }
.vl-empty.is-small { padding: 28px 16px; }
.vl-empty b { color: var(--vl-text); font-size: 14.5px; font-weight: 600; }
.vl-empty > span:not(.vl-empty-ic):not(.vl-spin) { max-width: 380px; }
.vl-empty .vl-btn { margin-top: 6px; }
.vl-empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--vl-acc-soft2); color: var(--vl-acc); margin-bottom: 4px; }
.vl-empty-ic.is-bad { background: var(--vl-danger-soft); color: var(--vl-danger); }

/* телефон: лист снизу */
.vl-backdrop { position: fixed; inset: 0; z-index: 99959; background: rgba(10, 15, 25, .42); animation: vl-fade .18s ease; }
@keyframes vl-fade { from { opacity: 0; } to { opacity: 1; } }
.vl-pop.is-sheet {
    left: 0; right: 0; bottom: 0; width: auto; max-height: 88vh; height: 88vh; border-radius: 18px 18px 0 0; border-bottom: 0;
    animation: vl-sheet-in .22s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom, 0);
}
.vl-pop.is-sheet::before { content: ''; display: block; flex: none; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--vl-line); }
@keyframes vl-sheet-in { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.vl-pop.is-sheet .vl-head { flex-wrap: wrap; padding: 10px 10px 10px 16px; }
.vl-pop.is-sheet .vl-title { flex: 1 1 auto; }
.vl-pop.is-sheet .vl-search { order: 5; flex: 1 1 100%; margin-right: 6px; }
.vl-pop.is-sheet .vl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }

/* ── общие кнопки и поля ── */
.vl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px;
    border: 1px solid transparent; font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.vl-btn:active:not(:disabled) { transform: translateY(1px); }
.vl-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--vl-ring); }
.vl-btn:disabled { opacity: .55; cursor: not-allowed; }
.vl-btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.vl-btn-primary { background: var(--vl-btn); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 6px 16px -8px var(--vl-btn); }
.vl-btn-primary:hover:not(:disabled) { background: var(--vl-btn-h); }
.vl-btn-ghost { background: var(--vl-bg); border-color: var(--vl-line); color: var(--vl-text); }
.vl-btn-ghost:hover:not(:disabled) { background: var(--vl-hover); }
.vl-btn-soft { background: var(--vl-acc-soft2); color: var(--vl-acc); }
.vl-btn-soft:hover:not(:disabled) { background: var(--vl-acc-soft); box-shadow: inset 0 0 0 1px var(--vl-acc); }
.vl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vl-field > span { font-size: 12.5px; font-weight: 600; color: var(--vl-muted); }
.vl-field > span i, .vl-field i { font-style: normal; font-weight: 400; opacity: .8; }
.vl-field small { font-size: 12px; color: var(--vl-muted); }
.vl-field input, .vl-field textarea, .vl-sec-add input, .vl-sec-name {
    width: 100%; min-width: 0; padding: 8px 11px; border: 1px solid var(--vl-line); border-radius: 10px; background: var(--vl-bg); color: var(--vl-text);
    font: inherit; font-size: 13.5px; line-height: 1.4; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.vl-field input, .vl-sec-add input { height: 38px; }
.vl-field textarea { resize: vertical; min-height: 74px; }
.vl-field input:focus, .vl-field textarea:focus, .vl-sec-add input:focus, .vl-sec-name:focus { border-color: var(--vl-acc); box-shadow: 0 0 0 3px var(--vl-ring); }
.vl-field input::placeholder, .vl-field textarea::placeholder, .vl-sec-add input::placeholder { color: var(--vl-muted); opacity: .75; }
.vl-sel {
    height: 38px; min-width: 150px; padding: 0 32px 0 11px; border: 1px solid var(--vl-line); border-radius: 10px; background-color: var(--vl-bg);
    color: var(--vl-text); font: inherit; font-size: 13.5px; outline: none;
}
.vl-sel:focus { border-color: var(--vl-acc); box-shadow: 0 0 0 3px var(--vl-ring); }
.vl-spin {
    display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--vl-line); border-top-color: var(--vl-acc);
    animation: vl-spin .8s linear infinite; flex: none;
}
.vl-spin.is-big { width: 30px; height: 30px; border-width: 3px; }
@keyframes vl-spin { to { transform: rotate(360deg); } }

/* ── окно предпросмотра ── */
.vl-ov {
    position: fixed; inset: 0; z-index: 99970; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: rgba(10, 15, 25, .56); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: vl-fade .16s ease;
    color: var(--vl-text); font-size: 13.5px; line-height: 1.45;
}
.vl-pv {
    width: min(940px, 100%); max-height: calc(100vh - 48px); display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
    background: var(--vl-bg); border-radius: 18px; overflow: hidden; box-shadow: var(--vl-shadow); animation: vl-pv-in .2s cubic-bezier(.2, .8, .2, 1);
}
.vl-pv.is-portrait { width: min(800px, 100%); grid-template-columns: minmax(0, 1fr) minmax(320px, 1.1fr); }
@keyframes vl-pv-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.vl-pv-media { position: relative; display: flex; align-items: center; justify-content: center; min-height: 300px; background: #05070b; }
.vl-pv-media video, .vl-pv-media img { display: block; width: 100%; height: 100%; max-height: calc(100vh - 48px); object-fit: contain; background: #05070b; }
.vl-pv-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 18px 16px 20px; overflow-y: auto; }
.vl-pv-top { display: flex; align-items: flex-start; gap: 10px; }
.vl-pv-top > div { flex: 1; min-width: 0; }
.vl-pv-sec { display: inline-block; margin-bottom: 6px; padding: 2px 9px; border-radius: 999px; background: var(--vl-acc-soft2); color: var(--vl-acc); font-size: 11.5px; font-weight: 600; }
.vl-pv h3 { margin: 0; font-size: 18px; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.vl-pv-meta { margin-top: 4px; color: var(--vl-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.vl-pv-to { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--vl-line); border-radius: 12px; background: var(--vl-bg2); }
.vl-pv-to-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--vl-bg); color: var(--vl-acc); box-shadow: inset 0 0 0 1px var(--vl-line); }
.vl-pv-to > div { min-width: 0; display: flex; flex-direction: column; }
.vl-pv-to span { font-size: 11.5px; color: var(--vl-muted); }
.vl-pv-to b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-pv-to small { font-size: 12px; color: var(--vl-muted); }
.vl-pv-warn {
    position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px 9px 16px; border-radius: 10px;
    background: var(--vl-warn-soft); color: var(--vl-text); font-size: 12.5px; line-height: 1.45;
}
.vl-pv-warn::before { content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--vl-warn); pointer-events: none; }
.vl-pv-warn .vl-i { color: var(--vl-warn); margin-top: 1px; }
.vl-pv-warn.is-bad { background: var(--vl-danger-soft); }
.vl-pv-warn.is-bad::before { background: var(--vl-danger); }
.vl-pv-warn.is-bad .vl-i { color: var(--vl-danger); }
.vl-pv-stat { display: flex; align-items: center; gap: 6px; color: var(--vl-muted); font-size: 12px; }
.vl-pv-stat .vl-i { flex: none; }
.vl-pv-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; padding-top: 4px; }
.vl-pv-actions .vl-btn-primary { min-width: 150px; }
.vl-pv-kbd { margin-top: -6px; text-align: right; color: var(--vl-muted); font-size: 11.5px; }
.vl-pv-kbd kbd, .vl-note kbd {
    display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--vl-line); border-bottom-width: 2px;
    background: var(--vl-bg); font: inherit; font-size: 11px; line-height: 16px; text-align: center;
}

/* ── окно управления ── */
.vl-mgr {
    width: min(1060px, 100%); height: min(780px, calc(100vh - 48px)); display: flex; flex-direction: column; background: var(--vl-bg);
    border-radius: 18px; overflow: hidden; box-shadow: var(--vl-shadow); animation: vl-pv-in .2s cubic-bezier(.2, .8, .2, 1);
}
.vl-mgr-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 16px 12px 20px; }
.vl-mgr-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--vl-acc-soft2); color: var(--vl-acc); }
.vl-mgr-ht { flex: 1; min-width: 0; }
.vl-mgr-ht h3 { margin: 1px 0 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.vl-mgr-ht p { margin: 2px 0 0; color: var(--vl-muted); font-size: 13px; }
.vl-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--vl-line); flex: none; overflow-x: auto; scrollbar-width: none; }
.vl-tab {
    position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 11px; border: 0; background: none;
    color: var(--vl-muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; border-radius: 8px 8px 0 0;
}
.vl-tab span { padding: 0 7px; border-radius: 999px; background: var(--vl-bg2); font-size: 11.5px; line-height: 18px; font-variant-numeric: tabular-nums; }
.vl-tab:hover { color: var(--vl-text); }
.vl-tab:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--vl-ring); }
.vl-tab.is-on { color: var(--vl-text); }
.vl-tab.is-on span { background: var(--vl-acc-soft2); color: var(--vl-acc); }
.vl-tab.is-on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--vl-acc); }
.vl-mgr-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px 22px; scrollbar-gutter: stable; }
.vl-mgr form { padding: 0; margin: 0; }   /* общее form { padding: 24px 26px } в style-new.css */

.vl-drop {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border: 1.5px dashed var(--vl-line); border-radius: 14px;
    background: var(--vl-bg2); cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.vl-drop:hover, .vl-drop.is-over { border-color: var(--vl-acc); background: var(--vl-acc-soft); }
.vl-drop.is-over { box-shadow: 0 0 0 4px var(--vl-ring); }
.vl-drop:focus-visible { outline: none; border-color: var(--vl-acc); box-shadow: 0 0 0 3px var(--vl-ring); }
.vl-drop-ic { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--vl-bg); color: var(--vl-acc); box-shadow: inset 0 0 0 1px var(--vl-line); }
.vl-drop-t { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vl-drop-t b { font-size: 14.5px; font-weight: 600; }
.vl-drop-t span { color: var(--vl-muted); font-size: 13px; }
.vl-drop-t u { color: var(--vl-acc); text-decoration: none; font-weight: 600; }
.vl-drop small { flex: 1 1 100%; padding-left: 66px; margin-top: -6px; color: var(--vl-muted); font-size: 12px; }
.vl-mgr-ov.is-file-over .vl-mgr { box-shadow: 0 0 0 3px var(--vl-acc), var(--vl-shadow); }

.vl-ups:not(:empty) { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.vl-up { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border: 1px solid var(--vl-line); border-radius: 12px; background: var(--vl-bg); }
.vl-up.is-err { border-color: color-mix(in srgb, var(--vl-danger) 45%, var(--vl-line)); background: var(--vl-danger-soft); }
.vl-up-ic { flex: none; width: 32px; display: grid; place-items: center; color: var(--vl-danger); }
.vl-up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vl-up-main b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-up-main > span { font-size: 12px; color: var(--vl-muted); font-variant-numeric: tabular-nums; }
.vl-prog { display: block; height: 6px; margin-top: 2px; border-radius: 3px; background: var(--vl-bg2); overflow: hidden; }
.vl-prog i { display: block; height: 100%; border-radius: 3px; background: var(--vl-acc); transition: width .2s ease; }

.vl-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; }
.vl-tools .vl-search { flex: 1 1 240px; height: 38px; }
.vl-list { display: flex; flex-direction: column; }
.vl-lgroup { padding: 6px 0 4px; border-radius: 12px; transition: background .15s ease; }
.vl-lgroup.drop-into { background: var(--vl-acc-soft); box-shadow: inset 0 0 0 1.5px var(--vl-acc); }
.vl-lgroup .vl-gh { margin: 8px 2px 8px; }
.vl-lempty { padding: 14px; border: 1px dashed var(--vl-line); border-radius: 12px; color: var(--vl-muted); font-size: 12.5px; text-align: center; }
.vl-row {
    --bar: var(--vl-acc);
    position: relative; display: grid; grid-template-columns: 24px 112px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
    padding: 9px 10px 9px 8px; margin-bottom: 8px; border: 1px solid var(--vl-line); border-radius: 12px; background: var(--vl-bg);
    transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.vl-row:hover { border-color: color-mix(in srgb, var(--vl-acc) 35%, var(--vl-line)); box-shadow: 0 2px 10px rgba(15, 23, 42, .05); }
.vl-row.is-drag { opacity: .4; }
.vl-row.is-processing, .vl-row.is-failed { padding-left: 12px; }
.vl-row.is-processing::before, .vl-row.is-failed::before {
    content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--bar); pointer-events: none;
}
.vl-row.is-failed { --bar: var(--vl-danger); }
.vl-row.drop-before::after, .vl-row.drop-after::after, .vl-sec.drop-before::after, .vl-sec.drop-after::after {
    content: ''; position: absolute; left: 10px; right: 10px; height: 3px; border-radius: 2px; background: var(--vl-acc); pointer-events: none;
}
.vl-row.drop-before::after, .vl-sec.drop-before::after { top: -6px; }
.vl-row.drop-after::after, .vl-sec.drop-after::after { bottom: -6px; }
.vl-grip {
    display: grid; place-items: center; width: 24px; height: 36px; border-radius: 7px; color: var(--vl-muted); cursor: grab; opacity: .75;
    transition: background .15s ease, opacity .15s ease;
}
.vl-grip:hover, .vl-grip:focus-visible { background: var(--vl-hover); opacity: 1; outline: none; }
.vl-grip:focus-visible { box-shadow: 0 0 0 3px var(--vl-ring); }
.vl-grip:active { cursor: grabbing; }
.vl-grip.is-off { cursor: default; visibility: hidden; }
.vl-rthumb { position: relative; display: block; width: 112px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--vl-thumb); }
.vl-rthumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--vl-line-soft); pointer-events: none; }
.vl-rthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vl-rthumb .vl-dur { bottom: 4px; right: 4px; font-size: 10.5px; line-height: 15px; padding: 0 5px; }
.vl-rthumb .vl-kind { bottom: 4px; left: 4px; font-size: 10.5px; line-height: 15px; padding: 0 5px; }
.vl-rmain { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vl-rmain[data-act], .vl-row.is-open-able { cursor: pointer; }
.vl-rmain b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-rmain[data-act]:hover b { color: var(--vl-acc); }
.vl-rmeta, .vl-rstat { font-size: 12px; color: var(--vl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-rstat { display: flex; align-items: center; gap: 5px; }
.vl-proc { color: var(--vl-acc); font-weight: 600; }
.vl-err { color: var(--vl-danger); font-weight: 600; white-space: normal; }
.vl-aud { justify-self: start; padding: 3px 10px; border-radius: 999px; background: var(--vl-bg2); color: var(--vl-muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; cursor: default; }
.vl-aud.aud-clients { background: var(--vl-aud-c-bg); color: var(--vl-aud-c); }
.vl-aud.aud-leads { background: var(--vl-aud-l-bg); color: var(--vl-aud-l); }
.vl-racts { display: flex; align-items: center; gap: 2px; }
.vl-move { display: none; }
.vl-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 2px 0; color: var(--vl-muted); font-size: 12.5px; line-height: 1.5; }
.vl-note .vl-i { margin-top: 2px; }

/* карточка ролика в окне управления */
.vl-back {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; margin: -4px 0 12px -6px; padding: 0 10px 0 6px; border: 0; border-radius: 8px;
    background: none; color: var(--vl-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.vl-back:hover { background: var(--vl-hover); color: var(--vl-text); }
.vl-back:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--vl-ring); }
.vl-det-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.vl-det-media { position: relative; display: flex; align-items: center; justify-content: center; min-height: 240px; border-radius: 14px; overflow: hidden; background: #05070b; }
.vl-det-media video, .vl-det-media img { display: block; width: 100%; max-height: 56vh; object-fit: contain; background: #05070b; }
.vl-det-media.is-portrait video, .vl-det-media.is-portrait img { max-height: 60vh; }
.vl-det-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 24px; text-align: center; color: rgba(255, 255, 255, .72); font-size: 13px; }
.vl-det-wait b { color: #fff; font-size: 15px; font-weight: 600; }
.vl-det-wait .vl-spin { border-color: rgba(255, 255, 255, .2); border-top-color: #fff; }
.vl-det-wait.is-bad .vl-i { color: #f87171; }
.vl-det-cover:not(:empty) { margin-top: 12px; }
.vl-cover-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--vl-line); border-radius: 12px; background: var(--vl-bg2); flex-wrap: wrap; }
.vl-cover-now { flex: none; width: 72px; aspect-ratio: 16 / 9; border-radius: 7px; overflow: hidden; background: var(--vl-thumb); }
.vl-cover-now img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vl-cover-row > div { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; }
.vl-cover-row > div b { font-size: 13px; font-weight: 600; }
.vl-cover-row > div span { font-size: 12px; color: var(--vl-muted); }
.vl-det-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.vl-det-form .vl-sel { width: 100%; }
.vl-det-info { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--vl-bg2); color: var(--vl-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.vl-det-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vl-grow { flex: 1 1 auto; }

/* разделы */
.vl-secs { max-width: 640px; }
.vl-sec-add { display: flex; gap: 8px; margin-bottom: 14px; }
.vl-sec-add input { flex: 1; }
.vl-sec-list { display: flex; flex-direction: column; gap: 8px; }
.vl-sec { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--vl-line); border-radius: 12px; background: var(--vl-bg); }
.vl-sec-name { height: 34px; border-color: transparent; background: transparent; font-weight: 600; }
.vl-sec-name:hover { border-color: var(--vl-line); }
.vl-sec-n { font-size: 12px; color: var(--vl-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── узкие экраны ── */
/* Ряд кнопок у поля ввода на телефоне не помещался и раньше (поле сжималось в ноль, «Отправить» уезжала за край). С кнопкой
   подборки он переносится: поле ввода — первой строкой во всю ширину, кнопки — под ним, «Отправить» — справа */
@media (max-width: 560px) {
    .chat-input-area:has(.vl-cbtn), .lp-chat-inputrow:has(.vl-cbtn), #salesTab .lp-chat-inputrow:has(.vl-cbtn),
    .adv-inbox-composer form:has(.vl-cbtn), #salesTab .adv-inbox-composer form:has(.vl-cbtn) { flex-wrap: wrap; row-gap: 8px; column-gap: 4px; }
    .chat-input-area:has(.vl-cbtn) > textarea, .lp-chat-inputrow:has(.vl-cbtn) > textarea, #salesTab .lp-chat-inputrow:has(.vl-cbtn) > textarea,
    .adv-inbox-composer form:has(.vl-cbtn) > textarea, #salesTab .adv-inbox-composer form:has(.vl-cbtn) > textarea { order: -1; flex: 1 1 100%; min-width: 0; width: 100%; }
    .chat-input-area:has(.vl-cbtn) > button:not(.chat-send-btn) { flex: 0 0 36px; width: 36px; height: 36px; }
    .lp-chat-inputrow:has(.vl-cbtn) > button:not(.lp-chat-send), #salesTab .lp-chat-inputrow:has(.vl-cbtn) > button:not(.lp-chat-send) { flex: 0 0 36px; width: 36px; height: 36px; justify-content: center; align-items: center; }
    .chat-input-area:has(.vl-cbtn) > .chat-send-btn, .lp-chat-inputrow:has(.vl-cbtn) > .lp-chat-send, #salesTab .lp-chat-inputrow:has(.vl-cbtn) > .lp-chat-send,
    .adv-inbox-composer form:has(.vl-cbtn) > [type="submit"], #salesTab .adv-inbox-composer form:has(.vl-cbtn) > [type="submit"] { margin-left: auto; }
}
@media (max-width: 760px) {
    .vl-pv, .vl-pv.is-portrait { grid-template-columns: 1fr; width: min(560px, 100%); }
    .vl-pv-media { min-height: 0; }
    .vl-pv-media video, .vl-pv-media img { max-height: 46vh; }
    .vl-det-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .vl-ov { padding: 0; align-items: flex-end; }
    .vl-pv, .vl-pv.is-portrait { width: 100%; max-height: 96vh; border-radius: 18px 18px 0 0; }
    .vl-pv-media video, .vl-pv-media img { max-height: 40vh; }
    .vl-pv-side { padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0)); gap: 12px; }
    .vl-pv h3 { font-size: 16.5px; }
    .vl-pv-actions { position: sticky; bottom: 0; background: var(--vl-bg); padding-top: 8px; }
    .vl-pv-actions .vl-btn { flex: 1; }
    .vl-pv-kbd { display: none; }
    .vl-mgr { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    .vl-ov.vl-mgr-ov { align-items: stretch; }
    .vl-mgr-head { padding: 14px 10px 10px 16px; }
    .vl-mgr-ht p { display: none; }
    .vl-mgr-body { padding: 14px 14px 22px; }
    .vl-drop { padding: 14px; gap: 12px; }
    .vl-drop-ic { width: 44px; height: 44px; }
    .vl-drop small { padding-left: 0; margin-top: 0; }
    .vl-tools .vl-sel { flex: 1 1 140px; min-width: 0; }
    .vl-row { grid-template-columns: 84px minmax(0, 1fr) auto; grid-template-areas: 'thumb main acts' 'thumb aud acts'; gap: 4px 10px; padding: 8px; }
    .vl-row .vl-grip { display: none; }
    .vl-row .vl-rthumb { grid-area: thumb; width: 84px; }
    .vl-row .vl-rmain { grid-area: main; }
    .vl-row .vl-aud { grid-area: aud; }
    .vl-row .vl-racts { grid-area: acts; flex-direction: column; }
    /* правка и архив — в карточке ролика: на телефоне она открывается нажатием на строку */
    .vl-row .vl-racts > [data-act="edit"], .vl-row .vl-racts > [data-act="archive"] { display: none; }
    .vl-row .vl-racts .vl-move { flex-direction: column; }
    .vl-row .vl-rstat { display: none; }
    .vl-move { display: flex; }
    .vl-row .vl-racts .vl-iconbtn { width: 34px; height: 32px; }
    .vl-sec { grid-template-columns: 24px minmax(0, 1fr) auto; }
    .vl-sec-n { display: none; }
}
@media (hover: none) { .vl-move { display: flex; } .vl-racts .vl-move { flex-direction: row; } }
@media (prefers-reduced-motion: reduce) {
    .vl-pop, .vl-pv, .vl-mgr, .vl-ov, .vl-backdrop, .vl-pop.is-sheet { animation: none; }
    .vl-thumb, .vl-play, .vl-card:hover .vl-thumb { transition: none; transform: none; }
    .vl-sk .vl-thumb, .vl-sk-line { animation: none; }
}
