/* =========================================================================
   Správa účtov — dizajnový systém „Airy"
   Svetlá modrá schéma, SF Pro, zaoblené rohy, mäkké tiene, rozostrené
   plochy. Všetky hodnoty (farby, rozmery, tiene, polomery, rozostupy)
   sú definované tokenmi nižšie — nikde inde sa nezavádzajú nové.
   ========================================================================= */

:root {
  /* plochy */
  --paper:        #f6f8fb;   /* pozadie stránky */
  --surface:      #ffffff;   /* karty */
  --surface-2:    #f8fafc;   /* jemné pruhy, hover riadkov */
  --surface-3:    #eef2f7;   /* výplne, koľajnice grafov, segmenty */

  /* text */
  --ink:          #0f172a;
  --ink-2:        #475569;
  --ink-3:        #7c8ba1;
  --muted:        var(--ink-3);

  /* linky */
  --line:         #e2e8f0;
  --line-2:       #cbd5e1;

  /* akcent — jedna svetlomodrá pre celú aplikáciu */
  --accent:       #3b82f6;
  --accent-ink:   #2563eb;
  --accent-soft:  #eff6ff;
  --accent-line:  #bfdbfe;

  /* stavy */
  --good:         #059669;
  --good-soft:    #ecfdf5;
  --good-line:    #a7f3d0;
  --warning:      #d97706;
  --warning-soft: #fffbeb;
  --warning-line: #fde68a;
  --critical:     #dc2626;
  --critical-soft:#fef2f2;
  --critical-line:#fecaca;
  --neutral-soft: #f1f5f9;
  --placeholder:  #a4b0c0;

  /* dátové rady */
  --series-1: #3b82f6;
  --series-2: #06b6d4;
  --series-3: #8b5cf6;
  --series-4: #f59e0b;
  --series-5: #10b981;
  --series-6: #64748b;

  /* typografia — SF Pro (Apple), inak Inter/systém */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Inter", "Segoe UI", system-ui, sans-serif;

  --fs-micro: 10px;
  --fs-xs:    11px;
  --fs-sm:    12px;
  --fs-base:  13px;
  --fs-md:    14px;
  --fs-lg:    16px;
  --fs-xl:    18px;
  --fs-2xl:   28px;

  --ls-caps:  .06em;   /* jediný rozstup verzálok */
  --ls-tight: -.01em;  /* nadpisy a čísla */

  /* rozostupy */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 44px;

  /* polomery */
  --r-xs:   6px;
  --r-sm:   8px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-full: 999px;

  /* tiene */
  --shadow-xs:  0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm:  0 1px 2px rgba(15, 23, 42, .05), 0 2px 6px rgba(15, 23, 42, .04);
  --shadow-md:  0 4px 10px -2px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .04);
  --shadow-lg:  0 12px 28px -8px rgba(15, 23, 42, .14), 0 4px 10px -4px rgba(15, 23, 42, .06);
  --shadow-pop: 0 24px 56px -12px rgba(15, 23, 42, .22), 0 8px 20px -8px rgba(15, 23, 42, .1);
  --ring:       0 0 0 3px rgba(59, 130, 246, .16);

  /* rozostrenie */
  --blur-bar:   saturate(1.5) blur(16px);   /* lišty (bočný panel, hlavička) */
  --blur-pop:   saturate(1.4) blur(20px);   /* menu, kalendár, modál */
  --blur-glass: saturate(1.4) blur(2px);    /* sklo nad jemnou textúrou – bodky sa rozostria, no nesplynú */
  --glass:      rgba(255, 255, 255, .66);   /* sklenené plochy (dlaždice, rýchle karty) */

  /* pohyb */
  --ease: cubic-bezier(.2, .7, .3, 1);
  --t-fast: .12s;
  --t-med:  .2s;

  --sidebar-w: 232px;
  --ctrl-h:  32px;
  --ctrl-sm: 24px;
}

/* --------------------------------------------------------------- základ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 480px at 88% -12%, rgba(219, 234, 254, .55), transparent 70%),
    radial-gradient(760px 460px at -8% 34%, rgba(239, 246, 255, .8), transparent 70%),
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  /* Vyhladzovanie písma: WebKit/Blink (macOS) + Firefox (macOS).
     Na Windows tieto vlastnosti nemajú efekt – tam vyhladzuje priamo
     DirectWrite, preto sa vzhľad medzi systémami mierne líši. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Formulárové prvky nededia vyhladzovanie vo všetkých prehliadačoch. */
input, select, textarea, button {
  -webkit-font-smoothing: inherit;
  -moz-osx-font-smoothing: inherit;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

button { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: var(--r-full); }
::-webkit-scrollbar-track { background: transparent; }

.icon { width: 16px; height: 16px; flex: none; }
.icon--xs { width: 12px; height: 12px; }
.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 24px; height: 24px; }

.mono, .col-num, .cell-num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
.strong { font-weight: 500; }
.tar { text-align: right; }

.section-title {
  font-size: var(--fs-micro);
  font-weight: 500;
  color: var(--ink-3);
}

/* ------------------------------------------------------------ rozloženie */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: var(--blur-bar);
  backdrop-filter: var(--blur-bar);
  border-right: 1px solid var(--line);
  color: var(--ink-2);
  padding: var(--sp-4) var(--sp-3) var(--sp-3);
}

.sidebar__head { display: none; }

.nav { display: flex; flex-direction: column; flex: 1; gap: 2px; }

.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--ctrl-h);
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: var(--fs-base);
  font-weight: 400;
  letter-spacing: var(--ls-tight);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav__item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav__item.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 500;
}
.nav__item .icon { width: 15px; height: 15px; transform: translateY(.5px); color: var(--ink-3); transition: color var(--t-fast) var(--ease); }
.nav__item:hover .icon { color: var(--ink-2); }
.nav__item.is-active .icon { color: var(--accent); }

.nav__count {
  margin-left: auto;
  min-width: 18px;
  height: 17px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  background: var(--critical-soft);
  color: var(--critical);
  border-radius: var(--r-full);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-micro);
  font-weight: 500;
}

.sidebar__foot { border-top: 1px solid var(--line); padding-top: var(--sp-2); margin-top: var(--sp-3); }

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--sp-2);
  margin-top: var(--sp-1);
  border-radius: var(--r-sm);
}
.sidebar__userinfo { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar__username {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__meta { font-size: var(--fs-micro); color: var(--ink-3); }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-6);
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: var(--blur-bar);
  backdrop-filter: var(--blur-bar);
  border-bottom: 1px solid var(--line);
}

