/* Mobilne zobrazenie (telefon, maly tablet). Nacitava sa posledne, po theme.css. Desktop sa tymto suborom nemeni. */

.tscroll { overflow-x: auto; max-width: 100%; }

@media (max-width: 900px) {
  /* tabulky s mnohymi stlpcami sa neskracuju na nepouzitelnu sirku, ale posuvaju sa do strany (s tienom na okraji) */
  .tscroll, .tablewrap {
    -webkit-overflow-scrolling: touch;
    background-image:
      linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)), linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)),
      radial-gradient(farthest-side at 0 50%, rgba(23, 32, 51, .22), rgba(23, 32, 51, 0)),
      radial-gradient(farthest-side at 100% 50%, rgba(23, 32, 51, .22), rgba(23, 32, 51, 0));
    background-position: 0 0, 100% 0, 0 0, 100% 0;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
  }
  .tscroll > table:has(thead th:nth-child(4)), .tablewrap > table:has(thead th:nth-child(4)) { min-width: 600px; }
  .tscroll > table:has(thead th:nth-child(6)), .tablewrap > table:has(thead th:nth-child(6)) { min-width: 820px; }
  .tscroll > table:has(thead th:nth-child(8)), .tablewrap > table:has(thead th:nth-child(8)) { min-width: 1000px; }
}

@media (max-width: 720px) {
  /* menu Akcie v detaile zariadenia: spodny panel namiesto okna mimo obrazovky */
  .amenu-body { position: fixed; left: 10px; right: 10px; bottom: 10px; top: auto; width: auto; max-width: none; max-height: 75vh; overflow-y: auto; z-index: 80; }

  /* zalozky a filtre: jeden riadok s posuvom namiesto 3 riadkov */
  .gtabs, .gsub { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .gtabs::-webkit-scrollbar, .gsub::-webkit-scrollbar { display: none; }
  .gtab, .schip { flex: none; white-space: nowrap; }
  .gtab { padding: 10px 12px; }

  /* prehlad: statistika tiketov na 2 stlpce */
  .tstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tstats > div:nth-child(2n) { border-right: 0; }
  .tstats > div:nth-child(n+3) { border-top: 1px solid var(--border); }

  /* casova os / udalosti: text na vlastny riadok */
  .tlrow { gap: 6px 10px; }
  .tlrow .tlwhen { flex: 0 0 auto; }
  .tlrow .tltext { flex: 1 0 100%; order: 3; }

  /* formulare: polia na celu sirku, bez pevnych sirok */
  .app .ipgrid label > input, .app .ipgrid label > select, .app .ipgrid label > textarea,
  .app .ipgrid label > input[type=text], .app .ipgrid label > input[type=search], .app .ipgrid .srch input,
  .app .ipgrid label > input[type=number], .app .ipgrid label > input[type=time] { width: 100%; }
  .trow input[type=search], .trow .grow { width: 100%; min-width: 0; }
  .exform { min-width: 0; }
  .cardhead:has(> .hrow) { flex-wrap: wrap; }
  .cardhead:has(> .hrow) > * { flex: 1 1 100%; min-width: 0; }
  .hrow > form { padding-right: 0; width: 100%; }
  .hrow > form.hsep { border-left: 0; padding-left: 0; }

  /* dotykove ciele a pisma (iOS neprybli po kliknuti do pola, ak je pismo >= 16 px) */
  .btn, button.btn { min-height: 40px; }
  .schip { height: 36px; }
  select, textarea, input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]) { min-height: 40px; font-size: 16px; }
  .topbar .navbtn { min-width: 40px; min-height: 40px; }

  /* plavajuce oznamenia nad spodnym okrajom */
  .act-stack { left: 10px; right: 10px; width: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }

  /* ---- zoznam zariadeni ako karty ---- */
  .devtbl { min-width: 0 !important; width: 100%; }
  .devtbl thead { display: none; }
  .devtbl, .devtbl tbody { display: block; }
  .devtbl tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
  .devtbl tr[hidden] { display: none; }
  .devtbl td { display: block; padding: 0; border: 0; min-width: 0; }
  .devtbl td:nth-child(1) { grid-column: 3; grid-row: 1; justify-self: end; white-space: nowrap; }
  .devtbl td:nth-child(2) { grid-column: 1 / 3; grid-row: 1; font-size: 16px; }
  .devtbl td:nth-child(3) { grid-column: 1 / 3; grid-row: 2; }
  .devtbl td:nth-child(4) { grid-column: 3; grid-row: 2; justify-self: end; }
  .devtbl td:nth-child(5) { grid-column: 1; grid-row: 3; }
  .devtbl td:nth-child(6) { grid-column: 2; grid-row: 3; }
  .devtbl td:nth-child(7) { grid-column: 3; grid-row: 3; }
  .devtbl td:nth-child(8) { grid-column: 1; grid-row: 4; }
  .devtbl td:nth-child(9) { grid-column: 2; grid-row: 4; }
  .devtbl td:nth-child(10) { grid-column: 3; grid-row: 4; justify-self: end; }
  .devtbl td:nth-child(n+5)::before { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .devtbl td:nth-child(5)::before { content: "CPU"; }
  .devtbl td:nth-child(6)::before { content: "RAM"; }
  .devtbl td:nth-child(7)::before { content: "Disk"; }
  .devtbl td:nth-child(8)::before { content: "Zabezp."; }
  .devtbl td:nth-child(9)::before { content: "Uptime"; }
  .devtbl td:nth-child(10)::before { content: "Naposledy"; text-align: right; }
  .devtbl meter { width: 100%; display: block; }
  /* detail tlaciarne: tabulky ako karty */
  .suptbl, .insttbl, .sctbl { min-width: 0 !important; width: 100%; }
  .suptbl thead, .insttbl thead, .sctbl thead { display: none; }
  .suptbl, .suptbl tbody, .insttbl, .insttbl tbody, .sctbl, .sctbl tbody { display: block; }
  .suptbl tr, .insttbl tr, .sctbl tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; padding: 10px 12px; border-top: 1px solid var(--border); }
  .suptbl td, .insttbl td, .sctbl td { display: block; padding: 0; border: 0; min-width: 0; }
  .suptbl tr { grid-template-columns: 1.6rem 1fr; }
  .suptbl td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .suptbl td:nth-child(2) { grid-column: 2; grid-row: 1; font-weight: 600; }
  .suptbl td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .suptbl td:nth-child(4) { grid-column: 2; grid-row: 3; }
  .insttbl td:nth-child(1) { grid-column: 1; grid-row: 1; font-weight: 600; }
  .insttbl td:nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; }
  .insttbl td:nth-child(3), .insttbl td:nth-child(4) { grid-column: 1 / -1; }
  .insttbl td:nth-child(3):empty, .insttbl td:nth-child(4):empty { display: none; }
  .sctbl td:nth-child(1) { grid-column: 1; grid-row: 1; font-weight: 600; }
  .sctbl td:nth-child(5) { grid-column: 2; grid-row: 1; justify-self: end; }
  .sctbl td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .sctbl td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
  .sctbl td:nth-child(4) { grid-column: 1 / -1; grid-row: 4; font-size: 12.5px; color: var(--muted); }
  .sctbl td:nth-child(4)::before { content: "Účet: "; }
  .sctbl td:nth-child(6) { grid-column: 1 / -1; grid-row: 5; display: flex; gap: 8px; flex-wrap: wrap; }
  .wz .row { flex-wrap: wrap; }
  .wz .row input[type=text], .wz .row input[type=password] { flex: 1 1 100%; min-width: 0; }
  /* tlaciarne: vlastne stlpce */
  .prtbl td:nth-child(3) { grid-column: 1 / 3; grid-row: 2; }
  .prtbl td:nth-child(4) { grid-column: 1 / 3; grid-row: 3; font-size: 12.5px; color: var(--muted); }
  .prtbl td:nth-child(5) { grid-column: 3; grid-row: 3; justify-self: end; font-size: 12.5px; color: var(--muted); }
  .prtbl td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; }
  .prtbl td:nth-child(7) { grid-column: 1 / -1; grid-row: 5; }
  .prtbl td:nth-child(7):has(.muted) { display: none; }
  .prtbl td:nth-child(8) { grid-column: 1; grid-row: 6; }
  .prtbl td:nth-child(9) { grid-column: 2 / -1; grid-row: 6; justify-self: end; text-align: right; }
  .prtbl td:nth-child(4)::before, .prtbl td:nth-child(5)::before { content: none; }
  .prtbl td:nth-child(6)::before { content: "Tonery"; }
  .prtbl td:nth-child(7)::before { content: "Hlásenia"; }
  .prtbl td:nth-child(8)::before { content: "Strán"; }
  .prtbl td:nth-child(9)::before { content: "Naposledy"; }
  .prtbl .tonerx { display: grid; grid-template-columns: 1.4rem 1fr 3rem; align-items: center; width: 100%; margin: 2px 0; }
  .prtbl .tonerx meter { width: 100%; }

  /* ---- zoznam problemov ako karty ---- */
  .probtbl { min-width: 0 !important; width: 100%; }
  .probtbl thead { display: none; }
  .probtbl, .probtbl tbody { display: block; }
  .probtbl tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
  .probtbl td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .probtbl td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .probtbl td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .probtbl td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .probtbl td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12.5px; color: var(--muted); }
  .probtbl td:nth-child(4)::before { content: "Trvá od: "; }
  .probtbl td:nth-child(5), .probtbl td:nth-child(6) { grid-column: 1 / -1; }
  .probtbl td:nth-child(5):empty, .probtbl td:nth-child(6):empty { display: none; }
  /* ---- vysledky skenera ako karty ---- */
  .scantbl { min-width: 0 !important; width: 100%; }
  .scantbl thead { display: none; }
  .scantbl, .scantbl tbody { display: block; }
  .scantbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
  .scantbl td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .scantbl td:nth-child(1) { grid-column: 2; grid-row: 1; justify-self: end; }
  .scantbl td:nth-child(2) { grid-column: 1; grid-row: 1; }
  .scantbl td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .scantbl td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12.5px; color: var(--muted); }
  .scantbl td:nth-child(5) { grid-column: 1 / -1; grid-row: 4; font-size: 12.5px; color: var(--muted); }
  .scantbl td:nth-child(6) { grid-column: 1 / -1; grid-row: 5; }
  .scantbl td:nth-child(4):not(:empty)::before { content: "MAC: "; }
  .scantbl td:nth-child(5)::before { content: "Výrobca: "; }
  .scantbl td:nth-child(1):empty { display: none; }
  /* ---- zalohy ako karty ---- */
  .pkgtbl, .jobtbl { min-width: 0 !important; width: 100%; }
  .pkgtbl thead, .jobtbl thead { display: none; }
  .pkgtbl, .pkgtbl tbody, .jobtbl, .jobtbl tbody { display: block; }
  .pkgtbl tr, .jobtbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
  .pkgtbl td, .jobtbl td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .pkgtbl td:nth-child(1) { grid-column: 1 / -1; }
  .pkgtbl td:nth-child(2) { grid-column: 1; }
  .pkgtbl td:nth-child(3) { grid-column: 2; justify-self: end; }
  .pkgtbl td:nth-child(4) { grid-column: 1 / -1; padding-top: 6px; }
  .pkgtbl td:nth-child(4) > *:not(dialog) { display: inline-block; margin-right: 8px; }
  .jobtbl td:nth-child(2) { grid-column: 1; grid-row: 1; font-weight: 600; }
  .jobtbl td:nth-child(5) { grid-column: 2; grid-row: 1; justify-self: end; }
  .jobtbl td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .jobtbl td:nth-child(1) { grid-column: 1; grid-row: 3; font-size: 12.5px; color: var(--muted); }
  .jobtbl td:nth-child(4) { grid-column: 1 / -1; grid-row: 4; font-size: 12.5px; color: var(--muted); }
}

