/* Webový klient VMS. Od 3.2.0 rovnaký základ ako správa (vms/web/style.css): tie isté premenné farieb, tlačidlá,
   ponuky, dialógy a hlásenia, ikony z ikony.js. Klient je len tmavý. Mimo :root nie je v štýloch farba napevno
   (farby kreslené skriptom na plátno – os záznamu, mapa – prídu na rad v ďalších etapách). */
:root {
  /* spoločné so správou */
  --bg: #1b1d21; --surface: #24272c; --raise: #2a2e34; --line: #33373d; --text: #e6e7e9; --muted: #9aa0a6;
  --accent: #5c8dd6; --accent-hover: #6d9be0; --on-accent: #fff; --input: #1b1d21;
  --ok: #3fa34d; --warn: #d9a441; --bad: #d05050; --gray: #6f7680;
  --ok-fg: #7bd389; --warn-fg: #ecc572; --bad-fg: #f08a8a; --info-fg: #a3c3f1; --gray-fg: #b3b9c1;
  --ok-bg: rgba(63, 163, 77, .16); --warn-bg: rgba(217, 164, 65, .15); --bad-bg: rgba(208, 80, 80, .16);
  --info-bg: rgba(92, 141, 214, .18); --gray-bg: rgba(154, 160, 166, .15);
  --logo-a: #4a7fd0; --logo-b: #2fa6a0; --on-logo: #fff;
  --shadow: 0 8px 24px rgba(0, 0, 0, .45);
  --backdrop: rgba(0, 0, 0, .55);
  --radius: 10px;
  /* klient navyše: plocha za obrazom kamier (veľmi tmavá), obraz, text na farebnom podklade, mapa */
  --stage: #0d0f12; --stage-line: #17191d; --video: #000; --on-color: #111; --map-bg: #2b2f36; --logo-lens: #2d5fa8;
  /* os záznamu (3.2.2): pozadie, budúcnosť, pás udalostí, ryska, popisy, záznam (bez / s udalosťou), poloha, značka
     udalosti z panela, výber úseku; druhy udalostí – tie isté farby v legende nad osou */
  --tl-bg: #16191d; --tl-future: #0f1114; --tl-lane: #1e2227; --tl-grid: #30353c; --tl-text: #9aa0a6;
  --tl-rec: #3fa34d; --tl-rec-ev: #c98a2b; --tl-pos: #7fb0ff; --tl-pos-text: #0d1420; --tl-mark: #f0c419;
  --tl-sel: rgba(92, 141, 214, .28); --tl-sel-edge: #a3c3f1; --tl-hover: rgba(255, 255, 255, .45);
  --tl-shade: rgba(20, 23, 27, .9); --tl-alarm-cap: #f3f4f6;
  --ev-motion: #e08a1e; --ev-smart: #e255a7; --ev-alarm: #e5534b; --ev-other: #9aa4b1; --ev-videoloss: #9aa4b1;
  /* mapa (3.2.3): podklad, odkazy na budovy, výber, výsek kamery (online / offline / alarm), kamery, štítky */
  --map-img-bg: #3c4048; --map-link: #f0b429; --map-link-text: #1b1d21; --map-sel: var(--accent);
  --map-cone: var(--accent); --map-cone-off: #8a9099; --map-alarm: #e5534b; --map-cam-on: var(--ok); --map-cam-off: var(--bad);
  --map-cam-none: #8a9099; --map-cam-ring: #ffffff; --map-cam-icon: #ffffff; --map-label-bg: rgba(20, 23, 27, .86);
  --map-label-fg: #e6e7e9; --map-label-border: rgba(255, 255, 255, .14); --map-pop-line: var(--accent); --map-handle-edge: #ffffff;
  --map-text-shade: rgba(0, 0, 0, .65);
  /* vzorka „záznam s udalosťou“ v legende záznamu – šrafovanie */
  --tl-hatch: rgba(0, 0, 0, .3);
  /* staršie mená (2.x) – rovnaké farby ako nové */
  --panel: var(--surface); --panel2: var(--raise);
  /* priesvitné odtiene (nad obrazom, zvýraznenia, prihlásenie) */
  --accent-a-06: rgba(92, 141, 214, .06); --accent-a-08: rgba(92, 141, 214, .08); --accent-a-15: rgba(92, 141, 214, .15);
  --accent-a-18: rgba(92, 141, 214, .18); --accent-a-20: rgba(92, 141, 214, .2); --accent-a-25: rgba(92, 141, 214, .25);
  --accent-a-35: rgba(92, 141, 214, .35); --accent-a-38: rgba(92, 141, 214, .38); --accent-a-45: rgba(92, 141, 214, .45);
  --accent-a-55: rgba(92, 141, 214, .55); --accent-a-75: rgba(92, 141, 214, .75);
  --bad-a-12: rgba(208, 80, 80, .12); --bad-a-35: rgba(208, 80, 80, .35); --bad-a-55: rgba(208, 80, 80, .55);
  --bad-a-80: rgba(208, 80, 80, .8); --bad-a-85: rgba(208, 80, 80, .85);
  --ok-a-35: rgba(63, 163, 77, .35); --ok-a-45: rgba(63, 163, 77, .45); --ok-a-60: rgba(63, 163, 77, .6);
  --warn-a-45: rgba(217, 164, 65, .45); --logo-b-a-13: rgba(47, 166, 160, .13);
  --glass-60: rgba(20, 23, 27, .6); --glass-74: rgba(20, 23, 27, .74); --glass-80: rgba(20, 23, 27, .8);
  --glass-90: rgba(20, 23, 27, .9); --glass-92: rgba(20, 23, 27, .92); --glass-96: rgba(20, 23, 27, .96);
  --glass-97: rgba(20, 23, 27, .97);
  --light-045: rgba(255, 255, 255, .045); --light-05: rgba(255, 255, 255, .05); --light-07: rgba(255, 255, 255, .07);
  --light-08: rgba(255, 255, 255, .08); --light-09: rgba(255, 255, 255, .09); --light-12: rgba(255, 255, 255, .12);
  --light-13: rgba(255, 255, 255, .13); --light-15: rgba(255, 255, 255, .15); --light-18: rgba(255, 255, 255, .18);
  --light-22: rgba(255, 255, 255, .22); --light-35: rgba(255, 255, 255, .35); --light-40: rgba(255, 255, 255, .4);
  --light-55: rgba(255, 255, 255, .55);
  --shade-22: rgba(0, 0, 0, .22); --shade-35: rgba(0, 0, 0, .35); --shade-40: rgba(0, 0, 0, .4);
  --shade-45: rgba(0, 0, 0, .45); --shade-50: rgba(0, 0, 0, .5); --shade-55: rgba(0, 0, 0, .55);
  --shade-60: rgba(0, 0, 0, .6); --shade-65: rgba(0, 0, 0, .65); --shade-70: rgba(0, 0, 0, .7);
  --shade-72: rgba(0, 0, 0, .72); --shade-80: rgba(0, 0, 0, .8); --shade-82: rgba(0, 0, 0, .82);
  --shade-85: rgba(0, 0, 0, .85);
  /* prihlásenie: tmavomodré „okná kamier“ v pozadí */
  --login-070a10: #070a10; --login-0b111b: #0b111b; --login-0c121a: #0c121a; --login-0d131c: #0d131c;
  --login-0e1520: #0e1520; --login-0f1620: #0f1620; --login-111923: #111923; --login-121b27: #121b27;
  --login-131c29: #131c29; --login-142030: #142030; --login-18232f: #18232f; --login-1a2532: #1a2532;
  --login-1c2839: #1c2839; --login-1f2e43: #1f2e43; --login-213044: #213044; --login-26394d: #26394d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 13px/1.35 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
}
/* --- ikony (ikony.js: icon(), data-icon) ------------------------------------------------------------------------- */
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
       stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.vis-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* --- tlačidlá, výbery, polia (ako správa: výška ~30 bodov, zaoblenie 6; na dotyk 40) --------------------------------- */
button, select, input, textarea { font: inherit; color: var(--text); }
button, select {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer;
  line-height: 1.35;
}
header button, .pop-menu > button, .dlg-btns button, .banner button, button.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
button:hover { border-color: var(--accent); }
select:hover { border-color: var(--gray); }
button.primary, .primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger:not(.primary) { color: var(--bad-fg); border-color: var(--bad); }
button.danger:not(.primary):hover { background: var(--bad-bg); }
button.ghost { background: none; border-color: transparent; }
button.ghost:hover { background: var(--raise); border-color: var(--line); }
button.icon-btn { width: 30px; height: 30px; padding: 0; flex: none; }
button:disabled, button:disabled:hover { opacity: .45; cursor: default; border-color: var(--line); }
button.primary:disabled { border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
/* --- horná lišta: jeden riadok; popisy tlačidiel sa pri užšom okne skryjú (ostanú ikony a popis pod myšou) -------- */
header {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; min-height: 44px;
  background: var(--surface); border-bottom: 1px solid var(--line); font-size: 13.5px; position: relative; z-index: 20;
}
header .sp { flex: 1 1 0; min-width: 4px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin-right: 6px;
  white-space: nowrap; }
.logo { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--logo-a), var(--logo-b)); color: var(--on-logo); flex: none; }
.logo .ico { width: 16px; height: 16px; vertical-align: 0; }
.seg { display: inline-flex; flex: none; }
.seg button { border-radius: 0; margin-left: -1px; min-width: 32px; }
.seg button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.seg button:last-child { border-radius: 0 6px 6px 0; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); position: relative; }
.pager { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.pager span { color: var(--muted); min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.caps b.ok { color: var(--ok-fg); } .caps b.bad { color: var(--bad-fg); } .caps b.warn { color: var(--warn-fg); }
.mob-only { display: none !important; }
.row-break { display: none; }
header .caret { display: inline-flex; color: var(--muted); margin: 0 -3px 0 -2px; }
header .caret .ico { width: 14px; height: 14px; }
header .vol-ico { display: inline-flex; color: var(--ok-fg); }
.diag-caps { color: var(--muted); }
.diag-dlg td.diag-line { font-size: 12px; color: var(--muted); }
dialog.diag-dlg { width: min(560px, calc(100vw - 32px)); }
.hd-btn { flex: none; }
/* ponuky z lišty: Zobrazenie, meno (používateľ), podrobnosti výpadku NVR */
.menu.pop-menu { min-width: 250px; padding: 6px; gap: 2px; font-size: 13.5px; }
.pop-menu .mi-hd { color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 8px 2px; }
.pop-menu .mi-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px;
  padding: 4px 8px; color: var(--text); }
.pop-menu .mi-row select { width: 160px; }
.pop-menu label.chk { padding: 6px 8px; border-radius: 6px; }
.pop-menu label.chk:hover { background: var(--raise); }
.pop-menu > button, .pop-menu > a { justify-content: flex-start; gap: 10px; }
.pop-menu > a { display: flex; align-items: center; padding: 6px 10px; border-radius: 6px; color: var(--text);
  text-decoration: none; }
.pop-menu > a:hover { background: var(--raise); }
.pop-menu .ico { color: var(--muted); }
.user-menu .um-who { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px; min-width: 0; }
.user-menu .um-who .who { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu .um-lang { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px;
  color: var(--muted); }
.badge.role { font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--info-bg);
  color: var(--info-fg); white-space: nowrap; }
.nvr-menu { max-width: min(460px, calc(100vw - 16px)); padding: 10px 12px; color: var(--bad-fg); display: flex;
  flex-direction: row; gap: 10px; align-items: flex-start; line-height: 1.5; }
.nvr-menu .ico { margin-top: 2px; }
.nvr-badge { color: var(--bad-fg); background: var(--bad-bg); border-color: var(--bad-a-55); font-weight: 600; }
.nvr-badge:hover { border-color: var(--bad); }
.user-btn .user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
/* pásy (nezabezpečená stránka / kodek, znovuotvorenie okien) – v štýle hlásení správy */
.banner { display: flex; align-items: center; gap: 10px; background: var(--warn-bg); color: var(--text); padding: 8px 14px;
  border-bottom: 1px solid var(--line); border-left: 4px solid var(--warn); line-height: 1.5; }
.banner > .ico { color: var(--warn-fg); }
.banner code { background: var(--shade-35); padding: 1px 4px; border-radius: 4px; }
main { flex: 1; display: flex; min-height: 0; }
aside {
  position: relative; flex: none; display: flex; min-height: 0;
  background: var(--panel); border-right: 1px solid var(--line);
}
/* ľavý panel (2.9.4): pásik s ikonami ako v desktop aplikácii + obsah záložky; « skryje obsah (ostane pásik),
   šírka obsahu sa mení ťahaním pravého okraja */
.side-rail { flex: none; width: 42px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0; background: var(--bg); border-right: 1px solid var(--line); }
.side-body { width: var(--side-w, 236px); min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.side-head { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.side-head b { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-hide, .side-show { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  background: none; border-color: transparent; color: var(--muted); }
.side-hide .ico, .side-show .ico { width: 16px; height: 16px; }
.side-show[hidden] { display: none; }
.side-hide:hover, .side-show:hover { color: var(--text); background: var(--panel2); }
.side-show { margin-top: auto; }
body.side-off .side-body, body.side-off .side-grip { display: none; }
.side-grip { position: absolute; top: 0; bottom: 0; right: -4px; width: 7px; z-index: 6; cursor: col-resize; touch-action: none; }
.side-grip:hover, .side-grip.drag { background: var(--accent-a-35); }
/* hľadanie s ikonou, „len online“ ako prepínač (3.2.1) */
.search-box { position: relative; display: flex; }
.search-box .search-ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted);
  display: inline-flex; pointer-events: none; }
.search-box .search-ico .ico { width: 15px; height: 15px; }
aside input[type=search] { width: 100%; background: var(--input); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 9px 6px 30px; }
aside input[type=search]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--info-bg); }
label.chk.switch { gap: 9px; color: var(--muted); font-size: 12.5px; padding: 2px 0; }
label.chk.switch input { appearance: none; -webkit-appearance: none; position: relative; width: 30px; height: 17px; margin: 0;
  border-radius: 999px; background: var(--line); cursor: pointer; flex: none; transition: background .15s; }
