/* Модуль «Видеоаналитика»: видеопульт (стена камер, полоса дня, журнал, плеер) и мини-виджеты.
   Тёмные «экраны» камер с линейной сценой, рамки детекций — HTML поверх SVG в процентах viewBox 320×180 */
.vd, .vdf { --nvr: #0d0f14; --nvr-2: #151923; --nvr-line: rgba(173, 190, 230, .16); --nvr-line-2: rgba(173, 190, 230, .08);
    --det: #5b8cff; --det-ok: #34c77b; --det-bad: #ff5d5d; --det-warn: #ffb547; --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.vd-head { max-width: 820px; }
.vd-head .lead { margin-top: 14px; }

.vd-app { margin-top: 36px; border: 1px solid var(--line-card); border-radius: 22px; background: var(--panel); overflow: hidden; }
.vd-bar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 13px; }
.vd-crumb { display: flex; align-items: center; gap: 7px; color: var(--ink-2); min-width: 0; white-space: nowrap; overflow: hidden; }
.vd-crumb b { color: var(--ink); font-weight: 600; }
.vd-crumb i { font-style: normal; color: var(--ph); }
.vd-rec { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: 12px; }
.vd-rec i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: vd-blink 1.4s infinite; }
@keyframes vd-blink { 50% { opacity: .25; } }
.vd-clock { margin-left: auto; font: 600 13px/1 var(--mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }

.vd-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; padding: 14px; }
.vd-wall { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; border-radius: 16px; background: var(--nvr); }