/* Hlavička stránky je vždy jeden riadok: rodič / názov / kontext */
.crumbs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.crumbs__parent {
  font-size: var(--fs-base);
  font-weight: 400;
  color: var(--ink-3);
  flex: none;
  padding: 3px 8px;
  margin-left: -8px;
  border-radius: var(--r-xs);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.crumbs__parent:hover { color: var(--ink); background: var(--surface-3); text-decoration: none; }
.crumbs__sep { color: var(--line-2); flex: none; }
.crumbs__current {
  font-size: var(--fs-base);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.5;
  flex: none;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs__meta {
  font-size: var(--fs-base);
  color: var(--ink-3);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1100px) { .crumbs__meta, .crumbs__sep--meta { display: none; } }
.topbar__right { display: flex; align-items: center; gap: var(--sp-2); }

.content {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  max-width: 1460px;
  width: 100%;
}
.content--wide { max-width: none; }

/* --------------------------------------------------------------- karty */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.stack { display: grid; gap: var(--sp-4); align-content: start; }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.card__title {
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: var(--ls-tight);
}
.card__actions { display: flex; align-items: center; gap: var(--sp-2); }
.card__body { padding: var(--sp-5); }
.card__body--tight { padding: var(--sp-3) var(--sp-5); }
.card__body--chart { display: block; }
.rule { border: 0; border-top: 1px solid var(--line); }

/* zaoblenie rohov obsahu, ktorý sa dotýka okraja karty */
.card > .tablewrap:last-child,
.card > .pager:last-child,
.card > .finding:last-child,
.card > .linklist:last-child > .linkitem:last-child,
.card > .chat:last-child > .chat__row:last-child {
  border-bottom-left-radius: calc(var(--r-lg) - 1px);
  border-bottom-right-radius: calc(var(--r-lg) - 1px);
}
.card > .tablewrap:first-child {
  border-top-left-radius: calc(var(--r-lg) - 1px);
  border-top-right-radius: calc(var(--r-lg) - 1px);
}

/* ------------------------------------------------------- sieťová mapa */

.netmap { display: flex; flex-direction: column; gap: var(--sp-3); }
.netmap__toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.netmap__search {
  display: flex; align-items: center; gap: var(--sp-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0 var(--sp-2);
  height: var(--ctrl-h);
  background: var(--surface);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.netmap__search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.netmap__search input { border: 0; outline: 0; height: 30px; background: transparent; font: inherit; min-width: 150px; }
.netmap__meta { margin-left: auto; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.input--sm { height: var(--ctrl-h); }

.netmap__stage {
  position: relative;
  height: 68vh;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background-color: var(--surface-2);
  background-image: radial-gradient(var(--line) 1px, transparent 1.5px);
  background-size: 12px 12px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.netmap__svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.netmap__svg:active { cursor: grabbing; }

.net-edge { stroke: var(--line-2); stroke-width: 1.2; }
.net-edge--identifier { stroke: var(--line); stroke-dasharray: 4 3; }
.net-edge--paid { stroke: #0f766e; stroke-width: 2; }
.net-edge.is-dim { opacity: .12; }
.net-edge.is-path { stroke: var(--accent); stroke-width: 2.6; opacity: 1; }

.net-node { cursor: pointer; }
.net-node__dot { stroke: #fff; stroke-width: 1.5; }
.net-node__ring { stroke-width: 2; }
.net-node__ring--critical { stroke: var(--critical); }
.net-node__ring--warning { stroke: var(--warning); }
.net-node__ring--info { stroke: #0891b2; }
/* popisky sa ukazujú podľa dôležitosti – všetko naraz by bola kaša */
.net-node__label {
  font-size: 10px;
  fill: var(--ink-2);
  paint-order: stroke;
  stroke: var(--surface-2);
  stroke-width: 3px;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
  pointer-events: none;
}
.net-node.is-hub .net-node__label,
.netmap__svg.is-zoomed .net-node__label,
.net-node:hover .net-node__label,
.net-node.is-focus .net-node__label,
.net-node.is-match .net-node__label,
.net-node.is-path .net-node__label { opacity: 1; }
.net-node.is-dim { opacity: .18; }
.net-node.is-focus .net-node__dot, .net-node.is-match .net-node__dot { stroke: var(--accent); stroke-width: 3; }
.net-node.is-path .net-node__dot { stroke: var(--accent); stroke-width: 3; }
.net-node:focus { outline: none; }
.net-node:focus .net-node__dot { stroke: var(--accent); stroke-width: 3; }

.netmap__legendtoggle { position: absolute; left: var(--sp-3); bottom: var(--sp-3); }
.netmap__legend {
  position: absolute; left: var(--sp-3); bottom: calc(var(--sp-3) + 40px);
  background: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: var(--blur-pop);
  backdrop-filter: var(--blur-pop);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  max-width: 320px;
}
.netmap__legrow { display: flex; align-items: center; gap: 8px; line-height: 1.9; font-size: var(--fs-xs); color: var(--ink-2); }
.netdot { width: 8px; height: 8px; border-radius: var(--r-full); display: inline-block; flex: none; }
.netdot--account { background: var(--accent); } .netdot--person { background: var(--accent); }
.netdot--business { background: #8b5cf6; } .netdot--identifier { background: #c2410c; }
.netshape { width: 9px; height: 9px; display: inline-block; flex: none; }
.netshape--circle { border-radius: var(--r-full); }
.netshape--square { border-radius: 2px; }
.netshape--diamond { border-radius: 2px; transform: rotate(45deg) scale(.9); }
.netshape--ok { background: #64748b; }
.netshape--info { background: #0891b2; }
.netshape--warning { background: var(--warning); }
.netshape--critical { background: var(--critical); }
.netshape--person { background: #3b82f6; }
.netshape--business { background: #8b5cf6; }
.netshape--ident { background: #94a3b8; }
.netshape--identshared { background: #c2410c; }
.netline { width: 14px; height: 0; border-top: 2px solid var(--critical); display: inline-block; border-radius: var(--r-full); }
.netline--paid { border-top-color: #0f766e; }
.netline--risk { border-top-color: var(--critical); }
.netmap__hint { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--fs-micro); max-width: 260px; }

.netmap__panel {
  position: absolute; top: 0; right: 0; width: 320px; max-width: 82%; height: 100%;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: var(--blur-pop);
  backdrop-filter: var(--blur-pop);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-4); overflow-y: auto;
}
.netmap__panelclose { position: absolute; top: var(--sp-2); right: var(--sp-2); border: 0; background: transparent; cursor: pointer; color: var(--muted); border-radius: var(--r-xs); }
.netmap__panelclose:hover { color: var(--ink); }
.net-detail__type { font-size: var(--fs-sm); color: var(--ink-3); }
.net-detail__title {
  font-size: var(--fs-xl);
  font-weight: 400;
  letter-spacing: var(--ls-tight);
  font-variant-numeric: tabular-nums;
  margin: 2px 0 8px;
  word-break: break-word;
}
.net-detail__sub {
  display: flex;
  width: fit-content;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-full);
  background: var(--neutral-soft);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  margin-bottom: var(--sp-4);
}
.net-detail__stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.net-stat { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 6px 8px; }
.net-stat__l { display: block; font-size: var(--fs-sm); color: var(--muted); }
.net-stat__v { display: block; font-variant-numeric: tabular-nums; }
.net-detail__conns { margin-top: var(--sp-3); }
.net-detail__group { margin-bottom: var(--sp-3); }
.net-detail__glabel {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.net-conn {
  display: block; width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); padding: 8px 10px; margin-bottom: 6px;
  cursor: pointer; font: inherit;
  font-size: var(--fs-base);
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.net-conn:hover { border-color: var(--accent-line); box-shadow: var(--shadow-xs); }
.net-path { line-height: 1.9; word-break: break-word; }
.net-path__arrow { color: var(--accent); }

.netmap__loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); background: rgba(248, 250, 252, .85);
  -webkit-backdrop-filter: var(--blur-bar);
  backdrop-filter: var(--blur-bar);
}
.netmap__loading[hidden] { display: none; }
.netmap__loadbox { max-width: 420px; text-align: center; }
.netmap__loadhint { margin-top: 8px; font-size: var(--fs-sm); line-height: 1.5; }
@media (max-width: 640px) { .netmap__panel { width: 100%; max-width: 100%; } .netmap__stage { height: 60vh; } }

/* Riadok, v ktorom si karty vyrovnajú výšku podľa najvyššej z nich. */
.grid.grid--match { align-items: stretch; }
.card__scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; }
/* okno histórie: pevná výška, roluje sa vnútri */
.card__scroll--capped {
  flex: 0 1 auto;
  height: 340px;
  max-height: 52vh;
  overflow-y: auto;
  border-bottom-left-radius: calc(var(--r-lg) - 1px);
  border-bottom-right-radius: calc(var(--r-lg) - 1px);
}
.card__body--fill { flex: 1 1 auto; display: flex; flex-direction: column; }
.card__body--fill > .colchart { flex: 1; grid-template-rows: minmax(160px, 1fr) auto; }

/* dva formuláre vedľa seba v jednej karte */
.split { display: grid; grid-template-columns: 1fr 1fr; }
.split__col { padding: var(--sp-5); min-width: 0; }
.split__col + .split__col { border-left: 1px solid var(--line); }
.split__title {
  font-size: var(--fs-micro);
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: -4px;
}
.split--side { grid-template-columns: minmax(0, 1fr) 340px; }
.split__col--side { background: var(--surface-2); border-radius: 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0; }
@media (max-width: 900px) {
  .split, .split--side { grid-template-columns: 1fr; }
  .split__col + .split__col { border-left: 0; border-top: 1px solid var(--line); }
  .split__col--side { border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px); }
}

.grid { display: grid; gap: var(--sp-4); align-items: start; }
.grid > *, .stack > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid--1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

/* mriežka faktov */
.datagrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}
.card > .datagrid:last-child {
  border-bottom-left-radius: calc(var(--r-lg) - 1px);
  border-bottom-right-radius: calc(var(--r-lg) - 1px);
  overflow: hidden;
}
.datacell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  min-width: 0;
}
.datacell__key {
  font-size: var(--fs-base);
  font-weight: 400;
  color: var(--ink-3);
}
.datacell__val {
  font-size: var(--fs-base);
  color: var(--ink);
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}
.datacell__val .btn--sm.btn--icon { width: 22px; height: 22px; margin: -4px 0; }
.datacell__val--text { line-height: 1.55; color: var(--ink-2); }
.datacell--wide { grid-column: span 2; }
@media (max-width: 700px) { .datacell--wide { grid-column: span 1; } }

@media (max-width: 1240px) {
  .grid--5, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3, .grid--2-1, .grid--1-2 { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================================
   Mobil a tablet — bočný panel sa mení na vysúvacie menu
   ========================================================================= */

.topbar .navtoggle { display: none; }
.navbackdrop { display: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 268px;
    max-width: 84vw;
    height: 100%;
    z-index: 200;
    background: rgba(255, 255, 255, .92);
    transform: translateX(-100%);
    transition: transform var(--t-med) var(--ease);
    padding: var(--sp-3);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }

  .sidebar__head {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 var(--sp-2);
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--sp-2);
  }

  .navbackdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(15, 23, 42, .32);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-med) var(--ease);
  }
  body.nav-open .navbackdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .topbar .navtoggle { display: inline-flex; flex: none; }

  .topbar { padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); }
  .content { padding: var(--sp-4); gap: var(--sp-4); }
  .crumbs__current { font-size: var(--fs-lg); max-width: none; }
  .grid--2, .grid--4, .grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card__body, .filters { padding: var(--sp-4); }
  .card__head { padding: var(--sp-3) var(--sp-4); }
  .table th, .table td { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .linkitem, .finding, .pager { padding-left: var(--sp-4); padding-right: var(--sp-4); }
}

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .crumbs { flex: 1; }
  .topbar__right { width: 100%; flex-wrap: wrap; }
  .searchbox { flex: 1 1 160px; }
  .searchbox__input { width: 100%; }

  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .grid--4, .grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .stat { padding: var(--sp-3); }
  .stat__value { font-size: var(--fs-xl); }
  .stat__foot { margin-top: var(--sp-2); padding-top: var(--sp-2); font-size: var(--fs-xs); }
  .content { padding: var(--sp-3); gap: var(--sp-3); }
  .card__body, .filters { padding: var(--sp-3); }
  .card__head { padding: var(--sp-3); }
  .filters .field, .filters .field--wide { flex: 1 1 100%; }
  .form__foot { flex-wrap: wrap; }
  .authbox { padding: var(--sp-5); }

  .btn--sm { height: 30px; }
  .btn--sm.btn--icon { width: 30px; }
  .table td { height: 48px; }
  .table th:first-child, .table td:first-child { min-width: 150px; }
}

@media (hover: none) {
  .tip { display: none; }
  .tlb__del { opacity: 1; }
}

/* ------------------------------------------------------------- dlaždice */

.stat {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur-bar);
  backdrop-filter: var(--blur-bar);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  transition: box-shadow var(--t-med) var(--ease);
}
.stat:hover { box-shadow: var(--shadow-sm); }
.stat__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.stat__label {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--ink-2);
}
.stat__icon { color: var(--ink-3); }
.stat__value {
  font-size: var(--fs-2xl);
  font-weight: 400;
  letter-spacing: var(--ls-tight);
  line-height: 1.15;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.stat__foot {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
}
.stat__foot .stat__delta { flex: none; }
.stat__foot .stat__note { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stat__delta {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--r-full);
  background: var(--neutral-soft);
  color: var(--ink-2);
  font-size: var(--fs-xs);
}
.stat__delta--good { background: var(--good-soft); color: var(--good); }
.stat__delta--critical { background: var(--critical-soft); color: var(--critical); }
.stat__delta--warning { background: var(--warning-soft); color: var(--warning); }
.stat__delta--neutral { background: var(--accent-soft); color: var(--accent-ink); }
.stat__note { padding-left: 10px; border-left: 1px solid var(--line); }
.stat__foot .stat__note:first-child { padding-left: 0; border-left: 0; }

/* -------------------------------------------------------------- odznaky */

/* Odznak = mäkká farebná kapsula s bodkou. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-full);
  background: var(--neutral-soft);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--ink-2);
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; flex: none; border-radius: var(--r-full); background: var(--line-2); }
.badge__dot, .badge .icon { display: none; }

.badge--good     { background: var(--good-soft);     color: var(--good); }
.badge--good::before     { background: var(--good); }
.badge--warning  { background: var(--warning-soft);  color: var(--warning); }
.badge--warning::before  { background: var(--warning); }
.badge--critical { background: var(--critical-soft); color: var(--critical); }
.badge--critical::before { background: var(--critical); }
.badge--neutral  { background: var(--accent-soft);   color: var(--accent-ink); }
.badge--neutral::before  { background: var(--accent); }
.badge--muted    { background: var(--neutral-soft);  color: var(--ink-3); }
.badge--muted::before    { background: var(--line-2); }
.ref .badge, .linkitem .badge { font-size: var(--fs-xs); }

/* plná varianta — tam, kde má odznak vyniknúť (nálezy, prehľady) */
.badge--solid { gap: 5px; border: 1px solid; }
.badge--solid::before { display: none; }
.badge--solid .icon { display: block; width: 12px; height: 12px; }
.badge--solid.badge--good     { border-color: var(--good-line); }
.badge--solid.badge--warning  { border-color: var(--warning-line); }
.badge--solid.badge--critical { border-color: var(--critical-line); }
.badge--solid.badge--neutral  { border-color: var(--accent-line); }
.badge--solid.badge--muted    { border-color: var(--line); }

.tone-good     { background: var(--good); }
.tone-warning  { background: var(--warning); }
.tone-critical { background: var(--critical); }
.tone-neutral  { background: var(--accent); }
.tone-muted    { background: var(--line-2); }

.avatar {
  width: 27px; height: 27px;
  flex: none;
  display: inline-grid; place-items: center;
  vertical-align: middle;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: var(--r-full);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: .04em;
}
.avatar--lg { width: 42px; height: 42px; font-size: var(--fs-md); }

.pmark {
  width: 24px; height: 24px;
  flex: none;
  display: inline-grid; place-items: center;
  vertical-align: middle;
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: .02em;
  color: #fff;
  background: var(--pmark, var(--accent));
  border-radius: var(--r-xs);
}
.pmark--img {
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
}

.risk { display: inline-flex; align-items: center; gap: var(--sp-2); }
.risk__bar { width: 34px; height: 4px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.risk__bar > span { display: block; height: 100%; border-radius: var(--r-full); }
.risk__label { font-size: var(--fs-sm); color: var(--ink-2); }
.risk__count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--critical-soft);
  color: var(--critical);
  border-radius: var(--r-full);
  font-size: var(--fs-micro);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.risk--good .risk__bar > span     { background: var(--good); }
.risk--neutral .risk__bar > span  { background: var(--accent); }
.risk--warning .risk__bar > span  { background: var(--warning); }
.risk--critical .risk__bar > span { background: var(--critical); }
.riskcell { display: flex; align-items: center; gap: var(--sp-2); white-space: nowrap; }

/* ------------------------------------------------------------- tlačidlá */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--ctrl-h);
  padding: 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  font-size: var(--fs-sm);
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--line-2); text-decoration: none; }
.btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.btn:disabled, .btn.is-disabled { opacity: .45; pointer-events: none; }

.btn--primary, .btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover, .btn--accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn--danger { color: var(--critical); border-color: var(--critical-line); background: var(--critical-soft); box-shadow: none; }
.btn--danger:hover { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--ink-3); box-shadow: none; }
.btn--ghost:hover { background: var(--surface-3); color: var(--ink); border-color: transparent; }
.btn--icon { width: var(--ctrl-h); padding: 0; }
.btn--sm { height: var(--ctrl-sm); font-size: var(--fs-xs); padding: 0 8px; border-radius: var(--r-xs); }
.btn--sm.btn--icon { width: var(--ctrl-sm); }
.btn--block { width: 100%; }

.btnrow { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.table .col-actions .btnrow { flex-wrap: nowrap; justify-content: flex-end; }
.inputrow { display: flex; align-items: center; gap: var(--sp-2); }
.inputrow .input { flex: 1; min-width: 0; }

/* -------------------------------------------------------------- tabuľky */

.tablewrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th {
  text-align: left;
  font-size: var(--fs-micro);
  font-weight: 400;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 8px var(--sp-4);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
  height: 42px;
}
.table td.wrap { white-space: normal; }
.table tfoot td {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-weight: 500;
}
.amount-neg { color: var(--critical); }

.cell-clip {
  display: inline-block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast) var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table .col-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }

.th-sort { display: inline-flex; align-items: center; gap: 3px; color: inherit; }
.th-sort:hover { color: var(--ink); text-decoration: none; }
.th-sort.is-active { color: var(--accent-ink); }

.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; }
.cell-main:hover { text-decoration: none; }
.cell-main:hover .cell-title { color: var(--accent-ink); }
.cell-main__text { min-width: 0; }
.cell-title {
  font-weight: 500;
  color: var(--ink);
  display: block;
  letter-spacing: var(--ls-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table th:first-child, .table td:first-child { min-width: 168px; }
.cell-sub { font-size: var(--fs-xs); color: var(--ink-3); display: block; overflow: hidden; text-overflow: ellipsis; }

.tagline {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  height: 18px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: var(--fs-micro);
  font-weight: 400;
  vertical-align: middle;
}

/* ------------------------------------------------------------ formuláre */

.form { display: flex; flex-direction: column; gap: var(--sp-4); }

.fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-4); }
.field { grid-column: span 12; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--2 { grid-column: span 2; }
.field--3 { grid-column: span 3; }
.field--4 { grid-column: span 4; }
.field--5 { grid-column: span 5; }
.field--6 { grid-column: span 6; }
.field--8 { grid-column: span 8; }
.field--12 { grid-column: span 12; }
@media (max-width: 980px) { .field--2, .field--3, .field--4, .field--5, .field--6, .field--8 { grid-column: span 12; } }

.field__label {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field__hint { font-weight: 400; color: var(--ink-3); font-size: var(--fs-xs); }
.field__hint.ok { color: var(--good); }

/* otáznik namiesto vysvetľujúceho textu — popis sa zobrazí po prejdení myšou */
.qhint {
  width: 15px; height: 15px;
  flex: none;
  display: inline-grid; place-items: center;
  vertical-align: middle;
  margin-top: -1px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: var(--fs-micro);
  font-weight: 500;
  cursor: help;
  user-select: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.qhint:hover { background: var(--accent-soft); color: var(--accent-ink); }

.input {
  width: 100%;
  height: var(--ctrl-h);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-base);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input::placeholder { color: var(--placeholder); }
.input:hover { border-color: var(--line-2); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input--area { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.6; }
.input--money, .input--date { font-variant-numeric: tabular-nums; }
.input--money { text-align: right; padding-right: 28px; }

.datefield, .moneyfield { position: relative; display: block; }
.datefield__icon {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none;
}
.input--date { padding-right: 32px; }
.moneyfield__suffix {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: var(--fs-sm); pointer-events: none;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-base);
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
input[type="checkbox"] {
  width: 15px; height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex: none;
}

.form__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}
.form__foot--split { justify-content: space-between; }

/* -------------------------------------------------------- vlastný výber */

select.js-select {
  width: 100%; height: var(--ctrl-h);
  font-family: inherit; font-size: var(--fs-base);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
}
select.js-select.is-enhanced { position: absolute; opacity: 0; pointer-events: none; height: 0; width: 0; }

.cselect { position: relative; }
.cselect__btn {
  width: 100%;
  height: var(--ctrl-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: var(--fs-base);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.cselect__btn:hover { border-color: var(--line-2); }
.cselect__btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.cselect.is-open .cselect__btn { border-color: var(--accent); box-shadow: var(--ring); }
.cselect__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect__value.is-placeholder { color: var(--placeholder); }
.cselect__chev { color: var(--ink-3); transition: transform var(--t-fast) var(--ease); }
.cselect.is-open .cselect__chev { transform: rotate(180deg); }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.cselect__menu {
  position: absolute;
  z-index: 500;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 272px;
  overflow-y: auto;
  padding: 4px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: var(--blur-pop);
  backdrop-filter: var(--blur-pop);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  display: none;
}
.cselect.is-open .cselect__menu { display: block; animation: pop-in var(--t-fast) var(--ease); transform-origin: top; }
.cselect.is-up .cselect__menu { top: auto; bottom: calc(100% + 4px); transform-origin: bottom; }
.cselect.is-right .cselect__menu { left: auto; right: 0; }

.cselect__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 6px 8px;
  border-radius: var(--r-xs);
  font-size: var(--fs-base);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease);
}
.cselect__opt:hover, .cselect__opt.is-focus { background: var(--surface-3); }
.cselect__opt.is-selected { background: var(--accent-soft); color: var(--accent-ink); }
.cselect__opt .icon { color: var(--accent); opacity: 0; }
.cselect__opt.is-selected .icon { opacity: 1; }

/* --------------------------------------------------------------- kalendár */

.cal {
  position: absolute;
  z-index: 500;
  top: calc(100% + 4px);
  left: 0;
  width: 252px;
  padding: var(--sp-3);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: var(--blur-pop);
  backdrop-filter: var(--blur-pop);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  animation: pop-in var(--t-fast) var(--ease);
}
.cal.is-right { left: auto; right: 0; }
.cal.is-up { top: auto; bottom: calc(100% + 4px); }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.cal__title { font-size: var(--fs-base); font-weight: 500; letter-spacing: var(--ls-tight); }
.cal__nav {
  width: var(--ctrl-sm); height: var(--ctrl-sm);
  display: grid; place-items: center;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.cal__nav:hover { background: var(--surface-3); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__dow {
  font-size: var(--fs-micro); color: var(--ink-3); text-align: center;
  padding: 4px 0; font-weight: 400;
}
.cal__day {
  height: 28px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.cal__day:hover { background: var(--surface-3); }
.cal__day.is-out { color: var(--line-2); }
.cal__day.is-today { box-shadow: inset 0 0 0 1px var(--accent-line); }
.cal__day.is-selected { background: var(--accent); color: #fff; }
.cal__foot { display: flex; justify-content: space-between; margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--line); }
.cal__link {
  background: none; border: 0; padding: 2px 6px;
  border-radius: var(--r-xs);
  font-size: var(--fs-sm); font-weight: 400; color: var(--accent-ink); cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.cal__link:hover { background: var(--accent-soft); }

/* ----------------------------------------------------------------- filtre */

.filters {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.filters .field { flex: 0 0 172px; }
.filters .field--wide { flex: 1 1 250px; }
.filters .field--end { flex: 0 0 auto; margin-left: auto; }
.filters__spacer { flex: 1; }

.searchbox { position: relative; display: flex; align-items: center; }
.searchbox__icon { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.searchbox__input {
  width: 280px;
  height: var(--ctrl-h);
  padding: 0 10px 0 30px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  background: var(--surface-3);
  font-family: inherit;
  font-size: var(--fs-base);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.searchbox__input::placeholder { color: var(--placeholder); }
.searchbox__input:hover { background: var(--surface-2); }
.searchbox__input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: var(--ring); }
@media (max-width: 1200px) { .searchbox__input { width: 170px; } }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--ink-2);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.filters .chips { align-self: flex-end; }
.filters .chip { height: var(--ctrl-h); padding: 0 12px; font-size: var(--fs-sm); }

/* segmentovaný prepínač filtrov */
.segmented {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 2px;
  padding: 3px;
  background: var(--surface-3);
  border-radius: var(--r-sm);
}
.segmented__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 400;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.segmented__item:hover { color: var(--ink); text-decoration: none; }
.segmented__item.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}
.segmented__item.is-empty { color: var(--ink-3); }
.segmented__count {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.segmented__item.is-active .segmented__count { color: var(--accent-ink); }

/* prepínač namiesto zaškrtávacieho políčka */
.toggle { display: inline-flex; position: relative; }
.toggle input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  margin: 0;
}
.toggle__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--ctrl-h);
  padding: 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--ink-3);
  font-size: var(--fs-sm);
  font-weight: 400;
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.toggle__label:hover { border-color: var(--line-2); color: var(--ink); }
.toggle input:checked + .toggle__label {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-ink);
}
.toggle input:focus-visible + .toggle__label { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.toggle__label .icon { display: none; width: 14px; height: 14px; }
.toggle input:checked + .toggle__label .icon { display: block; }
a.chip:hover { border-color: var(--accent-line); color: var(--accent-ink); text-decoration: none; }
.chip .strong { font-variant-numeric: tabular-nums; }
.chip a { display: grid; place-items: center; color: var(--ink-3); }
.chip a:hover { color: var(--critical); }

/* ------------------------------------------------------------------ grafy */

.bars { display: flex; flex-direction: column; }
.bars__row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 92px;
  align-items: center;
  gap: var(--sp-3);
  padding: 6px 0;
}
.bars__row:hover .bars__fill { background: var(--accent-ink); }
.bars__label { font-size: var(--fs-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__meta { color: var(--ink-3); font-size: var(--fs-xs); margin-left: 6px; font-variant-numeric: tabular-nums; }
.bars__track { height: 8px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.bars__fill { display: block; height: 100%; border-radius: var(--r-full); background: var(--fill, var(--series-1)); transition: background var(--t-fast) var(--ease); }
.bars__stack { display: flex; gap: 2px; height: 100%; border-radius: var(--r-full); overflow: hidden; }
.bars__seg { display: block; height: 100%; }
.bars__value { text-align: right; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
@media (max-width: 720px) { .bars__row { grid-template-columns: 100px minmax(0, 1fr) 70px; } }

.legend { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-2); }
.legend__dot { width: 8px; height: 8px; border-radius: var(--r-full); }

.colchart {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 132px auto;
  column-gap: 10px;
}
.colchart__scale {
  grid-column: 1; grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 100%;
  padding: 1px 0 2px;
  font-size: var(--fs-micro);
  font-weight: 400;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.colchart__plot {
  grid-column: 2; grid-row: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px solid var(--line-2);
}
.colchart__col {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  border-radius: var(--r-xs) var(--r-xs) 0 0;
  transition: background var(--t-fast) var(--ease);
}
.colchart__col:hover { background: var(--accent-soft); }
.colchart__bar {
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  transition: background var(--t-fast) var(--ease);
}
.colchart__col.is-current .colchart__bar { background: var(--accent-ink); }
.colchart__col:hover .colchart__bar { background: var(--accent-ink); }
.colchart__col.is-empty .colchart__bar { height: 2px; background: var(--line-2); }
.colchart__axis { grid-column: 2; grid-row: 2; display: flex; gap: 5px; padding-top: 6px; }
.colchart__tick {
  flex: 1;
  text-align: center;
  font-size: var(--fs-micro);
  font-weight: 400;
  color: var(--ink-3);
  min-width: 0;
}

/* -------------------------------------------------------------- časová os */

/* zhora a zdola sa okno histórie stráca do biela – prekryvy, nie maska,
   maska by vytvorila backdrop root a sklo bublín by prestalo rozostrovať */
.tlfade { position: relative; }
.tlfade::before, .tlfade::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  height: 26px;
  pointer-events: none;
  z-index: 2;
}
.tlfade::before { top: 0; background: linear-gradient(to bottom, var(--surface), transparent); }
.tlfade::after {
  bottom: 0;
  background: linear-gradient(to top, var(--surface), transparent);
  border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px);
}

/* Okno histórie: bodkované pozadie dodáva hĺbku, sklenené bubliny ho rozostrujú. */
.tlwrap {
  background-image: radial-gradient(var(--line) 1px, transparent 1.5px);
  background-size: 12px 12px;
}
.timeline {
  --tl-date: 84px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--sp-4) var(--sp-5);
  min-height: 100%;
}
/* jedna súvislá linka zhora nadol, bez prerušenia */
.timeline::before {
  content: "";
  position: absolute;
  left: calc(var(--sp-5) + var(--tl-date) + var(--sp-3) + 4px);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-2);
}
.tl {
  display: grid;
  grid-template-columns: var(--tl-date) 9px minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: start;
}
.tl__dot {
  width: 9px;
  height: 9px;
  border-radius: var(--r-full);
  margin-top: 13px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 2px 8px rgba(15, 23, 42, .25);
}
.tl__when { min-width: 0; padding-top: 6px; }

/* sklenená bublina udalosti */
.tlb {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px var(--sp-4);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  border-top-left-radius: var(--r-xs);
  box-shadow: var(--shadow-xs);
}
.tlb__type {
  font-size: var(--fs-micro);
  color: var(--ink-3);
}
.tlb__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.tlb__title { font-size: var(--fs-base); font-weight: 500; letter-spacing: var(--ls-tight); min-width: 0; }
.tlb__foot { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); min-width: 0; }
.tlb__foot .tlb__meta { flex: 1; min-width: 0; }
.tlb__amount { margin-left: auto; font-size: var(--fs-md); color: var(--good); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tlb__amount.is-neg { color: var(--critical); }
/* poistka pre zastaraný markup (suma ešte v hlavičke bubliny): aj tak vpravo dole */
.tlb__head .tlb__amount { position: absolute; right: var(--sp-4); bottom: 9px; }
.tlb__meta { font-size: var(--fs-sm); color: var(--ink-3); overflow-wrap: anywhere; }
.tlb__del { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.tlb:hover .tlb__del, .tlb__del:focus-within { opacity: 1; }

@keyframes tl-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
/* „backwards", nie „both": doznievajúca animácia priehľadnosti by natrvalo
   vytvorila backdrop root a sklo bublín by prestalo rozostrovať podklad */
.tl { animation: tl-in .3s var(--ease) backwards; }
.tl:nth-child(1) { animation-delay: .02s; }
.tl:nth-child(2) { animation-delay: .05s; }
.tl:nth-child(3) { animation-delay: .08s; }
.tl:nth-child(4) { animation-delay: .11s; }
.tl:nth-child(5) { animation-delay: .14s; }
.tl:nth-child(6) { animation-delay: .17s; }
.tl:nth-child(n + 7) { animation-delay: .2s; }

@media (max-width: 700px) {
  .timeline { --tl-date: 60px; }
}

/* --------------------------------------------------------------- zoznamy */

.dl { display: grid; }
.dl__row {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.dl__row:last-child { border-bottom: 0; }
.dl__key {
  font-size: var(--fs-base);
  font-weight: 400;
  color: var(--ink-3);
}
.dl__val { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .dl__row { grid-template-columns: 1fr; gap: 2px; } }

.linklist { display: flex; flex-direction: column; }
.linkitem {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--line);
  color: inherit;
  transition: background var(--t-fast) var(--ease);
}
.linkitem:last-child { border-bottom: 0; }
.linkitem:hover { background: var(--surface-2); text-decoration: none; }
.linkitem:hover .linkitem__title { color: var(--accent-ink); }
.linkitem--critical::before, .linkitem--warning::before, .linkitem--info::before {
  content: "";
  width: 6px; height: 6px;
  flex: none;
  border-radius: var(--r-full);
}
.linkitem--critical::before { background: var(--critical); }
.linkitem--warning::before { background: var(--warning); }
.linkitem--info::before { background: var(--accent); }
.linkitem__text { min-width: 0; flex: 1; }
.linkitem__title { font-weight: 500; display: block; letter-spacing: var(--ls-tight); }
.linkitem__sub { font-size: var(--fs-xs); color: var(--ink-3); display: block; }

/* ---------------------------------------------------------------- nálezy */

.finding {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  transition: background var(--t-fast) var(--ease);
}
.finding:last-child { border-bottom: 0; }
.finding::before {
  content: "";
  width: 7px; height: 7px;
  flex: none;
  margin-top: 6px;
  border-radius: var(--r-full);
  background: var(--line-2);
}
.finding--critical::before { background: var(--critical); }
.finding--warning::before { background: var(--warning); }
.finding--info::before { background: var(--accent); }
.finding:hover { background: var(--surface-2); }
.finding.is-dismissed { opacity: .55; }

/* nálezy vnorené do tela karty (vyšetrovacia vrstva, grafové nálezy) */
.card__body .finding {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-2);
}
.card__body .finding:last-child { margin-bottom: 0; }
.card__body .finding:hover { background: var(--surface-2); }

.finding__body { min-width: 0; flex: 1; }
.finding__sev {
  font-size: var(--fs-micro);
  font-weight: 400;
  color: var(--ink-3);
  white-space: nowrap;
}
.finding--critical .finding__sev { color: var(--critical); }
.finding--warning .finding__sev { color: var(--warning); }
.finding--info .finding__sev { color: var(--accent-ink); }
.finding__title { font-size: var(--fs-md); font-weight: 500; letter-spacing: var(--ls-tight); }
.finding__detail { color: var(--ink-2); margin-top: 3px; max-width: 92ch; }
.finding__meta { display: block; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 6px; }
.finding__refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.finding__actions { display: flex; align-items: center; gap: var(--sp-2); flex: none; }

.ref {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 var(--sp-3) 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--ink-2);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.ref .pmark,
.ref .icon { width: 16px; height: 16px; flex: none; }
.ref .pmark { font-size: 8px; border-radius: var(--r-full); }
.ref .icon { color: var(--ink-3); }
.ref:hover { border-color: var(--accent-line); color: var(--accent-ink); text-decoration: none; box-shadow: var(--shadow-xs); }
.ref--banned { color: var(--critical); border-color: var(--critical-line); background: var(--critical-soft); }

/* --------------------------------------------------------------- ostatné */

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: var(--fs-base);
}
.alert--success { background: var(--good-soft); border-color: var(--good-line); color: var(--good); }
.alert--error { background: var(--critical-soft); border-color: var(--critical-line); color: var(--critical); }
.alert--info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  color: var(--ink-3);
}
.empty .icon { color: var(--line-2); margin-bottom: var(--sp-2); }
.empty__title { font-weight: 500; color: var(--ink-2); font-size: var(--fs-md); }
.empty__text { font-size: var(--fs-sm); margin-top: 4px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--line);
}
.pager__btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: var(--ctrl-sm); padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--ink-2);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.pager__btn:hover { border-color: var(--accent-line); color: var(--accent-ink); text-decoration: none; }
.pager__btn.is-disabled { opacity: .4; pointer-events: none; }
.pager__info { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.tip {
  position: fixed;
  z-index: 900;
  padding: 5px 9px;
  background: rgba(15, 23, 42, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #f8fafc;
  font-size: var(--fs-xs);
  line-height: 1.45;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  max-width: 280px;
}

/* ------------------------------------------------------------------ modál */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  background: rgba(15, 23, 42, .32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: modal-fade var(--t-med) var(--ease);
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  padding: var(--sp-6);
  animation: modal-rise var(--t-med) var(--ease);
}
.modal__icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--critical-soft);
  color: var(--critical);
  margin-bottom: var(--sp-4);
}
.modal__title { font-size: var(--fs-lg); font-weight: 500; letter-spacing: var(--ls-tight); }
.modal__text { color: var(--ink-2); font-size: var(--fs-base); margin-top: 6px; line-height: 1.55; }
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}

