/* TRANKILO RED - promedea vizual (tokens v tokens.css). Mobil first 390 px, desktop >= 900 px sidebar 220 px. */
@import url('/tokens.css');

[x-cloak] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* html/body BEZ overflow/overscroll pravidiel (iOS Safari s nimi vie zaseknut vertikalny scroll dokumentu);
   horizontalne pretecenie glow-bg orezava az .app cez overflow-x: clip (clip NEvytvara scroll-kontajner) */
html, body { margin: 0; background: var(--bg); color: var(--fg); }
html { -webkit-text-size-adjust: 100%; }
.app, .page { overflow-x: clip; }
/* stav "v telefone" (Google kontakty) */
.phbadge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid rgba(255,255,255,.14); color: var(--fg-muted); background: rgba(255,255,255,.04); }
.phbadge.on { border-color: rgba(52,211,153,.5); color: #6EE7B7; background: rgba(52,211,153,.08); }
button.phbadge { cursor: pointer; border-color: rgba(255,196,0,.4); color: var(--fire); }
.sharebox { border-color: rgba(167,139,250,.35); }
.sharebox textarea.inp { min-height: 120px; font-size: 15px; }
.phsyncerr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 12px; padding: 6px 10px; border: 1px solid rgba(248,113,113,.45); background: rgba(248,113,113,.08); color: #FCA5A5; border-radius: 10px; }
.phchip { font-size: 12px; margin-left: 6px; }
/* priebeh AI spracovania */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(8,6,16,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.ovbox { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; background: var(--glass-bg); border: 1px solid rgba(167,139,250,.4); border-radius: var(--radius-lg); padding: 28px 20px; box-shadow: var(--glow-magic-soft); }
.ovbox .title { font-size: 16px; font-weight: 500; }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(167,139,250,.25); border-top-color: var(--magic-light); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.steps span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid rgba(255,255,255,.12); color: var(--fg-faint); }
.steps span.on { border-color: var(--magic-light); color: var(--magic-light); }
.steps span.done { border-color: var(--fire); color: var(--fire); }
.qsheet { position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 30; background: rgba(8,6,16,.97); border: 1px solid rgba(167,139,250,.5); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--glow-magic); }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 35; background: rgba(255,196,0,.12); border: 1px solid rgba(255,196,0,.45); color: var(--fg); border-radius: var(--radius-md); padding: 12px 14px; font-size: 14px; text-align: center; }
/* install banner (PWA) */
.install { position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 25; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: rgba(8,6,16,.96); border: 1px solid rgba(167,139,250,.4); border-radius: var(--radius-lg); box-shadow: var(--glow-magic-soft); font-size: 13px; }
.install.login-pos { bottom: calc(16px + env(safe-area-inset-bottom)); }
.install .txt { flex: 1; }
.install .x { flex: none; }
body { font-family: var(--font-body); font-size: 15px; line-height: 1.5; min-height: 100dvh; }
a { color: var(--magic-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: #C4B5FD; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; color: inherit; }
svg.ic { width: 16px; height: 16px; flex: none; }
.hidden { display: none !important; }

/* ---------- Typografia ---------- */
.h1, .h2, .h3, .h-num { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; color: var(--fg); margin: 0; }
.h1 { font-size: 24px; }
.h2 { font-size: 20px; }
.h3 { font-size: 19px; }
.h-num { font-size: 20px; }
.brand { font-family: var(--font-display); font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; color: var(--fg); }
.label { font-family: var(--font-body); font-weight: 600; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-faint); }
.label.danger { color: var(--danger); }
.label.fire { color: var(--fire); }
.lead { font-size: 15px; color: var(--fg-muted); line-height: 1.7; margin: 0; }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.sec { color: var(--fg-secondary); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
/* DES-03: metadata/poznamky 12px = fg-muted (6.9:1); .faint (4.7:1) LEN na .label caps a kratke datumy (.item .when, .tl-date) */
.meta { font-size: 12px; color: var(--fg-muted); }
.mono { font-family: var(--font-mono); font-size: 13px; }
.err { color: var(--danger); font-size: 13px; min-height: 20px; margin: 0; }
.okmsg { color: var(--fire); font-size: 13px; min-height: 20px; margin: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }
.center { text-align: center; }
.break { word-break: break-all; }

/* ---------- Layout ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.page { flex: 1; width: 100%; padding: 24px 12px calc(88px + env(safe-area-inset-bottom)); padding-top: calc(24px + env(safe-area-inset-top)); position: relative; }
.page.narrow { max-width: 480px; margin: 0 auto; }
.page.center-v { display: flex; flex-direction: column; justify-content: center; min-height: 100dvh; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 16px; }
.row-sm { display: flex; align-items: center; gap: 8px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mt-auto { margin-top: auto; }
.head { padding-top: 8px; }

/* ambientna ziara (radial, nikdy pod malym textom) */
.glow-bg { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; }
.glow-bg.magic-tr { top: -120px; right: -100px; width: 320px; height: 320px; background: radial-gradient(circle, rgba(124,58,237,.35), transparent 70%); }
.glow-bg.fire-bl { bottom: -140px; left: -110px; width: 300px; height: 300px; background: radial-gradient(circle, rgba(255,196,0,.14), transparent 70%); }
.glow-bg.magic-top { top: -100px; left: 50%; width: 300px; height: 300px; margin-left: -150px; background: radial-gradient(circle, rgba(124,58,237,.3), transparent 70%); }
.glow-bg.magic-card { top: -120px; right: -80px; width: 280px; height: 280px; background: radial-gradient(circle, rgba(124,58,237,.3), transparent 70%); }
.rel { position: relative; z-index: 1; }

/* ---------- Karty (glass) ---------- */
.card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: 16px; backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.card.pad { padding: 26px; }
.card.lg { border-radius: var(--radius-lg); }
.card.xl { border-radius: var(--radius-lg); padding: 44px 26px; }
.card.magic { border-color: rgba(167,139,250,.35); box-shadow: var(--glow-magic-soft); }
.card.fire { background: rgba(255,196,0,.06); border-color: rgba(255,196,0,.3); }
.card.danger { background: var(--danger-surface); border-color: var(--danger-border); }
.card.press { cursor: pointer; text-align: left; width: 100%; display: flex; flex-direction: column; gap: 4px; }
.card.press:hover { border-color: rgba(167,139,250,.35); transform: var(--hover-lift); }
.card.press.magic:hover { box-shadow: var(--glow-magic); }
.card .title { font-size: 17px; font-weight: 500; color: var(--fg); }
.card .desc { font-size: 14px; color: var(--fg-muted); line-height: 1.6; }
.card .body { font-size: 15px; color: var(--fg-secondary); line-height: 1.7; }
.card.stat { display: flex; flex-direction: column; gap: 2px; }
.hr { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }

/* riadok zoznamu */
.item { display: flex; align-items: center; gap: 16px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: 16px; cursor: pointer; transition: border-color var(--transition), transform var(--transition); text-align: left; width: 100%; }
.item:hover { border-color: rgba(167,139,250,.35); transform: var(--hover-lift); }
.item .name { font-size: 15px; font-weight: 500; color: var(--fg); }
.item .sub { font-size: 13px; color: var(--fg-muted); }
.item .when { font-size: 12px; color: var(--fg-faint); flex: none; }

/* ---------- Avatar ---------- */
.avatar { width: 40px; height: 40px; flex: none; border-radius: var(--radius-pill); background: rgba(109,40,217,.25); border: 1px solid rgba(167,139,250,.4); color: var(--magic-light); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.avatar.md { width: 48px; height: 48px; font-size: 15px; }
.avatar.lg { width: 56px; height: 56px; font-size: 17px; }
.avatar.xl { width: 72px; height: 72px; font-size: 22px; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-row { align-items: center; gap: 16px; }
.photo-row .btn input[type=file] { display: none; }
.avatar.me { background: rgba(255,196,0,.15); border-color: var(--fire); color: var(--fire); }
.avatar.co { border-radius: var(--radius-md); background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: var(--fg); font-family: var(--font-display); font-weight: 400; }

/* ---------- Tlacidla (pill) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-pill); font-weight: 600; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; padding: 14px 28px; min-height: 44px; border: 1px solid transparent; text-align: center; transition: color var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition), transform var(--transition); white-space: nowrap; }
.btn:hover:not(:disabled) { transform: var(--hover-lift); }
.btn.cta { background: var(--fire); color: var(--ink); box-shadow: var(--glow-fire-soft); }
.btn.cta:hover:not(:disabled) { box-shadow: var(--glow-fire); color: var(--ink); }
.btn.sec { border-color: rgba(255,255,255,.15); color: var(--fg-secondary); }
.btn.sec:hover:not(:disabled) { border-color: rgba(255,255,255,.3); color: var(--fg); }
.btn.ter { border-color: rgba(167,139,250,.4); color: var(--magic-light); }
.btn.ter:hover:not(:disabled) { box-shadow: var(--glow-magic-soft); }
.btn.fire-o { border-color: rgba(255,196,0,.4); color: var(--fire); }
.btn.danger { border-color: var(--danger-border); color: var(--danger); }
.btn.block { width: 100%; display: flex; }
.btn.sm { padding: 10px 20px; font-size: 11px; min-height: 40px; }
.btn.xs { padding: 8px 16px; font-size: 11px; min-height: 36px; }
/* DES-02: neaktivny pill bez opacity (fg-secondary*.35 ~ 2.2:1); fg-faint na 11px caps = 4.7:1 */
.btn.off { color: var(--fg-faint); border-color: var(--glass-border); box-shadow: none; pointer-events: none; }
.btn.grow { flex: 1; }
.fab { width: 44px; height: 44px; border-radius: var(--radius-pill); background: var(--fire); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; box-shadow: var(--glow-fire-soft); transition: box-shadow var(--transition), transform var(--transition); flex: none; }
.fab:hover { box-shadow: var(--glow-fire); transform: var(--hover-lift); }
.link { background: none; color: var(--magic-light); font-size: 13px; }
.link:hover { color: #C4B5FD; }
.back { color: var(--fg-muted); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.back:hover { color: var(--fg); }

/* ---------- MOB-03: touch hit-area >= 44 px bez zmeny vizualu (neviditelny ::before presahuje prvok) ---------- */
.check, .x, .link, .back, .filter, button.chip, .chip button, .toggle, .relbtn, .btn.xs { position: relative; }
.check::before, .x::before, .link::before, .back::before, .filter::before, button.chip::before, .chip button::before, .toggle::before, .relbtn::before, .btn.xs::before { content: ''; position: absolute; inset: -10px; }
.check::before { inset: -12px; }
.x::before { inset: -8px; }
.link::before, .back::before { inset: -12px -8px; }
.filter::before, button.chip::before { inset: -8px -4px; }
.chip button::before { inset: -12px -8px -12px -4px; }
.toggle::before { inset: -12px; }
.relbtn::before { inset: -8px 0; }
.btn.xs::before { inset: -4px 0; }

/* ---------- Chipy a filtre ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg); background: rgba(109,40,217,.2); border: 1px solid rgba(167,139,250,.35); padding: 6px 14px; border-radius: var(--radius-pill); }
.chip.sel { background: rgba(109,40,217,.3); border-color: rgba(167,139,250,.5); }
.chip.ghost { background: none; border-color: var(--glass-border); color: var(--fg-muted); }
.chip button { color: var(--magic-light); font-size: 15px; line-height: 1; }
.filter { font-weight: 600; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; border: 1px solid var(--glass-border); color: var(--fg-muted); padding: 6px 14px; border-radius: var(--radius-pill); transition: color var(--transition), border-color var(--transition), background var(--transition); }
.filter.on { background: rgba(255,196,0,.12); border-color: rgba(255,196,0,.4); color: var(--fire); }
.role { font-weight: 600; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid rgba(255,255,255,.15); color: var(--fg-muted); flex: none; }
.role.admin { color: var(--fire); border-color: rgba(255,196,0,.4); }
.role.off { text-decoration: line-through; }
.dots { display: inline-flex; gap: 3px; margin-left: auto; }
.dots i { width: 6px; height: 6px; border-radius: var(--radius-pill); background: rgba(255,255,255,.15); }
.dots i.on { background: var(--magic-light); }

/* ---------- Inputy ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inp { width: 100%; display: block; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 15px; color: var(--fg); outline: none; min-height: 48px; transition: border-color var(--transition), box-shadow var(--transition); }
.inp::placeholder { color: var(--fg-faint); }
.inp:focus { border-color: rgba(167,139,250,.5); box-shadow: var(--glow-magic-soft); }
.inp.mono { font-family: var(--font-mono); font-size: 14px; }
.inp.code { font-family: var(--font-mono); letter-spacing: .3em; text-align: center; }
.inp.pill { border-radius: var(--radius-pill); padding: 12px 16px; }
.inp.ai { border-color: rgba(167,139,250,.5); box-shadow: inset 3px 0 0 var(--fire); }
textarea.inp { resize: vertical; min-height: 96px; line-height: 1.6; }
select.inp { appearance: none; -webkit-appearance: none; }
select.inp option { background: var(--surface); color: var(--fg); }
input[type=date].inp { -webkit-appearance: none; color-scheme: dark; }
input[type=search].inp::-webkit-search-cancel-button { -webkit-appearance: none; }
.pre-ic { position: relative; }
.pre-ic > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--fg-faint); pointer-events: none; }
.pre-ic > .inp { padding-left: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 8px 12px; min-height: 48px; transition: border-color var(--transition); }
.chips:focus-within { border-color: rgba(167,139,250,.5); }
.chips.ai { border-color: rgba(167,139,250,.5); box-shadow: inset 3px 0 0 var(--fire); }
.chipin { flex: 1; min-width: 110px; background: transparent; border: 0; outline: none; color: var(--fg); font-size: 15px; padding: 4px; }
.chipin::placeholder { color: var(--fg-faint); }
fieldset.fs { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
fieldset.fs legend { padding: 0; margin-bottom: 8px; }
.aibanner { display: flex; gap: 8px; align-items: center; background: rgba(109,40,217,.2); border: 1px solid rgba(167,139,250,.35); border-radius: var(--radius-sm); color: var(--fg); font-size: 13px; padding: 12px 16px; }
.aibanner svg { color: var(--fire); width: 16px; height: 16px; flex: none; }
details.transcript summary { cursor: pointer; font-size: 13px; color: var(--magic-light); }
.toggle { width: 36px; height: 20px; border-radius: var(--radius-pill); background: rgba(255,255,255,.15); position: relative; flex: none; transition: background var(--transition); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--radius-pill); background: var(--ink); transition: left var(--transition); }
.toggle.on { background: rgba(255,196,0,.9); }
.toggle.on::after { left: 18px; }
.check { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; color: var(--ink); font-size: 13px; transition: background var(--transition), border-color var(--transition); }
.check.on { background: var(--fire); border-color: var(--fire); }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: rgba(8,6,16,.92); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border-top: 1px solid rgba(255,255,255,.08); z-index: 20; }
.savebar .btn { flex: 1; }
.qr { font-family: var(--font-mono); font-size: 12px; color: var(--fg-secondary); word-break: break-all; line-height: 1.6; }

/* ---------- Diktovanie ---------- */
.mic { width: 120px; height: 120px; border-radius: 50%; margin-top: 24px; background: rgba(109,40,217,.3); border: 1px solid rgba(167,139,250,.5); display: flex; align-items: center; justify-content: center; font-size: 44px; box-shadow: var(--glow-magic); transition: box-shadow var(--transition), transform var(--transition), background var(--transition); }
.mic:hover:not(:disabled) { transform: var(--hover-lift); }
.mic.live { animation: pulse 1.4s ease-in-out infinite; background: rgba(109,40,217,.45); }
.mic:disabled { animation: none; opacity: .6; }
.timer { font-family: var(--font-mono); font-size: 13px; color: var(--magic-light); letter-spacing: .1em; }
.lvl { width: 100%; height: 4px; background: rgba(255,255,255,.08); border-radius: var(--radius-pill); overflow: hidden; }
/* Google login */
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.12); }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.gbtn svg { width: 18px; height: 18px; flex: none; }
/* dodiktovanie v rucnom formulari */
.dictbar { display: flex; align-items: center; gap: 12px; }
.dictbar .lvl { flex: 1; max-width: 180px; }
.dictbtn { display: inline-flex; align-items: center; gap: 8px; }
.dictbtn svg { width: 15px; height: 15px; flex: none; }
.dictbtn.live { animation: pulse 1.4s ease-in-out infinite; border-color: var(--danger-border); color: var(--danger); }
.lvl-bar { height: 100%; background: var(--magic-light); border-radius: var(--radius-pill); transition: width .08s linear; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 44px -6px rgba(124,58,237,.95); } 50% { box-shadow: 0 0 60px 2px rgba(124,58,237,.9); } }

/* ---------- Prazdny stav ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.empty .spark { width: 64px; height: 64px; border-radius: var(--radius-pill); background: rgba(109,40,217,.2); border: 1px solid rgba(167,139,250,.35); display: flex; align-items: center; justify-content: center; font-size: 28px; box-shadow: var(--glow-magic-soft); }

/* ---------- Navigacia: mobil spodna lista ---------- */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(8,6,16,.92); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border-top: 1px solid rgba(255,255,255,.08); padding-bottom: env(safe-area-inset-bottom); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; font-weight: 600; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); transition: color var(--transition); }
.tab .ico { font-size: 18px; line-height: 1; }
.tab.on { color: var(--fire); }
.sidebar { display: none; }
.desk-only { display: none; }

/* ---------- MOB-04: mobil - vsetky polia 16 px (iOS inak zoomuje pri focuse; viewport uz nema maximum-scale) ---------- */
@media (max-width: 899px) {
  .inp, .inp.mono, .inp.pill, select.inp, textarea.inp, .chipin, .sm-sel { font-size: 16px; }
}

/* ---------- MOB-02: boot fallback (vidno kym Alpine nenabehne; init() ho odstrani) ---------- */
.boot { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 16px; max-width: 480px; margin: 0 auto; padding: 24px 12px; }
.boot .boot-fail { display: none; }
.boot.failed .boot-fail { display: flex; }
.boot.failed .boot-wait { display: none; }

/* ---------- Desktop >= 900 px ---------- */
@media (min-width: 900px) {
  .app { flex-direction: row; align-items: flex-start; }
  .tabbar { display: none; }
  .desk-only { display: block; }
  .savebar { position: sticky; bottom: 0; margin: 16px -24px -32px; padding: 16px 24px; }
  .savebar .btn { flex: 0 0 auto; min-width: 180px; }
  .sidebar { display: flex; flex-direction: column; gap: 24px; width: 220px; flex: none; position: sticky; top: 0; height: 100dvh; padding: 24px; border-right: 1px solid rgba(255,255,255,.08); }
  .sidebar .brand-sm { font-family: var(--font-display); font-size: 15px; color: var(--fg); }
  .sidebar nav { display: flex; flex-direction: column; gap: 8px; }
  .sidebar .nl { font-weight: 600; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-muted); padding: 10px 14px; border-radius: var(--radius-sm); text-align: left; transition: color var(--transition), background var(--transition); }
  .sidebar .nl:hover { color: var(--fg); }
  .sidebar .nl.on { color: var(--fire); background: rgba(255,196,0,.08); }
  .sidebar .me { margin-top: auto; }
  .page { padding: 32px 24px; max-width: var(--content-max); margin: 0 auto; }
  .page.narrow { max-width: 480px; }
  .page.mid { max-width: 720px; }
  .row-desk { display: flex; flex-direction: row; gap: 16px; align-items: stretch; }
  .row-desk > * { flex: 1; min-width: 0; }
  .item { padding: 16px 24px; gap: 24px; }
  .h1 { font-size: 24px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card.press:hover, .item:hover, .btn:hover, .fab:hover, .mic:hover { transform: none; }
}

/* ---------- Karta: vztahy, stretnutia, follow-up ---------- */
.relrow { display: flex; align-items: center; gap: 8px; }
.relbtn { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); text-align: left; width: 100%; min-height: 28px; transition: color var(--transition); }
.relbtn:hover { color: var(--magic-light); }
.x { color: var(--fg-faint); font-size: 18px; line-height: 1; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-pill); flex: none; transition: color var(--transition), background var(--transition); }
.x:hover { color: var(--danger); background: rgba(255,255,255,.05); }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.6; }
.tl-date { color: var(--fg-faint); font-size: 12px; flex: none; min-width: 44px; padding-top: 2px; }
.tl-date::after { content: ' —'; }
.card.fire.overdue { background: var(--danger-surface); border-color: var(--danger-border); }

