/* TRASSIR Cloud — новый плеер. Светлая тема на дизайн-токенах (assets/tokens.css). */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root, [data-theme="light"] {
  --tree-w: 280px; --bar-h: 64px; --head-h: 64px;
  /* тема-аваре переменные плеера (light) */
  --pl-page: #ffffff; --pl-surface: #f7f7f8; --pl-surface2: #f0f0f2; --pl-elev: #ffffff;
  --pl-border: #e0e1e4; --pl-border-soft: #ececed;
  --pl-text: #1d1f24; --pl-text2: #535967; --pl-text-muted: #818794;
  --pl-accent: #6555f1; --pl-accent-hover: #5649cd; --pl-accent-fg: #ffffff;
  --pl-accent-soft: #f0effe; --pl-accent-soft-fg: #3d3391;
  --pl-video-bg: #141518; --pl-shadow: rgba(20,21,24,.14);
  --pl-on-glass: rgba(255,255,255,.92); --pl-glass: rgba(20,21,24,.45);
  --ring: 0 0 0 3px var(--pl-accent-soft);
}
[data-theme="dark"] {
  --pl-page: #1a1c22; --pl-surface: #141518; --pl-surface2: #23262d; --pl-elev: #23262d;
  --pl-border: #34373f; --pl-border-soft: #2a2d34;
  --pl-text: #f2f3f5; --pl-text2: #a8adb8; --pl-text-muted: #767c89;
  --pl-accent: #8477f4; --pl-accent-hover: #a399f7; --pl-accent-fg: #14112e;
  --pl-accent-soft: #2a2566; --pl-accent-soft-fg: #c1bbfa;
  --pl-video-bg: #000000; --pl-shadow: rgba(0,0,0,.5);
  --pl-on-glass: rgba(35,38,45,.92); --pl-glass: rgba(0,0,0,.5);
  --ring: 0 0 0 3px var(--pl-accent-soft);
}
html, body { height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--pl-elev);
  color: var(--pl-text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.ic.warn { stroke: var(--palette-warning-500); }
.hidden { display: none !important; }
.muted { color: var(--pl-text-muted); }
.err { color: var(--palette-error-500); }

/* ---------- общий layout ---------- */
.player {
  display: grid;
  grid-template-columns: var(--tree-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ---------- дерево ---------- */
.tree-panel {
  display: flex; flex-direction: column;
  background: var(--pl-elev);
  border-right: 1px solid var(--pl-border);
  min-width: 0;
}
.tree-head { padding: 20px 20px 8px; }
.tree-title { font-size: 18px; font-weight: 700; color: var(--pl-text); }
.tree-search-row { display: flex; gap: 8px; padding: 8px 20px 12px; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: 10px; padding: 0 10px; height: 40px; min-width: 0;
}
.search-box:focus-within { border-color: var(--pl-accent); box-shadow: var(--ring); }
.search-box .ic { color: var(--pl-text-muted); width: 18px; height: 18px; flex: none; }
.search-box input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14px; color: var(--pl-text); min-width: 0; }
.search-clear { border: 0; background: transparent; cursor: pointer; color: var(--pl-text-muted); display: flex; padding: 2px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  color: var(--pl-text2); flex: none;
}
.icon-btn:hover { background: var(--pl-surface2); color: var(--pl-text); }
.icon-btn:active { background: var(--pl-border); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.filter-btn { border-color: var(--pl-border); background: var(--pl-surface); }

/* фильтры */
.filters-panel { padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.filter-label { font-size: 13px; font-weight: 600; color: var(--pl-text); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 0; cursor: pointer; padding: 7px 14px; border-radius: 999px;
  background: var(--pl-accent-soft); color: var(--pl-accent-soft-fg);
  font-size: 13px; font-weight: 500;
}
.chip:hover { background: var(--pl-accent-soft); }
.chip.active { background: var(--pl-accent); color: #fff; }

/* tree list */
.tree-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.tree-node { user-select: none; }
.tree-row {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px;
  border-radius: 8px; cursor: pointer; position: relative; color: var(--pl-text);
}
.tree-row:hover { background: var(--pl-surface); }
.tree-row.selected { background: var(--pl-accent-soft); }
.tree-row.selected::before { content: ""; position: absolute; left: -8px; top: 3px; bottom: 3px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pl-accent); }
.tree-caret { width: 16px; height: 16px; color: var(--pl-text-muted); flex: none; transition: transform .15s; }
.tree-node.collapsed > .tree-row .tree-caret { transform: rotate(-90deg); }
.tree-caret.leaf { visibility: hidden; }
.tree-ic, .tree-caret { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tree-ic { width: 18px; height: 18px; flex: none; color: var(--pl-text-muted); }
.tree-ic.cam-on { color: var(--palette-success-400); }
.tree-ic.cam-off { color: var(--palette-error-400); }
.tree-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.tree-name mark { background: var(--palette-yellow-400); color: #1d1f24; border-radius: 2px; padding: 0 1px; }
.tree-folder { position: relative; display: inline-flex; flex: none; }
.tree-count { position: absolute; top: -5px; right: -6px; font-size: 9px; font-weight: 700; color: #fff; background: var(--pl-accent); border-radius: 999px; min-width: 14px; height: 14px; padding: 0 3px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 0 0 2px var(--pl-elev); }
.tree-badge-warn { width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--palette-warning-500); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.tree-copy { width: 26px; height: 26px; border-radius: 6px; display: none; align-items: center; justify-content: center; color: var(--pl-text-muted); flex: none; }
.tree-row:hover .tree-copy, .tree-row.selected .tree-copy { display: inline-flex; }
.tree-children { padding-left: 18px; }
.tree-node.collapsed > .tree-children { display: none; }

/* ---------- панель тарифа ---------- */
.tariff-overlay { position: fixed; inset: 0; background: rgba(10,11,14,.55); z-index: 60; display: flex; align-items: center; justify-content: center; }
.tariff-panel { position: relative; width: min(520px, 94vw); max-height: 86vh; display: flex; flex-direction: column; background: var(--pl-elev); border: 1px solid var(--pl-border); border-radius: 16px; box-shadow: 0 20px 48px var(--pl-shadow); overflow: hidden; }
.tp-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--pl-border); }
.tp-title { font-size: 16px; font-weight: 700; color: var(--pl-text); }
.tp-body { padding: 14px 16px; overflow: auto; min-height: 0; }
.tp-loading { color: var(--pl-text-muted); font-size: 13px; padding: 8px 0; }
.tp-current { background: var(--pl-surface); border: 1px solid var(--pl-border); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.tp-cur-name { font-size: 14px; font-weight: 700; color: var(--pl-text); display: flex; align-items: center; gap: 8px; }
.tp-cur-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tp-cur-status.on { background: var(--bg-success-soft-default); color: var(--palette-success-400); }
.tp-cur-status.off { background: var(--bg-error-soft-default); color: var(--palette-error-400); }
.tp-cur-sub { font-size: 12px; color: var(--pl-text-muted); margin-top: 4px; }
.tp-balance { font-size: 13px; color: var(--pl-text); margin: 0 0 12px; }
.tp-balance b { font-weight: 700; }
.tp-sub { font-size: 13px; font-weight: 700; color: var(--pl-text); margin-bottom: 8px; }
.tp-search { width: 100%; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--pl-border); background: var(--pl-surface); color: var(--pl-text); font-size: 13px; margin-bottom: 8px; }
.tp-search:focus { outline: none; border-color: var(--pl-accent); }
.tp-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; }
.tp-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.tp-item:hover { background: var(--pl-surface); }
.tp-item.sel { background: var(--pl-accent-soft); border-color: var(--pl-accent); }
.tp-item.cur { opacity: .75; cursor: default; }
.tp-cur-badge { font-size: 10px; font-weight: 700; color: var(--pl-accent); background: var(--pl-accent-soft); border-radius: 999px; padding: 1px 6px; margin-left: 6px; }
.tp-item-name { flex: 1; font-size: 13px; color: var(--pl-text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-item-meta { font-size: 12px; color: var(--pl-text-muted); flex: none; }
.tp-item-price { font-size: 13px; font-weight: 700; color: var(--pl-text); flex: none; min-width: 84px; text-align: right; }
.tp-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--pl-border); }
.tp-confirm { position: absolute; inset: 0; background: var(--pl-elev); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; z-index: 2; }
.tp-confirm-text { font-size: 14px; color: var(--pl-text); text-align: center; line-height: 1.5; }
.tp-confirm-btns { display: flex; gap: 10px; }

/* ---------- сцена ---------- */
/* min-height:0 на сцене И видео-области — иначе строка видео (1fr) с min-height:auto растёт под
   натуральный размер кадра/видео при загрузке канала и ВЫДАВЛИВАЕТ панель управления вниз/за экран. */
.stage { display: grid; grid-template-rows: var(--head-h) minmax(0, 1fr) auto auto; min-width: 0; min-height: 0; height: 100vh; background: var(--pl-elev); overflow: hidden; }

/* шапка */
.stage-head {
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  border-bottom: 1px solid var(--pl-border); min-width: 0;
}
.head-cam { display: flex; align-items: center; gap: 10px; min-width: 0; }
.head-cam-ic { width: 36px; height: 36px; border-radius: 9px; background: var(--bg-success-soft-default); display: flex; align-items: center; justify-content: center; color: var(--palette-success-400); flex: none; }
.head-cam-ic.off { background: var(--bg-error-soft-default); color: var(--palette-error-400); }
.head-cam-text { min-width: 0; }
.head-cam-name { font-size: 15px; font-weight: 700; color: var(--pl-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-cam-sub { font-size: 12px; color: var(--pl-text-muted); }
.head-banner {
  display: flex; align-items: center; gap: 8px; margin: 0 auto;
  background: var(--bg-warning-soft-default); border: 1px solid var(--border-warning-soft);
  border-radius: 10px; padding: 6px 10px; font-size: 13px; color: var(--pl-text);
  min-width: 0; overflow: hidden;
}
#banner-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-actions { flex: none; }
@media (max-width: 1200px) { .head-banner { display: none; } }
.head-banner .ic { width: 18px; height: 18px; }
.banner-ic { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--palette-warning-500); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.banner-link { color: var(--pl-accent-hover); font-weight: 600; text-decoration: underline; cursor: pointer; }
.banner-x { border: 0; background: transparent; cursor: pointer; color: var(--pl-text-muted); display: flex; }
.banner-x .ic { width: 16px; height: 16px; }
.head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border-radius: 10px; padding: 0 14px; height: 38px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.btn .ic { width: 16px; height: 16px; }
.btn-soft { background: var(--pl-surface); border-color: var(--pl-border); color: var(--pl-text); }
.btn-soft:hover { background: var(--pl-surface2); }
.btn-primary { background: var(--pl-accent); color: #fff; }
.btn-primary:hover { background: var(--pl-accent-hover); }
.btn-outline { background: transparent; border-color: var(--pl-accent); color: var(--pl-accent-hover); }
.btn-outline:hover { background: var(--pl-accent-soft); }
.btn-block { width: 100%; justify-content: center; height: 40px; }
.close-btn { color: var(--pl-accent); border: 1px solid var(--pl-border); }
.close-btn:hover { background: var(--pl-accent-soft); }
#btn-fav.active { color: var(--palette-warning-500); }
#btn-fav.active .ic { fill: var(--palette-warning-400); }

/* видео */
.video-area { position: relative; background: var(--pl-video-bg); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; }
.video-el { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.arc-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 1; }
.arc-frame-spin { position: absolute; top: 12px; right: 12px; z-index: 2; }
/* календарь-поповер */
.cal-pop { position: absolute; bottom: 56px; left: 0; background: var(--pl-elev); border: 1px solid var(--pl-border); border-radius: 14px; box-shadow: 0 12px 32px var(--pl-shadow); padding: 12px; z-index: 20; min-width: 264px; }
.time-pop-row { display: flex; gap: 8px; align-items: center; }
#time-input { width: 110px; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--pl-border); background: var(--pl-surface); color: var(--pl-text); font-size: 14px; font-weight: 600; text-align: center; }
#time-input:focus { outline: none; border-color: var(--pl-accent); }
.time-pop-hint { margin-top: 8px; font-size: 11px; color: var(--pl-text-muted); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { font-weight: 600; font-size: 14px; color: var(--pl-text); }
.cal-nav { border: 0; background: transparent; cursor: pointer; color: var(--pl-text2); font-size: 20px; line-height: 1; width: 30px; height: 30px; border-radius: 8px; }
.cal-nav:hover { background: var(--pl-surface2); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 11px; color: var(--pl-text-muted); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-cell { border: 0; background: transparent; aspect-ratio: 1; border-radius: 9px; font-size: 13px; color: var(--pl-text-muted); display: flex; align-items: center; justify-content: center; position: relative; padding: 0; }
.cal-cell.empty { visibility: hidden; }
.cal-cell.has { color: var(--pl-text); cursor: pointer; font-weight: 600; }
.cal-cell.has::after { content: ""; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--pl-accent); }
.cal-cell.has:hover { background: var(--pl-surface2); }
.cal-cell.sel { background: var(--pl-accent); color: #fff; }
.cal-cell.sel::after { background: #fff; }
.cal-cell:disabled { cursor: default; opacity: .35; }
.video-area.state .video-el { visibility: hidden; }
.video-area.state { background: var(--pl-surface2); }
.video-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.state-text { font-size: 15px; font-weight: 600; color: var(--pl-text2); }
.state-text.err { color: var(--palette-error-500); }
.ic-big { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--pl-text-muted); }
.ic-big.err { color: var(--palette-error-400); }
.spinner-dots { display: flex; gap: 6px; }
.spinner-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--pl-accent); animation: bounce 1.2s infinite ease-in-out; }
.spinner-dots span:nth-child(2) { animation-delay: .15s; }
.spinner-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,80%,100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.unmute-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer; }

/* тосты */
.toast-stack { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 15; }   /* выше settings-menu (10): тост не прячется под меню */
.toast { display: flex; align-items: center; gap: 12px; background: var(--pl-elev); border: 1px solid var(--pl-border); border-radius: 12px; padding: 14px 16px; box-shadow: 0 8px 24px var(--pl-shadow); min-width: 280px; }
.toast-ic { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.toast-ic.ok { background: var(--bg-success-soft-default); color: var(--palette-success-400); }
.toast-ic.err { background: var(--bg-error-soft-default); color: var(--palette-error-400); }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: 14px; color: var(--pl-text); }
.toast-sub { font-size: 12px; color: var(--pl-text-muted); margin-top: 2px; }
.toast-spin { width: 26px; height: 26px; border: 3px solid var(--pl-accent-soft); border-top-color: var(--pl-accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast .btn-outline { height: 32px; padding: 0 12px; }
.toast-x { border: 0; background: transparent; cursor: pointer; color: var(--pl-text-muted); display: flex; }

/* ---------- timeline ---------- */
.timeline-wrap { padding: 8px 16px 0; background: var(--pl-elev); }
.tl-ruler { position: relative; height: 18px; font-size: 11px; color: var(--pl-text-muted); }
.tl-ruler .tl-tick { position: absolute; top: 0; transform: translateX(-50%); }
.tl-ruler .tl-tick::after { content: ""; position: absolute; left: 50%; top: 14px; width: 1px; height: 5px; background: var(--pl-border); }
.tl-ruler .tl-tick.minor::after { top: 16px; height: 3px; opacity: .6; }
.tl-ruler .tl-tick.edge-l { transform: translateX(0); }
.tl-ruler .tl-tick.edge-r { transform: translateX(-100%); }
/* overflow:visible — чтобы тултип курсора/ховера (над треком) не обрезался; сегменты клипуем в .tl-rec */
.tl-track { position: relative; height: 44px; background: var(--pl-surface2); border-radius: 8px; overflow: visible; cursor: pointer; }
.tl-layer { position: absolute; left: 0; right: 0; }
.tl-rec { top: 0; bottom: 0; overflow: hidden; border-radius: 8px; }
.tl-rec .seg { position: absolute; top: 0; bottom: 0; background: var(--pl-accent); }
/* две дорожки индикации (как в Figma): жёлтая (звук) сверху, красная (детекция) снизу */
.tl-motion { top: 0; height: 50%; }
.tl-motion .seg { position: absolute; top: 2px; bottom: 1px; background: var(--palette-yellow-400); border-radius: 2px; }
.tl-events { top: 50%; bottom: 0; }
.tl-events .seg { position: absolute; top: 1px; bottom: 2px; background: var(--palette-error-500); border-radius: 2px; }
.tl-cursor { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--pl-accent-soft-fg); z-index: 3; }
.tl-cursor::after { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--pl-accent-soft-fg); }
.tl-cursor-tip { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; background: var(--pl-accent); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.tl-hover-tip { position: absolute; bottom: 100%; margin-bottom: 6px; transform: translateX(-50%); background: var(--pl-text); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.tl-sel { position: absolute; top: 0; bottom: 0; background: var(--pl-accent-soft); border: 1px solid var(--pl-accent); z-index: 2; }
.tl-handle { position: absolute; top: 0; bottom: 0; width: 12px; background: var(--pl-accent); cursor: ew-resize; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px var(--pl-elev), 0 2px 6px rgba(0,0,0,.4); }
.tl-handle::after { content: ""; width: 2px; height: 18px; background: #fff; border-radius: 2px; box-shadow: 2px 0 0 #fff, -2px 0 0 #fff; }
/* ручки снаружи выделения — при коротком интервале не слипаются в один комок */
.tl-h-l { left: -13px; border-radius: 4px 0 0 4px; }
.tl-h-r { right: -13px; border-radius: 0 4px 4px 0; }

/* ---------- панель управления ---------- */
/* wrap: на узких окнах (ноутбуки 1280/1366, попап) панель переносится на 2 ряда,
   а не обрезается за краем экрана (мин-контент архивного ряда ~968px) */
.control-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: var(--bar-h); padding: 4px 16px; }
.cb-left { display: flex; align-items: center; gap: 10px; position: relative; }
.cb-center { display: flex; align-items: center; gap: 8px; margin: 0 auto; }
.cb-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
@media (max-width: 1360px) {
  .control-bar { gap: 6px 8px; padding: 4px 10px; }
  .cb-pill { padding: 0 8px; font-size: 12px; }
  .vol-slider { width: 64px; }
}
.mode-toggle { display: inline-flex; background: var(--pl-surface); border: 1px solid var(--pl-border); border-radius: 999px; padding: 3px; }
.mode-btn { border: 0; background: transparent; cursor: pointer; padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--pl-text2); }
.mode-btn.active { background: var(--pl-accent); color: #fff; }
.arc-disabled { opacity: .35; pointer-events: none; }
.filter-btn.active { background: var(--pl-accent-soft); color: var(--pl-accent); }
.cb-pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--pl-border); background: var(--pl-surface); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--pl-text); }
.cb-pill:hover { background: var(--pl-surface2); }
.cb-pill .ic { width: 16px; height: 16px; color: var(--pl-text-muted); }
.cb-play { background: var(--pl-border); border: 1px solid var(--pl-border); color: var(--pl-text); }
.speed-pill { min-width: 44px; justify-content: center; }
.export-range { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--pl-text); white-space: nowrap; }
.exp-dt { white-space: nowrap; }
.exp-presets { display: inline-flex; gap: 4px; margin-left: 8px; }
.exp-preset { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--pl-border); background: var(--pl-surface); color: var(--pl-text2); font-size: 12px; font-weight: 600; cursor: pointer; }
.exp-preset:hover { border-color: var(--pl-accent); color: var(--pl-accent); }
.exp-dt { display: inline-flex; align-items: center; gap: 6px; }
.exp-dt .ic { width: 15px; height: 15px; color: var(--pl-text-muted); }
.exp-dash { color: var(--pl-text-muted); }
.zoom-ctl { display: inline-flex; align-items: center; gap: 4px; background: var(--pl-surface); border: 1px solid var(--pl-border); border-radius: 10px; padding: 4px 6px; }
.zoom-label { font-size: 12px; font-weight: 600; color: var(--pl-text2); min-width: 34px; text-align: center; }
.vol-ctl { display: inline-flex; align-items: center; gap: 4px; }
.vol-slider { width: 88px; height: 20px; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.vol-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: var(--pl-border); }
.vol-slider::-moz-range-track { height: 4px; border-radius: 999px; background: var(--pl-border); }
.vol-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--pl-accent); margin-top: -5px; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.vol-slider::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--pl-accent); }
.vol-slider::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--pl-accent); }
.settings-wrap { position: relative; }
.settings-btn { position: relative; overflow: visible; }
.hq-badge { position: absolute; top: 2px; right: 2px; font-size: 8px; font-weight: 700; background: var(--pl-accent); color: #fff; border-radius: 4px; padding: 1px 3px; line-height: 1; }
.settings-menu { position: absolute; right: 0; bottom: 48px; background: var(--pl-elev); border: 1px solid var(--pl-border); border-radius: 14px; box-shadow: 0 12px 32px var(--pl-shadow); padding: 8px; min-width: 244px; z-index: 10; }
.set-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; cursor: default; padding: 10px 10px; border-radius: 10px; font-size: 14px; color: var(--pl-text); }
.set-row.set-nav { cursor: pointer; }
.set-row.set-nav:hover { background: var(--pl-surface2); }
.set-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--pl-text2); }
.set-ic.badge { display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; background: var(--pl-text); color: var(--pl-elev); border-radius: 4px; width: 22px; height: 16px; stroke: none; }
.set-label { flex: 1; }
.set-val { color: var(--pl-text-muted); font-size: 13px; }
.set-arrow { width: 16px; height: 16px; fill: none; stroke: var(--pl-text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.set-arrow.back { stroke: var(--pl-text2); width: 18px; height: 18px; }
/* тоггл */
.set-toggle { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; }
.set-toggle input { position: absolute; opacity: 0; }
.set-sw { position: absolute; inset: 0; background: var(--pl-border); border-radius: 999px; transition: background .15s; }
.set-sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .15s; }
.set-toggle input:checked + .set-sw { background: var(--pl-accent); }
.set-toggle input:checked + .set-sw::after { transform: translateX(18px); }
/* подменю */
.set-page.hidden { display: none; }
.set-back { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; cursor: pointer; padding: 8px 8px; font-size: 13px; font-weight: 700; color: var(--pl-text); margin-bottom: 4px; }
.set-check { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; }
.set-check:hover { background: var(--pl-surface2); }
.set-check input { margin-left: auto; accent-color: var(--pl-accent); width: 18px; height: 18px; }
.set-dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.set-dot.red { background: var(--palette-error-500); }
.set-dot.yellow { background: var(--palette-yellow-500); }
.set-opt { display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 10px; border-radius: 10px; font-size: 13px; color: var(--pl-text); }
.set-opt:hover { background: var(--pl-surface2); }
.set-opt.active { background: var(--pl-accent-soft); color: var(--pl-accent-soft-fg); font-weight: 600; }

/* PTZ */
.ptz-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.ptz-joy { position: absolute; left: 28px; bottom: 28px; width: 132px; height: 132px; pointer-events: auto; }
.ptz-joy button { position: absolute; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(20,21,24,.45); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.ptz-joy button:hover { background: rgba(20,21,24,.7); }
.ptz-joy .up { left: 46px; top: 0; } .ptz-joy .down { left: 46px; bottom: 0; }
.ptz-joy .left { left: 0; top: 46px; } .ptz-joy .right { right: 0; top: 46px; }
.ptz-joy .home { left: 46px; top: 46px; background: rgba(20,21,24,.6); }
.ptz-joy .ic { width: 18px; height: 18px; }
.ptz-tools { position: absolute; right: 28px; bottom: 28px; display: flex; gap: 10px; pointer-events: auto; }
.ptz-tool { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: rgba(20,21,24,.45); color: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; font-size: 11px; backdrop-filter: blur(4px); }
.ptz-tool:hover, .ptz-tool.active { background: var(--pl-accent); }
.ptz-tool .ic { width: 22px; height: 22px; }

/* fullscreen */
.video-area:fullscreen { background: #000; }

@media (max-width: 720px) {
  .player { grid-template-columns: 1fr; }
  .tree-panel { display: none; }
}