label.chk.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--text); transition: transform .15s; }
label.chk.switch input:checked { background: var(--accent); }
label.chk.switch input:checked::after { transform: translateX(13px); }
label.chk.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* vysvetľujúce texty pod „?“ (3.2.1) */
.side-help { flex: none; }
.side-help > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  color: var(--muted); font-size: 12px; padding: 2px 0; }
.side-help > summary::-webkit-details-marker { display: none; }
.side-help > summary .ico { width: 15px; height: 15px; }
.side-help > summary:hover { color: var(--text); }
.side-help[open] > summary { color: var(--text); }
.side-help .side-hint { margin-top: 4px; }
/* zoznamy kamier: Kamery, Skupiny, Obľúbené (3.2.1: vyššie riadky, ikony, značka „v okne“) */
.camlist { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.camlist li {
  position: relative; display: flex; align-items: center; gap: 7px; min-height: 30px; padding: 3px 4px 3px 6px; border-radius: 6px;
  cursor: pointer; white-space: nowrap; user-select: none;
}
.camlist li:hover { background: var(--raise); }
.camlist li.note { color: var(--muted); cursor: default; white-space: normal; }
.camlist li.note:hover { background: none; }
.camlist .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); flex: none; }
.camlist li.online .dot { background: var(--ok); }
.camlist li.offline .dot { background: var(--bad); }
.camlist li.offline, .camlist li.neobsadený { color: var(--muted); }
.camlist .num { color: var(--muted); min-width: 20px; text-align: right; flex: none; font-variant-numeric: tabular-nums;
  font-size: 12px; }
.camlist .name { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.camlist .codec, .camlist .only-rec { font-size: 11px; color: var(--muted); background: var(--gray-bg); border-radius: 999px;
  padding: 0 7px; flex: none; }
/* práva: kamera len so záznamom (v živom obraze stlmená so značkou), kamera bez záznamu (v režime záznamu stlmená) */
body:not(.rec) .camlist li.nolive .name { color: var(--muted); }
body.rec .camlist .only-rec { display: none; }
body.rec .camlist li.norec { opacity: .45; }
/* kamera v mriežke (3.2.4): jemne podfarbený celý riadok (ako 3.1.0) – bez prúžka a krúžku, nezaberá miesto názvu;
   text „v okne“ je pre čítačky a v popise riadka; v zázname vybraná kamera zreteľne silnejšie (podklad + prúžok) */
.camlist .in-win { display: none; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.camlist .in-win .ico { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body:not(.rec) .camlist li.playing .in-win { display: block; }
body:not(.rec) .camlist li.playing { background: var(--accent-a-15); }
body:not(.rec) .camlist li.playing:hover { background: var(--accent-a-20); }
body.rec .camlist li.playing { background: var(--accent-a-25); box-shadow: inset 3px 0 0 var(--accent); }
.camlist li.marked, .camlist li.marked:hover { background: var(--accent-a-38); }
/* hviezdička obľúbenej a „⋯“ sú stále v riadku (len priehľadné) – klik na ne nikdy neotvorí kameru */
.camlist li button { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  background: none; border: 0; padding: 0; border-radius: 6px; color: var(--muted); opacity: 0; }
.camlist li button .ico { width: 15px; height: 15px; }
.camlist li:hover button, .camlist li button:focus-visible { opacity: 1; }
.camlist li button:hover { color: var(--text); background: var(--surface); }
.camlist .fav.on { opacity: 1; color: var(--warn); }
.camlist .fav.on .ico { fill: var(--warn); }
/* myš: hviezdička berie miesto len pri obľúbenej kamere, ostatné tlačidlá sa ukážu až pod myšou (názov má celú šírku);
   na dotyk ostávajú v riadku ako doteraz */
@media (hover: hover) and (pointer: fine) {
  .camlist li:not(:hover):not(:focus-within) button.fav:not(.on), .camlist li:not(:hover):not(:focus-within) button.more { display: none; }
}
.camlist li.drop, .camlist.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
/* skupiny: hlavičky častí, skupina (rozbaľovacia), jej kamery odsadené */
.grp-list li.grp-head {
  cursor: default; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); padding: 8px 6px 3px; overflow: hidden; text-overflow: ellipsis; min-height: 0;
}
.grp-list li.grp-head:hover { background: none; }
.grp-list li.grp { gap: 5px; padding-left: 2px; }
.grp-list li.grp .caret { opacity: 1; }
.grp-list .gdot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex: none; }
.grp-list li.grp.shared .gdot { background: var(--warn); }
.grp-list .gname { overflow: hidden; text-overflow: ellipsis; flex: 1; font-weight: 600; min-width: 0; }
.grp-list .gcnt { color: var(--muted); font-size: 11px; min-width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.grp-list li.in-grp { padding-left: 26px; }
/* úprava a odstránenie skupiny až pod myšou (myš) – názov skupiny má viac miesta; na dotyk ostávajú */
@media (hover: hover) and (pointer: fine) {
  .grp-list li.grp:not(:hover):not(:focus-within) .g-ren, .grp-list li.grp:not(:hover):not(:focus-within) .g-del { display: none; }
}
#grpNew, #favOpen, #layNew { flex: none; }
#favOpen:disabled { opacity: .5; cursor: default; }
/* hlavička NVR v zozname kamier: počet online / spolu, zbalenie, nedostupné NVR (3.2.1) */
#camList li.nvr-head { cursor: pointer; font-weight: 600; font-size: 12px; color: var(--muted); padding: 8px 4px 4px;
  min-height: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; margin-bottom: 2px; gap: 5px; }
#camList li.nvr-head:hover { color: var(--text); background: none; }
#camList li.nvr-head .caret { display: inline-flex; }
#camList li.nvr-head .caret .ico, #camList li.nvr-head .nvr-down .ico { width: 14px; height: 14px; }
#camList li.nvr-head .nvr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#camList li.nvr-head .nvr-cnt { font-weight: 500; font-variant-numeric: tabular-nums; }
#camList li.nvr-head .nvr-down { color: var(--bad-fg); display: inline-flex; }
#camList li.nvr-head.down .nvr-name { color: var(--bad-fg); }
#grid {
  flex: 1; display: grid; gap: 2px; padding: 2px; min-width: 0; min-height: 0; background: var(--stage);
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 2), minmax(0, 1fr));
}
/* okno kamery (mriežka, záznam): obraz cez celé okno, názov, značky a štatistika ležia na obraze (--vt / --vb / --vl /
   --vr = kde je obraz v okne, nastavuje app.js fitOverlay) */
.tile { position: relative; background: var(--video); overflow: hidden; outline: 1px solid var(--stage-line); }
/* rámik okna (3.2.4): vrstva nad obrazom, názvom aj štatistikou (::after), nie outline okna – ten leží pod plátnom
   a keď obraz vyplní celé okno (pomer okna = pomer obrazu, „roztiahnuť“, „vyplniť“), nebolo ho vidieť; tenká tmavá
   linka vo vnútri, aby bol rámik vidieť aj na svetlom obraze; kliknutia prechádzajú na okno */
.tile::after { content: ''; position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.tile.sel { z-index: 1; }
.tile.sel::after { box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3px var(--shade-72); transition: opacity .4s ease; }
/* rámik vybraného okna len pri práci s klientom (výber, myš nad mriežkou / panelom, klávesy, dotyk – trieda sel-show
   na body nastavuje app.js); po ~3 s bez činnosti plynulo zmizne, aby nerušil na obraze. Výber ostáva. */
body:not(.sel-show) .tile.sel:not(.alert):not(.drop)::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .tile.sel::after { transition: none; } }
.tile.drop { z-index: 2; }
.tile.drop::after { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--accent-a-15);
  box-shadow: inset 0 0 0 4px var(--shade-72); }
/* nová udalosť na kamere (2.9.6, upozornenia) – okno bliká farbou udalosti */
.tile.alert { z-index: 2; }
.tile.alert::after { box-shadow: inset 0 0 0 3px var(--ac, var(--bad)), inset 0 0 0 4px var(--shade-72);
  animation: tile-alert 1s ease-in-out infinite; }
@keyframes tile-alert { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tile.alert::after { animation: none; } }
.tile canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: var(--fit, contain); }
.tile .hdr {
  position: absolute; left: var(--vl, 0); right: var(--vr, 0); top: var(--vt, 0); display: flex; gap: 5px; align-items: center;
  padding: 5px 6px 14px 8px; background: linear-gradient(var(--shade-72), var(--shade-35) 60%, transparent);
  pointer-events: none; font-size: 12.5px; text-shadow: 0 1px 2px var(--video); min-width: 0;
}
.tile .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: min(50%, 14em); font-weight: 600;
  pointer-events: auto; }
/* značky v jednom riadku: čo sa nezmestí (technické sú posledné), prejde do skrytého druhého riadku – nič sa neoreže v polovici */
.tile .badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; row-gap: 8px; align-items: center; flex: 0 1 auto;
  min-width: 0; height: 16px; overflow: hidden; }