/* Плитка камеры */
.vd-tile, .vd-pl-scr, .vdf-arch { position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden;
    background: radial-gradient(120% 90% at 50% 10%, #1b2130 0%, var(--nvr-2) 55%, #0b0d12 100%); outline: 1.5px solid transparent; outline-offset: -1.5px; transition: outline-color .3s, opacity .3s; }
.vd-tile::after, .vd-pl-scr::after, .vdf-arch::after { content: ''; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px); }
.vd-wall:not(.is-static) .vd-tile:not(.is-on) { opacity: .62; }
.vd-tile.is-on { outline-color: rgba(91, 140, 255, .75); }
.vd-scn { position: absolute; inset: 0; width: 100%; height: 100%; }
.vd-scn .ln, .vdf-room .ln { fill: none; stroke: var(--nvr-line); stroke-width: 1; }
.vd-scn .ln2, .vdf-room .ln2 { fill: none; stroke: var(--nvr-line-2); stroke-width: 1; }
.vd-scn .cab { fill: #232a38; stroke: rgba(173, 190, 230, .22); stroke-width: 1; }
.vd-scn .led { stroke: #5b8cff; stroke-width: 2; stroke-linecap: round; opacity: .8; }
.vd-wall-bg { fill: rgba(120, 150, 210, .06); stroke: var(--nvr-line); }
.vd-gl { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1.4; stroke-dasharray: 4 4; transition: stroke .3s; }
.vd-tile.is-pass .vd-gl, .vd-pl-scr.is-pass .vd-gl { stroke: var(--det-ok); stroke-dasharray: none; stroke-width: 2; }
.vd-gl-t, .vd-zone-t { position: absolute; left: 66%; top: 63%; font: 500 9px/1 var(--mono); color: rgba(255, 255, 255, .45); letter-spacing: .03em; }
.vd-cam { position: absolute; left: 8px; bottom: 7px; margin: 0; display: flex; gap: 6px; align-items: center; font: 500 10.5px/1 var(--font); color: rgba(255, 255, 255, .78); z-index: 3; }
.vd-cam b { font: 600 9.5px/1 var(--mono); padding: 3px 5px; border-radius: 4px; background: rgba(255, 255, 255, .12); color: #fff; display: inline-flex; gap: 4px; align-items: center; }

/* Рамка детекции */
.vd-box { position: absolute; border: 1.6px solid var(--det); border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 0 18px rgba(91, 140, 255, .25); z-index: 2; transition: border-color .25s, opacity .25s; }
.vd-box::before { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: currentColor; color: var(--det); opacity: .9; }
.vd-box.is-ok { border-color: var(--det-ok); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 0 18px rgba(52, 199, 123, .3); }
.vd-box.is-ok::before { color: var(--det-ok); }
.vd-box.is-bad { border-color: var(--det-bad); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 0 18px rgba(255, 93, 93, .35); }
.vd-box.is-bad::before { color: var(--det-bad); }
.vd-box.is-off { opacity: 0; }
.vd-lab { position: absolute; left: -1.6px; bottom: calc(100% + 3px); display: flex; flex-direction: column; gap: 2px; white-space: nowrap; pointer-events: none; }
.vd-lab b { align-self: flex-start; font: 600 10px/1 var(--font); color: #fff; background: var(--det); padding: 3px 5px; border-radius: 3px; }
.vd-box.is-ok .vd-lab b { background: var(--det-ok); }
.vd-box.is-bad .vd-lab b { background: var(--det-bad); }
.vd-lab em { align-self: flex-start; font: 500 9.5px/1 var(--font); font-style: normal; color: #dfe7ff; background: rgba(13, 15, 20, .82); padding: 3px 5px; border-radius: 3px; display: none; align-items: center; gap: 3px; }
.vd-box.show-em .vd-lab em { display: inline-flex; }
.vd-box.is-ok .vd-lab em { color: #b9f2d2; }
.vd-lab-b { bottom: auto; top: calc(100% + 3px); }

/* Лицо */
.vd-face, .vd-crop { position: absolute; z-index: 2; }
.vd-face { --c: var(--det); background:
    linear-gradient(var(--c), var(--c)) top left / 26% 2px no-repeat, linear-gradient(var(--c), var(--c)) top left / 2px 26% no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 26% 2px no-repeat, linear-gradient(var(--c), var(--c)) top right / 2px 26% no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 26% 2px no-repeat, linear-gradient(var(--c), var(--c)) bottom left / 2px 26% no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 26% 2px no-repeat, linear-gradient(var(--c), var(--c)) bottom right / 2px 26% no-repeat; transition: opacity .25s; }
.vd-face i, .vd-crop i { position: absolute; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: #9ec0ff; box-shadow: 0 0 6px #5b8cff; transition: opacity .3s; }
.vd-face.no-lm i { opacity: 0; }
.vd-face.is-off { opacity: 0; }
.vd-tile.is-match .vd-face { --c: var(--det-ok); }
.vd-tile.is-match .vd-face i { background: #a6f0c8; box-shadow: 0 0 6px var(--det-ok); }
.vd-saved { position: absolute; left: 8px; top: 8px; display: inline-flex; gap: 4px; align-items: center; padding: 4px 7px; border-radius: 5px; background: rgba(13, 15, 20, .82); color: #cfe0ff; font: 500 10px/1 var(--font); z-index: 3; opacity: 0; transform: translateY(-4px); transition: .3s; }
.vd-tile.is-match .vd-saved, .vd-tile.is-snap .vd-saved { opacity: 1; transform: none; }
.vd-saved-r { left: auto; right: 8px; color: #ffd0d0; }
.vd-cmp { position: absolute; right: 8px; bottom: 26px; display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 4px 8px; padding: 8px 9px; border-radius: 9px; background: rgba(250, 250, 249, .96); color: var(--ink); z-index: 3; opacity: 0; transform: translateY(6px); transition: .35s; }
.vd-tile.is-match .vd-cmp { opacity: 1; transform: none; }
.vd-cmp-a { display: grid; justify-items: center; gap: 3px; }
.vd-cmp-a small { font-size: 8.5px; color: var(--muted); white-space: nowrap; }
.vd-cmp-eq { color: var(--muted); }
.vd-cmp > b { grid-column: 1 / -1; display: inline-flex; gap: 4px; align-items: center; font-size: 10.5px; font-weight: 600; color: var(--ok); white-space: nowrap; }
.vd-ini { --h: 222; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, hsl(var(--h) 70% 58%), hsl(calc(var(--h) + 40) 65% 45%)); }
.vd-crop { position: relative; display: block; width: 30px; height: 30px; border-radius: 8px; background: #1a2030; outline: 1.5px solid var(--det-ok); outline-offset: -1.5px; }
.vd-crop i { width: 3px; height: 3px; margin: -1.5px; background: #a6f0c8; box-shadow: none; }

/* Вид сверху: зона, след, счётчик */
.vd-zone { fill: rgba(255, 181, 71, .06); stroke: rgba(255, 181, 71, .65); stroke-width: 1.2; stroke-dasharray: 5 4; }
.vd-tile.is-alarm .vd-zone { fill: rgba(255, 93, 93, .14); stroke: var(--det-bad); }
.vd-arrow { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.vd-zone-t { left: 55.5%; top: 72.5%; color: rgba(255, 200, 120, .8); }
.vd-head-box { border-radius: 50%; }
.vd-head-box .vd-lab { left: calc(100% + 4px); bottom: auto; top: 0; }
.vd-trail { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.vd-trail i { position: absolute; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: var(--det); }
.vd-trail.is-bad i { background: var(--det-bad); }
.vd-trail i:nth-child(1) { opacity: .5; } .vd-trail i:nth-child(2) { opacity: .3; } .vd-trail i:nth-child(3) { opacity: .15; }
.vd-count { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; z-index: 3; }
.vd-count span { padding: 4px 7px; border-radius: 5px; background: rgba(13, 15, 20, .82); color: #cfd6e6; font: 500 10px/1 var(--font); }
.vd-count b { font-family: var(--mono); color: #fff; margin-left: 2px; }
.vd-tile.is-alarm .vd-count span:first-child { background: var(--det-bad); color: #fff; }
.vd-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 4; }
.vd-tile.is-flash .vd-flash { animation: vd-flash .5s ease-out; }
@keyframes vd-flash { 0% { opacity: .55; } 100% { opacity: 0; } }

/* Коридор */
.vd-wet { position: absolute; right: 8px; top: 8px; display: inline-flex; gap: 4px; align-items: center; padding: 4px 7px; border-radius: 5px; background: rgba(13, 15, 20, .82); color: #b9d4ff; font: 500 10px/1 var(--font); z-index: 3; }
.vd-feet { position: absolute; left: -12%; right: -12%; bottom: -2px; height: 14%; border: 1.4px dashed var(--det-warn); border-radius: 3px; opacity: 0; transition: opacity .3s; }
.vd-feet span { position: absolute; left: calc(100% + 4px); top: 50%; transform: translateY(-50%); display: none; gap: 3px; align-items: center; white-space: nowrap; padding: 3px 5px; border-radius: 3px; background: var(--det-warn); color: #2b1b00; font: 600 9.5px/1 var(--font); }
.vd-box.show-feet .vd-feet { opacity: 1; }
.vd-box.show-verdict .vd-feet span { display: inline-flex; }

/* Плеер */
.vd-player { position: absolute; inset: 0; z-index: 6; display: grid; grid-template-columns: minmax(0, 1fr) 210px; grid-template-rows: 1fr auto; gap: 10px; padding: 12px; border-radius: 16px; background: rgba(9, 11, 16, .97); opacity: 0; visibility: hidden; transform: scale(.97); transition: opacity .35s, transform .35s, visibility 0s .35s; }
.vd-player.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .35s, transform .35s; }
.vd-pl-scr { aspect-ratio: auto; min-height: 0; }
.vd-pl-scr .vd-cam b { background: var(--det); }
.vd-pl-side { display: flex; flex-direction: column; gap: 8px; color: #cfd6e6; min-width: 0; }
.vd-pl-h { margin: 0; font-size: 11px; color: rgba(255, 255, 255, .55); }
.vd-pl-ev { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.vd-pl-ev li { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; padding: 7px 8px; border-radius: 7px; background: rgba(255, 255, 255, .05); opacity: .45; transition: .3s; }
.vd-pl-ev li.is-on { opacity: 1; }
.vd-pl-ev li.is-me.is-on { background: rgba(52, 199, 123, .16); box-shadow: inset 0 0 0 1px rgba(52, 199, 123, .5); }
.vd-pl-ev time { grid-row: span 2; font: 500 10px/1.4 var(--mono); color: rgba(255, 255, 255, .6); }
.vd-pl-ev b { font-size: 11.5px; color: #fff; font-weight: 600; }
.vd-pl-ev span { font-size: 10.5px; color: rgba(255, 255, 255, .6); }
.vd-more { margin-top: auto; display: inline-flex; gap: 6px; align-items: center; justify-content: center; padding: 8px 10px; border-radius: 8px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 600; transition: transform .15s, background .2s; }
.vd-more.is-press { transform: scale(.94); background: #dfe7ff; }
.vd-more-on { display: inline-flex; gap: 5px; align-items: center; justify-content: center; font-size: 11px; color: #9ff0c4; opacity: 0; transition: opacity .3s; }
.vd-player.is-wide .vd-more-on { opacity: 1; }
.vd-scrub { grid-column: 1 / -1; }
.vd-scrub-t { position: relative; height: 26px; border-radius: 6px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 10%), rgba(255, 255, 255, .06); }
.vd-scrub-clip { position: absolute; left: 0; width: 100%; top: 0; bottom: 0; border-radius: 6px; background: rgba(91, 140, 255, .28); box-shadow: inset 0 0 0 1px rgba(91, 140, 255, .7); transition: left .6s, width .6s; }
.vd-player.is-wide .vd-scrub-clip { left: 46.7%; width: 8.3%; }
.vd-scrub-pass { position: absolute; left: 40%; top: -3px; bottom: -3px; width: 2px; background: var(--det-ok); transition: left .6s; }
.vd-player.is-wide .vd-scrub-pass { left: 50%; }
.vd-scrub-h { position: absolute; left: 0; top: -5px; bottom: -5px; width: 2px; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .7); }
.vd-scrub-h::before { content: ''; position: absolute; left: -4px; top: -2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.vd-scrub-l { display: flex; justify-content: space-between; margin-top: 5px; font: 500 10px/1 var(--mono); color: rgba(255, 255, 255, .5); }

/* Журнал */
.vd-jr { display: flex; flex-direction: column; min-width: 0; padding: 14px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.vd-jr-h { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.vd-jr-h small { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 12px; }
.vd-jr-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.vd-jr-r { --tone: var(--accent); --tone-s: var(--accent-soft); position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 2px 10px; align-items: start; padding: 9px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); margin-top: 8px; max-height: 120px; transition: opacity .35s, transform .35s, box-shadow .3s, max-height .4s, margin .4s, padding .4s; }
.vd-jr-r[data-t="ok"] { --tone: var(--ok); --tone-s: var(--ok-soft); }
.vd-jr-r[data-t="bad"] { --tone: var(--bad); --tone-s: var(--bad-soft); }
.vd-jr-r[data-t="warn"] { --tone: var(--warn); --tone-s: var(--warn-soft); }
.vd-jr-r:not(.is-in) { opacity: 0; transform: translateX(14px); max-height: 0; margin-top: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }
.vd-jr-r.is-seed { opacity: .6; }
.vd-jr-r.is-hot { box-shadow: 0 0 0 2px var(--tone), 0 10px 26px rgba(20, 20, 19, .08); }
.vd-thumb { grid-row: span 2; position: relative; width: 52px; aspect-ratio: 16 / 10; border-radius: 6px; background: linear-gradient(160deg, #1d2433, #0e1118); overflow: hidden; }
.vd-thumb i { position: absolute; left: 38%; top: 22%; width: 22%; height: 58%; border: 1.4px solid var(--tone); border-radius: 2px; filter: brightness(1.35); }
.vd-jr-r[data-t="bad"] .vd-thumb i { box-shadow: 9px 6px 0 -1.4px #0e1118, 9px 6px 0 0 var(--tone); }
.vd-jr-b { min-width: 0; display: grid; gap: 2px; }
.vd-jr-b b { font-size: 12.5px; font-weight: 600; }
.vd-jr-b small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.vd-jr-r time { font: 500 11px/1.4 var(--mono); color: var(--muted); }
.vd-jr-i { grid-column: 3; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--tone-s); color: var(--tone); justify-self: end; }

/* Полоса дня */
.vd-tl { position: relative; margin: 0 14px 14px; padding: 30px 14px 22px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.vd-tl-bars { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.vd-tl-bars i { flex: 1; height: calc(var(--v) * 100%); min-height: 2px; border-radius: 2px 2px 0 0; background: #dfe4ef; }
.vd-tl-axis { position: relative; height: 14px; margin-top: 4px; }
.vd-tl-axis span { position: absolute; transform: translateX(-50%); font: 500 10px/14px var(--mono); color: var(--faint); }
.vd-tl-axis span:first-child { transform: none; }
.vd-tl-axis span:last-child { transform: translateX(-100%); }
.vd-tl-cap { position: absolute; right: 14px; top: 9px; font-size: 11px; color: var(--muted); }
.vd-mk { --tone: var(--ok); position: absolute; top: 24px; height: 46px; transform: translateX(-50%); padding: 0; border: 0; background: none; cursor: pointer; z-index: 2; width: 18px; }
.vd-mk[data-t="bad"] { --tone: var(--bad); }
.vd-mk[data-t="warn"] { --tone: #c98a1a; }
.vd-mk::before { content: ''; position: absolute; left: 50%; top: 6px; bottom: 0; width: 2px; margin-left: -1px; background: var(--tone); opacity: .55; }
.vd-mk i { position: absolute; left: 50%; top: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 3px var(--bg); transition: transform .25s; }
.vd-mk span { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--tone); padding: 2px 7px; border-radius: 99px; background: var(--bg); opacity: .8; transition: .2s; }
.vd-mk:first-of-type span { left: 0; transform: none; }
.vd-mk.is-on i { transform: scale(1.35); box-shadow: 0 0 0 3px var(--bg), 0 0 0 7px color-mix(in srgb, var(--tone) 22%, transparent); }
.vd-mk.is-on span, .vd-mk:hover span { opacity: 1; background: color-mix(in srgb, var(--tone) 12%, var(--bg)); }
.vd-ph { position: absolute; top: 22px; height: 52px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 2px; z-index: 3; pointer-events: none; }
.vd-ph::before { content: ''; position: absolute; left: -5px; top: -4px; border: 6px solid transparent; border-top: 7px solid var(--ink); }

/* Управление */
.vd-ctl { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.vd-steps { flex: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.vd-steps button { position: relative; display: flex; gap: 10px; width: 100%; padding: 10px 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); text-align: left; cursor: pointer; font: inherit; color: inherit; overflow: hidden; transition: border-color .2s, background .2s; }
.vd-steps button:hover { background: var(--hover-soft); }
.vd-steps button.is-on { border-color: var(--ink); }
.vd-st-n { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--chip); font-size: 12px; font-weight: 600; }
.vd-steps button.is-on .vd-st-n, .vd-steps button.is-done .vd-st-n { background: var(--ink); color: #fff; }
.vd-st-t { display: grid; gap: 2px; min-width: 0; }
.vd-st-t b { font-size: 13px; font-weight: 600; }
.vd-st-t small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.vd-st-bar { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--line); }
.vd-st-bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--ink); }
.vd-steps button.is-done .vd-st-bar i { width: 100%; }
.vd-ctl-btns { display: flex; gap: 8px; flex: none; }

/* ───── Виджеты ───── */
.vdf-grid { margin-top: 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.vdf-card { display: flex; flex-direction: column; border: 1px solid var(--line-card); border-radius: 20px; background: var(--bg); overflow: hidden; }
.vdf-card h3 { display: flex; gap: 8px; align-items: center; margin: 20px 22px 8px; font-size: 17px; font-weight: 600; line-height: 1.3; }
.vdf-card h3 .i { flex: none; color: var(--accent); }
.vdf-card > p { margin: 0 22px 22px; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.vdf-vis { position: relative; min-height: 210px; padding: 18px; display: grid; place-items: center; border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #f7f8fb, #f1f3f8); overflow: hidden; }
.vdf-vis::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .55;
    background-image: linear-gradient(rgba(47, 91, 216, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(47, 91, 216, .06) 1px, transparent 1px); background-size: 22px 22px; }
.vdf-vis > * { position: relative; }

/* Поиск по зоне */
.vdf-zone, .vdf-visits { grid-column: span 2; }
.vdf-visits .vdf-vr { grid-template-columns: 48px minmax(0, 1fr); }
.vdf-zone .vdf-vis { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.vdf-arch { width: 100%; }
.vdf-room { position: absolute; inset: 0; width: 100%; height: 100%; }
.vdf-room .lk { fill: rgba(120, 150, 210, .07); stroke: var(--nvr-line); }
.vdf-room .lk-d { fill: rgba(173, 190, 230, .35); }
.vdf-room .bench { fill: #2a3242; stroke: rgba(173, 190, 230, .25); }
.vdf-room .bench-l { stroke: rgba(173, 190, 230, .25); stroke-width: 3; }
.vdf-phones { fill: none; stroke: #e7ecf7; stroke-width: 2.2; stroke-linecap: round; }
.vdf-phones rect { fill: #e7ecf7; stroke: none; }
.vdf-lasso { fill: rgba(255, 181, 71, .12); stroke: var(--det-warn); stroke-width: 1.8; stroke-dasharray: 100; stroke-dashoffset: 0; stroke-linejoin: round; }
.vdf-strip { display: grid; gap: 10px; min-width: 0; width: 100%; }
.vdf-film { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; padding: 5px; border-radius: 8px; background: var(--nvr); overflow: hidden; }
.vdf-film i { aspect-ratio: 3 / 4; border-radius: 2px; background: linear-gradient(180deg, #232a38, #161b26); }
.vdf-film i.is-hit { background: linear-gradient(180deg, #5a4220, #2c2214); box-shadow: inset 0 0 0 1.4px var(--det-warn); }
.vdf-sweep { position: absolute; top: 0; bottom: 0; left: 0; width: 14%; background: linear-gradient(90deg, transparent, rgba(91, 140, 255, .55), transparent); opacity: 0; }
.vdf-prog { margin: 0; font-size: 12px; color: var(--muted); }
.vdf-prog b { font-family: var(--mono); color: var(--ink); }
.vdf-found { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vdf-found li { display: flex; gap: 7px; align-items: center; padding: 7px 10px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.vdf-found li .i { color: var(--warn); }
.vdf-found time { font: 500 11px/1 var(--mono); color: var(--muted); }
.vdf-ba { display: flex; align-items: center; gap: 8px; }
.vdf-ba-i { display: grid; justify-items: center; gap: 2px; }
.vdf-ba-i i { position: relative; width: 46px; height: 30px; border-radius: 5px; background: linear-gradient(180deg, #232a38 62%, #384156 62% 74%, #232a38 74%); }
.vdf-ba-i i.has::after { content: ''; position: absolute; left: 50%; top: 42%; width: 12px; height: 8px; margin-left: -6px; border: 2px solid #e7ecf7; border-bottom: 0; border-radius: 8px 8px 0 0; }
.vdf-ba-i small { font-size: 10.5px; color: var(--muted); }
.vdf-who { margin-left: auto; display: inline-flex; gap: 5px; align-items: center; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }

/* Разные лица */
.vdf-faces .vdf-vis { place-items: stretch; }
.vdf-plot { position: relative; height: 150px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.vdf-plot i { position: absolute; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: #b9c0cf; transition: left 1.2s cubic-bezier(.5, 0, .2, 1), top 1.2s cubic-bezier(.5, 0, .2, 1), background .6s .8s; }
.vdf-plot.is-grouped i.a { background: var(--accent); }
.vdf-plot.is-grouped i.b { background: #e0802a; }
.vdf-plot b { position: absolute; border-radius: 50%; border: 1.5px dashed; opacity: 0; transition: opacity .5s 1.1s; }
.vdf-plot b.a { border-color: rgba(47, 91, 216, .5); background: rgba(47, 91, 216, .05); }
.vdf-plot b.b { border-color: rgba(224, 128, 42, .6); background: rgba(224, 128, 42, .06); }
.vdf-plot.is-grouped b { opacity: 1; }
.vdf-grp { justify-self: start; display: inline-flex; gap: 5px; align-items: center; margin-top: 8px; padding: 5px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; opacity: 0; transform: translateY(4px); transition: .4s; }
.vdf-grp.a { background: var(--accent-soft); color: var(--accent); }
.vdf-grp.b { background: #fdf0e3; color: #b0601a; margin-top: 5px; }
.vdf-faces.is-play .vdf-grp { opacity: 1; transform: none; transition-delay: 1.6s; }
.vdf-faces.is-play .vdf-grp.b { transition-delay: 1.9s; }

/* Ключница */
.vdf-board { position: relative; display: grid; grid-template-columns: repeat(6, 38px); gap: 5px; padding: 10px; border-radius: 10px; background: #2b2f38; box-shadow: inset 0 0 0 2px #3a3f4b; }
.vdf-board i { position: relative; height: 38px; border-radius: 4px; background: #3b414e; transition: box-shadow .3s; }
.vdf-board i small { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font: 600 8px/1 var(--mono); color: rgba(255, 255, 255, .6); }
.vdf-board i::before { content: ''; position: absolute; left: 50%; top: 4px; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: #8b93a5; }
.vdf-board i.has::after { content: ''; position: absolute; left: 50%; top: 7px; width: 9px; height: 17px; margin-left: -4.5px; border-radius: 4px 4px 2px 2px; background: #0b0c0f; box-shadow: 0 0 0 1.5px #14161b; }
.vdf-keys.is-done .vdf-board i.miss { box-shadow: 0 0 0 2px var(--det-bad), 0 0 14px rgba(255, 93, 93, .45); }
.vdf-keys.is-done .vdf-board i.free { box-shadow: 0 0 0 2px var(--det-warn); }
.vdf-scan { position: absolute; left: 6px; right: 6px; top: 6px; height: 3px; border-radius: 3px; background: #7aa2ff; box-shadow: 0 0 12px #5b8cff; opacity: 0; }
.vdf-keys.is-play .vdf-scan { animation: vdf-scan 1.8s ease-in-out 2 forwards; }
@keyframes vdf-scan { 0% { top: 6px; opacity: 1; } 90% { opacity: 1; } 100% { top: calc(100% - 9px); opacity: 0; } }
.vdf-kt, .vdf-kf { display: flex; gap: 6px; margin: 10px 0 0; flex-wrap: wrap; justify-content: center; }
.vdf-kt span, .vdf-kf { display: inline-flex; gap: 4px; align-items: center; padding: 4px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; }
.vdf-kt .c { background: var(--ink); color: #fff; }
.vdf-kt .m { background: var(--bad-soft); color: var(--bad); opacity: 0; transition: opacity .4s; }
.vdf-kf { background: var(--warn-soft); color: var(--warn); margin-top: 6px; opacity: 0; transition: opacity .4s .3s; }
.vdf-keys.is-done .vdf-kt .m, .vdf-keys.is-done .vdf-kf { opacity: 1; }
.vdf-keys .vdf-vis { align-content: center; }

/* Визиты */
.vdf-vrows { width: 100%; display: grid; gap: 8px; }
.vdf-vr { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 4px 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); opacity: 0; transform: translateY(6px); transition: .4s calc(var(--k) * .15s); }
.vdf-visits.is-play .vdf-vr { opacity: 1; transform: none; }
.vdf-vr small { grid-row: span 2; font-size: 11px; color: var(--muted); font-weight: 600; }
.vdf-vt { position: relative; height: 6px; border-radius: 3px; background: var(--chip); }
.vdf-vt i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.vdf-vr[data-flag] .vdf-vt i { background: var(--bad); }
.vdf-vd { display: flex; gap: 5px; align-items: center; font: 500 11px/1 var(--mono); color: var(--ink-2); }
.vdf-vd b { margin-left: auto; font: 600 11px/1 var(--font); color: var(--ink); }
.vdf-vr[data-flag] .vdf-vd b { color: var(--bad); }

/* Кто это? */
.vdf-whois .vdf-vis { grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.vdf-wq { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.vdf-wq .vd-crop { width: 54px; height: 64px; border-radius: 10px; }
.vdf-wq .vd-crop i { width: 4px; height: 4px; margin: -2px; }
.vdf-wl { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.vdf-wl li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 3px 8px; align-items: center; padding: 7px 9px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.vdf-wl li:first-child { border-color: rgba(47, 91, 216, .45); }
.vdf-wl .vd-ini { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; grid-row: span 2; }
.vdf-wl b { font-size: 12.5px; font-weight: 600; }
.vdf-wl em { font: 600 11px/1 var(--mono); font-style: normal; color: var(--ink-2); grid-row: span 2; }
.vdf-sim { height: 4px; border-radius: 2px; background: var(--chip); overflow: hidden; }
.vdf-sim i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--accent); transition: width 1s calc(.3s + var(--k) * .2s) cubic-bezier(.3, 0, .2, 1); }
.vdf-wl li:not(:first-child) .vdf-sim i { background: #b9c0cf; }
.vdf-whois.is-play .vdf-sim i { width: var(--v); }

/* Роли камер */
.vdf-ch { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 6px; }
.vdf-ch li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 30px minmax(70px, auto); gap: 8px; align-items: center; padding: 6px 9px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; }
.vdf-chv { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--nvr); color: #9ec0ff; }
.vdf-tog { position: relative; width: 28px; height: 16px; border-radius: 99px; background: #d9dbe0; transition: background .3s calc(.25s + var(--k) * .22s); }
.vdf-tog i { position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .3s calc(.25s + var(--k) * .22s); }
.vdf-ch em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--accent); justify-self: start; padding: 3px 8px; border-radius: 99px; background: var(--accent-soft); opacity: 0; transition: opacity .3s calc(.4s + var(--k) * .22s); }
.vdf-roles.is-play .vdf-tog { background: var(--ok); }
.vdf-roles.is-play .vdf-tog i { transform: translateX(12px); }
.vdf-roles.is-play .vdf-ch em { opacity: 1; }

/* Журнал просмотров */
.vdf-lg { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 7px; }
.vdf-lg li { display: grid; grid-template-columns: 38px 26px minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); opacity: 0; transform: translateX(-8px); transition: .4s calc(var(--k) * .25s); }
.vdf-log.is-play .vdf-lg li { opacity: 1; transform: none; }
.vdf-lg time { font: 500 11px/1 var(--mono); color: var(--muted); }
.vdf-li { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--chip); color: var(--ink-2); }
.vdf-lg b { display: block; font-size: 12.5px; font-weight: 600; }
.vdf-lg small { font-size: 11.5px; color: var(--muted); }
.vdf-lg .vdf-deny { grid-template-columns: 26px minmax(0, 1fr); background: var(--bad-soft); border-color: transparent; margin-left: 46px; }
.vdf-deny .vdf-li { background: #fff; color: var(--bad); }
.vdf-deny b { color: var(--bad); }

/* ───── Адаптив ───── */
@media (max-width: 1180px) {
    .vd-body { grid-template-columns: 1fr; }
    .vd-steps { grid-template-columns: 1fr 1fr; }
    .vd-ctl { align-items: flex-start; }
    .vd-ctl-btns { flex-direction: column; }
    .vdf-grid { grid-template-columns: 1fr 1fr; }
    .vdf-zone { grid-column: 1 / -1; }
    .vdf-visits { grid-column: auto; }
}
@media (max-width: 760px) {
    .vd-app { border-radius: 16px; margin-top: 24px; }
    .vd-bar { padding: 10px 12px; gap: 8px; }
    .vd-crumb span:nth-of-type(2), .vd-crumb i:nth-of-type(2) { display: none; }
    .vd-body { padding: 10px; gap: 10px; }
    .vd-wall { grid-template-columns: 1fr; padding: 6px; }
    .vd-wall:not(.is-static) .vd-tile:not(.is-on) { display: none; }
    .vd-wall.is-play .vd-tile { display: none; }
    .vd-player { position: relative; inset: auto; display: none; grid-template-columns: 1fr; padding: 8px; }
    .vd-player.is-open { display: grid; }
    .vd-pl-scr { aspect-ratio: 16 / 9; }
    .vd-pl-ev { grid-template-columns: 1fr; }
    .vd-cmp { right: 6px; bottom: 24px; padding: 6px 7px; }
    .vd-jr-r.is-seed { display: none; }
    .vd-tl { margin: 0 10px 10px; padding: 30px 10px 20px; }
    .vd-mk span { display: none; }
    .vd-mk.is-on span { display: block; }
    .vd-mk:first-of-type.is-on span { left: 0; transform: none; }
    .vd-mk:last-of-type.is-on span { left: auto; right: 0; transform: none; }
    .vd-tl-axis span:nth-child(even) { display: none; }
    .vd-ctl { flex-direction: column; align-items: stretch; }
    .vd-steps { grid-template-columns: 1fr 1fr; }
    .vd-steps small { display: none; }
    .vd-ctl-btns { flex-direction: row; }
    .vd-ctl-btns .btn { flex: 1; justify-content: center; }
    .vdf-grid { grid-template-columns: 1fr; }
    .vdf-zone, .vdf-visits { grid-column: auto; }
    .vdf-zone .vdf-vis { grid-template-columns: 1fr; }
    .vdf-card > p { margin: 0 18px 20px; }
    .vdf-card h3 { margin: 18px 18px 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .vd *, .vdf * { transition: none !important; animation: none !important; }
}
