:root {
  color-scheme: dark;   /* WKWebView default backdrop = čierny aj v safe-area insetoch */
  --bg: #000000;
  --text: #c8ccd6;
  --muted: #565c6e;
}

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

/* HTML `hidden` attribute MUST win over any custom display:flex/grid we set
   on .modal, .sheet etc. Otherwise overlay panels stay visible on load. */
[hidden] { display: none !important; }

/* Transcript visibility opt-in — set by JS for chat/both mode or on explicit
   voice command "ukáž prepis". */
body.show-transcript .transcript { display: flex !important; }

html, body {
  height: 100%;
  /* #000 aj v safe-area insetoch (notch/home indikátor) — inak presvital biely
     default WKWebView (Petrov screenshot: biely pruh hore/dole). */
  background: #000;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: #000;
}

/* CANVAS CEZ CELÝ DISPLEJ (Petrov pokyn 2026-06-13): predtým bol malý štvorec
   min(92vmin,780px) → orb sa OREZÁVAL na jeho hranách (hore aj dole) a okolo
   presvitalo pozadie. Full-screen canvas: žiadne orezanie + čierny trail pokryje
   aj safe-area (biele pruhy preč). pointer-events:none → tapy idú na tlačidlá. */
#orb {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  background: #000;
}
/* OKIENKO 24 (Petrov pokyn 2026-06-20): ČISTÝ prehrávač — len bublinky obsahu + šípka SPÄŤ. Grafika orbu aj
   horné ovládanie (hamburger / mikrofón / kamera / membrána-toggle / ambient) skryté; namiesto hamburgeru šípka späť. */
body.okienko-open #orb { display: none !important; }
body.okienko-open #hamburger, body.okienko-open #mic-toggle, body.okienko-open #timeline-btn,
body.okienko-open #ambient-toggle { display: none !important; }
/* Okienko cez CHAT (Petrov pokyn 2026-07-13): chat sa ZAVRIE — správy, input bar,
   hlavička aj membrána zmiznú, nič nebeží na pozadí. Po zatvorení Okienka sa vráti. */
body.okienko-open #transcript, body.okienko-open #chat-bar,
body.okienko-open #chat-header, body.okienko-open #orb-mem-btn { display: none !important; }
/* plávajúci hamburger chat režimu má silnejšie pravidlo (display:grid !important) — treba silnejšiu výnimku */
body.chat-primary.okienko-open #hamburger.hamburger-btn { display: none !important; }
/* CELÉ MENU otvorené (Petrov pokyn 2026-06-20): bez orb grafiky a bez kamera/mic ikon. HAMBURGER OSTÁVA
   viditeľný (Petrov pokyn 2026-06-20b): klik naň menu ZATVORÍ (toggle, tá istá ikona) — dvíhame ho NAD drawer (60). */
body.menu-open #orb, body.menu-open #mic-toggle, body.menu-open #timeline-btn, body.menu-open #chat-bar,
body.menu-open #ambient-toggle { display: none !important; }
body.menu-open .hamburger-btn { z-index: 70; }   /* nad drawer panelom → klik = zatvoriť menu */
#okienko-back { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px)); width: 55px; height: 55px; display: none;
  align-items: center; justify-content: center; border-radius: 50%; z-index: 96;   /* nad Okienkom (95) — X musí byť vždy klikateľné */
  border: 1px solid rgba(255,255,255,.18); background: rgba(20,24,32,.55);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: var(--text); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
html[data-theme="day"] #okienko-back { background: rgba(255,255,255,.82); border-color: rgba(0,0,0,.10); color: #111; }

/* Default state labels skryté — orb mood vyjadruje stav. Chyby ostávajú viditeľné. */
.status {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom, 28px));
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  pointer-events: none;
  text-align: center;
  max-width: 80vw;
  opacity: 0;
  transition: opacity 200ms ease;
}
.status.error {
  opacity: 1;
  color: rgba(255, 110, 110, 0.95);
}
.status.loading {
  opacity: 0.75;
  color: rgba(180, 200, 230, 0.7);
}

.transcript {
  /* Default: invisible. Shown only in chat/both mode OR when Peter asks. */
  display: none !important;
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 88vw);
  max-height: 24vh;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(214, 219, 231, 0.78);
  text-align: center;
  pointer-events: none;
  flex-direction: column;
  justify-content: flex-end;
  /* Top fades to nothing, bottom fades into the orb area below. */
  mask-image: linear-gradient(to bottom, transparent 0, #000 32px, #000 calc(100% - 60px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 32px, #000 calc(100% - 60px), transparent 100%);
}

/* nano-status-bar — small floating window above the orb showing the task
   label and the numeric % for whatever job the visualizer is tracking. */
.nano-status {
  position: absolute;
  top: max(20px, env(safe-area-inset-top, 20px));
  left: 50%;
  transform: translateX(-50%);
  min-width: 120px;
  max-width: min(360px, 80vw);
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 12, 18, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(220, 226, 240, 0.92);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  animation: nano-status-fade-in 240ms ease forwards;
  z-index: 5;
}
.nano-status[hidden] { display: none !important; }
.nano-status .nano-status-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.nano-status .nano-status-percent {
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: rgba(180, 220, 240, 0.95);
}
.nano-status.is-complete .nano-status-percent { color: rgba(170, 235, 190, 0.95); }
.nano-status.is-error .nano-status-percent    { color: rgba(255, 150, 150, 0.95); }
/* If canvas rendering fails the orb sets is-fallback — the small window then
   becomes the sole indicator, so we give it a touch more presence. */
.nano-status.is-fallback {
  background: rgba(20, 24, 32, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
}
@keyframes nano-status-fade-in {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.transcript .me { color: rgba(140, 200, 240, 0.95); }
.transcript .ai { color: rgba(230, 220, 200, 0.95); }

/* Copy + selektívny výber textu z bublín (popis sa dá vybrať a skopírovať) */
.transcript p { position: relative; }
.transcript .bubble-text { user-select: text; -webkit-user-select: text; cursor: text; }
.bubble-copy {
  position: absolute; top: 3px; right: 5px;
  border: 1px solid rgba(150,190,240,0.18); background: rgba(20,28,44,0.78);
  color: var(--muted); border-radius: 7px; font-size: 12px; line-height: 1;
  padding: 3px 6px; cursor: pointer; opacity: 0;
  transition: opacity .12s ease, color .12s ease, background .12s ease;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.transcript p:hover .bubble-copy,
.bubble-copy:focus-visible { opacity: 1; }
.bubble-copy:hover { color: #fff; background: rgba(40,52,76,0.92); }
.bubble-copy.done { color: #7ad19a; border-color: rgba(122,209,154,0.5); }
@media (hover: none) { .bubble-copy { opacity: 0.6; } }   /* na mobile vždy viditeľné */

/* Dátumový oddeľovač v histórii chatu (nekonečný príbeh po dňoch) */
.transcript .date-sep {
  align-self: center; margin: 10px auto 6px; padding: 3px 12px;
  font-size: 11px; letter-spacing: 0.04em; text-transform: capitalize;
  color: var(--muted); background: rgba(20,28,44,0.6);
  border: 1px solid rgba(150,190,240,0.14); border-radius: 999px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.transcript p.hist { animation: none; }   /* história sa nefejduje */

/* Dropped/attached image preview in the chat */
.transcript p.attach { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.chat-attach {
  max-width: 180px; max-height: 180px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(150,190,240,0.25); object-fit: cover;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35); transition: transform .12s ease;
}
.chat-attach:hover { transform: scale(1.03); }
.attach-cap { font-size: 11px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transcript p {
  margin: 6px 0;
  opacity: 1;
  transition: opacity 1.6s ease 6s; /* full opacity for 6s, then fade over 1.6s */
}
.transcript p.fading { opacity: 0; }
.transcript p.gone   { display: none; }

.controls {
  position: absolute;
  right: 24px;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ctrl-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 200ms ease, transform 120ms ease;
}
.ctrl-btn:hover { background: rgba(255, 255, 255, 0.06); }
.ctrl-btn:active { transform: scale(0.95); }
.ctrl-btn.live { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); }

/* Učenie hlasu — čistá biela ikona dole-vľavo (nad listen ikonou), bez neónu. */
#learn-voice-btn {
  position: fixed; left: 14px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20, 24, 32, 0.72); border: 1px solid rgba(255, 255, 255, 0.22); color: #fff; cursor: pointer;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
#learn-voice-btn:active { transform: scale(0.95); }
#learn-voice-btn.learning { border-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.14); }
html[data-theme="day"] #learn-voice-btn { background: rgba(255, 255, 255, 0.85); border-color: rgba(0, 0, 0, 0.12); color: #111; }

#mode-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 0; gap: 6px; }

/* Mode toggle becomes a minimal pill: icon + small label ("Hlas" / "Chat"
   / "Oba"). Wider than the default circular ctrl-btn so the label fits. */
#mode-toggle {
  width: auto;
  min-width: 78px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
}
/* ── Voice settings (provider + voice picker + preview) — top-right ───────── */
#voice-settings-btn {
  position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); right: 104px; z-index: 61;
  height: 38px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(20, 24, 32, 0.72); border: 1px solid rgba(255,255,255,0.14); color: var(--text);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  font: 600 11px -apple-system, system-ui, sans-serif; letter-spacing: 0.04em; text-transform: uppercase;
}
html[data-theme="day"] body.chat-primary #voice-settings-btn { background: rgba(255,255,255,0.82); border-color: rgba(0,0,0,0.10); color: #111; }

/* ── AMBIENT / LIVE prepínač (Petrov pokyn 2026-06-13) — pill vľavo od mode-toggle. */
#ambient-toggle {
  position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); right: 66px; z-index: 61;
  height: 38px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(20, 24, 32, 0.72); border: 1px solid rgba(255,255,255,0.14); color: var(--text);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  font: 600 11px -apple-system, system-ui, sans-serif; letter-spacing: 0.04em; text-transform: uppercase;
}
#ambient-toggle:active { transform: scale(0.95); }
/* AMBIENT zapnutý → jantárový akcent (vizuálne „len počúvam"). */
#ambient-toggle.ambient-on { background: rgba(255,180,70,0.22); border-color: rgba(255,180,70,0.55); }
body.chat-primary #ambient-toggle { display: none !important; }   /* chat režim: nepotrebné */
html[data-theme="day"] body.voice-only #ambient-toggle { background: rgba(255,255,255,0.9); border-color: rgba(0,0,0,0.12); color: #111; }
html[data-theme="day"] body.voice-only #ambient-toggle.ambient-on { background: rgba(255,170,40,0.28); border-color: rgba(210,130,20,0.5); }
#voice-settings-panel {
  position: fixed; top: calc(54px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 62;
  width: min(280px, 86vw); padding: 12px; border-radius: 14px;
  background: rgba(16, 20, 28, 0.96); border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
html[data-theme="day"] body.chat-primary #voice-settings-panel { background: #fff; border-color: rgba(0,0,0,0.10); }
.vsp-row { display: flex; gap: 8px; align-items: center; }
.vsp-providers .vsp-prov {
  flex: 1; height: 34px; border-radius: 9px; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: var(--text);
  font: 600 13px -apple-system, system-ui, sans-serif;
}
.vsp-providers .vsp-prov.active { background: rgba(120,220,200,0.22); border-color: rgba(120,220,200,0.5); }
#vsp-voice { flex: 1; height: 34px; border-radius: 9px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: var(--text); padding: 0 8px; font-size: 13px; }
#vsp-preview { width: 40px; height: 34px; border-radius: 9px; background: rgba(120,220,200,0.18); border: 1px solid rgba(120,220,200,0.4); color: var(--text); cursor: pointer; font-size: 14px; }
#vsp-apply { flex: 1; height: 34px; border-radius: 9px; background: rgba(120,220,200,0.22); border: 1px solid rgba(120,220,200,0.5); color: var(--text); cursor: pointer; font: 600 13px -apple-system, system-ui, sans-serif; }
.vsp-status { font-size: 11.5px; color: var(--wa-dim, #8a93a6); min-height: 14px; }
html[data-theme="day"] body.chat-primary #voice-settings-panel select,
html[data-theme="day"] body.chat-primary #voice-settings-panel .vsp-prov,
html[data-theme="day"] body.chat-primary #voice-settings-panel button { color: #111; }

/* ── DAY THEME for the VOICE orb (deň/noc rovnako ako v chate) ─────────────────
   Night = čierne pozadie + biele bodky (default). Day = biele pozadie + tmavomodré
   bodky (kreslené v orb.js podľa html[data-theme]). Tu doladíme okolie + ovládače
   aby boli na bielom čitateľné. Platí len v čistom hlasovom móde (body.voice-only). */
html[data-theme="day"] body.voice-only { background: #ffffff; }
html[data-theme="day"] body.voice-only #status { color: #2a2f3a; }
html[data-theme="day"] body.voice-only #voice-settings-btn,
html[data-theme="day"] body.voice-only #voice-settings-panel,
html[data-theme="day"] body.voice-only #mode-toggle.mode-float {
  background: rgba(255, 255, 255, 0.9); border-color: rgba(0, 0, 0, 0.12); color: #111;
}
html[data-theme="day"] body.voice-only #voice-settings-panel { box-shadow: 0 12px 40px rgba(0,0,0,0.15); }
html[data-theme="day"] body.voice-only #voice-settings-panel select,
html[data-theme="day"] body.voice-only #voice-settings-panel .vsp-prov,
html[data-theme="day"] body.voice-only #voice-settings-panel button,
html[data-theme="day"] body.voice-only #mode-toggle.mode-float .mode-label,
html[data-theme="day"] body.voice-only #mode-toggle.mode-float svg { color: #111; }
html[data-theme="day"] body:not(.chat-primary) .chat-bar #chat-mic { color: #4a5160; }

/* Fixed floating mode chip — always reachable top-right (voice orb AND chat UI). */
#mode-toggle.mode-float {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 14px;
  bottom: auto; left: auto;
  z-index: 60;
  background: rgba(20, 24, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
html[data-theme="day"] body.chat-primary #mode-toggle.mode-float {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(0,0,0,0.10);
}
html[data-theme="day"] body.chat-primary #mode-toggle.mode-float .mode-label,
html[data-theme="day"] body.chat-primary #mode-toggle.mode-float svg { color: #111; }
#mode-icon .mode-label {
  font: 600 11px -apple-system, system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: inherit;
  line-height: 1;
}
#mode-icon svg { display: block; }
.ctrl-menu {
  position: absolute;
  right: 64px;
  bottom: 0;
  min-width: 200px;
  background: rgba(11, 14, 21, 0.95);
  border: 1px solid #1f2430;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ctrl-menu-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  text-align: left;
  color: #d6dbe7;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.ctrl-menu-item:hover { background: rgba(255,255,255,0.06); }

.chat-bar {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 86vw);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.chat-bar input, .chat-bar textarea {
  flex: 1;
  padding: 14px 16px;
  font: 15px/1.35 -apple-system, system-ui, sans-serif;
  color: #d6dbe7;
  background: rgba(255,255,255,0.04);
  border: 1px solid #1f2430;
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  outline: none;
  resize: none; max-height: 132px;
}
.chat-bar input:focus, .chat-bar textarea:focus { border-color: rgba(120, 220, 200, 0.4); }
.chat-bar #chat-mic { background: transparent !important; border: none; color: #8a93a6; }
.chat-bar button {
  width: 48px;
  border-radius: 12px;
  border: 1px solid #1f2430;
  background: rgba(120, 220, 200, 0.18);
  color: #d6dbe7;
  font-size: 18px;
  cursor: pointer;
}

/* ── VOICE mode: clean ORB + ONE floating mic (hold = talk, tap = switch to chat).
   No WhatsApp chrome here — chat-primary is off so the cloud-point orb fills the
   screen on the day/night background. ── */
body:not(.chat-primary) .chat-bar {
  width: auto; gap: 0;
  bottom: max(30px, env(safe-area-inset-bottom, 30px));
}
/* Čistá biela mic ikona. Presunutá NA BOK (dole-vľavo) NAD ostatné ikony
   (learn-voice 82px, listen 30px → mic 134px), rovnaká veľkosť 44px ako ostatné. */
body:not(.chat-primary) .chat-bar #chat-mic {
  position: fixed; left: 14px; bottom: calc(134px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  color: #ffffff;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  touch-action: none;  /* hold-to-talk: don't let the browser treat it as scroll */
  transition: transform 0.12s ease, background 0.12s ease;
}
body:not(.chat-primary) .chat-bar #chat-mic svg { width: 20px; height: 20px; }
body:not(.chat-primary) .chat-bar #chat-mic.talking {
  background: rgba(255, 255, 255, 0.16) !important;
  transform: scale(1.06);
}
/* Muted mic — neutrálne stlmené biele + jemné preškrtnutie (bez červeného neónu).
   POZN.: position MUSÍ ostať fixed (NIE relative) — relative by prepísalo fixed
   z pravidla vyššie a mic by spadol späť do stredu chat-baru. fixed je tiež
   positioning context pre ::after preškrtnutie, takže to funguje. */
body:not(.chat-primary) .chat-bar #chat-mic { position: fixed; }
/* Legacy „99+" košík badge (bare span v normálnom toku) — nikdy nezobrazovať. */
#cart-badge { display: none !important; }
/* STLMENÉ (mic + reproduktor) = nezameniteľné: vyšedená ikona + ČERVENÉ hrubé
   preškrtnutie + červený rámik. Peter musí na prvý pohľad vidieť, že Orbio
   nepočuje ani nehovorí. */
body:not(.chat-primary) .chat-bar #chat-mic.muted {
  background: rgba(224, 72, 59, 0.12) !important;
  border-color: rgba(224, 72, 59, 0.65) !important;
  color: rgba(255, 255, 255, 0.40);
}
body:not(.chat-primary) .chat-bar #chat-mic.muted::after {
  content: ""; position: absolute; left: 9px; right: 9px; top: 50%;
  height: 3px; border-radius: 2px; background: #e0483b;
  box-shadow: 0 0 6px rgba(224, 72, 59, 0.55);
  transform: translateY(-50%) rotate(-45deg);
}
/* Deň: tmavá ikona na bielom pozadí (čitateľnosť). */
html[data-theme="day"] body:not(.chat-primary) .chat-bar #chat-mic {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.18) !important;
  color: #1a1f29;
}
html[data-theme="day"] body:not(.chat-primary) .chat-bar #chat-mic.talking { background: rgba(0, 0, 0, 0.12) !important; }
html[data-theme="day"] body:not(.chat-primary) .chat-bar #chat-mic.muted::after { background: #d63a2e; }
html[data-theme="day"] body:not(.chat-primary) .chat-bar #chat-mic.muted {
  background: rgba(214, 58, 46, 0.10) !important;
  border-color: rgba(214, 58, 46, 0.55) !important;
  color: rgba(26, 31, 41, 0.45);
}
body.voice-only .transcript { display: none !important; }