.tile .badge { display: inline-flex; align-items: center; gap: 3px; flex: none; font-size: 11px; line-height: 16px; padding: 0 6px;
  border-radius: 999px; background: var(--shade-55); color: var(--text); text-shadow: none; white-space: nowrap; }
.tile .badge .ico { width: 12px; height: 12px; }
.tile .badge.gpu { background: var(--ok-a-35); }
.tile .badge.cpu, .tile .badge.wasm { background: var(--warn-a-45); }
.tile .badge.st.bad { background: var(--bad-a-80); color: var(--on-accent); }
.tile .badge.st.on { background: var(--accent-a-75); color: var(--on-accent); }
.tile .badge.muted { background: var(--warn-a-45); color: var(--warn-fg); }
/* technické značky (prúd, kodek, dekodér) len so štatistikou, pod myšou a vo vybranom okne */
.tile .badge.tech { display: none; }
body.stats-on .tile .badge.tech, .tile:hover .badge.tech, .tile.sel .badge.tech { display: inline-flex; }
/* tlačidlá okna: rovnaké okrúhle ikony (pod myšou; zapnutá lupa, hrajúci zvuk a PTZ ostávajú) */
.tile .hbtn {
  pointer-events: auto; display: none; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border-radius: 50%; border: 1px solid var(--light-15); background: var(--glass-74); color: var(--text);
}
.tile .hbtn .ico { width: 15px; height: 15px; }
.tile .hbtn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* myš: tlačidlá pod myšou; dotyk (3.3.3): :hover po ťuknutí na okne ostával (tlačidlá zakryli názov aj v úzkych
   oknách), preto na zariadení bez hover len vybrané okno, kým s klientom niekto pracuje (body.sel-show, ako rámik) */
@media (hover: hover) { .tile:hover .hbtn { display: inline-flex; } }
@media (hover: none) { :where(body.sel-show) .tile.sel .hbtn:not([hidden]) { display: inline-flex; } }
.tile .hbtn[hidden], .tile:hover .hbtn[hidden] { display: none; }
.tile .empty:not([hidden]) ~ .hdr .hbtn { display: none; }
.tile.dragging { opacity: .45; }
.tile[draggable=true] { cursor: grab; }
/* hlásenie v strede okna s ikonou – čitateľné na obraze aj na čiernej */
.tile .msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 8px; text-align: left; color: var(--text); background: var(--glass-90);
  border: 1px solid var(--light-13); padding: 6px 12px; border-radius: 8px; box-shadow: var(--shadow);
  pointer-events: none; font-size: 12.5px; line-height: 1.35;
}
.tile .msg:empty { display: none; }
.tile .msg .ico { width: 16px; height: 16px; color: var(--muted); }
.tile .msg.bad .ico { color: var(--bad-fg); }
.tile .msg .spin { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--light-22);
  border-top-color: var(--accent); animation: tile-spin .9s linear infinite; }
@keyframes tile-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tile .msg .spin { animation: none; } }
.tile .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--gray);
  pointer-events: none; font-size: 12px; background: var(--stage); }
.tile .empty span { border: 1px dashed var(--line); border-radius: 8px; padding: 6px 12px; }
.tile .empty[hidden] { display: none; }
/* štatistika jedným riadkom bežným písmom (číslice rovnakej šírky), problémy farbou varovania */
.tile .stats {
  position: absolute; left: var(--vl, 0); right: var(--vr, 0); bottom: var(--vb, 0); padding: 12px 8px 4px;
  font-size: 11.5px; line-height: 1.3; font-variant-numeric: tabular-nums;
  background: linear-gradient(transparent, var(--shade-65)); color: var(--text); pointer-events: none; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px var(--video);
}
.tile .stats:empty { display: none; }
.tile .stats .bad { color: var(--warn-fg); font-weight: 600; }
/* dotyk (3.3.1): okno bez lupy dovolí posúvať prstom zvislo (na mobile sú okná pod sebou a posúva sa ich zoznam);
   lupa – výber oblasti, priblížené okno (ťahanie posúva obraz) a PTZ (držanie tlačidla) – prehliadač nesmie posúvať
   ani zväčšovať; dva prsty na okne bez lupy zachytí stránka (attachZoom – touchstart) a zapne lupu */
.tile { touch-action: pan-y; }
.tile.zoomed, .tile.zoom-select, .tile.panning, .tile .ptz { touch-action: none; }
.tile .zoom-sel { position: absolute; z-index: 2; border: 1px solid var(--info-fg); background: var(--accent-a-20); pointer-events: none; }
.tile.zoom-select canvas { cursor: crosshair; }
.tile.zoomed canvas { cursor: grab; }
.tile.zoomed.panning canvas { cursor: grabbing; }
.tile.zoomed .hbtn.zoom, .tile.zoom-select .hbtn.zoom { display: inline-flex; background: var(--accent); border-color: var(--accent);
  color: var(--on-accent); }
