/* ======================================================================
   01. BASE
   Reset html/body, swipe-viewport, zdielane premenne

   Poradie suborov v index.html je zavazne -- kaskada od neho zavisi.
   Tento subor obsahuje povodne sekcie 01-01.
   ====================================================================== */

/* ======================================================================
   01. [GLOBAL]  global-base-style
   ====================================================================== */
/* ============================================================
   GLOBAL BASE — one viewport foundation shared by Qwick surfaces.
   Optional modules are overlaid in the same viewport and crossfade;
   this base never arranges whole applications next to each other.
   ============================================================ */
:root{
  color-scheme: dark;
}

*{
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Roly --bg, --surface a --surface2 sa presunuli do
   styles/00-tokens/01-semantic.css. Token sa definuje iba tam. */

html,body{
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  /* Follows --bg like the screens themselves, so overscroll and safe-area
     edges match the dashboard instead of showing a black band behind it. */
  background: var(--bg);
  color-scheme: dark;
  overflow: hidden;                 /* the document itself never scrolls — each screen scrolls internally */
  /* JEDEN BACKDROP ROOT PRE CELU APLIKACIU.
     `backdrop-filter` na tlacidle QWICK berie iba to, co je nakreslene
     vnutri najblizsieho predka s vlastnym `filter`. Runtime modulu taky
     filter nesie (prelinanie ploch), a prave preto rozostrenie za zelenym
     tlacidlom fungovalo dokonale, kym za modrym nie: modre ziadny taky
     koren nad sebou nemalo a WebKit mu backdrop zahodil.
     Odkedy je tlacidlo JEDNO a lezi nad oboma plochami, koren musi byt
     spolocny predok oboch -- teda `body`. `blur(0)` nic nekresli, iba
     vyhlasi koren, presne ako to robi runtime modulu.
     NEODSTRANUJ to: bez toho sa rozostrenie tlacidla stane znovu
     zavislym na tom, ktora plocha je prave otvorena. */
  filter: blur(0);
  -webkit-filter: blur(0);
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  touch-action: pan-y;              /* let vertical native scroll pass through; horizontal is ours */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input, textarea, [contenteditable="true"]{
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* RAMEC APLIKACIE MA VYSKU VZDY, NIE IBA PO PRIDANI NA PLOCHU.
   `#app-track` ma `height:100%` a obrazovka v nom je `position:absolute`,
   teda MIMO toku -- vysku dratu neurcuje nic z jeho obsahu. Percento sa preto
   musi mat o co oprieť. Vysku dostaval iba selektor
   `html.ios-standalone-fullscreen`, takze v beznom Safari (otvoreny subor,
   karta prehliadaca) sa cely retazec zrutil na nulu: pozadie ostalo, hlavicka,
   karty aj zoznam pohybov zmizli a na obrazovke ostalo len to, co je
   `position:fixed` -- tlacidlo QWICK. Presne tak to vyzeralo na screenshote.

   Hodnota je ta ista, ktoru dopocitava `scripts/03-qwick-viewport-height.js`;
   standalone pravidlo v `03-controls.css` ju uz iba zopakuje pre `html` a
   `body`, takze na ploche sa nic nemeni. */
#app-viewport{
  height:var(--app-viewport-height, 100dvh);
  min-height:var(--app-viewport-height, 100dvh);
}

#app-track{
  position:relative;
  width:100%;
  height:100%;
  overflow:hidden;
}

.app-screen-moves{
  position:absolute;
  inset:0;
  height:100%;
  max-height:100%;
  overflow-y:auto;
  overscroll-behavior-y:none;
}

/* Dashboard stays above its own ambient colour field. Optional modules are
   separate fixed overlays and never change this internal stacking. */
.app-screen-moves{
  z-index:1;
  box-shadow:none;
}

/* Every top-level container for each app (screen, its detached overlays,
   and the dynamically-created export-image stage) carries this scope
   class, so put the base font/color here once rather than on just the
   screen container — anything living outside the screen's own subtree
   (overlays, export stage) still needs to inherit the right font. */
.qwick-surface{
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
}

/* Prevent the background screen from scrolling while a modal sheet is open */
body.modal-open .app-screen-moves{
  overflow: hidden;
}

/* ---------- QWICK BACKUP / RESTORE ---------- */
.qwick-surface .backup-settings-section{margin-top:18px;}
.qwick-surface .backup-settings-title{font-size:13px;font-weight:850;color:var(--text);margin:0 2px 10px;}
.qwick-surface .backup-settings-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;width:calc(100% - 14px);margin-inline:auto;}
.qwick-surface .backup-settings-pill{width:100%;height:54px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:850;line-height:1;padding:0 16px;transition:transform .14s cubic-bezier(.22,1,.36,1),border-color .18s ease,color .18s ease,opacity .18s ease;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.qwick-surface .backup-settings-pill:active{transform:scale(1.035);}
.qwick-surface .backup-settings-pill svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.qwick-surface .backup-settings-pill.backup-blue{color:#69d7ff;}
.qwick-surface .backup-settings-pill.restore-green{color:#51cf66;}
.qwick-surface .backup-settings-pill.cancel-red{color:#ff6b6b;}
.qwick-surface .backup-settings-status{min-height:17px;margin:9px 2px 0;color:var(--muted);font-size:11px;line-height:1.35;text-align:center;overflow-wrap:anywhere;}