/* ---------- Nova vazba (09) ---------- */
.pair { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px 0; }
.pair-p { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 72px; }
.pair-line { width: 60px; height: 2px; border-radius: var(--radius-pill); background: rgba(167,139,250,.3); transition: background var(--transition), box-shadow var(--transition); }
.pair-line.on { background: var(--magic-light); box-shadow: var(--glow-magic-soft); }
.avatar.ghost { background: none; border-style: dashed; color: var(--fg-faint); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--magic-light) var(--pct, 50%), rgba(255,255,255,.08) var(--pct, 50%)); outline: none; margin: 8px 0; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: var(--radius-pill); background: var(--fg); border: 0; cursor: pointer; }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: var(--radius-pill); background: var(--fg); border: 0; cursor: pointer; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: var(--glow-magic-soft); }

/* ---------- Graf (08) ---------- */
.graph-page { overflow: hidden; }
/* design 08 (390 px): nadpis Siet Michroma 20 (nie 24) */
@media (max-width: 899px) { .graph-page .h1 { font-size: 20px; } }
.glow-bg.graph-mist { inset: 0; border-radius: 0; background: radial-gradient(circle at 30% 20%, rgba(124,58,237,.18), transparent 55%), radial-gradient(circle at 80% 85%, rgba(255,196,0,.07), transparent 55%); }
.graph-wrap { display: flex; flex-direction: column; gap: 16px; }
.graph-main { flex: 1; min-width: 0; }
/* MOB-07: touch-action none = pan/pinch ide do JS (viewBox), nie do scrollu stranky; na mobile vyssie SVG (portrait viewBox 390x520) */
.graph-svg { width: 100%; height: auto; aspect-ratio: 800 / 520; display: block; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.graph-svg:active { cursor: grabbing; }
@media (max-width: 899px) { .graph-svg { height: 60dvh; } .gpanel { max-height: 40dvh; } }
.gnode { cursor: pointer; }
.gnode circle, .gnode rect { transition: stroke-width var(--transition), filter var(--transition); }
.gnode:hover circle, .gnode:hover rect { stroke-width: 2; }
.gnode.sel circle, .gnode.sel rect { stroke-width: 2.5; filter: drop-shadow(0 0 8px rgba(124,58,237,.9)); }
.sm-sel { width: auto; min-height: 40px; padding: 8px 32px 8px 16px; font-size: 13px; background-image: linear-gradient(45deg, transparent 50%, var(--fg-faint) 50%), linear-gradient(135deg, var(--fg-faint) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; max-width: 200px; }
.lg-line { display: inline-block; width: 20px; border-radius: var(--radius-pill); }
.lg-line.dashed { height: 0; border-top: 1px dashed rgba(167,139,250,.6); }
/* mobil: spodny panel nad tabbarom */
.gpanel { position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 19; background: rgba(8,6,16,.96); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border-top: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 16px; max-height: 40dvh; overflow-y: auto; transform: translateY(105%); transition: transform var(--transition); }
.gpanel.open { transform: translateY(0); }
.mob-only { display: inline-flex; }

@media (min-width: 900px) {
  .mob-only { display: none; }
  .graph-wrap { flex-direction: row; align-items: stretch; min-height: calc(100dvh - 64px); }
  .gpanel { position: static; transform: none; width: 320px; flex: none; border-top: 0; border-left: 1px solid rgba(255,255,255,.08); border-radius: 0; padding: 32px; max-height: none; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; margin: -32px -24px -32px 0; }
  .gpanel:not(.open) { display: none; }
}

/* ---------- Offline banner ---------- */
.offline { position: sticky; top: 0; z-index: 30; background: rgba(187,30,60,.18); border-bottom: 1px solid var(--danger-border); color: var(--fg); font-size: 13px; text-align: center; padding: 8px 16px; backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); }

/* ---------- Obohatenie (06): diff karty, skeleton ---------- */
.diff .old { text-decoration: line-through; }
.diff .new { font-size: 15px; color: var(--fg); line-height: 1.5; word-break: break-word; }
.diff .src { color: var(--magic-light); }
/* DES-02: skip stav bez opacity (text musi ostat citatelny >= 4.5:1) - preciarknutie + fg-muted, label fg-faint, toggle sedy */
.diff.skip .new { text-decoration: line-through; color: var(--fg-muted); }
.diff.skip .src { color: var(--fg-muted); }
.diff.skip .old { color: var(--fg-faint); }
.toggle { cursor: pointer; }
.toggle:focus-visible { outline: 2px solid var(--magic-light); outline-offset: 2px; }
.skel { min-height: 96px; }
.sk { height: 12px; border-radius: var(--radius-pill); background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk.w30 { width: 30%; } .sk.w60 { width: 60%; } .sk.w80 { width: 80%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Karta osoby: mobil stack, desktop 3 stlpce ---------- */
.pcards { display: flex; flex-direction: column; gap: 16px; }
.desk-only-i { display: none; }

@media (min-width: 900px) {
  .desk-only.btn, .desk-only.row-sm { display: inline-flex; }
  .desk-only-i { display: inline; }
  /* zoznam: 4 stlpce - avatar, meno 220, firma flex, kedy 120 */
  .item.people .cols { display: contents; }
  .item.people .name { width: 220px; flex: none; }
  .item.people .sub { flex: 1; min-width: 0; font-size: 14px; }
  .item.people .when { width: 120px; text-align: right; font-size: 13px; }
  /* karta osoby: cela sirka, avatar 72, meno 28, 3 stlpce + pas + stretnutia */
  .person-page { max-width: var(--content-max); }
  .phead { gap: 24px; }
  .phead .avatar.lg { width: 72px; height: 72px; font-size: 22px; }
  .pname { font-size: 28px; }
  .pactions { max-width: 480px; }
  .pcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
  .pcards > .fu-wrap { grid-column: 1 / -1; order: 1; }
  .pcards > .meetings { grid-column: 1 / -1; order: 2; }
  .pcards .card.fire { padding: 16px 24px; }
}

/* C4: follow-up termin ako klikatelne tlacidlo + inline date input */
/* casova os karty (31.8.): chip typu + pevny datum dd.mm.yyyy; desktop = cely riadok pod 3 stlpcami */
.chip.xs { font-size: 11px; padding: 2px 10px; letter-spacing: .04em; }
.chip.xs.meeting { background: rgba(109,40,217,.2); }
.chip.xs.followup { background: rgba(255,196,0,.1); border-color: rgba(255,196,0,.35); color: var(--fire); }
.chip.xs.first { background: none; border-color: var(--glass-border); color: var(--fg-muted); }
.tl-dmy { min-width: 84px; }
.tl-dmy::after { content: ''; }
/* after-call capture pas na vrchu karty */
.callbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.callbar .grow { min-width: 160px; }
@media (min-width: 900px) {
  .pcards > .tlcard { grid-column: 1 / -1; order: 3; }
  .pcards > .filescard { grid-column: 1 / -1; order: 4; }
}
/* Subory karty (R2 prilohy): riadok = nahlad/ikona + nazov + meta, x s dvojtapom */
.filerow { display: flex; align-items: center; gap: 8px; }
.filebtn { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 44px; text-align: left; color: var(--fg); transition: color var(--transition); }
.filebtn:hover { color: var(--magic-light); }
.filebtn .truncate { display: block; max-width: 100%; }
.fthumb { width: 44px; height: 44px; flex: none; border-radius: var(--radius-sm); overflow: hidden; background: rgba(255,255,255,.06); border: 1px solid var(--glass-border); }
.fthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ficon { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 22px; border-radius: var(--radius-sm); background: rgba(255,255,255,.04); border: 1px solid var(--glass-border); }
.x.arm { width: auto; padding: 0 10px; font-size: 12px; color: var(--danger); border: 1px solid var(--danger-border); background: var(--danger-surface); }
/* (A) profilovka vystrihnuta AI zo screenshotu = rovnaky "ai" akcent ako polia */
.avatar.xl.ai { border-color: rgba(167,139,250,.6); box-shadow: 0 0 0 3px rgba(255,196,0,.35); }
/* (B) banner "AI ma navrh" na karte + chip v zozname */
.enrichbar { flex-wrap: wrap; }
.enrichbar .grow { min-width: 140px; }
.aichip { margin-left: 8px; padding: 0 8px; font-size: 11px; color: var(--fire); background: rgba(255,196,0,.1); border-color: rgba(255,196,0,.35); vertical-align: middle; }
/* (C) rychle akcie na socialne siete v karte Kontakt */
.socialq { margin-top: 4px; }
.socialq .btn.xs { padding: 6px 12px; min-height: 32px; letter-spacing: .1em; }
.fu-due { text-align: right; flex: none; }
.fu-due[title]:hover { color: var(--fg); }
.fu-date { width: 150px; padding: 6px 10px; min-height: 34px; flex: none; }

/* ---- QR vizitka (#/novy/qr) ---- */
.qrbox { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 60vh; overflow: hidden; background: rgba(0,0,0,.6); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); }
.qrvideo { width: 100%; height: 100%; object-fit: cover; display: block; }
.qrframe { position: absolute; inset: 16%; border: 2px solid rgba(167,139,250,.85); border-radius: var(--radius-md); box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none; }
.qrstate { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--fg-muted); background: rgba(8,6,16,.7); text-align: center; padding: 16px; }
.linkish { color: var(--magic-light); text-decoration: underline; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* ---- NFC vizitka (#/novy/nfc) ---- */
.nfcbox { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 260px; padding: 32px 20px; text-align: center; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); overflow: hidden; }
.nfcbox.live { border-color: rgba(167,139,250,.5); box-shadow: var(--glow-magic-soft); }
.nfcicon { font-size: 44px; line-height: 1; }
.nfclabel { font-size: 15px; color: var(--fg-muted); }
.nfcwave { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(167,139,250,.5); opacity: 0; }
.nfcbox.live .nfcwave { animation: nfcping 1.8s ease-out infinite; }
@keyframes nfcping { 0% { transform: scale(.5); opacity: .7; } 100% { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .nfcbox.live .nfcwave { animation: none; opacity: .35; } }

/* male kolieska s tvarou v riadku vztahu */
.avatar.xs { width: 22px; height: 22px; font-size: 9px; display: inline-flex; vertical-align: middle; margin-right: 6px; }
.avatar.xs i { font-style: normal; }
.relbtn .avatar.xs { flex: none; }