.tile .badge.zoom { background: var(--accent-a-75); color: var(--on-accent); }
#pbZoomBtn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* zvuk (od 2.7.5): tlačidlo v okne ostane vidieť, kým zvuk hrá; značka stavu; hlasitosť v hlavičke */
.tile.snd-on .hbtn.snd { display: inline-flex; background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.tile .badge.snd { background: var(--ok-a-60); }
.tile .badge.snd.wait { background: var(--shade-55); }
.tile .badge.snd.bad { background: var(--bad-a-55); }
#pbAudio.on { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.vol { display: inline-flex; align-items: center; gap: 5px; }
.vol input[type=range] { width: 90px; accent-color: var(--ok); }
.vol .vol-val { color: var(--muted); min-width: 36px; font-size: 12px; }
.vol button { padding: 0 6px; line-height: 18px; }
@media (pointer: coarse) {
  .tile .hbtn { width: 38px; height: 38px; }
  .tile .hbtn .ico { width: 18px; height: 18px; }
  .camlist li { min-height: 40px; }
  .camlist li button { width: 34px; height: 34px; opacity: 1; }
}
/* PTZ: ovládanie otočnej kamery vpravo dole v okne, tlačidlá sa držia; veľkosť podľa okna (malé okno = smer, zoom
   a pozície, bez ostrosti a rýchlosti) */
#grid .tile { container-type: size; }
/* úzke okno (mobil, malá mriežka): bez názvu NVR a technických značiek pred názvom kamery (celý názov v popise) */
@container (max-width: 260px) {
  .tile .nvr-pre { display: none; }
  .tile .badge.tech { display: none !important; }
  .tile .title { min-width: 0; }
  .tile .stats .st-res { display: none; }      /* 3.3.5: rozlíšenie len v širšom okne – varovania musia ostať vidieť */
}
/* úzke okno na dotyk (3.3.3): z tlačidiel len „⋯“ (ponuka okna má všetky úkony) – päť tlačidiel po 38 bodov s medzerami
   (~235 bodov) by v okne užšom ako ~340 bodov zakrylo názov a vyčnievalo z okna; tlačidlá zapnutých stavov (lupa, zvuk,
   PTZ) ostávajú ako doteraz. V širšom okne sa názov kamery skráti („…“), aby sa tlačidlá zmestili. */
@media (hover: none) {
  .tile .title { min-width: 0; }
  @container (max-width: 340px) {
    .tile .hbtn.rec, .tile .hbtn.full, .tile .hbtn.x, .tile:not(.zoomed):not(.zoom-select) .hbtn.zoom,
    .tile:not(.snd-on) .hbtn.snd, .tile:not(.ptz-on) .hbtn.ptz-btn { display: none !important; }
  }
}
.tile.ptz-on .hbtn.ptz-btn { display: inline-flex; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tile .ptz {
  --b: clamp(22px, 8cqmin, 40px);
  position: absolute; right: 12px; bottom: 12px; z-index: 3; display: flex; gap: 8px; padding: 7px;
  background: var(--glass-74); border: 1px solid var(--light-13); border-radius: 9px;
  box-shadow: 0 6px 22px var(--shade-50); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; font-size: 12px; cursor: default;
}
.ptz button {
  display: grid; place-items: center; padding: 0; color: var(--text); line-height: 1;
  background: var(--light-08); border: 1px solid var(--light-15); border-radius: 6px;
}
.ptz button:hover { background: var(--light-18); border-color: var(--light-40); }
.ptz button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ptz-pad { display: grid; grid-template-columns: repeat(3, var(--b)); grid-auto-rows: var(--b); gap: 3px; }
.ptz button .ico { width: calc(var(--b) * .5); height: calc(var(--b) * .5); }
.ptz-pad .ptz-stop { color: var(--bad-fg); }
.ptz-pad .ptz-stop .ico { width: calc(var(--b) * .36); height: calc(var(--b) * .36); fill: currentColor; }
.ptz-side { display: flex; flex-direction: column; justify-content: space-between; gap: 3px; }
.ptz-row { display: flex; align-items: center; gap: 4px; height: var(--b); }
.ptz-row > span { flex: 1; min-width: 56px; text-align: center; color: var(--muted); white-space: nowrap; }
.ptz-zoom button, .ptz-focus button { width: var(--b); height: var(--b); font-size: calc(var(--b) * .55); }
.ptz-low { justify-content: space-between; gap: 8px; }
.ptz .ptz-presets { height: var(--b); padding: 0 10px; font-size: 12px; display: flex; align-items: center; }
.ptz .ptz-presets .ico { width: 14px; height: 14px; }
.ptz-pl { display: inline-flex; align-items: center; gap: 5px; }
.ptz-pi { display: none; }
.ptz-speed { display: flex; align-items: center; gap: 5px; color: var(--muted); cursor: pointer; }
.ptz-speed input { width: 64px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.ptz-speed b { min-width: 8px; color: var(--text); font-weight: 600; }
.ptz .ptz-x { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border-radius: 50%; background: var(--raise); }
.ptz .ptz-x .ico { width: 12px; height: 12px; }
@container (max-width: 340px) or (max-height: 300px) {
  .tile .ptz { gap: 5px; padding: 5px; }
  .ptz-focus, .ptz-speed, .ptz-row > span, .ptz-pl { display: none; }
  .ptz-zoom { flex-direction: column-reverse; height: auto; gap: 3px; }
  .ptz-side { justify-content: flex-start; }
  .ptz .ptz-presets { width: var(--b); padding: 0; justify-content: center; font-size: calc(var(--b) * .5); }
  .ptz-pi { display: inline; }
}
body.clean .tile .ptz { display: none !important; }
/* pozície kamery (ponuka z tlačidla „Pozície“): klik na názov = prejsť, vpravo premenovať / prepísať / odstrániť */
.ptz-menu { min-width: 250px; }
.ptz-menu .pz-row { display: flex; align-items: center; gap: 1px; }
.ptz-menu .pz-row button { background: none; border: 1px solid transparent; border-radius: 4px; padding: 6px 8px; }
.ptz-menu .pz-row button:hover { background: var(--panel2); border-color: transparent; }
.ptz-menu .pz-go { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptz-menu .pz-act { flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); opacity: 0; padding: 6px 7px; }
.ptz-menu .pz-act .ico { width: 15px; height: 15px; }
.ptz-menu .pz-add { display: flex; align-items: center; gap: 7px; }
.ptz-menu .pz-add .ico { width: 15px; height: 15px; }
.ptz-menu .pz-row:hover .pz-act, .ptz-menu .pz-act:focus-visible { opacity: 1; }
.ptz-menu .pz-act:hover { color: var(--text); }
.ptz-menu .pz-del:hover { color: var(--bad); }
.ptz-menu .pz-note { color: var(--muted); padding: 6px 10px; }
.ptz-menu .pz-note.bad { color: var(--bad); white-space: normal; }
/* záznam: deň a kalendár so dňami so záznamom (3.2.2: šípky ikonami, dnešok krúžkom, vybraný deň farbou dôrazu) */
.pb-btns button:disabled { opacity: .45; cursor: default; }
#pbTimeline.panning { cursor: grabbing; }
.cal-menu { min-width: 0; padding: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-head span { font-weight: 600; }
.cal-head button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  background: none; border-color: transparent; border-radius: 8px; }
.cal-head button:hover:not(:disabled) { background: var(--raise); }
.cal-head button .ico { width: 16px; height: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 34px); gap: 3px; }
.cal-grid .cal-wd { color: var(--muted); font-size: 11px; text-align: center; padding-bottom: 2px; }
.cal-grid button { height: 32px; padding: 0; text-align: center; background: var(--bg); border-color: transparent; border-radius: 8px;
  font-variant-numeric: tabular-nums; }
.cal-grid button.rec { background: var(--ok-a-35); color: var(--text); font-weight: 600; }
.cal-grid button.today { box-shadow: inset 0 0 0 1.5px var(--text); }
.cal-grid button.sel { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-grid button:disabled { color: var(--gray); background: none; cursor: default; }
.cal-note { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: var(--muted); font-size: 11px; margin-top: 8px; }
.cal-sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--ok-a-35); }
.cal-sw.today { background: none; box-shadow: inset 0 0 0 1.5px var(--text); margin-left: 8px; }
/* informácie o kamere */
.info-dlg { width: min(460px, calc(100vw - 32px)); }
.info-dlg table { width: 100%; border-collapse: collapse; }
.info-dlg th { text-align: left; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; padding: 10px 0 4px; }
.info-dlg tr:first-child th { padding-top: 0; }
.info-dlg td { padding: 2px 0; vertical-align: top; overflow-wrap: anywhere; }
.info-dlg td:first-child { color: var(--muted); width: 40%; padding-right: 12px; }
/* spodný riadok: krátky stav pre obsluhu (technické údaje sú v okne Diagnostika – klik na riadok ho otvorí) */
footer {
  display: flex; align-items: center; gap: 12px; padding: 3px 12px; min-height: 26px;
  background: var(--surface); border-top: 1px solid var(--line); color: var(--muted);
  white-space: nowrap; overflow: hidden; cursor: pointer; font-size: 12.5px;
}
footer:hover { color: var(--text); }
footer .ft-main { overflow: hidden; text-overflow: ellipsis; }
footer .ft-warn { display: inline-flex; align-items: center; gap: 5px; color: var(--warn-fg); font-weight: 600; }
footer .ft-warn .ico { width: 14px; height: 14px; }
footer .ft-diag { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
footer .ft-diag .ico { width: 14px; height: 14px; }
/* okno Diagnostika (technické údaje, obnovujú sa naživo) */
.diag-dlg table { width: 100%; border-collapse: collapse; }
.diag-dlg td { padding: 3px 0; vertical-align: top; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.diag-dlg td:first-child { color: var(--muted); width: 44%; padding-right: 12px; }
.diag-dlg td.bad { color: var(--bad-fg); font-weight: 600; }
body.rec .live-only { display: none !important; }
#modeSeg button { min-width: 0; }
#playback { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 2px; min-width: 0; min-height: 0; }
#playback .pb-video { flex: 1; min-height: 120px; }
/* záznam viacerých okien (3.3.0): 2 okná vedľa seba, 4 okná 2 × 2; pri jednom okne obal nič nemení (display: contents) */
.pb-wins { display: contents; }
#playback.multi .pb-wins { display: grid; flex: 1; min-height: 120px; gap: 2px; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr); }
#playback.multi .pb-wins.n4 { grid-template-rows: repeat(2, minmax(0, 1fr)); }
#playback.multi .pb-wins .pb-video { min-height: 0; }
#playback.multi .pb-axis { height: 96px; }
body.norec #recGridBtn { display: none; }
.ex-which { flex: none; }
.ex-which button { height: 26px; padding: 0 9px; font-size: 12px; }
/* ovládanie záznamu (3.2.2): jeden riadok – deň, čas, prehrávanie (Prehrať / Pauza veľké farbou dôrazu), udalosti,
   rýchlosť, nástroje, Viac, Stiahnuť; čo sa nezmestí, presunie skript do ponuky „Viac“ (pbFit) */
.pb-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 5px 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
.pb-btns { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.pb-bar button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 9px; }
.pb-bar button .ico { width: 17px; height: 17px; }
.pb-bar .pb-ic { width: 30px; padding: 0; background: none; border-color: transparent; }
.pb-bar .pb-ic:hover:not(:disabled) { background: var(--raise); border-color: var(--line); }
.pb-bar .pb-ic.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pb-bar .lbl { display: none; }
.pb-bar .pb-ic.pb-val { width: auto; padding: 0 9px; }
.pb-bar .pb-ic.pb-val .lbl { display: inline; font-variant-numeric: tabular-nums; }
.pb-play { width: 40px; height: 40px !important; padding: 0 !important; border-radius: 50%; background: var(--accent); border-color: var(--accent);
  color: var(--on-accent); margin: 0 2px; }
.pb-play:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.pb-play .ico { width: 19px !important; height: 19px !important; fill: currentColor; }
.pb-day #pbDayBtn { min-width: 0; padding: 0 8px; gap: 5px; font-variant-numeric: tabular-nums; }
.pb-day #pbDayBtn .ico { width: 15px; height: 15px; color: var(--muted); }
.pb-day .pb-ic { width: 26px; }
.pb-time { display: inline-flex; align-items: baseline; gap: 6px; flex: none; }
.pb-clock { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.pb-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
#pbSpeed { height: 32px; flex: none; }
.pb-gap { flex: 1 1 0; min-width: 0; }
#pbExportBtn .ico { width: 16px; height: 16px; }
/* ponuka „Viac“: tie isté tlačidlá ako v lište, s popisom */
.menu.pb-more { min-width: 200px; gap: 2px; }
.pb-more button { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: auto; padding: 7px 10px;
  background: none; border-color: transparent; text-align: left; }
.pb-more button:hover:not(:disabled) { background: var(--raise); }
.pb-more button .ico { width: 16px; height: 16px; flex: none; }
.pb-more .lbl { display: inline; }
.pb-more button.on { color: var(--info-fg); }
/* riadok nad osou: legenda farieb s počtami (a priebežné stavy) vľavo, rozsah osi vpravo */
.pb-legrow { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; padding: 0 2px; min-height: 26px; flex: none; }
.pb-evinfo { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 12px; color: var(--muted); font-size: 12px; }
.pb-evinfo .lg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pb-evinfo .lg b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pb-evinfo .lg .ico { width: 13px; height: 13px; }
.pb-evinfo .lg-state { color: var(--muted); }
.pb-evinfo .lg-note { color: var(--warn-fg); }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; background: var(--c); flex: none; }
.sw.k-motion { height: 6px; margin-top: 5px; }
.sw.k-alarm { box-shadow: inset 0 2px 0 var(--tl-alarm-cap); }
.sw.k-recev { background: repeating-linear-gradient(135deg, var(--c) 0 3px, var(--tl-hatch) 3px 5px); }
.pb-range button { height: 26px; padding: 0 9px; font-size: 12px; }
.pb-axis { position: relative; height: 84px; flex: none; }
#pbTimeline {
  width: 100%; height: 100%; display: block; cursor: pointer; border: 1px solid var(--line); border-radius: 6px;
  touch-action: pan-y;        /* 3.3.2: vodorovný ťah a dva prsty vybaví stránka (posun / priblíženie osi), zvislý posúva stránku */
}
.pb-hover {
  position: absolute; top: -30px; transform: translateX(-50%); background: var(--glass-96); color: var(--text);
  border: 1px solid var(--light-13); box-shadow: var(--shadow); padding: 3px 9px; border-radius: 7px; font-size: 12px;
  font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap; z-index: 4;
}
/* panel sťahovania: hlavička, formulár, nenápadné vysvetlenie, zoznam sťahovaní ako karty */
.pb-export {
  flex: none; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; max-height: 40vh; overflow-y: auto;
}
.ex-head { display: flex; align-items: center; gap: 10px; }
.ex-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.ex-fld { display: inline-flex; align-items: center; gap: 6px; }
.ex-fld label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.ex-form input[type=datetime-local] {
  background: var(--input); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; color-scheme: dark;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.ex-cam { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-len { color: var(--muted); min-width: 90px; font-variant-numeric: tabular-nums; }
.ex-len.bad { color: var(--bad-fg); }
.ex-go { display: inline-flex; align-items: center; gap: 6px; }
.ex-go .ico { width: 16px; height: 16px; }
.ex-go:disabled { opacity: .5; cursor: default; }
.ex-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  background: none; border-color: transparent; border-radius: 6px; }
.ex-x:hover { background: var(--raise); }
.ex-x .ico { width: 15px; height: 15px; }
.ex-hint { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.ex-hint .ico { width: 13px; height: 13px; flex: none; margin-top: 1px; }
.ex-hint .ex-noff { color: var(--warn); }
.ex-jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ex-jobs:empty { display: none; }
.ex-job { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--raise); }
.ex-job .ex-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ex-job .ex-title { flex: 1; min-width: 200px; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.ex-st { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 0 8px; line-height: 18px; }
.ex-st.running { background: var(--info-bg); color: var(--info-fg); }
.ex-st.done { background: var(--ok-bg); color: var(--ok-fg); }
.ex-st.error { background: var(--bad-bg); color: var(--bad-fg); }
.ex-job .ex-sub { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ex-job.done .ex-sub b { color: var(--ok-fg); }
.ex-job.error .ex-sub { color: var(--bad-fg); }
.ex-job .ex-note { color: var(--warn-fg); font-size: 12px; }
.ex-bar { height: 5px; background: var(--panel2); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.ex-bar div { height: 100%; background: var(--accent); transition: width .4s; }
.ex-job.done .ex-bar div { background: var(--ok); }
.ex-job button { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; font-size: 12.5px; }
.ex-job button .ico { width: 14px; height: 14px; }
.ex-job button.ex-ic { width: 28px; padding: 0; justify-content: center; }
/* ---- layouty a rozloženie mriežky */
.ctl { display: inline-flex; align-items: center; gap: 4px; flex: none; }
#laySel { max-width: 170px; }
/* neuložené zmeny layoutu: tlačidlo „● Uložiť“ zvýraznené (text stavu ostáva v #layMod pre čítačky obrazovky) */
#laySave.mod { background: var(--warn-bg); border-color: var(--warn); color: var(--warn-fg); font-weight: 600; }
#laySave.mod::before { content: "●"; font-size: 11px; }
#laySave.mod .ico { display: none; }
#gridBtn { display: inline-flex; align-items: center; gap: 6px; }
#gridBtn .caret { color: var(--muted); display: inline-flex; }
#gridBtn .caret .ico { width: 14px; height: 14px; }
.gicon { display: block; flex: none; }
.gicon rect { fill: none; stroke: var(--muted); stroke-width: 1; }
.gicon rect.bigc { fill: var(--accent-a-35); stroke: var(--accent); }
.gicon rect.full { fill: var(--accent); stroke: var(--accent); }
.menu {
  position: fixed; z-index: 50; display: flex; flex-direction: column; min-width: 190px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
/* 3.2.2: položka ponuky s ikonou, so značkou vybranej voľby a so šípkou podponuky */
.menu button.mi-ic { display: flex; align-items: center; gap: 9px; }
.menu button.mi-ic .ico, .menu button .ico-sp { width: 15px; height: 15px; flex: none; color: var(--muted); }
.menu button .ico-sp { display: inline-block; }
.menu button.mi-sub { display: flex; align-items: center; }
.menu button.mi-sub .mi-arrow { margin-left: auto; width: 14px; height: 14px; color: var(--muted); }
.menu > button { background: none; border: 1px solid transparent; text-align: left; padding: 6px 10px; border-radius: 6px; }
.menu > button:hover:not(:disabled) { background: var(--raise); border-color: transparent; }
.menu .sep { height: 1px; background: var(--line); margin: 4px; flex: none; }
.menu > button:disabled { color: var(--muted); cursor: default; }
.grid-menu { display: grid; grid-template-columns: repeat(4, auto); gap: 2px; min-width: 0; }
.grid-menu > button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 8px; text-align: center; font-size: 12px; }
.grid-menu > button.on { background: var(--accent-a-18); border-color: var(--accent); }
.grid-menu .sep { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 2px 4px; }
.side-tabs { display: flex; flex-direction: column; gap: 4px; }
.side-tabs button { position: relative; width: 34px; height: 34px; padding: 0; display: flex; align-items: center;
  justify-content: center; background: none; border-color: transparent; border-radius: 6px; color: var(--muted); }
.side-tabs button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.side-tabs button:hover { color: var(--text); background: var(--panel2); border-color: transparent; }
.side-tabs button.on { color: var(--on-accent); background: var(--accent-a-25); }
.side-tabs button.on::before { content: ''; position: absolute; left: -4px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 2px; background: var(--accent); }
.side-tabs .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pager #pageLbl { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager.src #pageLbl { color: var(--text); }
.ctx-menu { min-width: 210px; max-width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; }
.ctx-menu > button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-menu > button.hd { color: var(--muted); font-size: 12px; cursor: default; }
.ctx-menu .sep { height: 1px; background: var(--line); margin: 3px 4px; flex: none; }
.side-pane { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
#layList { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#layList li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; user-select: none; min-height: 36px; }
#layList li:hover { background: var(--panel2); }
#layList li.cur { background: var(--accent-a-15); }
#layList li.cur .lay-name { font-weight: 600; }
#layList li.note { color: var(--muted); cursor: default; }
#layList li.note:hover { background: none; }
.lay-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lay-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lay-sub { color: var(--muted); font-size: 11px; }
/* tlačidlá sú stále v riadku (len priehľadné) – klik na ne nikdy neotvorí layout namiesto premenovania/odstránenia */
#layList li button { opacity: 0; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  padding: 0; background: none; border-color: transparent; border-radius: 6px; color: var(--muted); flex: none; }
#layList li button .ico { width: 15px; height: 15px; }
#layList li button:hover { color: var(--text); background: var(--surface); border-color: var(--line); }
#layList li:hover button, #layList li button:focus-visible { opacity: 1; }
.side-hint { color: var(--muted); font-size: 12px; margin: 0; }
/* dialógy ako v správe: názov hore s krížikom (.dlg-x pridá app.js), obsah, tlačidlá dole na podklade */
dialog.dlg {
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px;
  width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow); font-size: 14px;
}
dialog.dlg::backdrop { background: var(--backdrop); }
dialog.dlg h3 { margin: 0 -20px 14px; padding: 14px 52px 12px 20px; font-size: 16px; font-weight: 600;
  border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dlg-x { position: absolute; top: 10px; right: 10px; color: var(--muted); }
.dlg-x:hover { color: var(--text); }
dialog.dlg { position: fixed; }
.dlg p { margin: 0 0 10px; }
.dlg label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.dlg input:not([type=checkbox]):not([type=radio]), .dlg select, .dlg textarea {
  background: var(--input); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; color: var(--text); }
.dlg input:focus, .dlg select:focus, .dlg textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--info-bg); }
.dlg-msg { min-height: 1.35em; font-size: 12.5px; margin: 6px 0 0 !important; }
.dlg-msg.bad { color: var(--bad-fg); }
.dlg-msg.warn { color: var(--warn-fg); }
.dlg-btns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 14px -20px 0; padding: 12px 20px;
  border-top: 1px solid var(--line); background: var(--raise); border-radius: 0 0 12px 12px; }
.primary.danger { background: var(--bad); border-color: var(--bad); }
.primary:disabled { opacity: .5; cursor: default; }
/* hlásenie dole: ikona a farba podľa druhu (info / úspech / chyba) */
.toast {
  position: fixed; left: 50%; bottom: 38px; transform: translateX(-50%); z-index: 60; max-width: min(640px, calc(100vw - 24px));
  display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 8px; padding: 9px 16px 9px 12px; box-shadow: var(--shadow);
  overflow-wrap: anywhere; font-size: 13.5px;
}
.toast[hidden] { display: none; }
.toast > .ico { color: var(--accent); margin-top: 1px; }
.toast.ok { border-left-color: var(--ok); } .toast.ok > .ico { color: var(--ok-fg); }
.toast.bad { border-left-color: var(--bad); } .toast.bad > .ico { color: var(--bad-fg); }
body.clean header, body.clean aside, body.clean footer, body.clean .banner,
body.clean .tile .hdr, body.clean .tile .stats, body.clean .al-stack { display: none !important; }
body.clean #grid { gap: 0; padding: 0; }
/* celá obrazovka: len obraz (mriežka alebo záznam s lištou), bez líšt stránky; tlačidlo na návrat a kurzor myši sa
   ukážu pri pohybe myši a po chvíli zmiznú (televízor, velín) */
body.fs > header, body.fs aside, body.fs > footer, body.fs > .banner { display: none !important; }
body.fs #grid { padding: 0; }
.fs-exit { display: none; }
body.fs .fs-exit {
  display: inline-flex; align-items: center; gap: 6px; position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 40;
  background: var(--glass-92); padding: 6px 14px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
body.fs.fs-ui .fs-exit { opacity: 1; pointer-events: auto; }
body.fs:not(.fs-ui), body.fs:not(.fs-ui) * { cursor: none !important; }
@media (hover: none) {
  #layList li button, .camlist li button, .ptz-menu .pz-act { opacity: 1; }
}
/* lišta pri užšom okne: najprv zmiznú popisy Monitory / Celá obrazovka / Zobrazenie, potom Stráženie a výpadok NVR
   v skratke, potom popisy režimov a meno (ostanú ikony, popis pod myšou) */
.arm-short { display: none; }
@media (max-width: 1799px) {
  .win-txt, .fs-txt, .view-txt { display: none; }
}
@media (max-width: 1599px) {
  .arm-txt, .arm-sub, .nb-long { display: none; }
  .arm-short { display: inline; }
}
@media (max-width: 1199px) {
  #modeSeg .t, .user-btn .user-name, #gridBtn > span:not(.caret) { display: none; }
  #laySel { max-width: 140px; }
}
@media (max-width: 1099px) {
  .brand b { display: none; }
  #laySel { max-width: 120px; }
  .pager span { min-width: 40px; }
}
@media (pointer: coarse) {
  header button, header select, .pop-menu > button, .pop-menu > a, .pop-menu select, .dlg-btns button,
  .menu > button { min-height: 40px; }
  button.icon-btn { width: 40px; height: 40px; }
}
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .mob-only { display: inline-flex !important; }
  /* lišta v 2 riadkoch: 1. ☰ · značka · režimy · výpadok NVR · Stráženie · meno (v ponuke aj Zobrazenie);
     2. layout · Uložiť · ⋯ · mriežka · strany · celá obrazovka */
  header { flex-wrap: wrap; gap: 5px 3px; padding: 5px 6px; }
  header .sp { display: none; }
  .brand { margin-right: 2px; }
  .brand b, #viewBtn, header .caret, #laySave .t, #pageLbl:empty { display: none; }
  #laySave.mod .ico { display: inline; }
  #laySave.mod::before { margin-right: -2px; }
  header > *, header .ctl { order: 1; }
  .row-break { display: block; order: 2; flex-basis: 100%; height: 0; }
  header .ctl, #pager, #fsBtn, #volCtl { order: 3; }
  header button, header select { padding: 0 8px; min-height: 36px; }
  header button.icon-btn, #fsBtn, #userBtn, #modeSeg button { width: 36px; height: 36px; padding: 0; }
  #nvrBadge, #armBtn { height: 36px; padding: 0 7px; gap: 4px; }
  #laySel { max-width: 96px; height: 36px; padding: 0 4px; }
  #gridBtn .caret { display: none; }
  #pager .icon-btn { width: 30px; }
  #laySave { width: 36px; padding: 0; }
  #laySave.mod { width: auto; padding: 0 7px; }
  #gridBtn { height: 36px; padding: 0 6px; }
  .pager span { min-width: 30px; font-size: 12.5px; }
  body.rec .row-break, body.map .row-break { display: none; }
  aside { position: absolute; z-index: 10; top: 0; bottom: 0; left: 0; width: 80%; max-width: 320px; transform: translateX(-100%); transition: transform .15s; }
  aside .side-body, body.side-off aside .side-body { display: flex; flex: 1; width: auto; }   /* mobil: panel sa vysúva ☰ */
  .side-hide, .side-show, .side-grip { display: none !important; }
  body.cams-open aside { transform: none; box-shadow: 0 0 30px var(--video); }
  main { position: relative; }
  .vol .vol-val { display: none; }
  .vol input[type=range] { width: 70px; }
}

/* ---- webový klient VMS: prihlásenie, NVR v zozname kamier ---- */
body.norec .tile .hbtn.rec { display: none; }
/* prihlásenie: „stena kamier“ v pozadí (len dekorácia, okná vytvorí app.js), priesvitná karta v strede */
.login { position: fixed; inset: 0; z-index: 1000; display: flex; padding: 16px; overflow: auto; color: var(--text); color-scheme: dark;
  background:
    radial-gradient(900px 600px at 12% 8%, var(--accent-a-18), transparent 60%),
    radial-gradient(800px 600px at 92% 96%, var(--logo-b-a-13), transparent 60%),
    linear-gradient(160deg, var(--login-070a10) 0%, var(--login-0b111b) 55%, var(--login-070a10) 100%); }
.login[hidden] { display: none; }
.login-wall { position: fixed; inset: -24px; display: grid; gap: 12px; padding: 12px; overflow: hidden; pointer-events: none;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: max-content; align-content: start;
  counter-reset: cam; opacity: .75;
  -webkit-mask-image: radial-gradient(ellipse 55% 60% at 50% 50%, var(--shade-22), var(--shade-40) 45%, var(--video) 100%);
  mask-image: radial-gradient(ellipse 55% 60% at 50% 50%, var(--shade-22), var(--shade-40) 45%, var(--video) 100%); }
.login-wall i { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  counter-increment: cam; border: 1px solid var(--light-09); box-shadow: inset 0 0 40px var(--shade-45);
  background: var(--scene, linear-gradient(180deg, var(--login-1c2839) 0%, var(--login-131c29) 55%, var(--login-0d131c) 100%)); }
.login-wall i:nth-child(5n+1) { --scene: linear-gradient(180deg, var(--login-1f2e43) 0%, var(--login-142030) 50%, var(--login-0e1520) 100%); }
.login-wall i:nth-child(5n+2) { --scene: radial-gradient(120% 90% at 70% 110%, var(--login-26394d), var(--login-121b27) 55%, var(--login-0c121a)); }
.login-wall i:nth-child(5n+3) { --scene: linear-gradient(170deg, var(--login-1a2532) 0%, var(--login-111923) 60%, var(--login-18232f) 100%); }
.login-wall i:nth-child(5n+4) { --scene: radial-gradient(90% 80% at 25% 20%, var(--login-213044), var(--login-0f1620) 70%); }
.login-wall i::before { content: "CAM " counter(cam, decimal-leading-zero); position: absolute; left: 9px; top: 8px;
  font: 600 10px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; color: var(--light-55);
  text-shadow: 0 1px 2px var(--video); }
.login-wall i::after { content: var(--osd, ""); position: absolute; left: 9px; bottom: 7px;
  font: 500 9.5px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; color: var(--light-40);
  text-shadow: 0 1px 2px var(--video); }
.login-wall b { position: absolute; top: 7px; right: 9px; display: flex; align-items: center; gap: 4px;
  font: 700 9px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .1em; color: var(--bad-a-85); }
.login-wall b::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bad);
  box-shadow: 0 0 8px var(--bad-a-80); animation: login-rec 2.4s ease-in-out infinite; }
.login-wall::after { content: ""; position: absolute; left: 0; right: 0; top: -30%; height: 30%;
  background: linear-gradient(180deg, transparent, var(--accent-a-08) 55%, transparent);
  animation: login-scan 10s linear infinite; }
@keyframes login-scan { to { transform: translateY(440%); } }
@keyframes login-rec { 50% { opacity: .2; } }
.login-main { position: relative; margin: auto; width: min(400px, 100%); display: flex; flex-direction: column;
  align-items: center; gap: 14px; }
.login-box { position: relative; width: 100%; display: flex; flex-direction: column; gap: 16px; padding: 30px 28px 24px;
  border-radius: 18px;
  background: var(--glass-80); border: 1px solid var(--light-09);
  box-shadow: 0 24px 70px var(--shade-60), inset 0 1px 0 var(--light-05);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  animation: login-in .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes login-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.login-box::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--logo-b) 70%, transparent); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.login-logo { position: relative; flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--logo-a), var(--logo-b)); box-shadow: 0 8px 24px var(--accent-a-35); }