/* ── Pre-auth state: clean orb screen, only 2 explicit auth icons visible ─ */
body.pre-auth .cart-btn,
body.pre-auth .transcript,
body.pre-auth #dropzone,
body.pre-auth #chat-bar,
body.pre-auth .post-auth-only { display: none !important; }

/* ── JEDINÉ tlačidlo hlasu (Petrov pokyn 2026-06-13): mikrofón HNEĎ VEDĽA hamburgeru
   v pravom hornom rohu. Stlmiť/zapnúť = aktivovať/deaktivovať hlas — JEDNA funkcia.
   Nahrádza zmazané centrálne „Aktivovať hlas". ── */
#mic-toggle {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: calc(max(14px, env(safe-area-inset-right, 0px)) + 63px);   /* vľavo od hamburgeru (55px) + 8px medzera */
  width: 55px; height: 55px; border-radius: 50%;   /* +25 % (Petrov pokyn 2026-06-20) */
  display: grid; place-items: center;
  background: rgba(20, 24, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  z-index: 80; cursor: pointer;   /* nad panel Okienka (z-index 70) — inak ho prekreslí (Petrov bug 2026-06-20) */
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, opacity 0.2s ease;
}
#mic-toggle svg { display: block; width: 27px; height: 27px; }   /* +25 % glyf */
#mic-toggle:active { transform: scale(0.93); }
/* AKTÍVNY (počúva a reaguje NAPLNO) — ČERVENÝ mikrofón BEZ preškrtnutia (Petrov pokyn 2026-06-13:
   „unmuted mikrofón červený, bez preškrtnutia"). Jemný glow = živé, „počúvam a reagujem". */
#mic-toggle.talking {
  background: rgba(224,72,59,0.20); border-color: rgba(224,72,59,0.78); color: #fff;
  box-shadow: 0 0 0 1px rgba(224,72,59,0.25), 0 0 12px rgba(224,72,59,0.30); transform: scale(1.04);
}
html[data-theme="day"] body:not(.chat-primary) #mic-toggle.talking {
  background: rgba(224,72,59,0.14); border-color: rgba(214,58,46,0.72); color: #b02a1f;
  box-shadow: 0 0 10px rgba(214,58,46,0.22);
}
/* VYPNUTÝ / stlmený — vyšedená ikona + ČERVENÉ preškrtnutie + červený rámik:
   na prvý pohľad „hlas je vypnutý, Orbio nepočuje ani nehovorí". */
#mic-toggle.muted {
  background: rgba(224, 72, 59, 0.12);
  border-color: rgba(224, 72, 59, 0.6);
  color: rgba(255, 255, 255, 0.45);
}
#mic-toggle.muted::after {
  content: ""; position: absolute; left: 10px; right: 10px; top: 50%;
  height: 3px; border-radius: 2px; background: #e0483b;
  box-shadow: 0 0 6px rgba(224, 72, 59, 0.55);
  transform: translateY(-50%) rotate(-45deg);
}
/* PASÍVNY ZÁPISNÍK (Petrov pokyn 2026-06-14): mic je preškrtnutý (nereaguje) + JEMNE
   PULZUJE načerveno = „aktívne nahrávam okolie". Odlišuje nahrávanie od obyčajne odpojeného. */
@keyframes micrec { 0%,100%{ box-shadow: 0 0 0 0 rgba(224,72,59,0); } 50%{ box-shadow: 0 0 11px 2px rgba(224,72,59,0.5); } }
#mic-toggle.recording { animation: micrec 1.5s ease-in-out infinite; border-color: rgba(224,72,59,0.78); }
/* Chat režim: mic žije v spodnom bare (#chat-mic) → horný duplikát skry. */
body.chat-primary #mic-toggle { display: none !important; }