/* ochrana proti presahu strany do sirky (Safari inak zmensi celu stranku a menu sa orezi) */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  .shell > *, .shell main, .card { min-width: 0; max-width: 100%; }
  .side { height: 100vh; height: 100dvh; overflow-y: auto; }
  .card > table.tbl, .card > form > table.tbl { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  pre.aires, .card pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
}

/* ---- Sietove disky a zdielane priecinky (NAS) na mobile ---- */
@media (max-width: 720px) {
  .site-head { flex-wrap: wrap; gap: 8px; }
  .site-head > [data-modal], .site-head > .btn { flex: 1 1 100%; }
  .site-head .btn.primary { width: 100%; justify-content: center; }
  .ndh { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .card code { overflow-wrap: anywhere; word-break: break-all; }
  .card .prewrap { overflow-wrap: anywhere; }

  /* tabulky ako karty */
  .ndtbl, .ndftbl, .ndjtbl, .ndstbl { min-width: 0 !important; width: 100%; display: block !important; overflow: visible !important; }
  .ndtbl thead, .ndftbl thead, .ndjtbl thead, .ndstbl thead { display: none; }
  .ndtbl tbody, .ndftbl tbody, .ndjtbl tbody, .ndstbl tbody { display: block; }
  .ndtbl tr, .ndftbl tr, .ndjtbl tr, .ndstbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
  .ndtbl tr:first-child, .ndftbl tr:first-child, .ndjtbl tr:first-child, .ndstbl tr:first-child { border-top: 0; }
  .ndtbl td, .ndftbl td, .ndjtbl td, .ndstbl td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }

  /* PC: zdielanie | stav disku | prepinac */
  .ndtbl td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .ndtbl td:nth-child(3) { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
  .ndtbl td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .ndtbl td:nth-child(2):has(> span.muted:only-child) { display: none; }
  .ndtbl td:nth-child(3) .small { max-width: 11rem; text-align: right; }

  /* NAS: zdielane priecinky pre PC */
  .ndftbl td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .ndftbl td:nth-child(3) { grid-column: 2; grid-row: 1; justify-self: end; }
  .ndftbl td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-size: 12.5px; color: var(--muted); }
  .ndftbl td:nth-child(2)::before { content: "Pripojený na: "; }

  /* NAS: nove zdielania */
  .ndjtbl td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .ndjtbl td:nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; font-size: 12.5px; color: var(--muted); }
  .ndjtbl td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .ndjtbl td:nth-child(2) { grid-column: 1 / -1; grid-row: 3; font-size: 12.5px; color: var(--muted); }
  .ndjtbl td:nth-child(2)::before { content: "Zväzok: "; }

  /* NAS: prehlad zdielani (8 stlpcov) */
  .ndstbl tr { grid-template-columns: minmax(0, 1fr); }
  .ndstbl td { grid-column: 1; }
  .ndstbl td:nth-child(1) { grid-row: 1; font-size: 15px; }
  .ndstbl td:nth-child(2) { grid-row: 2; font-size: 12.5px; color: var(--muted); }
  .ndstbl td:nth-child(7) { grid-row: 3; }
  .ndstbl td:nth-child(4) { grid-row: 4; }
  .ndstbl td:nth-child(3) { grid-row: 5; }
  .ndstbl td:nth-child(5) { grid-row: 6; }
  .ndstbl td:nth-child(6) { grid-row: 7; }
  .ndstbl td:nth-child(8) { grid-row: 8; }
  .ndstbl td:nth-child(n+3)::before { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
  .ndstbl td:nth-child(3)::before { content: "Popis"; }
  .ndstbl td:nth-child(4)::before { content: "Prístup"; }
  .ndstbl td:nth-child(5)::before { content: "Kôš"; }
  .ndstbl td:nth-child(6)::before { content: "Viditeľnosť"; }
  .ndstbl td:nth-child(7)::before { content: "Pripojené na PC"; }
  .ndstbl td:nth-child(8)::before { content: "Detaily"; }
  .ndstbl td:nth-child(3):not(:has(*)):where(:empty), .ndstbl td:nth-child(7):has(> span.muted:only-child) { display: none; }

  /* prepinac: dostatocne velky dotykovy ciel */
  label.switch { min-height: 40px; display: inline-flex; align-items: center; }
  .swform .btn { width: auto; }

  /* vyber priecinka zo stromu: velke dotykove ciele, menej odsadenia */
  .pickbox { max-height: 46vh; max-height: 46dvh; padding: 4px 6px; font-size: 15px; -webkit-overflow-scrolling: touch; }
  .pickbox summary { padding: 8px 4px; }
  .pickbox details > summary::before { font-size: 16px; width: 20px; }
  .pickbox .pkshare > summary { padding: 10px 4px; font-size: 15px; }
  ul.pick { margin-left: 9px; padding-left: 6px; }
  ul.pick li > label.pk { margin-left: 20px; }
  .pick label.pk, .dbody-add .pick label.pk, .exform .pick label.pk { padding: 8px 6px; font-size: 15px; gap: 8px; }
  .pick label.pk input[type=radio] { width: 20px !important; height: 20px !important; min-width: 20px; }

  /* okna (spodny panel): scroll obsahu, pata s velkymi tlacidlami, bezpecny okraj */
  dialog.dlg-add { max-height: 94vh; max-height: 94dvh; }
  dialog.dlg-add > form, dialog.dlg-add > .dform { max-height: 94vh; max-height: 94dvh; }
  dialog.dlg-add .dbody { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 14px; }
  dialog.dlg-add .dfoot { flex-wrap: wrap; gap: 8px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  dialog.dlg-add .dfoot .grow { display: none; }
  dialog.dlg-add .dfoot .btn { flex: 1 1 40%; justify-content: center; }
  .dbody-add .exform > div:last-child .btn { width: 100%; justify-content: center; }
  .ndbox select { width: 100%; }
}

/* ---- stranka Zariadenia na telefone: menej vnorenia, kompaktne filtre, spravne stitky v kartach ---- */
@media (max-width: 720px) {
  /* filtre: hladat na celu sirku, lokalita a siet vedla seba, stavove tlacidla v jednom posuvnom riadku */
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
  .toolbar .search { grid-column: 1 / -1; max-width: none; flex: none; }
  .toolbar select[data-filter-site], .toolbar select[data-filter-net] { min-width: 0; max-width: none; width: 100%; height: 40px; font-size: 15px; }
  .toolbar .fchips { grid-column: 1 / -1; display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -2px; padding: 0 2px 2px; }
  .toolbar .fchips::-webkit-scrollbar { display: none; }
  .toolbar .fchip { flex: none; height: 34px; padding: 0 14px; font-size: 13px; white-space: nowrap; }
  .toolbar [data-filter-reset] { grid-column: 1 / -1; width: 100%; }
  .toolbar > [data-modal], .toolbar > .grow { grid-column: 1 / -1; margin: 0; }
  .toolbar .grow { margin-left: 0; width: 100%; justify-content: center; }
  .toolbar2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0 0 10px; }
  .toolbar2 .tb2-l { display: none; }
  .kchips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .kchips::-webkit-scrollbar { display: none; }
  .kchip { flex: none; height: 36px; white-space: nowrap; }
  .vtoggle { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .vbtn { justify-content: center; height: 36px; }

  /* menej vnorenych okrajov: lokalita > siet > zariadenia bez odsadenia, riadky zariadeni na celu sirku */
  .sitebox { border-radius: 12px; }
  .sitebox > .site-head { padding: 10px 12px; }
  .sitebox .netsec { padding: 8px 0 2px; }
  .sitebox .netsec > .site-head { margin: 0 8px 6px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
  .sitebox .netsec > .site-head h3 { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .sitebox .netsec > .site-head .inline { flex: 1 1 100%; }
  .sitebox .netsec > p.muted { padding: 0 12px; }
  .devgrp { margin: 0 0 8px; padding-left: 0; border-left: 0; }
  .grphead { padding: 2px 12px 4px; }
  .sitebox .devgrp .tablewrap, .tablecard .tablewrap { background-image: none; }
  .devtbl tr { padding: 12px; }
  .devtbl tbody tr:first-child { border-top: 1px solid var(--border); }

  /* karta zariadenia (pocitac, storage; 11 stlpcov): nazov navrchu, stav pod nim, potom CPU/RAM/Disk a Zabezp./Uptime/Naposledy.
     Verzia agenta (5. stlpec) je v bubline Informacie o systeme. */
  .devtbl:not(.prtbl) td:nth-child(3) { grid-column: 1 / 3; grid-row: 1; font-size: 16px; }
  .devtbl:not(.prtbl) td:nth-child(1) { grid-column: 3; grid-row: 1; justify-self: end; }
  .devtbl:not(.prtbl) td:nth-child(2) { grid-column: 1 / 3; grid-row: 2; font-size: 13px; color: var(--muted); }
  .devtbl:not(.prtbl) td:nth-child(4) { grid-column: 3; grid-row: 2; justify-self: end; }
  .devtbl:not(.prtbl) td:nth-child(3) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
  .devtbl:not(.prtbl) td:nth-child(5) { display: none; }
  .devtbl:not(.prtbl) td:nth-child(6) { grid-column: 1; grid-row: 3; }
  .devtbl:not(.prtbl) td:nth-child(7) { grid-column: 2; grid-row: 3; }
  .devtbl:not(.prtbl) td:nth-child(8) { grid-column: 3; grid-row: 3; }
  .devtbl:not(.prtbl) td:nth-child(9) { grid-column: 1; grid-row: 4; }
  .devtbl:not(.prtbl) td:nth-child(10) { grid-column: 2; grid-row: 4; justify-self: start; }
  .devtbl:not(.prtbl) td:nth-child(11) { grid-column: 3; grid-row: 4; justify-self: end; text-align: right; }
  .devtbl:not(.prtbl) td:nth-child(5)::before { content: none; }
  .devtbl:not(.prtbl) td:nth-child(6)::before { content: "CPU"; }
  .devtbl:not(.prtbl) td:nth-child(7)::before { content: "RAM"; }
  .devtbl:not(.prtbl) td:nth-child(8)::before { content: "Disk"; }
  .devtbl:not(.prtbl) td:nth-child(9)::before { content: "Zabezp."; }
  .devtbl:not(.prtbl) td:nth-child(10)::before { content: "Uptime"; text-align: left; }
  .devtbl:not(.prtbl) td:nth-child(11)::before { content: "Naposledy"; text-align: right; }
}

/* ---- detail zariadenia na telefone: hlavicka, KPI, karty bez zbytocnych okrajov ---- */
@media (max-width: 720px) {
  .gtabs { margin-bottom: 12px; }
  .devhead { padding: 12px; }
  .dh-top { gap: 6px 8px; }
  .dh-top h2 { font-size: 20px; flex: 1 1 100%; }
  .dh-actions { margin-left: 0; flex: 1 1 100%; gap: 8px; }
  .dh-actions > a.btn, .dh-actions > form, .dh-actions > details { flex: 1 1 0; min-width: 0; }
  .dh-actions .btn, .dh-actions > form .btn, .dh-actions summary.btn { width: 100%; justify-content: center; text-align: center; }
  .devhead > dl.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
  .devhead > dl.facts > div { min-width: 0; overflow-wrap: anywhere; }
  .devhead > dl.facts > div:has(.blrow) { grid-column: 1 / -1; }
  .blrow { display: flex; max-width: 100%; }
  .devbody .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
  .devbody .kpis > .card { margin: 0; padding: 10px 12px; }
  .devbody .kpi b { font-size: 20px; }
  .devbody .grid2 { gap: 10px; margin-bottom: 10px; }
  .devbody .grid2 > .card, .devbody > .card { padding: 10px 12px; margin-bottom: 10px; }
  .devbody .grid2 > .card > .cardhead:first-child, .devbody > .card > .cardhead:first-child { margin: -10px -12px 6px; padding: 10px 12px; border-radius: 10px 10px 0 0; flex-wrap: wrap; row-gap: 4px; }
  .devbody .pad { padding: 8px 0; }
  .devbody .tiles { padding: 10px 0; }
  .devbody ul.alertlist.pad > li > .small { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
}

/* ---- vysuvne menu na telefone: kompaktnejsie, aby sa zmestilo viac poloziek ---- */
@media (max-width: 900px) {
  .side { width: min(268px, 82vw); padding-bottom: calc(20px + env(safe-area-inset-bottom)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .side .brand { padding: 10px 12px 10px; gap: 10px; margin: 0; }
  .side .brand img { width: 34px; height: 34px; }
  .side .brand .word b { font-size: 18px; }
  .side .brand .word small { font-size: 9.5px; letter-spacing: .26em; }
  .side .snav { padding: 0 4px; gap: 1px; }
  .side .sgroup { font-size: 10.5px; padding: 12px 12px 4px; letter-spacing: .14em; }
  .side .snav a { font-size: 14.5px; padding: 7px 10px; gap: 11px; border-radius: 9px; min-height: 38px; }
  .side .snav a .ico { width: 19px; height: 19px; }
  .side .snav a.on { box-shadow: inset 3px 0 0 #19c2ff; }
  .side .nbadge { min-width: 21px; height: 19px; font-size: 11.5px; }
  .side .sfoot { padding: 6px 4px 0; margin-top: 10px; }
  .side .suser, .side .slogout { font-size: 13.5px; padding: 7px 10px; min-height: 38px; }
  .side .powered { padding: 8px 10px 0; font-size: 11.5px; }
}

/* ---- Prehlad na telefone: mensie KPI, zoznam "Vyzaduje pozornost" bez stlacenych stlpcov ---- */
@media (max-width: 720px) {
  .kpis.four { gap: 10px; margin-bottom: 10px; }
  .kpis.four .kpi { padding: 10px 12px; gap: 1px; }
  .kpis.four .kpi span { font-size: 10.5px; letter-spacing: .05em; }
  .kpis.four .kpi b { font-size: 26px; }
  .kpis.four .kpi small { font-size: 12px; min-height: 0; }
  .dashtop { gap: 10px; margin-bottom: 10px; }
  .panel.big .dhead { padding: 10px 12px; }
  .panel.big .dhead h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
  .panel.big .acute li { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 10px; row-gap: 3px; padding: 10px 12px; align-items: start; }
  .panel.big .acute li > .adot { margin-top: 6px; grid-row: 1; }
  .panel.big .acute .atext { font-size: 14px; line-height: 1.35; flex: none; }
  .panel.big .acute .ameta { grid-column: 2; max-width: none; text-align: left; font-size: 12px; display: flex; flex-wrap: wrap; gap: 0 10px; }
  .panel.big .acute .ameta br { display: none; }
  .panel.big .acute .allok, .panel.big .acute .more { grid-column: 1 / -1; padding: 12px; }
  .panel.big .updline { padding: 10px 12px; font-size: 13px; }
  .panel.big .tstats > div { padding: 10px 12px; }
  .panel.big .tstats b { font-size: 24px; }
  .tcols .tbars { padding: 12px; }
  .tabhead { flex-wrap: wrap; gap: 6px 10px; }
  .tabhead .btn { margin-left: auto; }
}

/* ---- tlacidlo menu = logo GRATA ---- */
@media (max-width: 900px) {
  .topbar .navbtn { background: none; border: 0; padding: 4px; border-radius: 10px; align-items: center; justify-content: center; }
  .topbar .navbtn img { display: block; width: 32px; height: 32px; filter: drop-shadow(0 2px 6px rgba(25, 108, 255, .3)); transition: transform .15s; }
  .topbar .navbtn:active img { transform: scale(.9); }
  .topbar .navbtn + .ptitle .ptico { display: none; }
}

/* ---- Problemy na telefone: kratsia hlavicka, filtre v jednom riadku, kompaktne karty ---- */
@media (max-width: 720px) {
  .app main > h2 + p.muted.small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; }
  .app main > .kpis:not(.four) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
  .app main > .kpis:not(.four) > .kpi { margin: 0; padding: 8px 8px; }
  .app main > .kpis:not(.four) > .kpi span { font-size: 9.5px; letter-spacing: .03em; line-height: 1.2; min-height: 2.4em; }
  .app main > .kpis:not(.four) > .kpi b { font-size: 20px; }
  .tlbar { gap: 6px; margin-bottom: 10px; }
  .tlbar > .gsub[role="group"] { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .tlbar > .gsub[role="group"] .schip { flex: none; padding: 6px 12px; font-size: 13.5px; }
  .tlbar > form.gsub { display: flex; gap: 6px; width: 100%; }
  .tlbar > form.gsub select { flex: 1; min-width: 0; }
  .probtbl tr { padding: 10px 12px; gap: 4px 10px; }
  .probtbl td, .probtbl tr:hover td, .probtbl tr:nth-child(2n) td { background: none !important; }
  .probtbl td:nth-child(1) .pill { font-size: 12px; }
  .probtbl td:nth-child(2) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
  .probtbl td:nth-child(2) > a { font-weight: 650; }
  .probtbl td:nth-child(3) { font-size: 14px; line-height: 1.35; }
  .probtbl td:nth-child(3) > .small:last-child { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
  .probtbl td:nth-child(4) { grid-column: 1 / -1; grid-row: auto; display: flex; gap: 6px; }
  .probtbl td:nth-child(4) > .muted::before { content: "· "; }
  .probtbl td:nth-child(5):has(> .muted:only-child) { display: none; }
  .probtbl td.pacell { grid-column: 1 / -1; }
  .probtbl .pabtns { display: flex; gap: 8px; }
  .probtbl .pabtns .ibtn { width: 40px; height: 36px; }
}

/* ==== detail zariadenia na telefone: vsetky zalozky ==== */
@media (max-width: 720px) {
  /* hlavicka: kompaktne udaje v 3 stlpcoch */
  .devhead > dl.facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin-top: 10px; }
  .devhead > dl.facts dt { font-size: 10px; letter-spacing: .05em; }
  .devhead > dl.facts dd { font-size: 13.5px; margin: 1px 0 0; }
  .devhead .dh-top .chip, .devhead .dh-top .pill { font-size: 12.5px; }
  .dh-actions .btn { min-height: 40px; }

  /* navigacia: hlavne zalozky a podzalozky ako posuvne pasy */
  .gtabs { margin: 10px -14px 10px; padding: 0 14px; gap: 0; }
  .gtab { padding: 9px 11px; font-size: 14px; gap: 6px; }
  .seg { width: 100%; margin: 0 0 10px; }
  .seg a { padding: 7px 12px; font-size: 13px; flex: none; }
  .fstrip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 0 14px; margin-bottom: 8px; white-space: nowrap; }
  .fstrip::-webkit-scrollbar { display: none; }
  .fstrip > * { flex: none; }

  /* modry informacny pas */
  .roline { padding: 8px 12px; gap: 8px; font-size: 13px; line-height: 1.4; }
  .roline > span { flex: 1 1 100%; }
  .roline .btn, .roline form.inline { margin-left: 0; }
  .roline form.inline + .btn, .roline .btn + .btn { margin-left: 0; }

  /* karty v obsahu */
  .devbody > .card, .devbody section.card { padding: 10px 12px; margin-bottom: 10px; }
  .devbody .card.tablecard { padding: 0; }
  .devbody .cardhead, .devbody .site-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .devbody .card.tablecard > .cardhead { padding: 10px 12px; margin: 0; }
  .devbody .cardhead h3, .devbody .site-head h3 { font-size: 15px; margin: 0; flex: 1 1 auto; }
  .devbody .cardhead .muted.small { flex: 1 1 100%; }
  .devbody dl.kv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .devbody dl.kv.one { grid-template-columns: minmax(0, 1fr); }
  .devbody dl.kv dd { overflow-wrap: anywhere; }
  .devbody img, .devbody canvas, .devbody svg:not(.ico) { max-width: 100%; height: auto; }
  .devbody .actions, .devbody .swform, .devbody .exform, .devbody .netform { display: flex; flex-wrap: wrap; gap: 8px; }
  .devbody input[type="text"], .devbody input[type="number"], .devbody select, .devbody textarea { max-width: 100%; }
  .devbody .prewrap, .devbody pre { white-space: pre-wrap; overflow-wrap: anywhere; }

  /* tabulky ako karty (popisy stlpcov doplni mtable.js) */
  .devbody .tablewrap:has(> table.mcard) { overflow: visible; border: 0; }
  .devbody table.mcard { display: block; width: 100%; min-width: 0 !important; }
  .devbody table.mcard thead { display: none; }
  .devbody table.mcard tbody { display: block; }
  .devbody table.mcard tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 11px 12px; border-top: 1px solid var(--border); background: none; }
  .devbody table.mcard tbody:first-of-type tr:first-child { border-top: 0; }
  .devbody table.mcard td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.4; background: none !important; text-align: left !important; white-space: normal; }
  .devbody table.mcard td:first-child { grid-column: 1 / -1; font-size: 14.5px; }
  .devbody table.mcard td:first-child[data-l] { font-weight: 600; }
  .devbody table.mcard td.mwide, .devbody table.mcard td.mspan { grid-column: 1 / -1; }
  .devbody table.mcard td.mnil { display: none; }
  .devbody table.mcard td[data-l]:not(:first-child)::before { content: attr(data-l); display: block; margin-bottom: 2px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .devbody table.mcard td .btn { margin-top: 4px; }
  .devbody table.mcard td meter { width: 100%; }
  .devbody table.mcard td form.inline { display: inline-flex; flex-wrap: wrap; gap: 6px; }
}

/* ---- detail tiketu na telefone ---- */
@media (max-width: 720px) {
  .pdflow { flex-wrap: nowrap; gap: 4px; margin: 8px 0 10px; }
  .pdflow li { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; font-size: 11.5px; text-align: center; line-height: 1.15; }
  .pdflow li .n { width: 22px; height: 22px; font-size: 11.5px; }
  .pdst.cur { padding: 2px 12px 12px; margin: 6px 0 10px; }
  .pdst.cur h4 { margin: 10px 0 6px; font-size: 15px; }
  .pdres { padding: 8px 10px; }
  .pdclose { padding: 0; margin-top: 6px; background: none; }
  .pdclose > p.small:first-of-type { margin: 0 0 8px; }
  .pdclose label.opt { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 14.5px; background: #fff; }
  .pdclose label.opt:has(input:checked) { border-color: var(--blue); background: var(--blue-bg); color: #0f4fb8; font-weight: 600; }
  .pdclose label.opt input { margin: 0; width: 18px; height: 18px; }
  .pdclose p.small:has(> label) { margin: 10px 0 0; }
  .pdclose p.small > label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12.5px; }
  .pdclose p.small > label > select, .pdclose p.small > label > input { width: 100% !important; min-height: 42px; font-size: 16px; }
  .pdclose p:last-child { margin: 12px 0 0; }
  .pdst .btn.primary, .pdclose .btn.primary { width: 100%; min-height: 44px; justify-content: center; font-size: 15px; }
  .pdbtns { flex-direction: column; align-items: stretch; }
  .pdbtns form, .pdbtns .btn { width: 100%; }
  .pdbtns .btn { min-height: 42px; justify-content: center; }
  details.fold > summary { font-size: 14px; padding: 6px 0; }
  .tkact { gap: 8px; }
  .stbtns { width: 100%; }
  .stbtns > button, .stbtns > form > button, .stbtns > section { flex: 1 1 auto; }
  form.inl:has(select[name="assignee_id"]) { display: flex; gap: 8px; margin-top: 8px; }
  form.inl select[name="assignee_id"] { flex: 1; min-width: 0; }
  .kbsug h3 { flex-direction: column; gap: 2px; font-size: 15px; }
  .kbsug pre.steps { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; }
}

/* ==== Udrzba na telefone: plany, behy, sprievodca a dialogy ==== */
@media (max-width: 720px) {
  /* hlavicka a tlacidla */
  .mhead { gap: 10px; margin-bottom: 8px; }
  .mhead > div:first-child { flex: 1 1 100%; }
  .mhead p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .mbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .mbtns .btn { justify-content: center; min-height: 42px; padding: 8px 10px; text-align: center; line-height: 1.2; }
  .mbtns .btn.primary { grid-column: 1 / -1; font-size: 15px; }
  .mbtns > .btn:last-child:nth-child(2n) { grid-column: 1 / -1; }
  details.howto { margin-bottom: 10px; font-size: 13px; }

  /* karta Plany + filter */
  .card:has(> .plist) { padding: 0; overflow: hidden; }
  .card:has(> .plist) > .cardhead { padding: 10px 12px; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
  .card:has(> .plist) > .cardhead h3 { margin: 0; font-size: 16px; }
  .cardhead .pfbar { margin: 0; flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pfbar label { flex-direction: column; align-items: stretch; gap: 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
  .pfbar select { min-width: 0; width: 100%; min-height: 40px; font-size: 16px; }
  .pfbar [data-pf-count], .pfbar [data-pf-reset] { grid-column: 1 / -1; }
  .plist { padding: 8px; gap: 8px; }

  /* riadok planu: nazov hore, pod nim 2x2 prehlad s popismi */
  .pl-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; padding: 12px 12px 12px 34px; align-items: start; }
  .pl-row::before { top: 20px; left: 13px; margin-top: 0; }
  details.pcard[open] > .pl-row::before { margin-top: -1px; }
  .pl-name { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .pl-name .pill { font-size: 11px; padding: 0 7px; height: 20px; }
  .pl-t { display: contents; }
  .pl-t b { font-size: 15.5px; white-space: normal; flex: 1 1 auto; min-width: 0; }
  .pl-t .muted.small { flex: 1 1 100%; font-size: 12.5px; }
  .pl-when, .pl-state, .pl-last, .pl-next { background: var(--card2); border-radius: 8px; padding: 7px 9px; min-width: 0; font-size: 13px; }
  .pl-when b { font-size: 14px; }
  .pl-when::before, .pl-state::before, .pl-last::before, .pl-next::before { display: block; flex: 1 1 100%; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .pl-when::before { content: "Kedy"; }
  .pl-state::before { content: "Stav"; }
  .pl-last::before { content: "Posledný beh"; }
  .pl-next::before { content: "Najbližšie"; }
  .pl-last { flex-direction: row; flex-wrap: wrap; gap: 3px 6px; align-items: center; }
  .pl-last .muted.small { flex: 1 1 100%; font-size: 12px; }
  .pl-state .rprog { max-width: none; }
  .pl-live { font-size: 12.5px; }
  .pl-row:hover { background: none; }

  /* rozbaleny plan */
  .pc-body { padding: 12px; gap: 12px; }
  .pc-top { flex-direction: column; align-items: stretch; gap: 10px; }
  .pc-meta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pc-meta > div { flex-direction: row; justify-content: space-between; gap: 12px; align-items: baseline; }
  .pc-meta .pc-v { text-align: right; }
  .pc-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pc-actions form.inline, .pc-actions .btn { width: 100%; }
  .pc-actions .btn { min-height: 40px; justify-content: center; }
  .tchip { font-size: 12.5px; line-height: 24px; }
  .pc-run { flex-direction: column; align-items: stretch; gap: 8px; }
  .pc-live { min-width: 0; }
  .pc-live .rprog { max-width: none; }
  .pc-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pc-btns form.inline, .pc-btns .btn { width: 100%; }
  .pc-btns .btn, .pc-run .prun .btn { min-height: 42px; justify-content: center; }
  .pc-run .prun { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; }
  .pc-run .prun select { min-height: 42px; font-size: 16px; }
  .pc-rh { gap: 6px; }
  .pc-rh .pc-k { flex: 1 1 100%; }

  /* behy (v plane aj Ostatne behy) ako karty */
  .pc-runs .tablewrap, .otherruns .tablewrap { border: 0; overflow: visible; }
  table:has(td.rcell) { display: block; min-width: 0 !important; width: 100%; }
  table:has(td.rcell) thead { display: none; }
  table:has(td.rcell) tbody { display: block; }
  table:has(td.rcell) tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
  table:has(td.rcell) td { display: block; padding: 0; border: 0; min-width: 0; background: none; overflow-wrap: anywhere; }
  table:has(td.rcell) td.rhost { grid-column: 1; grid-row: 1; white-space: normal; font-size: 14.5px; }
  table:has(td.rcell) td:has(> .pill):not(.rcell) { grid-column: 2; grid-row: 1; justify-self: end; }
  table:has(td.rcell) td:not(.rhost):not(.rcell):not(.actions):not(:has(> .pill)) { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
  table:has(td.rcell) td.rcell { grid-column: 1 / -1; min-width: 0; }
  table:has(td.rcell) td.actions { grid-column: 1 / -1; }
  table:has(td.rcell) td.actions:not(:has(*)) { display: none; }
  table:has(td.rcell) td.actions .btn { width: 100%; min-height: 40px; justify-content: center; }
  .rsteps { gap: 4px; }
  .rstep { font-size: 11.5px; line-height: 20px; }
  .rcell pre.steps { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; max-height: 50vh; overflow: auto; }
  details.older-w { margin-left: 0; }
  details.otherruns > summary.cardhead { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 12px; }
  details.otherruns > summary .muted.small { flex: 1 1 100%; }
  details.otherruns > .tablewrap { padding: 0 8px 8px; }

  /* dialogy udrzby ako spodny panel na celu sirku */
  #dlg-wiz, #dlg-run, #dlg-tech { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 96vh; max-height: 96dvh; }
  #dlg-wiz { height: 96vh; height: 96dvh; }
  #dlg-wiz > form, #dlg-run > form, #dlg-tech > .dform { max-height: 96vh; max-height: 96dvh; height: 100%; }
  #dlg-wiz .dhead, #dlg-run .dhead, #dlg-tech .dhead { padding: 12px 14px 10px; }
  #dlg-wiz .dbody, #dlg-run .dbody, #dlg-tech .dbody { height: auto; flex: 1 1 auto; min-height: 0; padding: 12px 14px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  #dlg-wiz input:not([type=checkbox]):not([type=radio]), #dlg-wiz select, #dlg-run input:not([type=checkbox]):not([type=radio]), #dlg-run select, #dlg-tech input, #dlg-tech select { font-size: 16px; min-height: 42px; }
  #dlg-wiz .dfoot, #dlg-run .dfoot, #dlg-tech .dfoot { flex-wrap: wrap; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  #dlg-wiz .dfoot .grow, #dlg-run .dfoot .grow, #dlg-tech .dfoot .grow { display: none; }
  #dlg-wiz .dfoot .btn, #dlg-run .dfoot .btn, #dlg-tech .dfoot .btn { flex: 1 1 0; min-height: 44px; justify-content: center; }
  #dlg-wiz .dfoot [data-dlg-close] { display: none; }
  #dlg-wiz .dfoot .wizerr { flex: 1 1 100%; }
  #dlg-wiz .dfoot .wizerr:empty { display: none; }
  #dlg-wiz .dfoot [data-wiz-save][name="run_now"] { flex: 1 1 100%; order: 5; }

  /* sprievodca: kroky, volby, ciele, plan */
  .wsteps { padding: 8px 14px; }
  .wsteps li { justify-content: center; padding-right: 0; }
  .wsteps li + li::before { left: calc(-50% + 15px); width: calc(100% - 30px); }
  .optcard { padding: 12px 12px 12px 40px; }
  .optcard .oc-t { font-size: 14px; }
  .presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .presets > .muted { flex: 1 1 100%; }
  .fchip { height: 34px; font-size: 13px; }
  .tnum input, .tnum select { max-width: none; width: 100%; }
  .deferbox { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .deferbox input { width: 100%; }
  #dlg-wiz .trow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
  #dlg-wiz .trow input[type=search], #dlg-wiz .trow .grow, #dlg-wiz .trow .tcount { grid-column: 1 / -1; width: 100%; min-width: 0; }
  #dlg-wiz .trow .btn { min-height: 40px; justify-content: center; }
  #dlg-wiz .trow .grow input { width: 100%; }
  .targets { max-height: none; overflow: visible; }
  .trowi { padding: 11px 12px; font-size: 14px; }
  .trowi input { width: 20px; height: 20px; }
  .daychips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
  .dchip span { min-width: 0; width: 100%; height: 40px; }
  .timerow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .timerow .arrow { display: none; }
  .timerow label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .timerow label:last-child { grid-column: 1 / -1; }
  .timerow input[type=time], .timerow input[type=number] { width: 100%; }
  .fld label.opt { font-size: 14px; padding: 4px 0; }
  .fld label.opt input { width: 20px; height: 20px; flex: none; }
  .wsum { gap: 2px 0; }
  .wsum dt { margin-top: 8px; font-size: 12px; }

  /* dialog Test na 1 zariadeni */
  #dlg-run .dgrid { grid-template-columns: 1fr 1fr; }
  #dlg-run .dgrid .span2 { grid-column: 1 / -1; }
  #dlg-run .fld { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
  #dlg-run .avmode select { width: 100%; margin-top: 4px; }

  /* dialog Technici a podpis: tabulky pod sebou */
  #dlg-tech table, #dlg-tech tbody, #dlg-tech tr, #dlg-tech td { display: block; width: 100%; }
  #dlg-tech table { min-width: 0 !important; }
  #dlg-tech thead { display: none; }
  #dlg-tech .tablewrap { overflow: visible; }
  #dlg-tech tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  #dlg-tech td { padding: 0; border: 0; }
  #dlg-tech td + td { margin-top: 6px; color: var(--muted); font-size: 13px; }
  #dlg-tech form.inline { display: flex; gap: 8px; width: 100%; }
  #dlg-tech form.inline input[type=text], #dlg-tech form.inline select { flex: 1; min-width: 0; width: 100%; }
}

/* ---- Pracovny vykaz na telefone: riadky ako karty ---- */
@media (max-width: 720px) {
  .app main > section.card:has(> table.vktbl), .app main > section.card:has(> form > table.vkdraft) { padding: 12px; }
  .app main > section.card > h2, .app main > section.card > h3 { font-size: 17px; margin-top: 0; }
  table.vktbl, table.vkdraft { display: block; width: 100%; min-width: 0 !important; white-space: normal !important; }
  table.vktbl thead, table.vkdraft thead { display: none; }
  table.vktbl tbody, table.vkdraft tbody { display: block; }
  table.vktbl tr, table.vkdraft tr { display: grid; gap: 6px 10px; padding: 12px 2px; border-top: 1px solid var(--border); }
  table.vktbl tr:first-child, table.vkdraft tr:first-child { border-top: 0; }
  table.vktbl td, table.vkdraft td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; white-space: normal !important; font-size: 14px; line-height: 1.35; background: none; }

  /* hlavny vykaz */
  table.vktbl tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  table.vktbl td:nth-child(4) { grid-column: 1 / 3; grid-row: 1; font-size: 16px; font-weight: 650; }
  table.vktbl td:nth-child(1) { grid-column: 3; grid-row: 1; text-align: right; font-size: 12px; color: var(--muted); }
  table.vktbl td:nth-child(5) { grid-column: 1 / -1; grid-row: 2; }
  table.vktbl td:nth-child(6) { grid-column: 1; grid-row: 3; }
  table.vktbl td:nth-child(7) { grid-column: 2; grid-row: 3; font-weight: 650; }
  table.vktbl td:nth-child(8) { grid-column: 3; grid-row: 3; }
  table.vktbl td:nth-child(2) { grid-column: 1; grid-row: 4; }
  table.vktbl td:nth-child(3) { grid-column: 2; grid-row: 4; }
  table.vktbl td:nth-child(9) { grid-column: 3; grid-row: 4; }
  table.vktbl td:nth-child(10) { grid-column: 1 / -1; grid-row: 5; padding: 8px 10px; border-radius: 8px; background: var(--card2); font-size: 13px; }
  table.vktbl td:nth-child(10):empty { display: none; }
  table.vktbl td:nth-child(n+6):not(:nth-child(10))::before, table.vktbl td:nth-child(2)::before, table.vktbl td:nth-child(3)::before {
    display: block; margin-bottom: 1px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  table.vktbl td:nth-child(6)::before { content: "Vykázanie"; }
  table.vktbl td:nth-child(7)::before { content: "Čas"; }
  table.vktbl td:nth-child(8)::before { content: "Náklady AI"; }
  table.vktbl td:nth-child(2)::before { content: "Lokalita"; }
  table.vktbl td:nth-child(3)::before { content: "Sieť"; }
  table.vktbl td:nth-child(9)::before { content: "Technik"; }
  table.vktbl td:last-child[colspan] { grid-column: 1 / -1; grid-row: auto; }

  /* koncepty na potvrdenie */
  table.vkdraft tr { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; }
  table.vkdraft td:nth-child(1) { grid-column: 1; grid-row: 1; }
  table.vkdraft td:nth-child(1) input { width: 22px; height: 22px; margin: 0; }
  table.vkdraft td:nth-child(3) { grid-column: 2; grid-row: 1; font-size: 16px; font-weight: 650; }
  table.vkdraft td:nth-child(2) { grid-column: 3; grid-row: 1; font-size: 12px; color: var(--muted); text-align: right; }
  table.vkdraft td:nth-child(4) { grid-column: 2 / -1; grid-row: 2; }
  table.vkdraft td:nth-child(5) { grid-column: 2; grid-row: 3; }
  table.vkdraft td:nth-child(5) select { width: 100%; min-height: 42px; font-size: 16px; }
  table.vkdraft td:nth-child(6) { grid-column: 3; grid-row: 3; align-self: center; font-weight: 650; }
  .app main > section.card form:has(> table.vkdraft) > p .btn { width: 100%; min-height: 44px; justify-content: center; }
}

/* ---- vykaz: akcie zaznamu a dialog ako spodny panel ---- */
@media (max-width: 720px) {
  .vkhead .btn { width: 100%; min-height: 44px; justify-content: center; }
  table.vktbl td:nth-child(11) { grid-column: 1 / -1; grid-row: 6; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 4px; }
  table.vktbl td:nth-child(11) form.inline, table.vktbl td:nth-child(11) .btn { width: 100%; }
  table.vktbl td:nth-child(11) .btn { min-height: 42px; justify-content: center; }
  table.vktbl td:nth-child(5) .small { margin-top: 2px; }
  #dlg-vk { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 94vh; max-height: 94dvh; }
  #dlg-vk > form { max-height: 94vh; max-height: 94dvh; }
  #dlg-vk .dbody { padding: 12px 14px; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  #dlg-vk input:not([type=radio]):not([type=checkbox]), #dlg-vk select { font-size: 16px; min-height: 44px; }
  #dlg-vk .dgrid { grid-template-columns: 1fr; }
  #dlg-vk label.opt { padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 14.5px; margin-bottom: 6px; }
  #dlg-vk label.opt:has(input:checked) { border-color: var(--blue); background: var(--blue-bg); color: #0f4fb8; font-weight: 600; }
  #dlg-vk label.opt input { width: 20px; height: 20px; margin: 0; flex: none; }
  #dlg-vk .dfoot { gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  #dlg-vk .dfoot .grow { display: none; }
  #dlg-vk .dfoot .btn { flex: 1 1 0; min-height: 44px; justify-content: center; }
  details.vkhist { padding: 12px; }
}

/* ==== mobil: mensie ikony, stitky a tlacidla sa nelamu, texty sa zalamuju len medzi slovami ==== */
@media (max-width: 900px) {
  .side .snav a .ico { width: 17px; height: 17px; }
  .side .suser .ico, .side .slogout .ico { width: 17px; height: 17px; }
}
@media (max-width: 720px) {
  /* ikony */
  .ico { width: 16px; height: 16px; }
  .btn .ico, .mbtns .ico { width: 15px; height: 15px; }
  .gtab .ico { width: 15px; height: 15px; }
  .topbar .ptico, .topbar .ptico .ico { width: 20px; height: 20px; }
  .topbar .ptico { padding: 0; }
  .topbar .navbtn img { width: 28px; height: 28px; }
  .ibtn { width: 34px; height: 32px; }
  .ibtn svg { width: 15px; height: 15px; }
  .probtbl .pabtns .ibtn { width: 36px; height: 32px; }
  .dh-actions .btn .ico, .dh-actions summary .ico { width: 15px; height: 15px; }
  .devhead .chip .ico, .devhead .pill .ico { width: 14px; height: 14px; }
  .pill, .badge, .nbadge { font-size: 11.5px; }

  /* kratke stitky, tlacidla a cipy sa nikdy nelamu */
  .pill, .badge, .nbadge, .btn, .schip, .fchip, .gtab, .tchip, .rstep, .seg a, .chip, .ibtn, summary.btn, .dchip span, .tile .pill { white-space: nowrap; }
  .btn { flex-shrink: 0; }
  .btn.sm { padding-left: 11px; padding-right: 11px; }

  /* texty: zalomenie len medzi slovami, dlhy retazec (URL, cesta) sa zalomi az v nutnosti */
  .app main *, .modal *, dialog.dlg * { overflow-wrap: break-word !important; word-break: normal !important; hyphens: none; }
  .app main td, .app main li, .app main dd { text-wrap: pretty; }

  /* nazvy v kartach na jeden riadok s trojbodkou */
  .cardhead h3, .site-head h3, .site-head h2, .panel.big .dhead h3, .pl-t b, .ptitle .pttext { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .devtbl:not(.prtbl) td:nth-child(3) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.vktbl td:nth-child(4), table.vkdraft td:nth-child(3), .probtbl td:nth-child(2) > a, .rhost { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
  .pl-t b { display: block; }
  .kpi span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app main > .kpis:not(.four) > .kpi span { white-space: normal; }
}

/* ---- vykaz: opravy podla screenshotu ---- */
@media (max-width: 720px) {
  .vkhead { background: none !important; border: 0 !important; padding: 0 !important; margin: 0 0 8px !important; flex-direction: column; align-items: stretch; }
  .vkhead h2 { font-size: 18px; }
  .app main > section.card > p.muted.small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 10px; }
  .app main > section.card > .kpis.four { margin-bottom: 8px; }
  table.vktbl td, table.vkdraft td, table.vktbl tr, table.vkdraft tr { background: none !important; box-shadow: none !important; }
  table.vktbl td { padding: 0 !important; }
  table.vktbl tr { padding: 12px 0 !important; }
  table.vktbl td:nth-child(11) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; overflow: hidden; }
  table.vktbl td:nth-child(11) .btn { width: 100%; max-width: 100%; box-sizing: border-box; }
  table.vktbl td:nth-child(11) form.inline { min-width: 0; margin: 0; }
  table.vktbl td:nth-child(9), table.vktbl td:nth-child(2), table.vktbl td:nth-child(3) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.vktbl td.vk-nodev { display: none; }
  table.vktbl td:nth-child(1) { grid-column: 3; }
  table.vktbl td:nth-child(5) { font-size: 15px; font-weight: 600; }
  table.vktbl td:nth-child(5) .small { font-weight: 400; }
}

/* podzalozky skupiny na mobile: vodorovne posuvny pas */
@media (max-width: 720px) {
  .gsub-bar { flex-wrap: nowrap; overflow-x: auto; width: auto; -webkit-overflow-scrolling: touch; margin-bottom: 10px; }
  .gsub-bar a { padding: 7px 12px; flex: 0 0 auto; }
}

@media (max-width: 720px) {
  .app .card > h3, .app .card > h2, .app .cardhead > h3, .app .cardhead > h2 { font-size: 15px; padding: 7px 10px; }
}

@media (max-width: 720px) {
  .tkhead { flex-direction: column; align-items: stretch; }
  .tkhead form .btn { width: 100%; justify-content: center; }
}