.login-logo svg { width: 30px; height: 30px; fill: var(--on-accent); }
.login-logo .lens { fill: var(--logo-lens); }
.login-logo .dot { fill: var(--bad); }
.login-brand h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: .06em; line-height: 1.1; }
.login-brand p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field > label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.login-input { position: relative; display: flex; align-items: center; }
.login-input .ico { position: absolute; left: 13px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke .15s; }
.login-input input { width: 100%; height: 46px; padding: 0 46px 0 42px; font-size: 15px; border-radius: 11px; outline: none;
  background: var(--light-045); border: 1px solid var(--light-12);
  transition: border-color .15s, box-shadow .15s, background .15s; }
#loginName { padding-right: 14px; }
.login-input input:hover { border-color: var(--light-22); }
.login-input input:focus { border-color: var(--accent); background: var(--accent-a-06); box-shadow: 0 0 0 3px var(--accent-a-25); }
.login-input:focus-within .ico { stroke: var(--info-fg); }
.login-eye { position: absolute; right: 6px; width: 34px; height: 34px; padding: 0; display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px; color: var(--muted); }
.login-eye:hover { background: var(--light-07); color: var(--text); }
.login-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-eye .slash { display: none; }
.login-eye[aria-pressed="true"] .slash { display: inline; }
.login-caps { margin: 0; font-size: 12px; color: var(--warn); }
.login-err { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; color: var(--bad-fg);
  background: var(--bad-a-12); border: 1px solid var(--bad-a-35); }