/* ── „ORBIO" LAUNCHER pill (Petrov pokyn 2026-06-22): namiesto mic kruhu ikona s názvom Orbio → menu režimov. */
#mic-toggle.orbio-launcher {
  width: auto; height: 44px; border-radius: 22px; padding: 0 15px 0 13px;
  display: inline-flex; align-items: center; gap: 8px; place-items: center;
  top: calc(11px + env(safe-area-inset-top, 0px));
}
#mic-toggle.orbio-launcher::after { content: none !important; }   /* žiadny mic slash */
.orbio-launcher .ol-dot { width: 11px; height: 11px; border-radius: 50%; background: #7c8698; box-shadow: 0 0 0 1px rgba(255,255,255,.12); transition: background .2s, box-shadow .2s; flex: 0 0 auto; }
.orbio-launcher .ol-name { font: 700 14px -apple-system, system-ui, sans-serif; letter-spacing: .01em; color: var(--text); }
/* stav režimu cez farbu bodky */
.orbio-launcher.m-voice .ol-dot { background: #e0483b; box-shadow: 0 0 8px rgba(224,72,59,.6); }              /* hlas = červená, steady */
.orbio-launcher.m-ambient .ol-dot { background: #3b82e0; box-shadow: 0 0 8px rgba(59,130,224,.55); }          /* zápisník = modrá */
.orbio-launcher.m-workshop .ol-dot, .orbio-launcher.m-workshop_translate .ol-dot { background: #a855f7; box-shadow: 0 0 8px rgba(168,85,247,.55); }  /* porada = fialová */
.orbio-launcher.m-translate .ol-dot { background: #14b8a6; box-shadow: 0 0 8px rgba(20,184,166,.55); }        /* preklad = tyrkys */
.orbio-launcher.m-ambient .ol-dot, .orbio-launcher.m-workshop .ol-dot,
.orbio-launcher.m-workshop_translate .ol-dot, .orbio-launcher.m-translate .ol-dot { animation: olrec 1.6s ease-in-out infinite; }  /* nahráva = pulz */
@keyframes olrec { 0%,100%{ opacity: 1; } 50%{ opacity: .5; } }
html[data-theme="day"] body.voice-only #mic-toggle.orbio-launcher { background: rgba(255,255,255,0.9); border-color: rgba(0,0,0,0.12); }
html[data-theme="day"] body.voice-only .orbio-launcher .ol-name { color: #111; }

/* ── ESTETICKÉ MENU REŽIMOV (bottom-sheet) ── */
.orbio-menu { z-index: 90; }                       /* nad launcherom (80) aj okienkom */
.orbio-menu .om-panel { width: min(460px, 100%); }
.om-body { display: flex; flex-direction: column; gap: 8px; }
.om-item {
  /* bez emoji ikony (Petrov pokyn 2026-08-08) → dva stĺpce, žiadna prázdna medzera */
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  width: 100%; text-align: left; padding: 13px 14px;
  background: rgba(255,255,255,0.035); border: 1px solid #1f2430; border-radius: 13px;
  color: var(--text); cursor: pointer; transition: background .12s, border-color .12s, transform .1s;
}
.om-item:hover { background: rgba(255,255,255,0.06); border-color: #2c3342; }
.om-item:active { transform: scale(0.985); }
.om-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.om-t { font-size: 15px; font-weight: 650; color: #e6e9f0; }
.om-d { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.om-state { font-size: 11.5px; white-space: nowrap; }
.om-item.on { border-color: rgba(120,170,255,.55); background: rgba(80,130,230,.12); }
.om-item.on .om-state::before { content: '✓ aktívne'; color: #7cc0ff; font-weight: 700; }
.om-item.soon { opacity: .62; }
.om-item.soon .om-state::before { content: 'čoskoro'; color: #c79a3a; font-weight: 600; }

/* ── TLMOČNÍK status pill (Petrov pokyn 2026-06-22: BEZ prepisu na iOS — len „prekladám do SK" + ✕) ── */
.translate-pill {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 95;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 9px 9px 14px; border-radius: 999px;
  background: rgba(14,18,26,0.86); border: 1px solid rgba(20,184,166,0.5);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(20,184,166,0.15);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  color: #eafaf7; font: 600 13.5px -apple-system, system-ui, sans-serif;
}
.translate-pill .tpill-ic { font-size: 16px; animation: tpill-pulse 1.8s ease-in-out infinite; }
@keyframes tpill-pulse { 0%,100%{ opacity: 1; } 50%{ opacity: .5; } }
.translate-pill .tpill-tx { white-space: nowrap; letter-spacing: .01em; }
.translate-pill .tpill-x {
  width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.08); color: #cfeae5; font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}
.translate-pill .tpill-x:active { transform: scale(0.92); }
/* Deň: tmavá ikona na svetlom pozadí. */
html[data-theme="day"] body:not(.chat-primary) #mic-toggle {
  background: rgba(255,255,255,0.9); border-color: rgba(0,0,0,0.12); color: #111;
}
html[data-theme="day"] body:not(.chat-primary) #mic-toggle.muted {
  background: rgba(214,58,46,0.10); border-color: rgba(214,58,46,0.55); color: rgba(26,31,41,0.5);
}
html[data-theme="day"] body:not(.chat-primary) #mic-toggle.muted::after { background: #d63a2e; }
html[data-theme="day"] body:not(.chat-primary) #mic-toggle.talking { background: rgba(0,0,0,0.10); }

body:not(.pre-auth) .pre-auth-only { display: none !important; }

body.pre-auth .status { opacity: 0.4; font-size: 11px; }

/* ── Post-auth: only the mode toggle is visible; cart + camera open
       only when Orbio calls show_inbox or offer_media_options.       ─────── */
body:not(.pre-auth) .cart-btn { display: none !important; }

/* ── Chat-primary mode: small subtle orb in background, chat dominates ── */
body.chat-primary #orb {
  width: 38vmin;
  height: 38vmin;
  opacity: 0.4;
  filter: blur(0.6px);
  transition: width 320ms ease, height 320ms ease, opacity 320ms ease;
}
body.chat-primary .transcript {
  top: 56px;
  max-height: calc(100vh - 200px);
  font-size: 14.5px;
  /* Persistent log — no auto-fade */
  mask-image: linear-gradient(to bottom, transparent 0, #000 40px, #000 calc(100% - 20px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40px, #000 calc(100% - 20px), transparent 100%);
}
body.chat-primary .chat-bar {
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  z-index: 10;
}
body.chat-primary .chat-bar input {
  font-size: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(110, 231, 206, 0.18);
}
body.chat-primary .status { font-size: 11px; opacity: 0.5; }

.auth-choices {
  position: absolute;
  right: 24px;
  bottom: max(28px, env(safe-area-inset-bottom, 28px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: min(360px, 88vw);
  padding: 24px 22px;
  background: #0b0e15;
  border: 1px solid #1f2430;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-card h3 { font-size: 16px; font-weight: 600; color: #d6dbe7; }
.modal-card .modal-sub { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.modal-card input {
  padding: 11px 14px;
  font-size: 14px;
  color: #d6dbe7;
  background: #11141b;
  border: 1px solid #1f2430;
  border-radius: 8px;
  outline: none;
}
.modal-card input:focus { border-color: #6ee7ce; }
.modal-card button[type="submit"] {
  margin-top: 4px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  background: #6ee7ce;
  color: #06231d;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.modal-card button[type="submit"]:hover { background: #5dd1ba; }
.modal-card button#cl-cancel {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid #1f2430;
  border-radius: 8px;
  cursor: pointer;
}
.modal-err { color: #f87171; font-size: 13px; min-height: 18px; }

.dropzone {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}
.dropzone-inner {
  padding: 40px 60px;
  border: 2px dashed rgba(120, 220, 200, 0.7);
  border-radius: 18px;
  color: #d6dbe7;
  font-size: 16px;
  text-align: center;
  background: rgba(120, 220, 200, 0.06);
}
.dropzone-icon { font-size: 36px; margin-bottom: 10px; }

/* Debug log skrytý pre užívateľa. dlog() stále píše do DOMu (pre `?debug=1` toggle)
   + do console.log (pre Claude / DevTools). Body class `debug-on` ho odhalí. */
.debug-log { display: none; }
body.debug-on .debug-log {
  display: block;
  position: fixed;
  top: 8px;
  left: 8px;
  right: 8px;
  max-height: 40vh;
  overflow-y: auto;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #6ee7ce;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(110,231,206,0.25);
  border-radius: 6px;
  padding: 8px 10px;
  z-index: 999;
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-word;
}
body.debug-on .debug-log:empty { display: none; }
body.debug-on .debug-log .err { color: #f87171; }

/* Contextual media picker */
.media-panel { max-height: 70vh; }
.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 14px 18px;
}
.media-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid #1f2430;
  border-radius: 12px;
  color: #d6dbe7;
  font-size: 13px;
  cursor: pointer;
  transition: all 150ms ease;
}
.media-card:hover { background: rgba(110,231,206,0.08); border-color: #6ee7ce; }
.media-emoji { font-size: 32px; }

.cart-btn {
  position: absolute;
  top: max(20px, env(safe-area-inset-top, 20px));
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 200ms ease;
}
.cart-btn:hover { background: rgba(255, 255, 255, 0.06); }
.cart-btn .cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #f87171;
  color: #1a0a0a;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.sheet-panel {
  position: relative;
  width: min(620px, 100%);
  max-height: 78vh;
  background: #0b0e15;
  border-top: 1px solid #1f2430;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.55);
  animation: sheet-up 240ms ease;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #1f2430;
}
.sheet-head h3 { font-size: 15px; font-weight: 600; color: #d6dbe7; }
.sheet-head .ctrl-btn { width: 32px; height: 32px; font-size: 14px; }
.sheet-body { overflow-y: auto; padding: 12px 14px 18px; }
.sheet-body .empty { padding: 40px 0; text-align: center; color: var(--muted); font-size: 13px; }

.inbox-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #1f2430;
  border-radius: 9px;
}
.inbox-item.seen { opacity: 0.55; }
.inbox-item .ii-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.inbox-item .ii-kind { color: #6ee7ce; font-weight: 600; }
.inbox-item .ii-time { margin-left: auto; }
.inbox-item .ii-body { color: var(--text); font-size: 14px; word-break: break-word; }
.inbox-item .ii-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.ii-btn {
  padding: 5px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid #1f2430;
  border-radius: 6px;
  cursor: pointer;
  transition: all 120ms ease;
}
.ii-btn:hover { color: var(--text); border-color: #6ee7ce; }
.ii-btn.accept { color: #6ee7ce; }
.ii-btn.reject:hover { color: #f87171; border-color: #f87171; }
.ii-btn.open { color: #93c5fd; }

.ii-check { margin-right: 6px; accent-color: #6ee7ce; }
.inbox-item .ii-actions { flex-wrap: wrap; opacity: 1; }
.inbox-item .ii-actions .ii-btn { font-size: 11px; padding: 4px 9px; }

.inbox-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid #1f2430;
  flex-wrap: wrap;
}
.inbox-select-all {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.inbox-select-all input { accent-color: #6ee7ce; }
.inbox-bulk-actions {
  display: flex; gap: 4px; margin-left: auto;
}
.inbox-bulk-actions button {
  width: 32px; height: 32px;
  font-size: 14px; background: transparent;
  color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; transition: all 120ms ease;
}
.inbox-bulk-actions button:hover { color: var(--text); border-color: var(--accent); }
.inbox-bulk-actions button.accept:hover { color: #6ee7ce; border-color: #6ee7ce; }
.inbox-bulk-actions button.reject:hover { color: #f87171; border-color: #f87171; }
.inbox-bulk-actions .bulk-sep { width: 1px; background: #1f2430; margin: 0 4px; }

/* ── Hamburger button + drawer (Fáza Kosik) ─────────────────────────────────
   Hamburger replaces the always-visible cart icon. The drawer hosts the
   košík and a small nav block — single source of chrome on the orb screen
   so the visual stays minimal. */
.hamburger-btn {
  position: absolute;
  top: max(20px, env(safe-area-inset-top, 20px));
  right: 24px;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
  z-index: 40;
}
.hamburger-btn:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255,255,255,0.16); }
.hamburger-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  background: #f87171;
  color: #1a0a0a;
  font: 700 10px ui-monospace, monospace;
  line-height: 16px;
  text-align: center;
}
body.pre-auth .hamburger-btn { display: none !important; }

.drawer {
  position: fixed; inset: 0;
  z-index: 60;
  display: flex; justify-content: flex-end;
}
.drawer-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.drawer-panel {
  position: relative;
  width: min(380px, 92vw);
  height: 100%;
  background: #0b0e15;
  border-left: 1px solid #1f2430;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
  animation: drawer-in 220ms ease;
  box-shadow: -16px 0 40px rgba(0,0,0,0.5);
}
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #1f2430;
}
.drawer-title { font: 600 13px -apple-system, system-ui, sans-serif; letter-spacing: 0.04em; color: var(--text); text-transform: uppercase; }
.drawer-close {
  width: 28px; height: 28px;
  background: transparent; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); cursor: pointer;
  font: 16px -apple-system, sans-serif; line-height: 1;
}
.drawer-close:hover { color: var(--text); border-color: var(--accent); }
.drawer-section { border-bottom: 1px solid #1f2430; }
.drawer-section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px 8px;
  font: 600 11px -apple-system, system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.drawer-count { color: var(--muted); font: 600 11px ui-monospace, monospace; }
/* scroll kontajner — menu nikdy nepreteká cez displej */
.drawer-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.drawer-body { padding: 2px 18px 10px; overflow-y: auto; max-height: 24vh; }
.drawer-body .empty { padding: 8px 0; text-align: center; color: var(--muted); font-size: 12px; }
.drawer-nav { display: flex; flex-direction: column; }
.drawer-nav a {
  display: block; padding: 11px 18px;
  color: var(--text); text-decoration: none;
  font: 14px -apple-system, system-ui, sans-serif;
}
.drawer-nav a:hover, .drawer-nav a:active { background: var(--hover, rgba(127,127,127,0.10)); }

/* ── ZBALENÁ SERVISNÁ SEKCIA (redizajn menu 2026-06-12) ─────────────────────── */
.drawer-fold > summary { cursor: pointer; list-style: none; user-select: none; }
.drawer-fold > summary::-webkit-details-marker { display: none; }
.drawer-fold-arrow { transition: transform .18s ease; font-size: 12px; }
.drawer-fold[open] .drawer-fold-arrow { transform: rotate(90deg); }
.drawer-fold > a { opacity: .92; }

/* ── AUTO DEŇ/NOC aj v menu ─────────────────────────────────────────────────── */
html[data-theme="day"] .drawer-panel { background: #ffffff; border-left-color: rgba(0,0,0,0.08); box-shadow: -16px 0 40px rgba(0,0,0,0.12); }
html[data-theme="day"] .drawer-head { border-bottom-color: rgba(0,0,0,0.08); }
html[data-theme="day"] .drawer-section { border-bottom-color: rgba(0,0,0,0.06); }
html[data-theme="day"] .drawer-section-head { color: rgba(0,0,0,0.45); }
html[data-theme="day"] .drawer-nav a { color: #15181f; }
html[data-theme="day"] .drawer-nav a:hover, html[data-theme="day"] .drawer-nav a:active { background: rgba(0,0,0,0.05); }
html[data-theme="day"] .drawer-title { color: #15181f; }
html[data-theme="day"] .drawer-close { color: rgba(0,0,0,0.5); border-color: rgba(0,0,0,0.15); }

/* ════════════ DVOJÚROVŇOVÉ MENU (Petrov pokyn 2026-06-20) ════════════════════
   Úroveň 1 = LEN názvy sekcií (font +50 %). Klik na sekciu → úroveň 2 (obsah
   sekcie) + šípka „←" späť. Položky/sekcie zväčšené o ~50 % oproti pôvodným. */
.drawer-view { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.drawer-view[hidden] { display: none !important; }
.drawer-title { font-size: 19px; }   /* hlavička menu +50 % (13 → 19) */

/* — Úroveň 1: názvy sekcií, veľké a vzdušné, „›" pri rozklikávacích — */
.drawer-rootnav {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 0;
}
.drawer-rootitem {
  display: flex; align-items: center; gap: 9px;
  width: 100%; box-sizing: border-box; padding: 18px 20px;
  background: transparent; border: 0; border-bottom: 1px solid #1f2430;
  color: var(--text); text-align: left; text-decoration: none; cursor: pointer;
  font: 600 21px -apple-system, system-ui, sans-serif; letter-spacing: 0.01em;
}
.drawer-rootitem[data-go]::after {
  content: "›"; margin-left: auto; color: var(--muted);
  font-size: 26px; font-weight: 400; line-height: 1;
}
.drawer-rootitem:hover, .drawer-rootitem:active { background: var(--hover, rgba(127,127,127,0.10)); }
.drawer-rootitem--quiet { color: var(--muted); font-weight: 500; }
.drawer-rootnav .drawer-count {
  min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px;
  background: rgba(127,127,127,0.20); color: var(--text);
  font: 700 13px ui-monospace, monospace; line-height: 24px; text-align: center;
}

/* — Úroveň 2: detail sekcie + šípka späť — */
.drawer-detail .drawer-head { justify-content: flex-start; gap: 10px; }
.drawer-detail .drawer-title { text-transform: none; letter-spacing: 0.01em; }
.drawer-back {
  width: 36px; height: 36px; flex: 0 0 auto;
  background: transparent; border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); cursor: pointer; font-size: 22px; line-height: 1;
  display: grid; place-items: center;
}
.drawer-back:hover, .drawer-back:active { border-color: var(--accent); }
.drawer-detail .drawer-nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.drawer-detail .drawer-nav a { font-size: 20px; padding: 16px 20px; }   /* +50 % (14 → 20) */
.drawer-detail .drawer-body {
  max-height: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 20px 16px;
}

/* — Deň/noc pre nové prvky — */
html[data-theme="day"] .drawer-rootitem { color: #15181f; border-bottom-color: rgba(0,0,0,0.06); }
html[data-theme="day"] .drawer-rootitem--quiet { color: rgba(0,0,0,0.5); }
html[data-theme="day"] .drawer-rootitem:hover, html[data-theme="day"] .drawer-rootitem:active { background: rgba(0,0,0,0.05); }
html[data-theme="day"] .drawer-rootnav .drawer-count { background: rgba(0,0,0,0.10); color: #15181f; }
html[data-theme="day"] .drawer-back { color: #15181f; border-color: rgba(0,0,0,0.15); }

/* ════════════════════════════════════════════════════════════════════════
   WhatsApp-style CHAT (only in chat mode: body.chat-primary)
   Auto deň/noc cez [data-theme] na <html> (biele cez deň, čierne v noci).
   Voice/orb obrazovka ostáva nezmenená.
   ════════════════════════════════════════════════════════════════════════ */
:root, html[data-theme="night"] {
  --wa-bg:        #0b0f12;   /* takmer čierne pozadie chatu */
  --wa-header:    #1f2c34;
  --wa-bar:       #1f2c34;
  --wa-in:        #1f2c34;   /* prijaté (Orbio) */
  --wa-out:       #005c4b;   /* odoslané (ja) */
  --wa-text:      #e9edef;
  --wa-dim:       #8696a0;
  --wa-input-bg:  rgba(42,57,66,.92);   /* mierne priesvitný — chat obteká input */
  --wa-send:      #00a884;
  --wa-divider:   rgba(255,255,255,0.07);
}
html[data-theme="day"] {
  --wa-bg:        #f7f8fa;   /* biele pozadie chatu */
  --wa-header:    #f0f2f5;
  --wa-bar:       #f0f2f5;
  --wa-in:        #ffffff;
  --wa-out:       #d9fdd3;   /* WhatsApp zelená bublina */
  --wa-text:      #111b21;
  --wa-dim:       #667781;
  --wa-input-bg:  rgba(255,255,255,.92);   /* mierne priesvitný — chat obteká input */
  --wa-send:      #00a884;
  --wa-divider:   rgba(0,0,0,0.08);
}

/* Header (Orbio + status) — štandardne SKRYTÝ aj v chate (rovnaký štýl ako Claude
   Code chat): správy idú po okraj displeja, hore plávajú len ikony. Header zobrazí
   ťuknutie na membránu (body.orb-head-open). */
.chat-header { display: none; }
body.chat-primary.orb-head-open .chat-header {
  display: flex; align-items: center; gap: 11px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: calc(56px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 14px 0 200px;   /* vľavo miesto pre plávajúce ikony (hamburger+membrána+24h+001) */
  background: var(--wa-header); color: var(--wa-text);
  border-bottom: 1px solid var(--wa-divider);
}

/* Plávajúce ikony v chate (ako v Claude Code chate): hamburger + elastická membrána */
.orb-mem-btn { display: none; }   /* mimo chat módu neexistuje */
body.chat-primary .orb-mem-btn {
  display: flex; align-items: center; justify-content: center;
  position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 57px; z-index: 31;
  width: 41px; height: 41px; border-radius: 50%; padding: 0; cursor: pointer;
  background: rgba(31,44,52,.86); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
html[data-theme="day"] body.chat-primary .orb-mem-btn { background: rgba(255,255,255,.86); border-color: rgba(0,0,0,.10); }
/* Membrána — „živý" blob, elasticky sa prelieva a dýcha */
.orb-mem {
  width: 24px; height: 24px;
  background: radial-gradient(circle at 32% 30%, #7df3dd, #34e0c8 45%, #00a884 78%);
  border-radius: 47% 53% 58% 42% / 46% 49% 51% 54%;
  animation: orb-mem-morph 3.6s ease-in-out infinite;
}
@keyframes orb-mem-morph {
  0%,100% { border-radius: 47% 53% 58% 42% / 46% 49% 51% 54%; transform: scale(1) rotate(0deg); }
  20%     { border-radius: 58% 42% 44% 56% / 51% 58% 42% 49%; transform: scale(1.10) rotate(4deg); }
  45%     { border-radius: 42% 58% 53% 47% / 57% 42% 58% 43%; transform: scale(0.94) rotate(-3deg); }
  70%     { border-radius: 55% 45% 47% 53% / 44% 56% 46% 54%; transform: scale(1.06) rotate(2deg); }
}
.chat-header .ch-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 17px;
  background: radial-gradient(circle at 30% 30%, #34e0c8, #00a884 70%);
}
.chat-header .ch-title { font-weight: 600; font-size: 16px; line-height: 1.15; }
.chat-header .ch-sub   { font-size: 12.5px; color: var(--wa-dim); line-height: 1.15; }

/* Chat mode: skry orb, pozadie podľa témy */
body.chat-primary { background: var(--wa-bg); }
body.chat-primary #orb { display: none !important; }
body.chat-primary #orb-metal { display: none !important; }
body.chat-primary #orb-render-toggle { display: none !important; }
body.chat-primary .status { display: none !important; }

/* Správy = scrollujú po SAMOTNÝ okraj displeja (hore aj dole); plávajúce ikony
   a input bar ich len prekrývajú. Vnútorný padding drží prvú/poslednú správu
   mimo notchu a inputu. */
body.chat-primary .transcript {
  display: flex !important; flex-direction: column; justify-content: flex-start; gap: 2px;
  position: fixed; left: 0; right: 0; top: 0; bottom: 0;
  width: auto; max-width: none; max-height: none; transform: none;
  padding: calc(61px + env(safe-area-inset-top, 0px)) 9px calc(70px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; overflow-x: hidden;
  pointer-events: auto; text-align: left; color: var(--wa-text);
  background: var(--wa-bg);
  -webkit-mask-image: none; mask-image: none;
  -webkit-overflow-scrolling: touch;
}

/* Bublina */
body.chat-primary .transcript p {
  position: relative; margin: 1px 0; padding: 6px 9px 7px;
  max-width: 80%; width: fit-content; border-radius: 8px;
  font-size: 15px; line-height: 1.34; word-wrap: break-word; white-space: pre-wrap;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13); opacity: 1; transition: none;
}
/* Roly: .ai = prijaté (Orbio, vľavo), .me = odoslané (ja, vpravo, zelená).
   Text VŽDY var(--wa-text) (tmavý cez deň, svetlý v noci) — prebíja pôvodné
   bledé voice-farby, ktoré robili text nečitateľným v bielej téme. */
body.chat-primary .transcript p.ai,
body.chat-primary .transcript p.me,
body.chat-primary .transcript p.ai .bubble-text,
body.chat-primary .transcript p.me .bubble-text { color: var(--wa-text) !important; }
body.chat-primary .transcript p.ai {
  align-self: flex-start; background: var(--wa-in);
  border-top-left-radius: 2px;
}
body.chat-primary .transcript p.me {
  align-self: flex-end; background: var(--wa-out);
  border-top-right-radius: 2px;
}
/* Tail (malý cíp bubliny ako WhatsApp) */
body.chat-primary .transcript p.ai::before {
  content: ""; position: absolute; top: 0; left: -7px; width: 8px; height: 13px;
  background: var(--wa-in);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}
body.chat-primary .transcript p.me::before {
  content: ""; position: absolute; top: 0; right: -7px; width: 8px; height: 13px;
  background: var(--wa-out);
  clip-path: polygon(0 0, 0 100%, 100% 0);
}

/* Kopírovacie tlačidlo bublín v chate SKRYTÉ (Petrov pokyn 2026-07-14): na mobile
   bolo stále viditeľné ako sivý štvorček v rohu bubliny a prekrývalo text.
   Text sa dá aj tak vybrať a skopírovať prstom (user-select). */
body.chat-primary .bubble-copy { display: none !important; }
/* Dátumový oddeľovač (info pásik) v chate — svetlý WhatsApp štýl podľa témy,
   nie tmavý nočný pás z voice režimu. */
body.chat-primary .transcript .date-sep {
  background: var(--wa-input-bg); color: var(--wa-dim); border: none;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}
/* Tlačidlo Okienka „24h" — v chate vyzeralo ako duch-bublina (priehľadné pozadie
   nad textom správ). Rovnaký vzhľad ako ostatné plávajúce ikony (hamburger/membrána)
   a PRESUN HORE vedľa nich (Petrov pokyn 2026-07-14) — dole zavadzalo správam.
   Rad hore: hamburger (10px) → membrána (57px) → 24h (104px). */
body.chat-primary #infostorm-btn {
  top: calc(10px + env(safe-area-inset-top, 0px)) !important; left: 104px !important;
  bottom: auto !important; width: 41px !important; height: 41px !important; z-index: 31 !important;
  background: rgba(31,44,52,.86) !important; border: 1px solid rgba(255,255,255,.14) !important;
  color: var(--wa-text) !important; box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
html[data-theme="day"] body.chat-primary #infostorm-btn {
  background: rgba(255,255,255,.86) !important; border-color: rgba(0,0,0,.10) !important; color: #111 !important;
}
/* macOS semafory (Electron) — celý horný rad posunutý doprava, 24h za membránou */
html.is-electron body.chat-primary #infostorm-btn { left: 180px !important; }

/* Časová pečiatka — skrytá mimo chatu, v chate vpravo dole v bubline */
.transcript .bubble-time { display: none; }
body.chat-primary .transcript .bubble-time {
  display: inline-block; float: right; margin: 4px -3px -2px 10px;
  font-size: 11px; color: var(--wa-dim); line-height: 1; position: relative; top: 4px;
}

/* Vstupný riadok ako WhatsApp (pill + zelené koliesko) */
body.chat-primary .chat-bar {
  position: fixed; left: 0; right: 0; bottom: 0; transform: none; width: auto;
  gap: 6px; align-items: flex-end; z-index: 30;   /* flex-end → buttons stay at bottom as input grows */
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: none; border-top: none;   /* žiadny podkladový pás — ostáva len samotný input (pláva nad chatom) */
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
/* Auto-growing textarea (WhatsApp logic — grows in height while typing) */
body.chat-primary .chat-bar textarea {
  flex: 1; padding: 11px 16px; font: 16px/1.35 -apple-system, system-ui, sans-serif;
  color: var(--wa-text); background: var(--wa-input-bg);
  border: none; border-radius: 22px; box-shadow: 0 1px 1px rgba(0,0,0,0.06);
  resize: none; overflow-y: auto; max-height: 132px; min-height: 44px;
  outline: none; box-sizing: border-box;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);   /* text chatu presvitá popod input */
}
body.chat-primary .chat-bar textarea::placeholder { color: var(--wa-dim); }
/* Send = green circle */
body.chat-primary .chat-bar #chat-send {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
  background: var(--wa-send); color: #fff; border: none;
  display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
/* Mic = subtle icon button next to send */
body.chat-primary .chat-bar #chat-mic {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
  background: var(--wa-input-bg); color: var(--wa-dim); border: none;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center;
}
body.chat-primary .chat-bar #chat-mic:active,
body.chat-primary .chat-bar #chat-send:active { transform: scale(0.92); }

/* "Premýšľa / píše" bublina — animované bodky (WhatsApp typing) */
body.chat-primary .transcript p.typing { padding: 11px 14px; }
body.chat-primary .transcript p.typing .dots { display: inline-flex; gap: 4px; align-items: center; }
body.chat-primary .transcript p.typing .dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--wa-dim);
  animation: wa-typing 1.2s infinite ease-in-out;
}
body.chat-primary .transcript p.typing .dots span:nth-child(2) { animation-delay: .18s; }
body.chat-primary .transcript p.typing .dots span:nth-child(3) { animation-delay: .36s; }
@keyframes wa-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* Mode toggle (voice/chat/both) relocated into the header, next to "Orbio online" */
.chat-header .header-mode {
  margin-left: auto; flex: 0 0 auto;
  width: auto; min-width: 0; height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--wa-divider);
  background: rgba(0,0,0,0.05); color: var(--wa-text);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
html[data-theme="night"] .chat-header .header-mode { background: rgba(255,255,255,0.08); }
.chat-header .header-mode .mode-label { color: var(--wa-text); }
.chat-header .header-mode svg { color: var(--wa-text); }

/* Mic icon: ACTIVE = plain icon (no mark). MUTED/INACTIVE = crossed-out (slash)
   so it's obvious the microphone is off. */
body.chat-primary .chat-bar #chat-mic { position: relative; }
body.chat-primary .chat-bar #chat-mic.muted { color: var(--wa-dim); }
body.chat-primary .chat-bar #chat-mic.muted::after {
  content: ""; position: absolute; left: 8px; right: 8px; top: 50%;
  height: 2.5px; border-radius: 2px; background: #e0483b;
  transform: translateY(-50%) rotate(-45deg);
}

/* ── Data field ──────────────────────────────────────────────────────────────
   Graphic surface that grows out of the orb when the conversation turns to a
   concrete dataset (emails first). The orb's particles fly apart (orb.openField)
   and these cards coalesce in their place; on topic change they scatter back.
   pointer-events:none so the whole stage stays tap-to-talk underneath. */
.data-field {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: clamp(40px, 7vh, 96px) clamp(14px, 5vw, 64px);
  pointer-events: none;             /* margins stay tap-to-talk */
  opacity: 0;
  transition: opacity 260ms ease;
}
.data-field.active { display: flex; opacity: 1; }

/* Close (×) — always reachable to return to the conversation. */
.df-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 14px)); right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(150,190,240,0.2);
  background: rgba(20,28,44,0.7);
  color: var(--muted); font-size: 22px; line-height: 1;
  cursor: pointer; pointer-events: auto;
  display: grid; place-items: center;
  transition: transform .12s ease, background .12s ease, color .12s ease;
}
.df-close:hover { color: #fff; background: rgba(40,52,76,0.85); transform: scale(1.06); }

.df-head {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 260ms ease 60ms, transform 260ms ease 60ms;
}
.data-field.settled .df-head { opacity: 1; transform: none; }
.df-back {
  border: none; background: transparent; cursor: pointer;
  color: rgba(140,200,240,0.9); font-size: 19px; line-height: 1; padding: 2px 6px;
  border-radius: 8px;
}
.df-back:hover { background: rgba(120,180,230,0.14); }
.df-title {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw;
}
.df-count {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(140, 200, 240, 0.85);
  background: rgba(120, 180, 230, 0.12);
  border-radius: 999px;
  padding: 1px 9px;
}
.df-count:empty { display: none; }

.df-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 12px;
  width: min(92vw, 940px);
  max-height: 76vh;
  overflow-y: auto;
  pointer-events: auto;             /* scrollable */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 2px;
}
/* ROTÁTOR FOTIEK (Petrov pokyn 2026-07-20): fotky rolujú HORIZONTÁLNE so snapom
   — jedna veľká v strede, swipe listuje; počítadlo v hlavičke ukazuje i/N.
   Orbio cez photos_viewing vie, ktorá je v strede (data-field.js photosRotator). */
.data-field[data-kind="photos"] .df-grid {
  display: flex; flex-wrap: nowrap; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 2px calc((min(92vw, 940px) - min(78vw, 480px)) / 2);   /* prvá/posledná sa dá vycentrovať */
  scrollbar-width: none;
}
.data-field[data-kind="photos"] .df-grid::-webkit-scrollbar { display: none; }
.data-field[data-kind="photos"] .df-card.df-photo {
  flex: 0 0 min(78vw, 480px);
  scroll-snap-align: center;
  scroll-snap-stop: always;         /* jeden swipe = jedna fotka (rotátor, nie šmýkačka) */
}
.data-field[data-kind="photos"] .df-photo-thumb { aspect-ratio: 4 / 3; }
.df-grid::-webkit-scrollbar { width: 6px; }
.df-grid::-webkit-scrollbar-thumb { background: rgba(150,190,240,0.25); border-radius: 6px; }

.df-card {
  pointer-events: auto;
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(20, 28, 44, 0.72);
  border: 1px solid rgba(150, 190, 240, 0.12);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  /* Scatter-in: each card starts displaced (--dx/--dy/--rot) + collapsed. */
  opacity: 0;
  transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.6) rotate(var(--rot, 0));
  transition: opacity 300ms cubic-bezier(.22,.9,.28,1),
              transform 360ms cubic-bezier(.22,.9,.28,1),
              border-color .2s ease, background .2s ease;
}
.data-field.settled .df-card {
  opacity: 1;
  transform: translate(0, 0) scale(1) rotate(0);
}
.df-card:hover { border-color: rgba(150,190,240,0.32); background: rgba(28,38,58,0.8); }
.df-card.out {
  opacity: 0;
  transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.5) rotate(var(--rot, 0));
  transition: opacity 300ms ease, transform 340ms cubic-bezier(.5,0,.75,0);
}
/* ── Fotky (kind='photos') — galéria + detail ──────────────────────────────── */
.df-photo { padding: 0; overflow: hidden; gap: 0; }
.df-photo-thumb { width: 100%; aspect-ratio: 4 / 3; background: rgba(0,0,0,0.35); overflow: hidden; }
.df-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.df-photo-cap {
  font-size: 12.5px; color: rgba(225,235,250,0.95); padding: 8px 12px 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.df-photo .df-meta { padding: 4px 12px 10px; }
.df-tag {
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
  background: rgba(150,190,240,0.14); color: rgba(200,220,245,0.85);
}
.df-photo-detail { display: flex; flex-direction: column; gap: 12px; }
.df-photo-big { width: 100%; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,0.4); }
.df-photo-big img { width: 100%; max-height: 52vh; object-fit: contain; display: block; }
.df-photo-when { font-size: 12px; color: rgba(200,220,245,0.7); }
.df-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.df-pa {
  pointer-events: auto; cursor: pointer; font: 600 13px -apple-system, system-ui, sans-serif;
  padding: 9px 14px; border-radius: 10px; color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(150,190,240,0.2);
}
.df-pa:active { transform: scale(0.96); }
.df-pa-del { color: #e98a8a; border-color: rgba(233,138,138,0.4); background: rgba(233,138,138,0.08); }

/* ── Auto-generated card blocks (kind='card') ──────────────────────────────── */
.df-block { cursor: default; gap: 8px; }
.df-block:hover { border-color: rgba(150,190,240,0.12); background: rgba(20,28,44,0.72); } /* blocks aren't tappable */
/* stat sits in the auto-fill grid; list/table/everything-else span the full row */
.dfb-list, .dfb-table { grid-column: 1 / -1; }
.dfb-title {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(140,200,240,0.7); margin-bottom: 2px;
}

/* stat */
.dfb-stat { justify-content: center; min-height: 96px; }
.dfb-stat-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.dfb-stat-value {
  font-size: 34px; font-weight: 700; line-height: 1.05; color: #fff;
  font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 5px;
}
.dfb-stat-unit { font-size: 15px; font-weight: 500; color: rgba(200,220,245,0.7); }
.dfb-stat-delta { font-size: 12px; font-weight: 600; color: var(--muted); }
.dfb-stat-delta.tr-up { color: #7ad19a; }
.dfb-stat-delta.tr-down { color: #e98a8a; }
.dfb-stat-hint { font-size: 11px; color: rgba(200,220,245,0.55); }

/* list */
.dfb-ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dfb-li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 2px; border-bottom: 1px solid rgba(150,190,240,0.08);
}
.dfb-li:last-child { border-bottom: none; }
.dfb-li-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dfb-li-primary {
  font-size: 13px; color: rgba(225,235,250,0.95);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dfb-li-secondary {
  font-size: 11px; color: rgba(200,220,245,0.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dfb-li-trailing {
  flex: 0 0 auto; font-size: 12px; font-variant-numeric: tabular-nums;
  color: rgba(140,200,240,0.85);
}
.dfb-li.ac-good { border-left: 2px solid #7ad19a; padding-left: 8px; }
.dfb-li.ac-warn { border-left: 2px solid #e6c46a; padding-left: 8px; }
.dfb-li.ac-bad { border-left: 2px solid #e98a8a; padding-left: 8px; }

/* table */
.dfb-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.dfb-tbl th {
  text-align: left; font-weight: 600; color: rgba(140,200,240,0.7);
  text-transform: uppercase; letter-spacing: 0.05em; font-size: 10px;
  padding: 4px 8px 6px; border-bottom: 1px solid rgba(150,190,240,0.18);
}
.dfb-tbl td {
  padding: 6px 8px; color: rgba(225,235,250,0.92);
  border-bottom: 1px solid rgba(150,190,240,0.07);
  font-variant-numeric: tabular-nums;
}
.dfb-tbl tr:last-child td { border-bottom: none; }
.dfb-tbl td:first-child, .dfb-tbl th:first-child { padding-left: 2px; }

html[data-theme="day"] .dfb-stat-value { color: #16233f; }
html[data-theme="day"] .dfb-li-primary, html[data-theme="day"] .dfb-tbl td { color: rgba(30,44,78,0.9); }
html[data-theme="day"] .dfb-stat-label,
html[data-theme="day"] .dfb-li-secondary,
html[data-theme="day"] .dfb-stat-hint { color: rgba(40,56,92,0.62); }
html[data-theme="day"] .dfb-li-trailing { color: rgba(40,80,140,0.95); }

/* Verdict bar — approve (save as template) / redraw. Only shown for kind='card'. */
.df-verdict {
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  padding: 8px 12px; border-radius: 999px;
  background: rgba(20,28,44,0.78);
  border: 1px solid rgba(150,190,240,0.16);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 8px 26px rgba(0,0,0,0.35);
  opacity: 0; transform: translateY(8px);
  transition: opacity 260ms ease 120ms, transform 260ms ease 120ms;
}
.df-verdict[hidden] { display: none; }
.data-field.settled .df-verdict { opacity: 1; transform: none; }
.dfv-hint { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
/* Both verdict buttons share ONE graphic — identical pill, only the glyph differs. */
.dfv-btn {
  cursor: pointer; pointer-events: auto;
  font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(150,190,240,0.22);
  background: rgba(28,38,58,0.7); color: rgba(225,235,250,0.92);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.dfv-btn:hover { transform: scale(1.04); background: rgba(40,52,76,0.9); border-color: rgba(150,190,240,0.4); }
.dfv-btn:focus-visible { outline: 2px solid rgba(150,190,240,0.55); outline-offset: 2px; }
.df-verdict.dfv-done { border-color: rgba(122,209,154,0.5); }
.df-verdict.dfv-done .dfv-hint { color: #aef0c4; }
.df-verdict.dfv-done .dfv-btn { display: none; }

/* Auto-close odpočet — jemný „⏳ Xs" hore v strede; v posledných 12 s sa rozsvieti
   na výzvu „Zavriem o Xs — nechať otvorené?" + tlačidlo. Platí pre všetky polia. */
.df-autoclose {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  z-index: 6; pointer-events: auto;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(20,28,44,0.66); border: 1px solid rgba(150,190,240,0.14);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  font-size: 11px; color: var(--muted); letter-spacing: 0.02em;
  opacity: 0.55; transition: opacity .2s ease, background .2s ease, border-color .2s ease;
}
.df-autoclose[hidden] { display: none; }
.df-autoclose.dfac-asking {
  opacity: 1; color: rgba(255,225,180,0.95);
  background: rgba(60,44,20,0.82); border-color: rgba(240,200,120,0.45);
}
.dfac-keep {
  cursor: pointer; pointer-events: auto;
  font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(240,200,120,0.5);
  background: rgba(70,52,22,0.9); color: #ffe6b0;
  transition: transform .12s ease, background .12s ease;
}
.dfac-keep[hidden] { display: none; }
.dfac-keep:hover { transform: scale(1.05); background: rgba(90,68,30,0.95); }
html[data-theme="day"] .df-autoclose { background: rgba(255,255,255,0.85); border-color: rgba(0,0,0,0.1); color: #5a6170; }
html[data-theme="day"] .df-autoclose.dfac-asking { background: rgba(255,244,222,0.95); border-color: rgba(200,150,40,0.5); color: #7a5a18; }
html[data-theme="day"] .dfac-keep { background: rgba(255,236,200,0.95); color: #7a5418; border-color: rgba(200,150,40,0.55); }

.df-date {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.df-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.df-tag {
  font-size: 10px; letter-spacing: 0.04em;
  color: rgba(160, 200, 240, 0.7);
  border: 1px solid rgba(150, 190, 240, 0.18);
  border-radius: 6px; padding: 0 6px;
}

/* ── Detail view (fotky) ── */
.df-detail {
  width: min(92vw, 760px);
  max-height: 78vh;
  overflow-y: auto;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  opacity: 0; transform: translateY(8px) scale(0.98);
  transition: opacity 280ms ease, transform 320ms cubic-bezier(.22,.9,.28,1);
}
.data-field.settled .df-detail { opacity: 1; transform: none; }
.df-detail::-webkit-scrollbar { width: 6px; }
.df-detail::-webkit-scrollbar-thumb { background: rgba(150,190,240,0.25); border-radius: 6px; }
.df-detail-inner {
  background: rgba(20, 28, 44, 0.78);
  border: 1px solid rgba(150, 190, 240, 0.14);
  border-radius: 16px;
  padding: 20px 22px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.df-d-body { font-size: 14px; line-height: 1.55; color: rgba(225, 232, 245, 0.9); white-space: normal; word-break: break-word; }

/* Day theme — light cards on the white background. */
html[data-theme="day"] .df-card,
html[data-theme="day"] .df-detail-inner {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(22, 48, 120, 0.12);
  box-shadow: 0 8px 22px rgba(22, 48, 120, 0.1);
}
html[data-theme="day"] .df-d-body { color: rgba(30, 44, 78, 0.9); }
html[data-theme="day"] .df-title,
html[data-theme="day"] .df-date { color: rgba(30, 44, 78, 0.55); }
html[data-theme="day"] .df-close { background: rgba(255,255,255,0.85); border-color: rgba(22,48,120,0.15); color: rgba(30,44,78,0.6); }

@media (prefers-reduced-motion: reduce) {
  .df-card, .df-card.out, .df-detail { transition-duration: 160ms; animation: none; }
}

/* KOREŇ PROBLÉMU: .chat-bar má transform: translateX(-50%) → stáva sa containing
   blockom pre position:fixed potomkov, takže left:14px na #chat-mic sa rátalo voči
   (centrovanej) .chat-bar, nie voči obrazovke → mic ostal v strede aj s !important.
   V ne-chat režime transform zrušíme → fixed mic ide na skutočný ľavý okraj. */
html body:not(.chat-primary) .chat-bar {
  transform: none !important;
  left: auto !important;
  right: auto !important;
}

/* ── ČISTÝ ORB (Petrov pokyn 2026-06-13): VŠETKY ikony do hamburgeru, hamburger
   do PRAVÉHO HORNÉHO rohu. Orb obrazovka = len kruh + jediné tlačidlo menu.
   Scope :not(.pre-auth) NUTNÝ: display:grid !important tu má ID špecificitu a
   prebíjal pre-auth skrývačky (r. 492/977, len triedy) → menu svietilo aj na
   prihlasovacej obrazovke a na iOS (ikony dole, r. ~2535) sadlo PRESNE na
   prihlasovacie ikony — nedalo sa prihlásiť (Petrov bug 2026-08-04). */
html body:not(.chat-primary):not(.pre-auth) #hamburger.hamburger-btn {
  position: fixed !important;
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  right: max(14px, env(safe-area-inset-right, 0px)) !important;
  left: auto !important; bottom: auto !important;
  width: 55px !important; height: 55px !important;   /* +25 % (Petrov pokyn 2026-06-20) */
  border-radius: 50% !important; z-index: 80 !important;
  display: grid !important;
}
html body:not(.chat-primary) #hamburger.hamburger-btn svg { width: 25px !important; height: 25px !important; }
/* Floating ikony skryté na orb obrazovke (žijú v hamburgeri) — OKREM fotoaparátu,
   ktorý je od 2026-06-20 (Petrov pokyn) priamo na ploche (pozri rovno nižšie). */
html body:not(.chat-primary) #chat-mic,
html body:not(.chat-primary) #infostorm-btn,
html body:not(.chat-primary) #ambient-toggle,
html body:not(.chat-primary) #mode-toggle,
html #learn-voice-btn, html #listen-btn, html #voice-settings-btn { display: none !important; }

/* ── FOTOAPARÁT PRIAMO NA PLOCHE (Petrov pokyn 2026-06-20) ─────────────────────
   Horný rad vedľa mikrofónu a hamburgeru. +25 % oproti pôvodným 44px (→ 55px).
   Scope :not(.pre-auth) — na prihlasovacej obrazovke ostáva skrytý (post-auth-only). */
html body:not(.pre-auth):not(.chat-primary):not(.menu-open):not(.okienko-open) #timeline-btn {
  display: inline-flex !important;
  position: fixed !important;
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  right: calc(max(14px, env(safe-area-inset-right, 0px)) + 166px) !important;   /* za Orbio pilulkou (~91px široká, končí na +63) + medzera — neprekrývať (Petrov bug 2026-07-12) */
  left: auto !important; bottom: auto !important;
  width: 55px !important; height: 55px !important; z-index: 80 !important;   /* kamera nad panel Okienka (Petrov bug 2026-06-20) */
}
html body:not(.pre-auth):not(.chat-primary) #timeline-btn svg { width: 25px !important; height: 25px !important; }

/* ── KÓDOVANIE „001" NA PLOCHE — otvorí priamo Claude Code chat (/crm.html#devchat).
   Rovnaký vzhľad ako fotoaparát (55px sklenený kruh), o jedno miesto vľavo (+63px krok).
   Vnútri monospace „001" v zelenej — terminál/kód na prvý pohľad. */
#code-btn { display: none; }
html body:not(.pre-auth):not(.chat-primary):not(.menu-open):not(.okienko-open) #code-btn {
  display: inline-flex !important; align-items: center; justify-content: center;
  position: fixed !important;
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  right: calc(max(14px, env(safe-area-inset-right, 0px)) + 229px) !important;   /* vľavo od kamery (+166) + 55px + 8px medzera */
  left: auto !important; bottom: auto !important;
  width: 55px !important; height: 55px !important; border-radius: 50% !important;
  z-index: 80 !important;
  background: rgba(20, 24, 32, 0.72); border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform 0.12s ease;
}
#code-btn:active { transform: scale(0.93); }
#code-btn .cb-num {
  font: 700 15px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.09em; color: #34d399;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.45);
}
/* !important NUTNÉ: pravidlo vyššie (html body:not…) má vyššiu selektivitu a inak
   by cez deň vyhralo tmavé pozadie (Petrov bug 2026-07-12 — tmavý kruh na bielej). */
html[data-theme="day"] #code-btn { background: rgba(255, 255, 255, 0.85) !important; border-color: rgba(0, 0, 0, 0.12) !important; }
html[data-theme="day"] #code-btn .cb-num { color: #0a8f5b; text-shadow: none; }

/* ── ADAMKO „🌱“ NA PLOCHE — ORBIO Child (pestúnka), vedie na /child.
   Rovnaký sklenený kruh ako 001, o jedno miesto vľavo (+292 = 229 + 55 + 8). */
#child-btn { display: none; }
html body:not(.pre-auth):not(.chat-primary):not(.menu-open):not(.okienko-open) #child-btn {
  display: inline-flex !important; align-items: center; justify-content: center;
  position: fixed !important;
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  right: calc(max(14px, env(safe-area-inset-right, 0px)) + 292px) !important;
  left: auto !important; bottom: auto !important;
  width: 55px !important; height: 55px !important; border-radius: 50% !important;
  z-index: 80 !important;
  background: rgba(20, 24, 32, 0.72); border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  text-decoration: none; cursor: pointer; color: #7fdca0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform 0.12s ease;
}
#child-btn:active { transform: scale(0.93); }
#child-btn svg { filter: drop-shadow(0 0 6px rgba(127, 220, 160, 0.45)); }
/* !important z rovnakého dôvodu ako pri 001 (deň/noc špecificita, Petrov bug 2026-07-12) */
html[data-theme="day"] #child-btn { background: rgba(255, 255, 255, 0.85) !important; border-color: rgba(0, 0, 0, 0.12) !important; color: #0a8f5b !important; }
html[data-theme="day"] #child-btn svg { filter: none; }

/* ── DOMÁCNOSŤ NA PLOCHE (Petrov pokyn 2026-08-12) — domček VEDĽA Adamka:
   rovnaký sklenený kruh, o jedno miesto vľavo (+355 = 292 + 55 + 8).
   Jantárová farba ho odlíši od zeleného Adamka na prvý pohľad. */
#home-btn { display: none; }
html body:not(.pre-auth):not(.chat-primary):not(.menu-open):not(.okienko-open) #home-btn {
  display: inline-flex !important; align-items: center; justify-content: center;
  position: fixed !important;
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  right: calc(max(14px, env(safe-area-inset-right, 0px)) + 355px) !important;
  left: auto !important; bottom: auto !important;
  width: 55px !important; height: 55px !important; border-radius: 50% !important;
  z-index: 80 !important;
  background: rgba(20, 24, 32, 0.72); border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  text-decoration: none; cursor: pointer; color: #e8b44c;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform 0.12s ease;
}
#home-btn:active { transform: scale(0.93); }
#home-btn svg { filter: drop-shadow(0 0 6px rgba(232, 180, 76, 0.45)); }
/* !important z rovnakého dôvodu ako 001/Adamko (deň/noc špecificita, bug 2026-07-12) */
html[data-theme="day"] #home-btn { background: rgba(255, 255, 255, 0.85) !important; border-color: rgba(0, 0, 0, 0.12) !important; color: #a8760d !important; }
html[data-theme="day"] #home-btn svg { filter: none; }

/* ── MULTITASKING: vysúvací Claude Code panel (Petrov pokyn 2026-07-14) ─────────
   001 ikona panel VYSUNIE zboku, X ho ZASUNIE — čisto vizuálne; iframe vnútri žije
   stále, takže Claude aj hlas/chat Orbia bežia paralelne na pozadí. Platí pre
   všetky módy (hlas / chat / oboje). */
#claude-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(480px, 100vw);
  /* notch/home indicator: iframe nevidí safe-area hlavnej stránky → odsaď ho panelom */
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box;
  background: #fbfaf6;   /* krémový podklad devchatu — nech pri vysúvaní nepresvitá tma */
  transform: translateX(103%); transition: transform .32s ease;
  box-shadow: -8px 0 24px rgba(0, 0, 0, .25);
}
body.claude-open #claude-panel { transform: translateX(0); }
/* V Claude chate NESMIE nič plávať nad textom (Petrov pokyn 2026-07-14, screenshot
   s ikonou 24h cez správy) — kým je panel vysunutý, plávajúce ikonky skry úplne.
   Zdvojená trieda .claude-open.claude-open = vyššia špecificita, aby toto pravidlo
   prebilo chat-módové "display:... !important" pravidlá ikon nižšie v súbore. */
html body.claude-open.claude-open #infostorm-btn, html body.claude-open.claude-open #hamburger,
html body.claude-open.claude-open #orb-mem-btn, html body.claude-open.claude-open #code-btn,
html body.claude-open.claude-open #child-btn, html body.claude-open.claude-open #home-btn,
html body.claude-open.claude-open #timeline-btn, html body.claude-open.claude-open #mic-toggle { display: none !important; }
#claude-frame { width: 100%; height: 100%; border: 0; display: block; }
/* ── OVLÁDANIE PC (2026-09-15): rovnaký vysúvací panel ako Claude Code (/pc v iframe), ale
   hlas Orbia beží ďalej — Peter počúva, pozerá a diktuje. Tmavý podklad (pc.html je tmavé). */
#pc-panel {
  position: fixed; top: 0; right: 0; bottom: var(--kb, 0px); z-index: 90;
  width: min(480px, 100vw);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box;
  background: #0a0c10;
  transform: translateX(103%); transition: transform .32s ease;
  box-shadow: -8px 0 24px rgba(0, 0, 0, .35);
}
body.pc-open #pc-panel { transform: translateX(0); }
html body.pc-open.pc-open #infostorm-btn, html body.pc-open.pc-open #hamburger,
html body.pc-open.pc-open #orb-mem-btn, html body.pc-open.pc-open #code-btn,
html body.pc-open.pc-open #child-btn, html body.pc-open.pc-open #home-btn,
html body.pc-open.pc-open #timeline-btn, html body.pc-open.pc-open #mic-toggle,
html body.pc-open.pc-open #hdr-toggle { display: none !important; }
#pc-frame { width: 100%; height: 100%; border: 0; display: block; }
#pc-close {
  position: absolute; top: calc(6px + env(safe-area-inset-top, 0px)); right: 10px; z-index: 2;
  width: 41px; height: 41px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 21, 28, .86); color: #c9cccb; border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
#pc-close:active { transform: scale(0.93); }
#claude-close {
  position: absolute; top: calc(6px + env(safe-area-inset-top, 0px)); right: 10px; z-index: 2;
  width: 41px; height: 41px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(251, 250, 246, .86); color: #444; border: 1px solid rgba(0, 0, 0, .10);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
#claude-close:active { transform: scale(0.93); }
/* 001 aj v CHAT móde — štvrtá plávajúca ikona v hornom rade (10/57/104/151). */
body.chat-primary #code-btn {
  display: inline-flex !important; align-items: center; justify-content: center;
  position: fixed !important; top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  left: 151px !important; right: auto !important; bottom: auto !important;
  width: 41px !important; height: 41px !important; border-radius: 50% !important;
  z-index: 31 !important;
  background: rgba(31, 44, 52, .86); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
body.chat-primary #code-btn .cb-num { font-size: 12px; }
html.is-electron body.chat-primary #code-btn { left: 227px !important; }
/* V Okienku (čistý prehrávač) sa 001 skrýva ako ostatné chat ikony. */
body.chat-primary.okienko-open #code-btn { display: none !important; }

/* ── SWIPE prepínanie módov (hlas / chat / oboje) ako listovanie stránok ──────
   Počas ťahu hýbe plochou realtime.js priamo s prstom (inline transform);
   po prepnutí vkĺzne NOVÝ mód z celej strany (mode-slide-left/right na ~0,45 s). */
@keyframes mode-in-l { from { transform: translateX(72vw); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes mode-in-r { from { transform: translateX(-72vw); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
body.mode-slide-left #orb, body.mode-slide-left .transcript, body.mode-slide-left .chat-bar,
body.mode-slide-left .chat-header, body.mode-slide-left #hamburger, body.mode-slide-left .orb-mem-btn,
body.mode-slide-left #infostorm-btn, body.mode-slide-left #code-btn, body.mode-slide-left #mic-toggle,
body.mode-slide-left #timeline-btn { animation: mode-in-l .3s ease-out both; }
body.mode-slide-right #orb, body.mode-slide-right .transcript, body.mode-slide-right .chat-bar,
body.mode-slide-right .chat-header, body.mode-slide-right #hamburger, body.mode-slide-right .orb-mem-btn,
body.mode-slide-right #infostorm-btn, body.mode-slide-right #code-btn, body.mode-slide-right #mic-toggle,
body.mode-slide-right #timeline-btn { animation: mode-in-r .3s ease-out both; }
/* VOICE mód: .chat-bar NEanimuj — transform na rodičovi mení position:fixed
   mikrofónu vnútri na „fixed voči baru" a mic počas animácie teleportoval
   (Petrov bug 2026-07-16). Rovnaká výnimka je aj v JS ťahu (els() filter). */
body:not(.chat-primary).mode-slide-left .chat-bar,
body:not(.chat-primary).mode-slide-right .chat-bar { animation: none; }

/* ── CHAT mód (WhatsApp): plávajúce ikony hore, dole plávajúci input bar ──────── */
/* Hamburger v chate PLÁVA vľavo hore (kruh, ako v Claude Code chate); vedľa neho membrána. */
body.chat-primary #hamburger.hamburger-btn {
  position: fixed !important; top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  left: 10px !important; right: auto !important; bottom: auto !important;
  width: 41px !important; height: 41px !important; border-radius: 50% !important;
  display: grid !important; z-index: 31 !important;
  background: rgba(31,44,52,.86); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
html[data-theme="day"] body.chat-primary #hamburger.hamburger-btn { background: rgba(255,255,255,.86); border-color: rgba(0,0,0,.10); color: #111; }
/* macOS semafory (Electron, vľavo hore) — posuň plávajúce ikony aj rezervu headera doprava. */
html.is-electron body.chat-primary #hamburger.hamburger-btn { left: 86px !important; }
html.is-electron body.chat-primary .orb-mem-btn { left: 133px; }
html.is-electron body.chat-primary.orb-head-open .chat-header { padding-left: 276px !important; }
/* Foto: v chat móde NIE je plávajúce — je v input bare (#chat-cam, WhatsApp). */
body.chat-primary #timeline-btn { display: none !important; }
/* Kamera v chat bare — vľavo, ako mic/send. V ne-chat režime skrytá. */
body:not(.chat-primary) #chat-cam { display: none !important; }
body.chat-primary .chat-bar #chat-cam {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
  background: var(--wa-input-bg); color: var(--wa-dim); border: none;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center;
}
body.chat-primary .chat-bar #chat-cam:active { transform: scale(0.92); }

/* ── iOS FIX: grafika nesmie pretekať cez displej (chat aj voice) ───────────── */
/* Tvrdá poistka proti horizontálnemu pretekaniu + plovúce prvky v bezpečnej zóne. */
html, body { overflow-x: hidden !important; max-width: 100vw; position: relative; }
.stage { width: 100vw; max-width: 100vw; overflow: hidden; }
/* ambient vodotlač (dlhé slovo by inak pretieklo) */
#ambient-wm { max-width: 90vw; overflow: hidden; text-align: center; }
/* pravé plovúce prvky rešpektujú zaoblené rohy / notch a držia sa na displeji */
#mode-toggle.mode-float { right: max(14px, env(safe-area-inset-right, 0px)) !important; max-width: 90vw; }
#voice-settings-panel, .ctrl-menu { max-width: min(92vw, 340px); right: max(14px, env(safe-area-inset-right, 0px)); }
/* transcript a chat prvky nikdy širšie než displej */
.transcript, .chat-bar, #chat-header { max-width: 100vw; box-sizing: border-box; }

/* ── Informačné okienko — panely (nastavenia, záznamy): čisté, minimalistické, day/night ── */
.isp-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: max(60px, env(safe-area-inset-top,0px)) 16px 24px; }
.isp-card { width: min(460px, 94vw); max-height: 82vh; overflow-y: auto; background: #0b0e15; border: 1px solid #1f2430; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); -webkit-overflow-scrolling: touch; }
.isp-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.isp-head h3 { margin: 0; font: 600 15px -apple-system, system-ui, sans-serif; color: var(--text); letter-spacing: .02em; }
.isp-close { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--muted); font-size: 17px; cursor: pointer; }
.isp-sub { padding: 0 18px 8px; font: 12px -apple-system, system-ui, sans-serif; color: var(--muted); }
.isp-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 18px; border-top: 1px solid #1f2430; cursor: pointer; font: 14px -apple-system, system-ui, sans-serif; color: var(--text); }
.isp-row:active { background: rgba(127,127,127,0.10); }
.isp-dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(120,140,170,.6); flex: 0 0 auto; transition: all .15s; }
.isp-row.on .isp-dot { background: #1f6feb; border-color: #1f6feb; box-shadow: inset 0 0 0 3px #0b0e15; }
.isp-segs { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; }
.isp-seg { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font: 13px -apple-system, system-ui, sans-serif; cursor: pointer; }
.isp-seg.on { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.isp-actions { display: flex; gap: 10px; padding: 14px 18px; }
.isp-btn { flex: 1; padding: 12px; border-radius: 10px; border: 0; background: #1f6feb; color: #fff; font: 600 14px -apple-system, system-ui, sans-serif; cursor: pointer; }
.isp-btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.isp-meta { color: var(--muted); font-size: 12px; }
/* pomer témy −  N  + (nastavenia okienka) — farby podľa témy, nie inline biela */
.isp-rbtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,0.12); color: var(--text); font: 700 17px -apple-system, system-ui, sans-serif; line-height: 1; cursor: pointer; padding: 0; }
.isp-rbtn:active { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.isp-rnum { min-width: 16px; text-align: center; font: 700 15px -apple-system, system-ui, sans-serif; color: var(--text); }
/* deň */
html[data-theme="day"] .isp-card { background: #fff; border-color: rgba(0,0,0,0.08); box-shadow: 0 20px 60px rgba(0,0,0,0.18); }
html[data-theme="day"] .isp-head h3, html[data-theme="day"] .isp-row, html[data-theme="day"] .isp-seg { color: #15181f; }
html[data-theme="day"] .isp-row, html[data-theme="day"] .isp-card { border-color: rgba(0,0,0,0.07); }
html[data-theme="day"] .isp-row.on .isp-dot { box-shadow: inset 0 0 0 3px #fff; }
html[data-theme="day"] .isp-btn.ghost { color: #15181f; }
html[data-theme="day"] .isp-rbtn { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); color: #15181f; }
html[data-theme="day"] .isp-rnum { color: #15181f; }

/* ── OKIENKO v5 (Petrov redizajn 2026-07-14): header s dátumom vo farbe Claude,
   záznamy ako riadky s farbou témy (riadok = pretáčadlo), stiahnutie dňa, swipe po dňoch ── */
/* SAMOSTATNÉ OKNO: nepriehľadné pozadie — pod Okienkom nesmie presvitať chat ani nič iné */
#infostorm-panel { background: #070a0f; }
html[data-theme="day"] #infostorm-panel { background: #eef0f4; }
/* status hlášky (pauza, koniec okienka…) musia byť vidieť aj NAD nepriehľadným Okienkom */
body.okienko-open .status { position: fixed; z-index: 97; }
.okn-head { display: flex; align-items: center; gap: 12px; margin: 0 64px 16px 0; padding: 9px 9px 9px 16px;
  border-radius: 18px; background: #fbfaf6; color: #3d3929; box-shadow: 0 2px 12px rgba(0,0,0,.22);
  min-height: 55px; box-sizing: border-box; flex: 0 0 auto; }
.okn-hgrow { flex: 1; min-width: 0; }
.okn-dow { font: 700 16px -apple-system, system-ui, sans-serif; color: #d97757; text-transform: capitalize; line-height: 1.15; }
.okn-dnum { font: 500 12px -apple-system, system-ui, sans-serif; color: #8a857a; margin-top: 1px; }
.okn-dl { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid rgba(217,119,87,.55); background: transparent;
  color: #d97757; display: flex; align-items: center; justify-content: center; cursor: pointer;
  font: 700 11px -apple-system, system-ui, sans-serif; flex: 0 0 auto; -webkit-tap-highlight-color: transparent; }
.okn-dl.done { background: #d97757; border-color: #d97757; color: #fff; font-size: 15px; }
.okn-list { display: flex; flex-direction: column; gap: 9px; width: 100%; max-width: 560px; margin: 0 auto; }
.okn-rec { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 10px 10px 12px;
  border-radius: 14px; border-left: 4px solid var(--okc, #7f8c9b); background: rgba(33,41,51,.9);
  overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.okn-rec.playing { touch-action: none; }   /* hrajúci riadok = pretáčadlo — vodorovný ťah patrí zvuku */
.okn-rec.pend { opacity: .5; cursor: default; }
.okn-rec.heard .okn-title { opacity: .6; }
.okn-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--okc, #7f8c9b); opacity: .16; pointer-events: none; }
.okn-play { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--okc, #7f8c9b); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; cursor: pointer; position: relative;
  -webkit-tap-highlight-color: transparent; }
.okn-tx { flex: 1; min-width: 0; position: relative; }
.okn-title { font: 600 13.5px -apple-system, system-ui, sans-serif; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.okn-tag { font: 600 10px -apple-system, system-ui, sans-serif; color: var(--okc, #7f8c9b); text-transform: lowercase;
  margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.okn-side { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; position: relative; }
.okn-heard { font: 700 11px -apple-system, system-ui, sans-serif; color: var(--okc, #7f8c9b); margin-right: 2px; }
/* listovanie dní — nový zoznam vkĺzne zo strany */
@keyframes okn-in-l { from { transform: translateX(56vw); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes okn-in-r { from { transform: translateX(-56vw); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.okn-list.okn-anim-l { animation: okn-in-l .3s ease-out both; }
.okn-list.okn-anim-r { animation: okn-in-r .3s ease-out both; }
/* deň */
html[data-theme="day"] .okn-head { box-shadow: 0 2px 10px rgba(0,0,0,.12); border: 1px solid rgba(0,0,0,.06); }
html[data-theme="day"] .okn-rec { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.10); }
html[data-theme="day"] .okn-title { color: #15181f; }

/* ── JADRO SCOPE — bežiace úlohy pod guľou (titulok + progress čiara + ETA) ── */
.jadro-scope { position: absolute; left: 50%; transform: translateX(-50%); top: calc(50% + 150px);
  width: min(78vw, 380px); display: flex; flex-direction: column; gap: 7px; z-index: 5; pointer-events: none; }
body.chat-primary .jadro-scope { display: none; }
.js-task { background: rgba(13, 29, 51, .72); border: 1px solid rgba(127, 179, 255, .22);
  border-radius: 10px; padding: 7px 10px 8px; backdrop-filter: blur(6px);
  animation: jsIn .25s ease; }
@keyframes jsIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.js-title { font-size: 12px; color: #cfe0f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.js-bar { height: 3px; background: rgba(127, 179, 255, .15); border-radius: 2px; margin: 6px 0 4px; overflow: hidden; }
.js-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4f8ef7, #9ad1a5);
  border-radius: 2px; transition: width 2.6s linear; }
.js-eta { font-size: 10.5px; color: #8aa3c4; }

.js-task.js-done { border-color: rgba(154, 209, 165, .4); }
.js-task.js-done .js-bar i { background: #69d18c; }
.js-task.js-done .js-eta { color: #9ad1a5; }

/* ── SÚBORY (Petrov pokyn 2026-07-19) — úložisko tvorby ako dlaždice ─────────
   Rubikova kocka: .sb-grid roluje HORIZONTÁLNE po stĺpcoch typov (scroll-snap),
   každý .sb-col-list roluje VERTIKÁLNE dlaždice typu podľa dátumu. ~3 stĺpce
   na obrazovke; vyhľadávanie hore filtruje podľa indexu (summary+tags). */
#subory-panel {
  position: fixed; inset: 0; z-index: 95; display: none; flex-direction: column;
  background: linear-gradient(180deg, #0c1118, #10161f);
  color: #e7eef7; padding-top: env(safe-area-inset-top);
}
.sb-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px;
}
.sb-back {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(150,190,240,0.25);
  background: rgba(255,255,255,0.06); color: #e7eef7; font-size: 19px; cursor: pointer;
  touch-action: manipulation;
}
.sb-title { flex: 0 0 auto; font: 650 18px -apple-system, system-ui, sans-serif; }
.sb-search {
  flex: 1 1 auto; min-width: 0; padding: 9px 14px; border-radius: 999px;
  border: 1px solid rgba(150,190,240,0.25); background: rgba(255,255,255,0.07);
  color: #e7eef7; font-size: 16px; outline: none;   /* 16px = iOS bez auto-zoomu */
}
.sb-search::placeholder { color: rgba(200,215,235,0.5); }
.sb-grid {
  flex: 1 1 auto; display: flex; gap: 10px; padding: 4px 12px 14px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.sb-col {
  flex: 0 0 31%; min-width: 150px; max-width: 320px;
  display: flex; flex-direction: column; scroll-snap-align: start; min-height: 0;
}
.sb-col-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  font: 650 13px -apple-system, system-ui, sans-serif; color: #bcd6ef;
  padding: 6px 4px 8px; text-transform: uppercase; letter-spacing: 0.04em;
}
.sb-col-n { margin-left: auto; font-size: 11px; color: rgba(188,214,239,0.6); }
.sb-col-list {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; padding-bottom: 20px; scrollbar-width: none;
}
.sb-col-list::-webkit-scrollbar { display: none; }
.sb-tile {
  flex: 0 0 auto; scroll-snap-align: start; text-align: left; cursor: pointer;
  border: 1px solid rgba(150,190,240,0.16); border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,0.05); color: inherit; padding: 0;
  font: 12.5px -apple-system, system-ui, sans-serif;
}
.sb-tile:active { transform: scale(0.97); }
.sb-thumb { width: 100%; aspect-ratio: 4 / 3; background: rgba(0,0,0,0.3); overflow: hidden; }
.sb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-thumb-icon { display: grid; place-items: center; font-size: 34px; }
.sb-cap {
  padding: 6px 8px 2px; color: rgba(231,238,247,0.95); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sb-when { padding: 0 8px 7px; font-size: 10.5px; color: rgba(200,215,235,0.55); }
.sb-empty { padding: 40px 24px; text-align: center; color: rgba(200,215,235,0.6); font-size: 14px; }
.sb-viewer {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
  background: rgba(5, 8, 12, 0.96);
}
.sb-viewer img, .sb-viewer video { max-width: 96vw; max-height: 88vh; border-radius: 10px; }
.sb-viewer-x {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px;
  width: 40px; height: 40px; border-radius: 50%; border: none; font-size: 22px;
  background: rgba(255,255,255,0.14); color: #fff; cursor: pointer;
}
/* KRESLENIE: video v okne tvorby */
.cw-video { display: block; border-radius: 8px; background: #000; }

/* ── MAPA (2026-07-19) — okno + navigácia ──────────────────────────────────── */
.creation-win .cw-body-map { padding: 0; cursor: default; }
/* .cw-content.cw-map-wrap — vyššia špecificita než .cw-content (inline-block +
   max-content pre tabuľky), inak by obsah mapy pretiekol šírku okna (iPhone). */
.cw-content.cw-map-wrap { display: block; width: 100%; font: 12.5px -apple-system, system-ui, sans-serif; }
.cw-map { width: 100%; height: 300px; background: #dfe8ef; touch-action: none; }
.map-info { padding: 8px 10px 4px; color: inherit; opacity: 0.9; overflow-wrap: break-word; }
.map-photos { display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px; -webkit-overflow-scrolling: touch; }
.map-photos img { height: 64px; border-radius: 8px; flex: 0 0 auto; }
.map-reviews { padding: 2px 10px 4px; opacity: 0.75; font-size: 11.5px; display: grid; gap: 3px; overflow-wrap: break-word; }
.map-modes { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 10px 4px; }
.map-mode {
  /* flex-basis auto (nie 0) — inak by flex-wrap nikdy nezalomil a nowrap text
     by pri úzkom okne pretiekol tlačidlo */
  flex: 1 1 auto; padding: 9px 6px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(110, 160, 130, 0.4); background: rgba(255,255,255,0.07);
  color: inherit; font: 600 13px -apple-system, system-ui, sans-serif;
  white-space: nowrap; touch-action: manipulation;
}
.map-mode.on { background: #2c7be5; border-color: #2c7be5; color: #fff; }
.map-routeinfo { padding: 4px 10px; font: 650 14px -apple-system, system-ui, sans-serif; min-height: 18px; }
.map-navbtn {
  display: block; margin: 6px 10px 12px; width: calc(100% - 20px); padding: 12px;
  border: none; border-radius: 12px; background: #1f9d55; color: #fff;
  font: 700 15px -apple-system, system-ui, sans-serif; cursor: pointer;
  touch-action: manipulation;
}
#nav-panel {
  position: fixed; inset: 0; z-index: 96; display: flex; flex-direction: column;
  background: #0c1118; color: #eef4fb;
}
.nav-banner {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: #143c2b; font: 650 16px -apple-system, system-ui, sans-serif;
}
.nav-step { flex: 1 1 auto; }
.nav-stepdist { flex: 0 0 auto; font-variant-numeric: tabular-nums; opacity: 0.85; }
.nav-map { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; }
/* rotujúci štvorec (strana = uhlopriečka výrezu) — course-up autonavigácia;
   plynulé dotáčanie rieši CSS transition, uhol je kumulatívny (bez 359→1 pretočenia) */
.nav-rot { position: absolute; will-change: transform; transition: transform 0.9s linear; background: #dfe8ef; }
.nav-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.05);
}
.nav-remain { flex: 1 1 auto; font: 600 14px -apple-system, system-ui, sans-serif; }
.nav-mute, .nav-x {
  flex: 0 0 auto; height: 46px; border-radius: 23px; border: none;
  cursor: pointer; touch-action: manipulation;
}
.nav-mute { background: rgba(255,255,255,0.12); color: #fff; padding: 0 16px; font: 600 14px -apple-system, system-ui, sans-serif; }
.nav-x { width: 46px; }
.nav-x { background: rgba(200,70,70,0.9); color: #fff; font-size: 24px; }

/* ── PÍSMO SPRÁV (Petrov pokyn 2026-07-14, zoom gestami 2026-07-19) ─────────
   Základ z menu → Správy: malé 15px, stredné +15 % (17.25px), veľké +25 %
   (18.75px) = --msg-base (trieda msgf-md/msgf-lg na <html> podľa localStorage
   'orbio_msg_font'). × --msg-zoom = plynulé priblíženie gestami v chate
   (dvojité ťuknutie / pinch, realtime.js, localStorage 'orbio_msg_zoom') —
   „ako keby priblíženie", ale zväčšuje sa PÍSMO a layout drží.
   Na KONCI súboru — prebíja staršie pravidlá (.transcript 15px, bubliny 15px). */
html { --msg-base: 15px; --msg-zoom: 1; }
html.msgf-md { --msg-base: 17.25px; }
html.msgf-lg { --msg-base: 18.75px; }
.transcript { font-size: var(--msg-base); }   /* hlasový prepis pri orbe: LEN menu veľkosť, bez zoomu (gestá naň z plochy nesiahnu) */
body.chat-primary .transcript { font-size: calc(var(--msg-base) * var(--msg-zoom)); }   /* prebíja 14.5px pravidlo @632 (rovnaká špecificita, neskôr v súbore) */
body.chat-primary .transcript p { font-size: calc(var(--msg-base) * var(--msg-zoom)); }
/* zoom gestá na chate patria nám (JS) — natívny pinch/double-tap zoom vypnutý,
   vertikálny scroll ostáva */
body.chat-primary .transcript { touch-action: pan-y; }

/* ── NOČNÝ REŽIM CLAUDE PANELA (Petrov pokyn 2026-07-14) ────────────────────
   Devchat vo vnútri iframe sa v noci prefarbí sám (crm.js, eink sivá + biely
   font) — panel okolo neho (safe-area pásy) a tlačidlo X musia ladiť, inak by
   v noci svietila krémová. */
html[data-theme="night"] #claude-panel { background: #26282a; }
html[data-theme="night"] #claude-close {
  background: rgba(46, 48, 51, .86); color: #c9cccb;
  border-color: rgba(255, 255, 255, .14);
}

/* ── PRIPNUTÉ PRÍLOHY / FOKUS (Petrov pokyn 2026-07-16) ─────────────────────
   Odfotená/nahratá fotka „visí" ako náhľad VĽAVO HORE (na úrovni plávajúceho
   menu). Kým visí, je fokusom rozhovoru. Pridržanie fotky = presun celej
   lišty kdekoľvek na displeji (poloha sa pamätá). X = odopnúť — fotka ostáva
   uložená v knižnici príloh (galéria). */
.pin-strip {
  position: fixed; left: 6px; right: auto; bottom: auto;
  top: calc(10px + env(safe-area-inset-top, 0px));
  max-width: calc(100vw - 12px);
  display: flex; gap: 10px; padding: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  z-index: 29;   /* pod chat-bar (30) a plávajúcimi ikonami (31) */
}
.pin-strip.pin-dragging { opacity: .85; }
.pin-item { position: relative; flex: 0 0 auto; padding: 7px 7px 0 0; }
.pin-item img {
  width: 144px; height: 144px; object-fit: cover; border-radius: 14px;   /* 2× +50 % (Petrov pokyn 2026-07-16): 64 → 96 → 144 */
  border: 2px solid rgba(110, 231, 206, 0.65);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  display: block; cursor: pointer;
  /* pridržanie = presun lišty; vypni iOS callout (Uložiť obrázok…) a výber */
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
  -webkit-user-drag: none; touch-action: pan-x;
}
.pin-item .pin-x {
  position: absolute; top: 0; right: 0;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(20, 24, 32, 0.92); color: #fff;
  font: 18px/28px -apple-system, system-ui, sans-serif; text-align: center;
  padding: 0; cursor: pointer;
}
html[data-theme="day"] .pin-item .pin-x { background: rgba(0, 0, 0, 0.62); }
/* Úchyt na zmenu veľkosti fotky (Petrov pokyn 2026-07-18) — pravý dolný roh, ťahom zväčší/zmenší */
.pin-item .pin-resize {
  position: absolute; right: 4px; bottom: 4px;
  width: 28px; height: 28px; border-radius: 9px; border: none; padding: 0;
  background: rgba(10, 14, 20, 0.62); color: #cfe9e0;
  font-size: 16px; line-height: 28px; text-align: center;
  cursor: nwse-resize; touch-action: none;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
html[data-theme="day"] .pin-item .pin-resize { background: rgba(0, 0, 0, 0.55); color: #fff; }

/* ── ORBIOVA TVORBA — plávajúce okná (Petrov pokyn 2026-07-18) ─────────────── */
.creation-win {
  position: fixed; z-index: 60;
  background: rgba(14, 20, 27, 0.94); border: 2px solid rgba(110, 231, 206, 0.55);
  border-radius: 16px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  color: #e7f2ee; font-size: 14px; overflow: hidden;
  touch-action: none; overscroll-behavior: contain;   /* IZOLÁCIA: gestá na políčku nikdy nehýbu plochou */
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.creation-win .cw-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; cursor: grab; touch-action: none;
  background: rgba(110, 231, 206, 0.12); border-bottom: 1px solid rgba(110, 231, 206, 0.25);
}
.creation-win .cw-title { flex: 1; font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creation-win .cw-x {
  width: 28px; height: 28px; border-radius: 50%; border: none; flex: 0 0 auto;
  background: rgba(10, 14, 20, 0.6); color: #fff; font-size: 17px; line-height: 28px; cursor: pointer;
}
/* Náhľad = STATICKÝ FIT (ako fotka): žiadne vnútorné skrolovanie, obsah sa škáluje. */
.creation-win .cw-body { overflow: hidden; padding: 8px; cursor: zoom-in; box-sizing: content-box; }
.creation-win .cw-scale { will-change: transform; }
/* KRESLENIE (2026-07-19): pevná prirodzená šírka 640 + aspect-ratio (JS ho po
   načítaní spresní) = okno má formát obrázka OD ZAČIATKU (pomer ako fotka);
   fit rieši cw-scale transform. */
.cw-image { display: block; border-radius: 8px; width: 640px; object-fit: contain; background: rgba(0,0,0,0.15); }
.cw-canvas-empty {
  padding: 30px 22px; min-width: 240px; text-align: center;
  font-size: 14px; color: rgba(231, 242, 238, 0.75);
}
html[data-theme="day"] .cw-canvas-empty { color: rgba(22, 48, 110, 0.65); }
.cw-content { display: inline-block; width: max-content; }
.cw-content table { border-collapse: collapse; }
.cw-content th, .cw-content td {
  border: 1px solid rgba(110, 231, 206, 0.28); padding: 5px 9px; text-align: left;
  font-size: 13px; white-space: nowrap;
}
.cw-content th { background: rgba(110, 231, 206, 0.14); font-weight: 650; }
.cw-content tr:nth-child(even) td { background: rgba(255, 255, 255, 0.03); }
.cw-content .cw-text { white-space: pre-wrap; line-height: 1.45; max-width: 640px; }
.cw-content .cw-note { margin-top: 8px; font-size: 12px; opacity: .75; }

/* POČASIE — grafická scéna v okienku tvorby (obloha gradientom, SVG ikony). */
.wx { width: max-content; min-width: 348px; max-width: 1400px; border-radius: 12px; padding: 14px 16px 16px; color: #fff;
  font-family: -apple-system, "SF Pro Text", Segoe UI, sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.wx .wx-head { font-size: 13px; font-weight: 650; opacity: .95; margin-bottom: 8px; }
.wx .wx-main { display: flex; align-items: center; gap: 14px; }
.wx .wx-temp { font-size: 52px; font-weight: 300; line-height: 1; }
.wx .wx-cond { font-size: 15px; font-weight: 650; margin-top: 4px; }
.wx .wx-feels { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.wx .wx-chips { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; font-weight: 600; }
.wx .wx-days { display: flex; gap: 10px; }
.wx .wx-day { flex: 1; text-align: center; background: rgba(255, 255, 255, 0.12);
  border-radius: 12px; padding: 10px 6px 12px; }
.wx .wx-wd { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.wx .wx-mm { font-size: 15px; margin-top: 2px; }
.wx .wx-mm b { font-size: 17px; }
.wx .wx-sub { font-size: 12px; opacity: .9; margin-top: 3px; }
.wx .wx-chart { overflow: visible; }
.cw-content .wx { margin: -0px; }
.creation-win .cw-body:has(.wx) { padding: 0; }
#creation-detail .cd-inner:has(.wx) { padding: 0; background: transparent; border: none; }

/* DETAIL na celú obrazovku — logika ako fotkový lightbox (pinch/pan/dvojité ťuknutie). */
#creation-detail {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(4, 8, 12, 0.93);
  overflow: hidden; touch-action: none; overscroll-behavior: contain;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
#creation-detail .cd-inner {
  position: absolute; left: 0; top: 0; will-change: transform;
  background: rgba(14, 20, 27, 0.97); border: 1px solid rgba(110, 231, 206, 0.4);
  border-radius: 14px; padding: 14px; color: #e7f2ee;
}
#creation-detail .plb-x {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(10, 14, 20, 0.7); color: #fff; font-size: 24px; line-height: 40px; cursor: pointer;
}
html[data-theme="day"] #creation-detail { background: rgba(240, 244, 242, 0.95); }
html[data-theme="day"] #creation-detail .cd-inner { background: #fbfdfc; color: #16211d; border-color: rgba(35, 122, 96, 0.4); }
html[data-theme="day"] .cw-content th { background: rgba(35, 122, 96, 0.12); }
html[data-theme="day"] .cw-content th, html[data-theme="day"] .cw-content td { border-color: rgba(35, 122, 96, 0.3); }
.creation-win .cw-resize {
  position: absolute; right: 4px; bottom: 4px;
  width: 28px; height: 28px; border-radius: 9px; border: none; padding: 0;
  background: rgba(10, 14, 20, 0.62); color: #cfe9e0;
  font-size: 16px; line-height: 28px; text-align: center;
  cursor: nwse-resize; touch-action: none;
}
/* PROPORČNÝ RESIZE ZA HRANY (Petrov pokyn 2026-07-21): ťahanie ktorejkoľvek hrany
   škáluje CELÉ okno so zachovaným pomerom (nie naťahovanie jednej strany).
   Pásiky sú VNÚTRI okraja (okno má overflow:hidden); vrch patrí hlavičke. */
.creation-win .cw-edge { position: absolute; z-index: 3; background: transparent; touch-action: none; }
/* top 45px = pod celou hlavičkou (~44 px) — pásik nesmie kradnúť drag za hlavičku */
.creation-win .cw-edge-l { left: 0; top: 45px; bottom: 36px; width: 14px; cursor: ew-resize; }
.creation-win .cw-edge-r { right: 0; top: 45px; bottom: 36px; width: 14px; cursor: ew-resize; }
.creation-win .cw-edge-b { left: 14px; right: 40px; bottom: 0; height: 14px; cursor: ns-resize; }
.creation-win .cw-confirm {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-top: 1px solid rgba(110, 231, 206, 0.25);
  background: rgba(110, 231, 206, 0.1); font-size: 13px;
}
.creation-win .cw-confirm span { flex: 1; }
.creation-win .cw-confirm button {
  border: none; border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 650; cursor: pointer;
}
.creation-win .cw-save { background: #2f8f63; color: #fff; }
.creation-win .cw-print { background: #6f5fa6; color: #fff; }
.creation-win .cw-share { background: #2c6f9e; color: #fff; }
.creation-win .cw-del { background: rgba(200, 70, 70, 0.85); color: #fff; }
.creation-win .cw-confirm { flex-wrap: wrap; }
html[data-theme="day"] .creation-win { background: rgba(250, 252, 251, 0.97); color: #16211d; border-color: rgba(35, 122, 96, 0.5); }
html[data-theme="day"] .creation-win .cw-head { background: rgba(35, 122, 96, 0.1); border-bottom-color: rgba(35, 122, 96, 0.25); }
html[data-theme="day"] .creation-win .cw-body th { background: rgba(35, 122, 96, 0.12); }
html[data-theme="day"] .creation-win .cw-body th, html[data-theme="day"] .creation-win .cw-body td { border-color: rgba(35, 122, 96, 0.3); }
body.pre-auth .creation-win { display: none !important; }
body.pre-auth .pin-strip { display: none !important; }

/* ── LIGHTBOX na fotky (Petrov pokyn 2026-07-16) ─────────────────────────────
   Ťuk na pripnutú fotku/náhľad → celá obrazovka ako iPhone galéria: pinch =
   zoom, ťah = posun, dvojité ťuknutie = priblíž, X vpravo hore = späť na chat. */
#photo-lightbox {
  position: fixed; inset: 0; z-index: 220;
  display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.96);
  touch-action: none;              /* gestá rieši JS, nie scroll stránky */
  overscroll-behavior: contain;
}
#photo-lightbox.on { display: flex; }
#photo-lightbox img {
  max-width: 100vw; max-height: 100vh;
  transform-origin: center center;
  will-change: transform;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
#photo-lightbox .plb-x {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 14px;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12); color: #fff;
  font: 22px/40px -apple-system, system-ui, sans-serif; text-align: center;
  padding: 0; cursor: pointer; z-index: 221;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
#photo-lightbox .plb-x:active { transform: scale(0.92); }

/* ── VÝSUVNÝ HEADER PÁSIK (Petrov pokyn 2026-07-16) ──────────────────────────
   V chate sú plávajúce guličky headera (hamburger, membrána, 24h, 001, CHAT)
   zasunuté — vidno len okrúhle tlačidlo so šípkou vpravo hore. Ťuk = ikony sa
   plynule vysunú sprava doľava na svoje miesta (odstupňované oneskorenie =
   efekt pásika); × = zasunú sa naspäť doprava. Platí LEN v chat móde —
   hlasový (čistý orb) režim ostáva nedotknutý. */
#hdr-toggle { display: none; }
body.chat-primary #hdr-toggle {
  display: grid; place-items: center;
  position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px;
  width: 41px; height: 41px; border-radius: 50%; z-index: 32;
  background: rgba(31, 44, 52, .86); border: 1px solid rgba(255, 255, 255, .14);
  color: var(--wa-text); cursor: pointer; padding: 0;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}
html[data-theme="day"] body.chat-primary #hdr-toggle {
  background: rgba(255, 255, 255, .86); border-color: rgba(0, 0, 0, .10); color: #111;
}
body.chat-primary #hdr-toggle:active { transform: scale(0.92); }
#hdr-toggle .ht-x { display: none; font: 24px/1 -apple-system, system-ui, sans-serif; }
body.hdr-open #hdr-toggle .ht-arrow { display: none; }
body.hdr-open #hdr-toggle .ht-x { display: block; }
/* keď je otvorené okienko/menu/Claude panel, schovaj aj prepínač (ako ostatné) */
body.okienko-open #hdr-toggle, body.menu-open #hdr-toggle,
body.claude-open.claude-open #hdr-toggle { display: none !important; }

/* Plynulý posun ikon — každá má malé oneskorenie, takže „pásik" sa vysúva
   postupne sprava doľava (CHAT prvý, hamburger posledný). */
body.chat-primary #hamburger, body.chat-primary .orb-mem-btn,
body.chat-primary #infostorm-btn, body.chat-primary #code-btn,
body.chat-primary #mode-toggle.mode-float {
  transition: transform .38s cubic-bezier(.22, .9, .3, 1), opacity .3s ease;
}
body.chat-primary #mode-toggle.mode-float { transition-delay: 0s; }
body.chat-primary #code-btn              { transition-delay: .05s; }
body.chat-primary #infostorm-btn         { transition-delay: .10s; }
body.chat-primary .orb-mem-btn           { transition-delay: .15s; }
body.chat-primary #hamburger             { transition-delay: .20s; }
/* Zasunutý stav (bez .hdr-open): ikony odídu doprava mimo obrazovku. */
body.chat-primary:not(.hdr-open) #hamburger,
body.chat-primary:not(.hdr-open) .orb-mem-btn,
body.chat-primary:not(.hdr-open) #infostorm-btn,
body.chat-primary:not(.hdr-open) #code-btn,
body.chat-primary:not(.hdr-open) #mode-toggle.mode-float {
  transform: translateX(110vw) !important;
  opacity: 0; pointer-events: none;
}
/* Vysunutý stav: CHAT chip sa posunie vľavo od × (obe by sedeli vpravo).
   POZOR: musí byť !important — pravidlo pre notch (right: max(14px, …) !important
   vyššie v súbore) by inak posun prebilo a CHAT by × prekryl (Petrov bug 2026-07-16). */
body.chat-primary.hdr-open #mode-toggle.mode-float {
  right: calc(60px + env(safe-area-inset-right, 0px)) !important;
}

/* ── OPRAVA: menu sa nedalo zavrieť v chat móde (Petrov bug 2026-07-16) ──────
   Chat mód dáva hamburgeru z-index 31 !important, ale menu je vo vrstve 60 —
   hamburger (toggle na zatvorenie) skončil POD menu a nedal sa ťuknúť. Pri
   otvorenom menu ho zdvihneme nad panel a zrušíme zasunutie výsuvného pásika. */
body.chat-primary.menu-open #hamburger.hamburger-btn {
  z-index: 70 !important;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transition-delay: 0s;
}
/* × v hlavičke menu — zväčšené na úroveň menu +50 % (ako šípka ←) */
#drawer-close { width: 36px; height: 36px; font-size: 20px; border-radius: 9px; flex: 0 0 auto; }

/* ── CHAT VO VZHĽADE CLAUDE (Petrov pokyn 2026-07-16, voľba B) ───────────────
   Celý chat prechádza z WhatsApp vzhľadu na Claude chat: deň = papierová
   béžová, noc = e-ink sivá s bielym písmom (rovnaké farby ako Claude Code
   chat v crm.js); akcent terakota namiesto zelenej. Rozloženie: moja správa
   = jemná bublina vpravo, odpoveď Orbia = BEZ bubliny, čistý text na celú
   šírku s väčším riadkovaním. Všetko len pod body.chat-primary — hlasový
   (orb) režim ostáva nedotknutý. */
body.chat-primary {   /* noc (predvolené, ako :root) — e-ink sivá */
  --wa-bg: #26282a; --wa-header: #2e3033; --wa-bar: #2e3033; --wa-in: #2e3033;
  --wa-out: #35383b; --wa-text: #f2f3f2; --wa-dim: #a8acab;
  --wa-input-bg: rgba(46, 48, 51, .92); --wa-send: #C96442; --wa-divider: #3c3f42;
}
html[data-theme="day"] body.chat-primary {   /* deň — papierová béžová */
  --wa-bg: #F5F4EE; --wa-header: #FBFAF6; --wa-bar: #FBFAF6; --wa-in: #FBFAF6;
  --wa-out: #ECE9DF; --wa-text: #2A2A27; --wa-dim: #6B6A63;
  --wa-input-bg: rgba(255, 255, 255, .92); --wa-send: #C96442; --wa-divider: #E7E4DA;
}
/* Odpoveď Orbia — bez bubliny, na celú šírku (ako text Clauda) */
body.chat-primary .transcript p.ai {
  align-self: stretch; max-width: 100%; width: auto;
  background: none; box-shadow: none; border-radius: 0;
  padding: 3px 7px; margin: 5px 0; line-height: 1.62;
}
body.chat-primary .transcript p.ai::before { display: none; }
/* Moja správa — jemná bublina vpravo, zaoblenie ako v Claude chate */
body.chat-primary .transcript p.me {
  max-width: 86%; border-radius: 20px 20px 6px 20px;
  padding: 10px 15px; margin: 5px 0; line-height: 1.5; box-shadow: none;
}
body.chat-primary .transcript p.me::before { display: none; }
/* Membrána a avatar — z ORBIO zelenej na terakotu (jednotný akcent) */
body.chat-primary .orb-mem {
  background: radial-gradient(circle at 32% 30%, #F2C3AB, #DB8663 45%, #C96442 78%);
}
.chat-header .ch-avatar {
  background: radial-gradient(circle at 30% 30%, #DB8663, #C96442 70%);
}
/* Plávajúce ikony v noci — e-ink sivá namiesto WhatsApp tmavo-tyrkysovej.
   !important nutné: pravidlo 24h ikony má background !important. Deň má
   vlastné (biele) overridy nižšie špecifikované — tie nechávame tak. */
html[data-theme="night"] body.chat-primary #hamburger.hamburger-btn,
html[data-theme="night"] body.chat-primary .orb-mem-btn,
html[data-theme="night"] body.chat-primary #infostorm-btn,
html[data-theme="night"] body.chat-primary #code-btn,
html[data-theme="night"] body.chat-primary #hdr-toggle,
html[data-theme="night"] body.chat-primary #mode-toggle.mode-float {
  background: rgba(46, 48, 51, .86) !important;
  border-color: rgba(255, 255, 255, .10) !important;
}
/* Pripnuté fotky v chate — terakotový okraj k Claude palete (v hlase ostáva tyrkys) */
body.chat-primary .pin-item img { border-color: rgba(201, 100, 66, .65); }

/* ── INPUT BAR AKO CLAUDE (Petrov pokyn 2026-07-16): jedna pilulka ───────────
   Namiesto 4 oddelených krúžkov (foto / text / mikrofón / odoslať) je všetko
   v JEDNOM zaoblenom ráme ako v Claude chate: foto a mikrofón = tiché ikony
   bez pozadia, textové pole priesvitné, len Odoslať ostáva terakotový kruh.
   Funkcie sa nemenia — len vzhľad. Platí len v chat móde. */
body.chat-primary .chat-bar {
  left: 8px; right: 8px; bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  padding: 3px; gap: 2px;
  background: var(--wa-input-bg);
  border: 1px solid var(--wa-divider); border-radius: 22px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
}
body.chat-primary .chat-bar:focus-within {
  border-color: rgba(201, 100, 66, .35);
  box-shadow: 0 1px 6px rgba(201, 100, 66, .10);
}
body.chat-primary .chat-bar textarea {
  background: none; box-shadow: none; border-radius: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  padding: 10px 6px; min-height: 40px;
}
body.chat-primary .chat-bar #chat-cam,
body.chat-primary .chat-bar #chat-mic {
  width: 40px; height: 40px; background: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  color: var(--wa-dim);
}
body.chat-primary .chat-bar #chat-send { width: 40px; height: 40px; box-shadow: none; }

/* ── Fotky vľavo hore vs. prvá správa (IMG_2839, 2026-07-16) ─────────────────
   Pripnutá lišta fotiek v ZÁKLADNEJ polohe (top ~10px, fotky 144px) prekrývala
   začiatok chatu. Kým je lišta na defaulte (trieda pins-docked z realtime.js),
   transcript začína pod ňou; po presune lišty alebo odopnutí fotiek trieda
   zmizne a platí pôvodný odstup 61px (orb.css ~1199). */
body.chat-primary.pins-docked .transcript {
  padding-top: calc(186px + env(safe-area-inset-top, 0px));
}

/* ── Čierny pruh medzi input barom a klávesnicou (IMG_2842, 2026-07-16) ──────
   Pri otvorení klávesnice iOS posunie stránku hore a pod ňou odkryje PLÁTNO
   dokumentu — to má farbu z html { background:#000 } (riadok ~18, zámerne pre
   čierny orb režim a notch). V chat móde preto plátno prefarbíme na farbu
   papiera podľa témy; hlasový režim (čierny orb) ostáva nedotknutý.
   :has() = iOS Safari 15.4+ / Chrome 105+ — na starších sa pravidlo len
   ignoruje a ostane pôvodné čierne (žiadny rozbitý layout). */
html:has(body.chat-primary) { background: #26282a; }                    /* noc */
html[data-theme="day"]:has(body.chat-primary) { background: #F5F4EE; }  /* deň */

/* ── Čierny pás pri klávesnici, 2. kolo (IMG_2844, 2026-07-16) ───────────────
   Prefarbenie plátna stránky (vyššie) nestačilo — pás je NATÍVNA PODLOŽKA
   WKWebView (backdrop), ktorú farbí color-scheme, nie CSS background. Je to
   tá istá vrstva, čo kedysi robila BIELE pruhy v notchi, kým ju meta
   color-scheme:dark (index.html ~14) neprepla na čiernu. V DENNOM chat móde
   ju preto prepneme na svetlú → medzera pri klávesnici bude svetlá ako papier
   (aj lišta nad klávesnicou zosvetlie). Hlasový režim a noc ostávajú tmavé —
   inak by sa vrátil starý bug s bielymi pruhmi na čiernom orbe. */
html[data-theme="day"]:has(body.chat-primary) { color-scheme: light; }

/* ── iOS klávesnica: --kb = prekrytie klávesnicou (meria realtime.js) ─────────
   Input bar a spodné odsadenie chatu sa zdvihnú NAD klávesnicu a lepia sa na
   viditeľný výsek aj počas ťahania prstom — input bar už nemôže zmiznúť pod
   klávesnicou (IMG_2845/2846). max() = keď je klávesnica zavretá (--kb:0),
   platí pôvodná rezerva na home indikátor. */
body.chat-primary .chat-bar {
  bottom: calc(6px + max(env(safe-area-inset-bottom, 0px), var(--kb, 0px)));
}
body.chat-primary .transcript {
  padding-bottom: calc(70px + max(env(safe-area-inset-bottom, 0px), var(--kb, 0px)));
}
/* Devchat panel (iframe) končí NAD klávesnicou — jeho vnútorný composer si už
   crm.js vnútri iframu usadí sám (--crm-vh). Bez tohto by composer ostal
   schovaný pod klávesnicou, keď posun stránky vraciame na nulu. */
#claude-panel { bottom: var(--kb, 0px); }

/* ── iOS/MOBIL: IKONY DOLE (Petrov pokyn 2026-07-30: „v iOS situované dole —
   a na iOS appku sa nesmie zabúdať, vždy 1:1 s desktopom") ──────────────────
   Na dotykových úzkych displejoch (iPhone) sa celý pravý horný rad ikon orb
   plochy zrkadlí k SPODNEJ hrane (dosah palca), nad home-indicator safe-area.
   Poradie a funkcie 1:1: hamburger vpravo, Orbio pilulka, kamera, 001, klíček.
   Chat režim sa NEmení — dole žije vstupná lišta, ikony tam ostávajú hore
   v zasúvacom pásiku. Selektory kopírujú originály (rovnaká špecificita,
   neskôr v súbore = vyhrávajú nad ich top/bottom !important). */
@media (pointer: coarse) and (max-width: 820px) {
  html body:not(.chat-primary):not(.pre-auth) #hamburger.hamburger-btn,
  html body:not(.chat-primary):not(.pre-auth) #mic-toggle,
  html body:not(.pre-auth):not(.chat-primary):not(.menu-open):not(.okienko-open) #timeline-btn,
  html body:not(.pre-auth):not(.chat-primary):not(.menu-open):not(.okienko-open) #code-btn,
  html body:not(.pre-auth):not(.chat-primary):not(.menu-open):not(.okienko-open) #child-btn {
    top: auto !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* DOMČEK do DRUHÉHO RADU (2026-08-12): pri +355px by na iPhone (375–390 px)
     vytiekol z obrazovky o 35–50 px — spočítané, nie odhadnuté. Preto ide nad
     Adamka: rovnaké `right` (+292), o riadok vyššie (55 + 8 medzera). Ďalšie
     ikony pokračujú v tomto rade doľava, nie za okraj. */
  html body:not(.pre-auth):not(.chat-primary):not(.menu-open):not(.okienko-open) #home-btn {
    top: auto !important;
    right: calc(max(14px, env(safe-area-inset-right, 0px)) + 292px) !important;
    bottom: calc(77px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ── TLAČIDLO ORBIO = MIKROFÓN (2026-08-11): stlmený stav ────────────────────
   Klik na launcher prepína mikrofón; stlmené = sivá bodka bez žiary +
   prečiarknutý názov (textový signál bez emoji). Radené ZA m-* pravidlá,
   aby stlmenie prebilo farbu režimu (rovnaká špecificita → poradie rozhoduje). */
.orbio-launcher.muted .ol-dot { background: #566072; box-shadow: 0 0 0 1px rgba(255,255,255,.10); animation: none; }
.orbio-launcher.muted .ol-name { text-decoration: line-through; opacity: .65; }
html[data-theme="day"] .orbio-launcher.muted .ol-dot { background: #9aa3b2; }