/* ------------------------------------------------------------- analýza */

.chat { display: flex; flex-direction: column; }
.chat__row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.chat__row:last-child { border-bottom: 0; }
.chat__row--q { background: var(--surface-2); }
.chat__row--a .chat__who { color: var(--accent-ink); }
.chat__who {
  font-size: var(--fs-micro);
  font-weight: 400;
  color: var(--ink-3);
  padding-top: 3px;
}
.chat__body { min-width: 0; line-height: 1.6; overflow-wrap: anywhere; }

.chat__body > :first-child { margin-top: 0; }
.chat__body > :last-child { margin-bottom: 0; }
.chat__body p { margin: 0 0 10px; }
.chat__body .md-head {
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  margin: 16px 0 6px;
}
.chat__body .md-list { margin: 0 0 10px; padding-left: 0; list-style: none; }
.chat__body .md-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 4px;
}
.chat__body ul.md-list li::before {
  content: "";
  position: absolute;
  left: 4px; top: 9px;
  width: 5px; height: 5px;
  border-radius: var(--r-full);
  background: var(--accent);
}
.chat__body ol.md-list { counter-reset: md; }
.chat__body ol.md-list li::before {
  counter-increment: md;
  content: counter(md) ".";
  position: absolute;
  left: 0; top: 0;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.chat__body code {
  background: var(--surface-3);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  font-size: var(--fs-sm);
}
.chat__body strong { font-weight: 500; }
.chat__row--q .chat__body { color: var(--ink); }
.chat__meta {
  grid-column: 2;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 700px) {
  .chat__row { grid-template-columns: minmax(0, 1fr); }
  .chat__meta { grid-column: 1; }
}
button.chip { cursor: pointer; text-align: left; font-family: inherit; }

.secret { display: inline-flex; align-items: center; gap: 4px; }
.secret__value {
  display: inline-flex;
  align-items: center;
  height: var(--ctrl-sm);
  padding: 0 8px;
  min-width: 108px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  font-size: var(--fs-sm);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.copybtn.is-done { color: var(--good); }

.kbd {
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  box-shadow: inset 0 -1px 0 var(--line);
  padding: 1px 6px;
}

/* ------------------------------------------------- prihlásenie / inštalácia */

body.bare {
  display: grid;
  place-items: center;
  padding: var(--sp-6);
  background: radial-gradient(1100px 560px at 50% -8%, #dbeafe 0%, var(--paper) 58%);
}

.authbox {
  width: 100%;
  max-width: 384px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-7) var(--sp-7) var(--sp-8);
}
.authbox--wide { max-width: 600px; }
.authbox__logo {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-5);
}
.authbox__title { font-size: var(--fs-xl); font-weight: 500; letter-spacing: var(--ls-tight); margin-bottom: var(--sp-5); }
/* nadpis s podtitulom (inštalácia) zostáva tesný – záporný okraj vráti pôvodné 4px */
.authbox__title + .authbox__text { margin-top: calc(4px - var(--sp-5)); }
.authbox__text { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 4px; margin-bottom: var(--sp-5); }
.authbox .field { margin-bottom: var(--sp-4); }

.creds {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin: var(--sp-4) 0;
  display: grid;
  gap: var(--sp-3);
}
.creds__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.creds__key { font-size: var(--fs-base); font-weight: 400; color: var(--ink-3); }
.creds__val { font-variant-numeric: tabular-nums; font-size: var(--fs-md); font-weight: 400; overflow-wrap: anywhere; }

/* rad dlaždíc – vždy jeden riadok, bez posuvníka, s mäkkými okrajmi */
.statrow {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
/* okraj mizne len tým smerom, kde je čo rolovať – bez JS žiadna maska */
.statrow.fade-r, .qcards.fade-r {
  -webkit-mask-image: linear-gradient(to right, #000, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(to right, #000, #000 calc(100% - 24px), transparent);
}
.statrow.fade-l, .qcards.fade-l {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000);
          mask-image: linear-gradient(to right, transparent, #000 24px, #000);
}
.statrow.fade-l.fade-r, .qcards.fade-l.fade-r {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.statrow::-webkit-scrollbar { display: none; }
.statrow .stat { flex: 1 0 230px; min-width: 230px; }

/* sklenené karty údajov v posuvnom páse */
.dsheet {
  columns: 2 300px;
  column-gap: var(--sp-7);
  padding: var(--sp-4) var(--sp-5);
}
.dsheet__sec {
  break-inside: avoid;
  min-width: 0;
  margin-bottom: var(--sp-4);
}
.dsheet__sec:last-child { margin-bottom: 0; }
.dsheet__title {
  font-size: var(--fs-micro);
  color: var(--ink-3);
  margin-bottom: 6px;
}
.dsheet__row {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: baseline;
  padding: 5px 0;
}
.dsheet__key { font-size: var(--fs-base); color: var(--ink-3); }
.dsheet__val {
  font-size: var(--fs-base);
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dsheet__val .btn--sm.btn--icon { width: 20px; height: 20px; margin: -3px 0; }

/* ------------------------------------------------ prepínač akcií a kariet */

/* jedna akcia naraz — prepínanie formulárov v karte akcií */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: var(--surface-3);
  border-radius: var(--r-sm);
  width: max-content;
  max-width: 100%;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* rýchle karty (prehľad platforiem a pod.) */
.qcards {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.qcards::-webkit-scrollbar { display: none; }
.qcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 0 196px;
  min-width: 196px;
  padding: var(--sp-4);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur-bar);
  backdrop-filter: var(--blur-bar);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: inherit;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.qcard:hover { border-color: var(--accent-line); box-shadow: var(--shadow-sm); text-decoration: none; }
.qcard__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qcard__title { font-size: var(--fs-base); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcard__value { display: flex; align-items: baseline; gap: 6px; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.qcard__unit { font-size: var(--fs-xs); color: var(--ink-3); }
.qcard__meta { font-size: var(--fs-xs); color: var(--ink-3); }

/* úprava dátumu priamo v časovej osi */
.tl__when { min-width: 0; }
button.tl__date {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  padding: 2px 8px;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--ink-2);
  line-height: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
button.tl__date:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.tl__dateform { display: none; }
.tl.is-editing .tl__dateform { display: block; }
.tl.is-editing button.tl__date { display: none; }
.tl__dateform .input { height: var(--ctrl-sm); font-size: var(--fs-xs); padding: 0 22px 0 6px; }
.tl__dateform .datefield__icon { right: 5px; }

/* ovládacie prvky mapy — rovnaké selecty ako vo filtroch */
.netmap__ctl { width: 190px; flex: none; }
.netmap__reset { margin-left: auto; }

/* formulár prevodu v párovaní – všetky polia aj tlačidlo na jednom riadku */
.pairform .field { flex: 1 1 110px; }
.pairform .field--wide { flex: 1.7 1 170px; }
.pairform .btn { flex: none; }

/* ------------------------------------------------------ karty účtov */

.acards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
  padding: var(--sp-5);
}
@keyframes acard-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.acard {
  /* „backwards", nie „both" – doznievajúca animácia by vytvorila backdrop root
     a námraza s CTA by prestali rozostrovať podklad (rovnaké pravidlo ako časová os) */
  animation: acard-in .45s var(--ease) backwards;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  color: inherit;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.acard:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--acolor) 42%, var(--line));
  text-decoration: none;
}

/* vrstvy pozadia: nádych farby platformy, veľké rozmazané logo, námraza, zrno */
@keyframes mesh-drift {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate(-3%, 2.5%) rotate(5deg) scale(1.06); }
  100% { transform: translate(2.5%, -2%) rotate(-4deg) scale(1.03); }
}

.acard__tint {
  position: absolute;
  inset: -22%;
  animation: mesh-drift 16s ease-in-out infinite alternate;
  background:
    radial-gradient(90% 72% at 88% -12%, color-mix(in srgb, var(--acolor) 46%, transparent), transparent 62%),
    radial-gradient(70% 58% at -12% 34%, color-mix(in srgb, var(--acolor) 22%, transparent), transparent 58%),
    radial-gradient(62% 52% at 58% 112%, color-mix(in srgb, var(--acolor) 16%, transparent), transparent 60%);
}
/* mesh z odvodených odtieňov – posunuté tóny tej istej farby + svetlý akcent */
@supports (color: hsl(from red h s l)) {
  .acard__tint {
    background:
      radial-gradient(85% 70% at 88% -10%, color-mix(in srgb, var(--acolor) 46%, transparent), transparent 60%),
      radial-gradient(70% 60% at -8% 28%, color-mix(in srgb, hsl(from var(--acolor) calc(h + 35) s l) 26%, transparent), transparent 58%),
      radial-gradient(64% 54% at 62% 114%, color-mix(in srgb, hsl(from var(--acolor) calc(h - 30) s l) 18%, transparent), transparent 60%),
      radial-gradient(40% 36% at 20% -8%, rgba(255, 255, 255, .5), transparent 70%);
  }
}
.acard__logo {
  position: absolute;
  top: -34px;
  right: -34px;
  width: 196px;
  height: 196px;
  object-fit: contain;
  opacity: .72;
  transform: rotate(-8deg);
}
.acard__logotext {
  position: absolute;
  top: -18px;
  right: -10px;
  font-size: 128px;
  font-weight: 500;
  letter-spacing: -.04em;
  color: var(--acolor);
  opacity: .42;
  transform: rotate(-8deg);
}
.acard__frost {
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(255, 255, 255, .34);
}
.acard__grain {
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.14'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* sklenené CTA na spodku karty – na hoveri karty sa rozsvieti do akcentu */
.acard__cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--ctrl-h);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-xs);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
  transition: background var(--t-med) var(--ease), border-color var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
.acard__cta .icon { transition: transform var(--t-med) var(--ease); }
.acard:hover .acard__cta { background: var(--accent); border-color: var(--accent); color: #fff; }
.acard:hover .acard__cta .icon { transform: translateX(2px); }

/* obsah nad vrstvami */
.acard__head, .acard__kpi, .acard__facts, .acard__foot { position: relative; }
.acard__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acard__head .pmark { width: 30px; height: 30px; border-radius: var(--r-sm); }
.acard__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acard__title {
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acard__sub {
  font-size: var(--fs-xs);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acard__kpi { display: flex; flex-direction: column; gap: 1px; margin-top: var(--sp-2); }
.acard__value {
  font-size: var(--fs-2xl);
  font-weight: 400;
  letter-spacing: var(--ls-tight);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--ink);
}
.acard__vlabel { font-size: var(--fs-sm); color: var(--ink-2); }

.acard__facts { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.acard__fact { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.acard__fact span { font-size: var(--fs-micro); color: var(--ink-3); }
.acard__fact b { font-size: var(--fs-sm); font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

.acard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}
.acard__cta { margin-top: 2px; }

.acards .acard:nth-child(1) { animation-delay: .03s; }
.acards .acard:nth-child(2) { animation-delay: .07s; }
.acards .acard:nth-child(3) { animation-delay: .11s; }
.acards .acard:nth-child(4) { animation-delay: .15s; }
.acards .acard:nth-child(5) { animation-delay: .19s; }
.acards .acard:nth-child(6) { animation-delay: .23s; }
.acards .acard:nth-child(7) { animation-delay: .27s; }
.acards .acard:nth-child(8) { animation-delay: .31s; }
.acards .acard:nth-child(n + 9) { animation-delay: .35s; }

@media (max-width: 760px) {
  .acards { padding: var(--sp-3); gap: var(--sp-3); grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------- AI chat */

.chatlist { display: flex; flex-direction: column; }
.chatrow {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-5);
  border-bottom: 1px solid var(--line);
  transition: background var(--t-fast) var(--ease);
}
.chatrow:last-child { border-bottom: 0; }
.chatrow:hover { background: var(--surface-2); }
.chatrow.is-active { background: var(--accent-soft); }
.chatrow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 2px 0; color: inherit; }
.chatrow__main:hover { text-decoration: none; }
.chatrow__title { font-size: var(--fs-base); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatrow.is-active .chatrow__title { color: var(--accent-ink); }
.chatrow__sub { font-size: var(--fs-xs); color: var(--ink-3); }
.chatrow form { opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.chatrow:hover form, .chatrow form:focus-within { opacity: 1; }

.memlist { display: flex; flex-direction: column; }
.memrow {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: 7px var(--sp-3) 7px var(--sp-5);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.memrow:last-child { border-bottom: 0; }
.memrow__text { flex: 1; min-width: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.memrow__src { font-size: var(--fs-micro); color: var(--ink-3); }

/* editovateľný názov chatu – Enter uloží */
.aichat-title {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  width: 100%;
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: var(--r-xs);
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.aichat-title:hover { background: var(--surface-2); }
.aichat-title:focus { outline: none; background: var(--surface); box-shadow: var(--ring); }

/* okno správ nad bodkovaným podkladom, vyššie než história účtu */
.aichat-window { height: 520px; max-height: 66vh; }
.aichat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  min-height: 100%;
}
.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg--user { align-self: flex-end; align-items: flex-end; }
.msg--ai { align-self: flex-start; align-items: flex-start; }
.msg__bubble {
  min-width: 0;
  padding: 9px var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  font-size: var(--fs-base);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.msg--user .msg__bubble {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  border-bottom-right-radius: var(--r-xs);
}
.msg--ai .msg__bubble {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border-bottom-left-radius: var(--r-xs);
}
.msg__meta { font-size: var(--fs-micro); color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.msg__bubble--error { background: var(--critical-soft); border-color: var(--critical-line); color: var(--critical); }

/* animácia písania – tri dýchajúce bodky */
.typing { display: inline-flex; align-items: center; gap: 4px; height: 14px; }
.typing i {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--ink-3);
  animation: typing 1s infinite var(--ease);
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 60%, 100% { transform: none; opacity: .35; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* markdown vo vnútri bubliny */
.msg__bubble p { margin: 0 0 8px; }
.msg__bubble > :last-child { margin-bottom: 0; }
.msg__bubble .md-head { font-weight: 500; letter-spacing: var(--ls-tight); margin: 12px 0 4px; }
.msg__bubble .md-list { margin: 0 0 8px; padding-left: 0; list-style: none; }
.msg__bubble .md-list li { position: relative; padding-left: 16px; margin-bottom: 3px; }
.msg__bubble ul.md-list li::before {
  content: "";
  position: absolute;
  left: 3px; top: 8px;
  width: 5px; height: 5px;
  border-radius: var(--r-full);
  background: var(--accent);
}
.msg__bubble ol.md-list { counter-reset: md; }
.msg__bubble ol.md-list li::before {
  counter-increment: md;
  content: counter(md) ".";
  position: absolute;
  left: 0; top: 0;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.msg__bubble code { background: var(--surface-3); border-radius: var(--r-xs); padding: 1px 5px; font-size: var(--fs-sm); }
.msg__bubble strong { font-weight: 500; }

.aichat__empty {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  max-width: 560px;
  text-align: center;
  padding: var(--sp-5);
}
.aichat__empty .icon { width: 26px; height: 26px; color: var(--accent); }
.aichat__empty .chips { justify-content: center; }

.aichat__input {
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  border-top: 1px solid var(--line);
}
.aichat__input .input--area { flex: 1; min-height: 40px; max-height: 160px; }

/* skladateľ správy: pole a odosielacie tlačidlo žijú v jednom ráme */
.composer {
  position: relative;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.composer:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.composer__field {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  resize: none;
  font: inherit;
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--ink);
  padding: 11px 52px 11px var(--sp-4);
  min-height: 44px;
  max-height: 160px;
}
.composer__field::placeholder { color: var(--placeholder); }
.composer__field:focus { outline: none; }
.composer__field:disabled { color: var(--ink-3); }
.composer__send {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-full);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.composer__send:hover { background: var(--accent-ink); }
.composer__send:active { transform: scale(.92); }
.composer__send:focus-visible { outline: none; box-shadow: var(--ring); }
.composer__send:disabled { opacity: .45; cursor: default; pointer-events: none; }
.composer__send .icon { width: 15px; height: 15px; }

@media (hover: none) {
  .chatrow form { opacity: 1; }
}

/* =========================================================================
   Mobil – natívny vzhľad. Len prepisy v media query, desktop sa nemení.
   Formuláre sú zvislé s poľami na celú šírku, tlačidlá si držia
   prirodzenú šírku a zoskupujú sa – nič sa nerozťahuje ani neroluje nabok.
   ========================================================================= */

@media (max-width: 760px) {
  :root {
    --ctrl-h: 38px;   /* pohodlné dotykové ciele */
    --ctrl-sm: 30px;
  }

  /* 16px v poliach = iOS pri fokuse nepribližuje stránku */
  input:not([type="checkbox"]), select, textarea,
  .cselect__btn, .cselect__opt {
    font-size: 16px;
  }

  /* hlavička: všetko na JEDNOM riadku – titulok, lupa, ikonové akcie */
  .topbar { flex-wrap: nowrap; }
  .crumbs { flex: 1 1 auto; min-width: 0; }
  .crumbs__parent, .crumbs__sep { display: none; }
  .topbar__right { width: auto; flex: none; flex-wrap: nowrap; gap: var(--sp-2); }
  /* lupa je zbalená na ikonu, po ťuknutí sa roztiahne */
  .searchbox { flex: none; }
  .searchbox__input {
    width: var(--ctrl-h);
    padding-right: 0;
    transition: width var(--t-med) var(--ease);
  }
  .searchbox__input::placeholder { color: transparent; }
  .searchbox:focus-within .searchbox__input { width: 168px; padding-right: 10px; }
  .searchbox:focus-within .searchbox__input::placeholder { color: var(--placeholder); }
  /* akcie ako ikonové tlačidlá – text sa zbalí, ikona zostane */
  .topbar__right .btn {
    flex: none;
    font-size: 0;
    gap: 0;
    width: var(--ctrl-h);
    padding: 0;
  }
  .topbar__right .segmented { flex: none; }

  /* filtre: čistý zvislý formulár, polia na celú šírku */
  .filters { flex-wrap: wrap; }
  .filters .field, .filters .field--wide { flex: 1 1 100%; }
  .filters .field--end { margin-left: 0; flex: 1 1 100%; }
  .filters .btn { flex: none; }
  .filters .chips { flex-wrap: wrap; }

  /* tlačidlové rady: prirodzené šírky, zoskupené vpravo, bez rozťahovania */
  .form__foot { flex-wrap: wrap; justify-content: flex-end; }
  .form__foot .btn { flex: none; }
  .btnrow .btn { flex: none; }

  /* riadky nastavení: tlačidlo na celú šírku, stavový text drobným pod ním */
  .form__foot--split { flex-direction: column; align-items: stretch; gap: var(--sp-2); }
  .form__foot--split .btn { width: 100%; justify-content: center; order: 1; }
  .form__foot--split .muted { order: 2; font-size: var(--fs-xs); white-space: normal; }

  /* pásy dlaždíc zostávajú na švih – to je natívny vzor pre karty */
  .statrow .stat { flex: 1 0 200px; min-width: 200px; }

  /* chat pohodlne na výšku obrazovky */
  .aichat-window { height: 56vh; max-height: none; }
  .msg { max-width: 88%; }


  /* pásové ovládanie: prepínače kariet, štítky, rady tlačidiel a akcie
     v hlavičkách sa rolujú do strany – nič nepretečie cez okraj stránky */
  .tabs, .chips, .btnrow, .card__actions, .segmented {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar,
  .chips::-webkit-scrollbar,
  .btnrow::-webkit-scrollbar,
  .card__actions::-webkit-scrollbar,
  .segmented::-webkit-scrollbar { display: none; }
  .card__head { flex-wrap: wrap; }
  .chips .chip, .btnrow .btn, .card__actions .btn, .tabs .tab { flex: none; }
}

/* =========================================================================
   Tablet a mobil (do 960 px): poistka proti vodorovnému pretečeniu stránky
   a mriežkové ovládanie mapy. Desktop sa nemení.
   ========================================================================= */

@media (max-width: 960px) {
  /* stránka sa NIKDY neroluje do strany – rolujú len vnútorné pásy a tabuľky */
  html, body { overflow-x: hidden; overflow-x: clip; }

  .netmap__toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
  }
  .netmap__toolbar > * { min-width: 0; }
  .netmap__search { grid-column: 1 / -1; }
  .netmap__search input { min-width: 0; width: 100%; }
  .netmap__ctl { width: 100%; }
  .netmap__ctl .cselect { width: 100%; }
  .netmap__sep { display: none; }
  .netmap__reset { margin-left: 0; width: 100%; }
}

/* =========================================================================
   Spodná lišta – rýchla navigácia na mobile. Sklo s výrezom, domov v kruhu.
   ========================================================================= */

.tabbar { display: none; }

@media (max-width: 760px) {
  .tabbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 180;
    display: flex;
    align-items: stretch;
    height: 60px;
    padding: 0 var(--sp-2);
  }
  /* sklenená lišta – čistý zaoblený obdĺžnik, kolísku tvorí samotný kruh domova */
  .tabbar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .85);
    -webkit-backdrop-filter: var(--blur-bar);
    backdrop-filter: var(--blur-bar);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
  }
  .tabbar__item, .tabbar__gap, .tabbar__home { position: relative; }
  .tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--ink-3);
    font-size: var(--fs-micro);
    font-weight: 500;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar__item:hover { text-decoration: none; }
  .tabbar__item .icon { width: 21px; height: 21px; }
  .tabbar__item.is-active { color: var(--accent-ink); }
  .tabbar__icon { position: relative; display: grid; place-items: center; }
  .tabbar__dot {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 7px;
    height: 7px;
    border-radius: var(--r-full);
    background: var(--critical);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .9);
  }
  .tabbar__gap { flex: 0 0 76px; }

  /* domov: vyvýšený kruh vsadený do výrezu lišty */
  .tabbar__home {
    position: absolute !important;
    left: 50%;
    top: 0;
    transform: translate(-50%, -42%);
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: var(--r-full);
    background: var(--accent);
    color: #fff;
    /* kolíska: papierový prstenec prekryje hranu lišty, linka ju oblúkovito uzavrie */
    box-shadow:
      0 0 0 6px var(--paper),
      0 0 0 7px var(--line),
      var(--shadow-md);
    -webkit-tap-highlight-color: transparent;
    transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  }
  .tabbar__home .icon { width: 23px; height: 23px; }
  .tabbar__home:active { transform: translate(-50%, -42%) scale(.94); }
  .tabbar__home.is-active { background: var(--accent-ink); }

  /* obsah sa nesmie schovať pod lištu */
  .content { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
}

/* ------------------------------------------------------------------ pohyb */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .sidebar, .topbar, .btn, .pager, .filters { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .card { break-inside: avoid; box-shadow: none; }
}