.login-err:empty { display: none; }
/* 3.2.3: tlačidlo prihlásenia ako hlavné tlačidlo vo zvyšku klienta (farba dôrazu, rovnaké zaoblenie) */
.login-submit { height: 44px; margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 15px; font-weight: 600; color: var(--on-accent); border: 1px solid var(--accent); border-radius: 8px;
  background: var(--accent); box-shadow: 0 8px 20px var(--accent-a-25);
  transition: background .15s, box-shadow .15s, transform .05s; }
.login-submit:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 10px 24px var(--accent-a-35); }
.login-submit:active { transform: translateY(1px); }
.login-submit:focus-visible { outline: 2px solid var(--info-fg); outline-offset: 2px; }
.login-submit:disabled { cursor: progress; filter: saturate(.75) brightness(.92); }
.login-submit .spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--light-35);
  border-top-color: var(--on-accent); animation: login-spin .8s linear infinite; }
.login-submit.busy .spin { display: block; }
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-help { margin: 2px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.login-foot { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 12px; color: var(--muted);
  text-shadow: 0 1px 3px var(--video); }
.login-foot span { display: inline-flex; align-items: center; gap: 5px; }
.login-foot a { color: inherit; }
.login-foot svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 480px) {
  .login-box { padding: 24px 18px 20px; border-radius: 16px; }
  .login-wall { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-box, .login-wall::after, .login-wall b::before { animation: none; }
}
body.need-login > header, body.need-login > main, body.need-login > footer { visibility: hidden; }

/* výber jazyka vlajkou (od 2.7.8): na prihlasovacej stránke vpravo hore v karte, po prihlásení v hlavičke */
.lang-sel { display: inline-flex; align-items: center; gap: 6px; }
.lang-sel .lang-btn { padding: 2px; border: 1px solid transparent; border-radius: 4px; background: none; line-height: 0;
  opacity: .5; cursor: pointer; transition: opacity .15s, border-color .15s; }
.lang-sel .lang-btn:hover { opacity: .9; border-color: var(--line); }
.lang-sel .lang-btn.on { opacity: 1; border-color: var(--accent); cursor: default; }
.lang-sel .lang-btn svg { display: block; width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px var(--light-18); }
.lang-top .lang-btn svg { width: 18px; height: 12px; }
.login-lang { position: absolute; top: 14px; right: 16px; z-index: 1; }
.login-lang .lang-btn svg { width: 24px; height: 16px; }

/* ---------------------------------------------------------------- mapy kamier (2.8.0, mapa.js) */
body.map .live-only { display: none !important; }
/* mapa na celú šírku – zoznam kamier vľavo pri mape nič nerobí (mapa má vlastný výber máp) */
body.map aside, body.map #camsToggle { display: none !important; }
#maps { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* lišta mapy (3.2.3): výber mapy, cesta, podklad, „názvy kamier“ ako prepínač, Celá mapa, Upraviť, Nová mapa s ikonami */
.map-bar { display: flex; align-items: center; gap: 8px; padding: 5px 8px; flex-wrap: wrap; }
.map-bar .sp { flex: 1; }
.map-bar .chk { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.map-bar button { display: inline-flex; align-items: center; gap: 6px; }
.map-bar button .ico { width: 15px; height: 15px; }
#mapSel { max-width: 260px; }
#mapCrumbs { color: var(--muted); }
#mapCrumbs button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 2px 4px; }
#mapCrumbs button.cur { color: var(--text); font-weight: 600; cursor: default; }
.map-wrap { position: relative; flex: 1; min-height: 0; background: var(--map-bg); }
#mapCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.map-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px;
             color: var(--muted); text-align: center; pointer-events: none; }
.map-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--glass-96); color: var(--text); font-size: 12px;
           padding: 5px 9px; border-radius: 7px; white-space: pre; border: 1px solid var(--light-13); box-shadow: var(--shadow); }
.map-attr { position: absolute; right: 6px; bottom: 3px; font-size: 11px; color: var(--text); text-shadow: 0 1px 2px var(--video);
            pointer-events: none; }
.map-pop { position: absolute; z-index: 10; background: var(--video); border: 1px solid var(--accent); border-radius: 8px;
           box-shadow: var(--shadow); touch-action: none; cursor: move; overflow: hidden; }
/* mobil: jedno okienko ukotvené dole pod mapou cez celú šírku (ťuknutie na inú kameru ho vymení) */
.map-pop.dock { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; border-radius: 10px 10px 0 0;
                border-width: 1px 0 0; cursor: default; }
.map-pop canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.map-pop .pv-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
                   color: var(--text); font-size: 12px; pointer-events: none; text-align: center; padding: 0 8px;
                   text-shadow: 0 1px 2px var(--video); }
/* okienko kamery na mape (3.2.1): názov a štatistika na obraze ako v okne mriežky, tlačidlá okrúhle ikony */
.map-pop .pv-stats { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 8px 4px; pointer-events: none;
                     font-size: 11.5px; line-height: 1.3; font-variant-numeric: tabular-nums;
                     background: linear-gradient(transparent, var(--shade-65)); color: var(--text); white-space: nowrap;
                     overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px var(--video); }
.map-pop .pv-stats:empty { display: none; }
.map-pop .pv-stats .bad { color: var(--warn-fg); font-weight: 600; }
.map-pop .pv-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 4px;
                   padding: 4px 5px 12px 8px; background: linear-gradient(var(--shade-72), var(--shade-35) 60%, transparent); }
.map-pop .pv-title { flex: 1; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                     text-shadow: 0 1px 2px var(--video); }
.map-pop .pv-bar button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px;
                          padding: 0; border-radius: 50%; border: 1px solid var(--light-15); background: var(--glass-74);
                          color: var(--text); cursor: pointer; }
.map-pop .pv-bar button .ico { width: 14px; height: 14px; }
.map-pop .pv-bar button[hidden] { display: none; }
.map-pop .pv-bar button:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) { .map-pop:not(:hover) .pv-bar button { visibility: hidden; } }
/* posledná udalosť kamery v okienku na mape (2.9.6) – klik prehrá záznam */
/* pás udalosti ako značka: farebná bodka, čas a druh, ▶ záznam */
.map-pop .pv-ev { position: absolute; left: 8px; top: 34px; max-width: calc(100% - 16px); display: flex; align-items: center;
                  gap: 6px; padding: 2px 9px 2px 7px; background: var(--glass-90); border: 1px solid var(--c, var(--bad));
                  border-radius: 999px; font-size: 12px; cursor: pointer; color: var(--text); font-variant-numeric: tabular-nums; }
.map-pop .pv-ev:hover { background: var(--glass-90); }
.map-pop .pv-ev-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--bad)); }
.map-pop .pv-ev-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-pop .pv-ev-play { flex: none; display: inline-flex; align-items: center; gap: 3px; color: var(--info-fg); font-weight: 600; }
.map-pop .pv-ev-play .ico { width: 12px; height: 12px; fill: currentColor; }
@media (max-width: 700px) { #mapSel { max-width: 60vw; } }
/* úpravy mapy správcom (2.9.2, mapa.js) – zoznam kamier vľavo (len Kamery) na umiestnenie kamier */
body.map.map-edit aside { display: flex !important; }
body.map.map-edit #sideTabs { display: none; }
body.map.map-edit .side-rail, body.map.map-edit .side-head, body.map.map-edit .side-grip { display: none; }
body.map.map-edit .side-body { display: flex !important; }
body.map.map-edit .side-pane[data-side=cams] { display: flex !important; }
body.map.map-edit .side-pane:not([data-side=cams]) { display: none !important; }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) { body.map.map-edit #camsToggle { display: inline-block !important; } }
/* lišta úprav (3.2.3): skupiny s ikonami – Uložiť / Zrušiť / ● neuložené · Kamera / Budova / Popis · Späť / Zmazať ·
   Výrez / Podklad / Vlastnosti */
.map-editbar { display: flex; align-items: center; gap: 6px 10px; padding: 5px 8px; flex-wrap: wrap;
  border-top: 1px solid var(--line); background: var(--panel); }
.map-editbar .me-grp { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; padding-right: 10px;
  border-right: 1px solid var(--line); }
.map-editbar .me-grp:last-of-type { border-right: 0; padding-right: 0; }
.map-editbar button { display: inline-flex; align-items: center; gap: 6px; }
.map-editbar button .ico { width: 15px; height: 15px; }
.map-editbar button.danger { color: var(--bad-fg); }
.map-editbar button.danger:hover:not(:disabled) { background: var(--bad-bg); border-color: var(--bad); }
.map-editbar button.on { background: var(--accent-a-25); border-color: var(--accent); }
.map-editbar button:disabled { opacity: .45; cursor: default; }
.me-dirty { color: var(--warn-fg); background: var(--warn-bg); border-radius: 999px; padding: 1px 9px; font-size: 12px; white-space: nowrap; }
.map-hint { position: absolute; z-index: 4; top: 10px; left: 50%; transform: translateX(-50%); display: flex;
  align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 16px); padding: 7px 8px 7px 12px; border-radius: 10px;
  background: var(--glass-96); color: var(--text); border: 1px solid var(--light-13); box-shadow: var(--shadow); }
.map-hint span { flex: 1; }
.map-hint button:disabled { opacity: .45; cursor: default; }
.map-busy { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: var(--glass-60); }
.mb-box { width: min(440px, calc(100% - 32px)); padding: 16px 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.mb-txt { margin-bottom: 10px; }
.mb-bar { position: relative; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.mb-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.mb-bar.ind i { position: absolute; width: 35%; animation: mb-ind 1.2s linear infinite; }
@keyframes mb-ind { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .mb-bar.ind i { animation: none; width: 100%; opacity: .5; } }
dialog.map-dlg { width: min(560px, calc(100vw - 32px)); }
.map-dlg .map-form { display: flex; flex-direction: column; gap: 8px; }
.map-dlg label.radio { flex-direction: row; align-items: flex-start; gap: 6px; color: var(--text); cursor: pointer; }
.map-dlg label.radio input { margin-top: 2px; }
.map-dlg select { max-width: 100%; }
.mf-sub { display: flex; flex-direction: column; gap: 6px; margin-left: 22px; }
.mf-sub.off { opacity: .5; }
.mf-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mf-row input { flex: 1; min-width: 0; }
.mf-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-places { list-style: none; margin: 0; padding: 0; max-height: 132px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 4px; }
.map-places:empty { display: none; }
.map-places li { padding: 4px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-places li:hover { background: var(--panel2); }
.map-places li.on { background: var(--accent-a-25); }
.map-places li.note { color: var(--muted); cursor: default; }
.map-places li.bad { color: var(--bad); }
.map-dlg .muted { color: var(--muted); }
.map-dlg .pre { white-space: pre-line; font-size: 12px; margin: 0; }
.dlg-btns .left { margin-right: auto; }
.dlg-btns button.danger:not(.primary) { color: var(--bad); }
/* panel Udalosti (2.9.3): karty s fotkou ako v desktop aplikácii, zväčšenie fotky vpravo od panela */
.ev-head { display: flex; align-items: center; gap: 6px; }
/* súhrn filtra ako značky (3.2.1) */
.ev-sum { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 3px; }
.ev-sum .chip { font-size: 11px; line-height: 17px; padding: 0 7px; border-radius: 999px; background: var(--gray-bg);
  color: var(--gray-fg); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.ev-list li.ev { flex: none; display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 8px; cursor: pointer;
  background: var(--raise); border: 1px solid transparent; border-left: 3px solid var(--c, var(--muted)); user-select: none; }
.ev-list li.ev:hover { border-color: var(--accent); border-left-color: var(--c, var(--muted)); }
.ev-list li.ev.live { border-color: var(--c, var(--bad)); box-shadow: inset 0 0 0 1px var(--c, var(--bad)); }
.ev-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: var(--video); border-radius: 4px; }
.ev-txt { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; padding: 0 22px 0 2px; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.ev-l1 { min-width: 0; overflow-wrap: anywhere; }
.ev-l1 b { font-variant-numeric: tabular-nums; font-size: 13.5px; }
.ev-l2 { grid-column: 2; display: flex; gap: 8px; min-width: 0; color: var(--muted); font-size: 12px; }
.ev-cam { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-len { flex: none; font-variant-numeric: tabular-nums; }
/* prebiehajúca udalosť: „trvá“ ako značka */
.ev-list li.ev.live .ev-len { color: var(--bad-fg); background: var(--bad-bg); border-radius: 999px; padding: 0 7px; font-weight: 600;
  font-size: 11px; }
.ev-more { position: absolute; right: 0; top: -2px; display: inline-flex; align-items: center; justify-content: center; width: 24px;
  height: 24px; padding: 0; background: none; border-color: transparent; border-radius: 6px; opacity: 0; }
.ev-more .ico { width: 15px; height: 15px; }
.ev-list li.ev:hover .ev-more, .ev-more:focus-visible { opacity: 1; }
@media (hover: none) { .ev-more { opacity: 1; } }
.ev-more-btn { flex: none; }
/* upozornenia na nové udalosti (2.9.6): tlačidlo v paneli, počet na ikone Udalosti, okienka vpravo dole */
.ev-alert-btn { flex: none; padding: 0 5px; height: 24px; display: flex; align-items: center; }
.ev-alert-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; }
.ev-alert-btn .off-x { display: none; }
.ev-alert-btn.off { color: var(--muted); }
.ev-alert-btn.off .off-x { display: inline; }
.rail-badge { position: absolute; right: -3px; top: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--bad); color: var(--on-accent); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  pointer-events: none; }
.al-stack { position: fixed; right: 12px; bottom: 34px; z-index: 55; display: flex; flex-direction: column; gap: 8px;
  width: min(300px, calc(100vw - 24px)); pointer-events: none; }
.al-card { position: relative; pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  padding: 5px; background: var(--glass-97); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--bad));
  border-radius: 6px; box-shadow: 0 6px 24px var(--shade-55); animation: al-in .2s ease-out; }
.al-card:hover { border-color: var(--accent); border-left-color: var(--c, var(--bad)); }
.al-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--video); border-radius: 4px; }
.al-txt { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; padding: 0 20px 0 2px; }
.al-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--bad)); }
.al-l1 { min-width: 0; overflow-wrap: anywhere; }
.al-l1 b { font-variant-numeric: tabular-nums; }
.al-cam { grid-column: 2; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-x { position: absolute; right: 3px; bottom: 3px; padding: 0 6px; background: none; border-color: transparent; }
@keyframes al-in { from { transform: translateY(10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .al-card { animation: none; } }
body.fs .al-stack { bottom: 12px; }
.ev-pop { position: fixed; z-index: 40; pointer-events: none; padding: 6px; background: var(--raise); border: 1px solid var(--gray);
  border-radius: 6px; box-shadow: 0 10px 40px var(--shade-60); }
.ev-pop img { display: block; width: 100%; object-fit: contain; background: var(--video); border-radius: 3px; }
.ev-pop-cap { padding: 4px 2px 0; color: var(--text); font-size: 12px; }
dialog.ev-dlg { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog.ev-dlg[open] { display: flex; flex-direction: column; }
.ev-dlg-body { overflow-y: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ev-grp { position: relative; margin: 0; padding: 6px 10px 8px; border: 1px solid var(--line); border-radius: 6px;
  display: flex; flex-direction: column; gap: 3px; }
.ev-grp legend { padding: 0 4px; color: var(--text); font-weight: 600; }
.ev-grp-btns { position: absolute; right: 8px; top: -2px; display: flex; gap: 2px; }
.ev-grp-btns button { background: none; border-color: transparent; color: var(--accent); padding: 0 4px; font-size: 12px; }
.ev-dlg .ev-grp label.chk { flex-direction: row; color: var(--text); align-items: flex-start; }
.ev-dlg .ev-grp label.chk input { margin-top: 2px; padding: 0; }
.ev-cam-find { margin: 4px 0; }
.ev-cam-list { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 4px; padding: 4px 6px; }
/* osoby a vozidlá na osi záznamu (2.9.3): fotka nad osou pri myši */
.pb-pic { position: absolute; bottom: calc(100% + 34px); z-index: 5; width: 320px; max-width: 100%; padding: 5px; pointer-events: none;
  background: var(--glass-96); border: 1px solid var(--light-13); border-radius: 10px; box-shadow: var(--shadow); }
.pb-pic img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--video); border-radius: 6px; }
.pb-pic-cap { padding: 5px 3px 1px; color: var(--text); font-size: 12px; }
/* okná na ďalších monitoroch (2.9.9): tlačidlo „Monitory“ v hlavičke (v ďalšom okne „Okno N“ – zvýraznené, nech je
   vidieť, ktoré okno to je), pás po štarte hlavného okna s ponukou otvoriť okná, ktoré boli otvorené */
.win-btn.extra { border-color: var(--accent); color: var(--info-fg); background: var(--info-bg); }
.win-banner { flex-wrap: wrap; gap: 6px 10px; background: var(--info-bg); border-left-color: var(--accent); }
.win-banner > .ico { color: var(--info-fg); }
.win-banner .wb-txt { flex: 1 1 260px; }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) { #winBtn, .win-banner { display: none !important; } }
/* alarmy (3.0.0): ikona Alarmy (červená, keď je nový alarm), panel, okno s alarmom, Stráženie v hlavičke */
#sideTabs button.al-hot { color: var(--bad-fg); }
.al-seg button { padding: 2px 8px; }
.al-list li.al-item.st-new { box-shadow: inset 0 0 0 1px var(--c, var(--bad)); }
.al-list li.al-item.cur { border-color: var(--accent); }
/* stav alarmu ako farebná značka s bodkou – ako v správe (nový / prijatý / vybavený) */
.al-st { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; border-radius: 999px;
  padding: 0 8px; line-height: 17px; background: var(--gray-bg); color: var(--gray-fg); }
.al-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.al-st.st-new { background: var(--bad-bg); color: var(--bad-fg); }
.al-st.st-acked { background: var(--warn-bg); color: var(--warn-fg); }
.al-st.st-done { background: var(--ok-bg); color: var(--ok-fg); }
dialog.ap { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: auto;
  background: var(--panel); color: var(--text); border: 1px solid var(--c, var(--bad)); border-top: 5px solid var(--c, var(--bad));
  border-radius: 8px; box-shadow: 0 16px 60px var(--shade-70); }
dialog.ap::backdrop { background: var(--shade-45); }
dialog.ap.is-new { animation: ap-glow 1.2s ease-in-out infinite alternate; }
@keyframes ap-glow { from { box-shadow: 0 16px 60px var(--shade-70); } to { box-shadow: 0 0 0 4px var(--c, var(--bad)), 0 16px 60px var(--shade-70); } }
@media (prefers-reduced-motion: reduce) { dialog.ap.is-new { animation: none; } }
/* okno alarmu (3.2.3): spoločný štýl dialógu – značka priority a druh, kamera · čas, skryť ikonou; obraz a fotka vedľa
   seba; výsledky akcií a stav ako značky; vľavo ďalšie akcie, vpravo Vybaviť… a Prijať (hlavné) */
.ap-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 4px 18px; }
.ap-prio { flex: none; background: var(--c, var(--bad)); color: var(--on-color); font-weight: 700; font-size: 11.5px; letter-spacing: .04em;
  border-radius: 999px; padding: 2px 10px; text-transform: uppercase; }
.ap-title { flex: 1; min-width: 0; font-size: 16.5px; overflow-wrap: anywhere; }
.ap-nav { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ap-nav button { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px 0 10px; height: 30px; }
.ap-nav button .ico { width: 15px; height: 15px; }
.ap-min { flex: none; width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.ap-min .ico { width: 17px; height: 17px; }
.ap-sub { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 0 18px 10px; color: var(--muted); }
.ap-cam { color: var(--text); font-weight: 600; }
.ap-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; padding: 0 18px; }
.ap-live, .ap-pic { position: relative; background: var(--video); border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; }
.ap-live canvas, .ap-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ap-pic img { cursor: zoom-in; }
.ap-live .msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8px;
  color: var(--text); font-size: 12.5px; text-align: center; pointer-events: none; }
.ap-cap { position: absolute; left: 8px; top: 8px; font-size: 11px; background: var(--glass-80); color: var(--text); border-radius: 999px;
  padding: 1px 8px; pointer-events: none; }
.ap-res-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 0; }
.ap-res { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px 2px 7px;
  max-width: 100%; }
.ap-res .ico { width: 13px; height: 13px; flex: none; }
.ap-res.ok { color: var(--ok-fg); background: var(--ok-bg); } .ap-res.bad { color: var(--bad-fg); background: var(--bad-bg); }
.ap-res small { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.ap-state { padding: 10px 18px 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ap-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 2px 11px; }
.ap-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ap-st.new { color: var(--bad-fg); background: var(--bad-bg); }
.ap-st.acked { color: var(--warn-fg); background: var(--warn-bg); } .ap-st.done { color: var(--ok-fg); background: var(--ok-bg); }
.ap-note { color: var(--muted); }
.ap-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 18px 16px; margin-top: 12px;
  border-top: 1px solid var(--line); }
.ap-more, .ap-main { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-sp { flex: 1; }
.ap-btns button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; height: 34px; }
.ap-btns button .ico { width: 16px; height: 16px; }
.ap-btns button[hidden] { display: none; }
.ap-ack { min-width: 120px; font-weight: 600; }
.arm-btn.armed { border-color: var(--bad); color: var(--bad-fg); background: var(--bad-bg); }
.arm-btn.armed .ico { fill: var(--bad-a-35); }
.arm-btn.muted .arm-sub, .arm-btn.muted .arm-short { color: var(--warn-fg); }
.arm-sub { color: var(--muted); }
.arm-btn.armed .arm-sub { color: inherit; }
.arm-txt + .arm-sub:not(:empty)::before { content: "·"; margin: 0 6px 0 2px; }
/* Stráženie (3.2.3): zóny so stavom ako značka, tlačidlá s ikonami, dočasne vypnuté alarmy s ikonou a „ešte N min“ */
.arm-menu { width: min(400px, calc(100vw - 16px)); max-height: calc(100vh - 80px); overflow-y: auto; padding: 6px; }
.arm-menu .hd { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 6px 8px 4px; }
.arm-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.arm-row:hover { background: var(--panel2); }
.arm-row .arm-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.arm-row small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.arm-row button { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; }
.arm-row button .ico { width: 15px; height: 15px; }
.arm-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--raise); color: var(--muted); }
.arm-ico .ico { width: 16px; height: 16px; }
.arm-row.on .arm-ico { background: var(--bad-bg); color: var(--bad-fg); }
.arm-row.muted .arm-ico { background: var(--warn-bg); color: var(--warn-fg); }
.arm-sts { display: flex; flex-wrap: wrap; gap: 4px; }
.arm-st { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 0 8px;
  line-height: 18px; background: var(--gray-bg); color: var(--gray-fg); }
.arm-st .ico { width: 11px; height: 11px; }
.arm-st.on { background: var(--bad-bg); color: var(--bad-fg); }
.arm-st.off { background: var(--ok-bg); color: var(--ok-fg); }
.arm-st.plan { background: var(--info-bg); color: var(--info-fg); }
.arm-st.left { background: var(--warn-bg); color: var(--warn-fg); }
.arm-row.on b { color: var(--text); }
.arm-empty { color: var(--muted); font-size: 12px; padding: 2px 8px 6px; }
.arm-menu .arm-act { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border-color: transparent;
  padding: 8px 10px; }
.arm-menu .arm-act .ico { width: 15px; height: 15px; color: var(--muted); }
.arm-menu .arm-act:hover { background: var(--panel2); }
.badge.muted { background: var(--warn-bg); color: var(--warn-fg); }
dialog.al-dlg { width: min(440px, calc(100vw - 32px)); }
.al-dlg-body { display: flex; flex-direction: column; gap: 8px; }
.al-dlg-body label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12.5px; }
.al-dlg-body p { margin: 0 0 4px; color: var(--muted); }
.al-dlg select, .al-dlg-body input { background: var(--input); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px;
  color: var(--text); font-size: 13.5px; }
/* okno alarmu na mobile: na celú obrazovku, obraz a fotka pod sebou, Prijať a Vybaviť vedľa seba dole bez posúvania */
@media (max-width: 760px) {
  dialog.ap[open] { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0;
    display: flex; flex-direction: column; overflow: hidden; }
  .ap-head { flex-wrap: wrap; padding: 10px 10px 4px 12px; row-gap: 6px; }
  .ap-title { flex-basis: calc(100% - 50px); order: 2; font-size: 15.5px; }
  .ap-prio { order: 1; } .ap-min { order: 1; margin-left: auto; width: 40px; height: 40px; } .ap-nav { order: 3; }
  .ap-sub { padding: 0 12px 6px; }
  .ap-media { flex: 1 1 auto; min-height: 0; overflow-y: auto; grid-template-columns: 1fr; padding: 0 12px; align-content: start; }
  .ap-res-list, .ap-state { padding-left: 12px; padding-right: 12px; }
  .ap-btns { flex: none; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); margin-top: 8px; gap: 8px; }
  .ap-more { width: 100%; }
  .ap-more button { flex: 1 1 auto; height: 40px; }
  .ap-sp { display: none; }
  .ap-main { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ap-main button { height: 46px; }
  .menu, .menu.pop-menu { max-width: calc(100vw - 16px); }
  .menu.arm-menu, .menu.pop-menu, .menu.pb-more, #ptzMenu { left: 8px !important; right: 8px; width: auto; }
  dialog.dlg { width: calc(100vw - 16px); max-width: calc(100vw - 16px); }
  .menu button, .pop-menu > button { min-height: 40px; }
}
/* záznam na mobile (3.2.2): pod obrazom najviac 3 riadky ovládania – 1: deň a čas; 2: ⏮ −10 ◁ ▶ ▷ +10 ⏭;
   3: udalosť ◀ ▶, rýchlosť, Viac, Stiahnuť (lupa, snímka, informácie, zvuk sú v ponuke Viac) – potom legenda, rozsah a os */
@media (max-width: 760px) {
  .pb-bar { gap: 6px 6px; padding: 6px; }
  .pb-bar button { height: 38px; }
  .pb-bar .pb-ic { width: 38px; }
  .pb-bar .pb-ic.pb-val { width: auto; }
  #pbSpeed { height: 38px; }
  .pb-time { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
  .pb-transport { flex-basis: 100%; justify-content: space-between; }
  .pb-play { width: 46px; height: 46px !important; }
  .pb-legrow { min-height: 0; }
  .pb-range button { height: 30px; }
  .pb-axis { height: 80px; }
  .ex-form { gap: 6px 8px; }
}
/* 3.2.3 – mobil */
body.grid-stack #grid { grid-template-columns: repeat(var(--scol, 1), minmax(0, 1fr)); grid-template-rows: none;
  grid-auto-rows: var(--srow, auto); align-content: start; overflow-y: auto; }
body.grid-stack #grid .tile { min-height: 0; }
@media (max-width: 760px) {
  /* lišta v Zázname a na Mape v jednom riadku: bez značky VMS, celá obrazovka v prvom riadku */
  body.rec .brand, body.map .brand { display: none; }
  body.rec #fsBtn, body.map #fsBtn { order: 1; }
  /* záznam: obraz 16 : 9 bez čiernych pásov, legenda najviac v 2 riadkoch (farba a počet, popis pod prstom), rozsah pod ňou */
  #playback .pb-video { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .pb-legrow { flex-direction: column; align-items: stretch; gap: 4px; }
  .pb-evinfo { gap: 3px 10px; }
  .pb-evinfo .lg .lg-t { display: none; }
  .pb-range { align-self: flex-end; }
  #playback { overflow-y: auto; }
  #playback.multi .pb-axis { height: 92px; }
  /* mapa: úpravy a ďalšie voľby v ponuke „⋯“ */
  .map-bar { gap: 6px; }
  .map-bar .map-adm, .map-bar .map-names, #mapFit { display: none !important; }
  #mapSel { max-width: none; flex: 1; min-width: 0; }
  #mapCrumbs { order: 5; flex-basis: 100%; }
  #mapCrumbs:empty { display: none; }
}
@media (max-height: 500px) and (pointer: coarse) and (min-width: 761px) {
  /* telefón na šírku: lišta záznamu a mapy v jednom riadku ako na výšku */
  body.rec .brand, body.map .brand { display: none; }
  body.rec #fsBtn, body.map #fsBtn { order: 1; }
  #playback { overflow-y: auto; }
  #playback .pb-video { flex: none; height: 62vh; }
  #playback.multi .pb-wins { flex: none; height: 62vh; }
  #playback.multi .pb-wins .pb-video { height: auto; }
}
/* 3.3.0 – mobil na výšku: okná záznamu pod sebou (16 : 9); posúva sa len oblasť okien, lišta a os ostanú na mieste */
@media (max-width: 760px) and (orientation: portrait) {
  /* stĺpec (nie mriežka – riadky mriežky by sa stlačili do jej výšky a okná 16 : 9 by sa prekrývali) */
  #playback.multi .pb-wins { display: flex; flex-direction: column; overflow-y: auto; flex: 1 1 0; min-height: 25vh; }
  #playback.multi .pb-wins .pb-video { flex: none; width: 100%; aspect-ratio: 16 / 9; height: auto; }
}
/* 3.3.4 – telefón na výšku: pri oknách pod sebou (živý obraz, viac ako 1 okno) a pri zázname s 2 / 4 oknami sa posúva
   celá stránka (nie vnútorná oblasť), aby prehliadač (Chrome, Safari) pri posúvaní schoval adresnú lištu. Triedy na
   <html> nastavuje app.js (updateDocScroll). Horná lišta je prilepená hore, ovládanie záznamu s osou dole; spodný riadok
   stavu je na konci stránky. Výška okien sa ráta zo šírky – pri schovaní / ukázaní lišty sa nič neprepočítava. */
.pb-ctl { display: contents; }
html.doc-scroll { overscroll-behavior-y: none; scroll-padding-top: var(--hdr-h, 0px); }   /* bez „ťahom nadol obnoviť
   stránku“; posun k prvku (fokus, scrollIntoView) neskončí pod prilepenou lištou */
html.doc-rec { scroll-padding-bottom: var(--pbctl-h, 0px); }
html.doc-scroll body { height: auto; min-height: 100vh; overflow-x: hidden; overflow-y: auto; }   /* 100vh = výška pri schovanej lište prehliadača – aj krátka stránka sa dá posunúť o lištu */
html.doc-scroll header { position: sticky; top: 0; }
html.doc-scroll main { flex: 1 0 auto; }
html.doc-scroll aside { position: fixed; top: var(--hdr-h, 0px); bottom: 0; overscroll-behavior: contain; }
html.doc-scroll body.cams-open { overflow: hidden; }          /* vysunutý panel (☰): stránka pod ním stojí */
html.doc-live body.grid-stack #grid { overflow: visible; }
html.doc-rec #playback { overflow: visible; }
html.doc-rec #playback.multi .pb-wins { overflow: visible; flex: none; min-height: 0; }
html.doc-rec .pb-ctl { display: flex; flex-direction: column; gap: 4px; position: sticky; bottom: 0; z-index: 15; margin-top: auto;
  margin-left: -2px; margin-right: -2px; padding: 4px 2px calc(2px + env(safe-area-inset-bottom)); background: var(--bg);
  border-top: 1px solid var(--line); }
html.doc-rec .pb-export { max-height: 30vh; }
