/* =====================================================================
   Messenger – vizuálna vrstva
   Mobil je prvoradý. Výška sa riadi premennou --app-h, ktorú nastavuje
   JavaScript z visualViewport, takže klávesnica nikdy neprekryje pole
   na písanie ani poslednú správu.
   ===================================================================== */

/* ------------------------------------------------------------- tokeny */
:root {
  color-scheme: dark;

  --bg:          #0B0C0E;
  --surface:     #18191A;
  --surface-2:   #242526;
  --surface-3:   #3A3B3C;
  --line:        #2A2C2E;

  --text:        #E4E6EB;
  --text-2:      #B0B3B8;
  /* Zosvetlené kvôli kontrastu — pôvodná hodnota nespĺňala WCAG AA. */
  --muted:       #9BA0A6;

  --blue:        #0A7CFF;
  --blue-2:      #0668E0;
  --bubble-in:   #303233;
  --bubble-out:  linear-gradient(160deg, #00B2FF 0%, #0A7CFF 55%, #0A5BE0 100%);
  --bubble-out-text: #FFFFFF;
  --danger:      #FF5A5F;
  --burn:        #F5A623;
  --online:      #31D158;

  --r-bubble:    19px;
  --r-tight:     5px;
  --r-card:      14px;

  --f-ui:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --app-h: 100dvh;
  /* O koľko je viditeľná plocha odsunutá pod vrch stránky (klávesnica na iOS). */
  --app-top: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --header-h: 56px;
  --nav-h: 58px;
}

html[data-bs-theme="light"] {
  color-scheme: light;
  --bg:        #FFFFFF;
  --surface:   #FFFFFF;
  --surface-2: #F0F2F5;
  --surface-3: #E4E6EB;
  --line:      #E4E6EB;
  --text:      #050505;
  --text-2:    #5A5D62;
  --muted:     #6B7076;
  --bubble-in: #F0F0F0;
}

/* ------------------------------------------------------------- základ */
* { -webkit-tap-highlight-color: transparent; }
*, *::before, *::after { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Obrazovka chatu má vlastné vnútorné posúvanie, stránka sa hýbať nesmie. */
body.locked {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

/* Podstránky sa posúvajú normálne. Zamykal som predtým aj html, takže sa
   profil ani nastavenia nedali odscrollovať. */
body.scrollable {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--blue); text-decoration: none; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }

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

.hidden { display: none !important; }

/* Pruh sa zobrazí len vtedy, keď sa nenačíta JavaScript – core.js ho pri
   štarte odstráni. Tichá porucha sa tak zmení na zrozumiteľnú hlášku. */
.js-warn {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2000;
  background: var(--burn); color: #1A1200;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
  font-size: 13.5px; text-align: center; line-height: 1.4;
}
.js-warn b { color: #1A1200; }

/* ------------------------------------------------------- ikonové tlačidlá */
.ibtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--text); flex: none;
  transition: background .15s;
}
.ibtn:active { background: var(--surface-3); }
@media (hover: hover) { .ibtn:hover { background: var(--surface-2); } }
.ibtn--blue { color: var(--blue); }
.ibtn svg { width: 24px; height: 24px; display: block; }

/* ============================================================= APP SHELL */
.app {
  display: flex;
  height: var(--app-h);
  width: 100%;
  overflow: hidden;
}

/**
 * Obrazovka chatu pri vysunutej klávesnici.
 *
 * iOS pri otvorení klávesnice zmenší viditeľnú plochu a posunie ju nadol,
 * ale rozloženie stránky o tom nevie. Obal aplikácie preto zostával prilepený
 * k pôvodnému vrchu a pole na písanie vyskočilo úplne hore.
 *
 * Riešenie: obal je pevne ukotvený a posunieme ho presne o toľko, o koľko
 * je viditeľná plocha odsunutá. Hodnotu nastavuje syncHeight() v core.js.
 */
body.locked .app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-h);
  transform: translateY(var(--app-top, 0px));
  /* Bez tohto iOS pri každej zmene prekresľuje celú vrstvu a poskakuje to. */
  will-change: transform;
}

/* Rovnaký posun potrebuje aj to, čo leží nad aplikáciou. */
body.locked .callbox,
body.locked .viewer {
  transform: translateY(var(--app-top, 0px));
  height: var(--app-h);
  bottom: auto;
}

/* =============================================================== AVATAR */
.av {
  position: relative; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-3) center/cover no-repeat;
  display: grid; place-items: center;
  font-weight: 600; font-size: 15px; color: var(--text);
  overflow: visible;
}
.av span { pointer-events: none; }
.av.has-img span { display: none; }
.av--lg { width: 56px; height: 56px; font-size: 20px; }
.av--xl { width: 96px; height: 96px; font-size: 34px; }
.av--sm { width: 28px; height: 28px; font-size: 12px; }
.av.online::after {
  content: ''; position: absolute; right: -1px; bottom: -1px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--online); border: 2.5px solid var(--surface);
}
.av--lg.online::after { width: 15px; height: 15px; }

/* ============================================================ ZOZNAM CHATOV */
.pane-list {
  display: flex; flex-direction: column;
  width: 100%; min-width: 0; height: 100%;
  background: var(--surface);
}

.lhead {
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-t)) 12px 8px;
  flex: none;
}
.lhead__title {
  font-size: 25px; font-weight: 700; letter-spacing: -.02em;
  flex: 1; margin: 0;
}

.search {
  padding: 4px 12px 10px; flex: none;
}
.search input {
  width: 100%; height: 40px;
  background: var(--surface-2); border: none; border-radius: 20px;
  padding: 0 16px 0 40px; font-size: 16px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8D91' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; background-size: 18px;
}
.search input:focus { outline: none; box-shadow: 0 0 0 2px var(--blue) inset; }

/* Záložky potrebujú vzduch nad sebou aj pod sebou — nad nimi je čiara
   od pásu s príspevkami, pod nimi hneď prvá konverzácia. */
.tabs {
  display: flex; gap: 8px; flex: none;
  padding: 14px 12px 6px;
  margin-bottom: 10px;
  /* Pri šiestich záložkách sa na telefóne nezmestia vedľa seba —
     namiesto lámania sa pás posúva do strán. */
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; white-space: nowrap; }
.tab {
  padding: 7px 14px; border-radius: 18px; font-size: 14px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2);
}
.tab.on { background: rgba(10,124,255,.16); color: var(--blue); }

.install-bar {
  display: flex; align-items: center; gap: 11px;
  margin: 0 12px 10px; padding: 11px 12px;
  background: linear-gradient(140deg, rgba(0,178,255,.16), rgba(10,124,255,.10));
  border: 1px solid rgba(10,124,255,.35); border-radius: 13px;
  flex: none;
}
.install-bar__ico {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--blue); color: #fff; display: grid; place-items: center;
}
.install-bar__t { flex: 1; min-width: 0; line-height: 1.3; }
.install-bar__t b { display: block; font-size: 14.5px; font-weight: 600; }
.install-bar__t small { font-size: 12px; color: var(--text-2); }

.clist { flex: 1; overflow-y: auto; padding: 0 8px calc(12px + var(--safe-b)); -webkit-overflow-scrolling: touch; }

.crow {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 8px; border-radius: 12px; text-align: left;
}
.crow:active { background: var(--surface-2); }
@media (hover: hover) { .crow:hover { background: var(--surface-2); } }
.crow.on { background: var(--surface-2); }
.crow__mid { flex: 1; min-width: 0; }
.crow__name {
  font-size: 16px; font-weight: 500; margin-bottom: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crow__sub {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px; color: var(--text-2);
}
.crow__prev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.crow__time::before { content: '·'; margin-right: 5px; }
.crow__time { flex: none; }
.crow.unread .crow__name { font-weight: 700; }
.crow.unread .crow__sub { color: var(--text); font-weight: 600; }
.crow__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); flex: none; }
.crow__mute { flex: none; color: var(--muted); display: inline-flex; }
.crow__mute svg { width: 16px; height: 16px; }

.empty { padding: 48px 24px; text-align: center; color: var(--muted); font-size: 15px; }

/* nájdené správy pri hľadaní v bočnom paneli */
.globalhits {
  flex: none; max-height: 40%; overflow-y: auto;
  margin: 0 12px 8px; padding: 4px;
  background: var(--surface-2); border-radius: 12px;
}
.globalhits__none {
  padding: 18px 14px; text-align: center;
  color: var(--muted); font-size: 13.5px;
}
.globalhits__n {
  font-size: 11px; font-weight: 700; color: var(--muted);
  padding: 1px 7px; border-radius: 9px; background: var(--surface-2);
}
.globalhits__t {
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-2); padding: 8px 10px 4px;
}

/* --------------------------------------------------------- spodná navigácia */
.nav {
  display: flex; flex: none;
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
  background: var(--surface);
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px; color: var(--text-2); font-size: 11px; font-weight: 500;
  position: relative;
}
.nav a.on { color: var(--blue); }
.nav a svg { width: 25px; height: 25px; }
.nav__badge {
  position: absolute; top: 4px; left: 50%; margin-left: 4px;
  min-width: 17px; height: 17px; padding: 0 5px;
  background: var(--danger); color: #fff; border-radius: 9px;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* ================================================================= CHAT */
.pane-chat {
  display: none; flex-direction: column;
  width: 100%; min-width: 0; height: 100%;
  background: var(--bg);
}
.app.chat-open .pane-list { display: none; }
.app.chat-open .pane-chat { display: flex; }

.chead {
  display: flex; align-items: center; gap: 8px; flex: none;
  height: calc(var(--header-h) + var(--safe-t));
  padding: var(--safe-t) 6px 0 4px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.chead__mid { flex: 1; min-width: 0; line-height: 1.2; }
.chead__name {
  font-size: 16px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chead__sub { font-size: 12px; color: var(--text-2); }
.chead__sub.online { color: var(--online); }

/* ------------------------------------------------- hľadanie v konverzácii */
.findbar {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.findbar input {
  flex: 1; height: 38px; min-width: 0;
  background: var(--surface-2); border: none; border-radius: 19px;
  padding: 0 15px; font-size: 15px;
}
.findbar input:focus { outline: none; box-shadow: 0 0 0 2px var(--blue) inset; }
.findbar__count { font-size: 13px; color: var(--text-2); flex: none; }

.findres {
  flex: none; max-height: 45%; overflow-y: auto;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 4px 8px 8px;
}
.findres__item {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 11px;
}
.findres__item:active { background: var(--surface-2); }
@media (hover: hover) { .findres__item:hover { background: var(--surface-2); } }
.findres__top { display: flex; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 2px; }
.findres__top b { color: var(--text); font-weight: 600; }
.findres__txt { font-size: 14.5px; line-height: 1.4; }
.findres__txt mark { background: rgba(10,124,255,.35); color: inherit; border-radius: 3px; padding: 0 2px; }

/* zvýraznenie správy, na ktorú sme skočili */
@keyframes flash {
  0%, 100% { background: transparent; }
  25%, 75% { background: rgba(10,124,255,.22); }
}
.m.flash .bub { animation: flash 1.6s ease-in-out; }

/* --------------------------------------------------------------- správy */
.scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 12px 10px 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.older {
  display: block; margin: 4px auto 14px; padding: 7px 16px;
  background: var(--surface-2); border-radius: 18px;
  font-size: 13px; color: var(--text-2);
}

.daysep { text-align: center; margin: 18px 0 12px; }
.daysep span { font-size: 12px; font-weight: 600; color: var(--muted); }

.sys { text-align: center; margin: 14px 0; font-size: 12.5px; color: var(--muted); }

/* Riadok správy */
.m { display: flex; align-items: flex-end; gap: 6px; margin-top: 2px; position: relative; }
.m.out { flex-direction: row-reverse; }
.m .av { align-self: flex-end; margin-bottom: 2px; }
.m__pad { width: 28px; flex: none; }
.m__col { display: flex; flex-direction: column; max-width: 76%; min-width: 0; }
.m.out .m__col { align-items: flex-end; }
.m__author { font-size: 11.5px; color: var(--muted); margin: 8px 0 2px 12px; }

/* Bubliny, vrátane zoskupovania ako v Messengeri */
/* Označenie šifrovanej konverzácie v hlavičke. */
.encbadge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 7px; padding: 1px 7px 1px 5px; border-radius: 9px;
  background: rgba(49,209,88,.16); color: var(--green);
  font-size: 11px; font-weight: 700; vertical-align: middle;
}

/* Správa, ktorú sa zatiaľ nepodarilo odomknúť. */
.msg-text--locked {
  display: inline-flex; align-items: center; gap: 5px;
  opacity: .75; font-style: italic;
}

.alert--warn {
  background: rgba(255,176,32,.12);
  border-left: 3px solid var(--burn);
  padding: 12px 14px; border-radius: 0 9px 9px 0;
  font-size: 13.5px; line-height: 1.5;
}

/* Pruh o automatickom mazaní nad správami. */
.autodel {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  flex: none; padding: 7px 12px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 12.5px;
}
.autodel svg { opacity: .8; }

/* Zabalená dôverná správa. Obsah sa skryje, kým ho príjemca neodbalí. */
.bub--sealed { position: relative; min-width: 190px; min-height: 78px; }
.bub--sealed > *:not(.seal) { visibility: hidden; }

.seal {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; padding: 12px;
  border-radius: inherit; cursor: pointer;
  background: linear-gradient(140deg, #3A2E12, #201A0C);
  color: var(--burn);
  transition: transform .24s cubic-bezier(.34,1.4,.6,1), opacity .24s;
}
.m.out .seal { background: linear-gradient(140deg, #2A3550, #172033); }
.seal__t { font-size: 13px; font-weight: 700; }
.seal__h { font-size: 11px; color: #9AA5B0; }
.seal--open { transform: scale(1.06) rotate(-2deg); opacity: 0; }

/* Krátke zasvietenie po odbalení, aby bolo jasné, čo sa práve otvorilo. */
@keyframes bubReveal {
  from { transform: scale(.94); opacity: .3; }
  to   { transform: scale(1); opacity: 1; }
}
.bub--reveal { animation: bubReveal .35s ease-out; }

/* Vysvetlivka, prečo sa šifrované správy neotvárajú. */
.autodel--warn {
  background: rgba(255,176,32,.16); color: var(--burn);
  text-align: left; line-height: 1.45;
}

/* Označenie dôvernej správy. */
.bub--priv { box-shadow: 0 0 0 1.5px var(--burn) inset; }
.bub__priv {
  display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: 5px; padding: 2px 8px 2px 6px; border-radius: 9px;
  background: rgba(255,176,32,.16); color: var(--burn);
  font-size: 11.5px; font-weight: 700;
}
.m.out .bub__priv { background: rgba(255,255,255,.22); color: #fff; }
#privBar .bar { background: var(--burn); }

/* Ikona, ktorá sa objaví pri potiahnutí správy nabok. */
.swipe-reply {
  position: absolute; top: 50%; margin-top: -14px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
  opacity: 0; pointer-events: none;
  transition: background .15s, color .15s;
}
.swipe-reply.in { left: 6px; }
.swipe-reply.out { right: 6px; }
.swipe-reply.ready { background: var(--blue); color: #fff; }

.m { position: relative; }

/* Dlhé podržanie nesmie označiť text ani vyvolať systémovú ponuku. */
.bub {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  position: relative;
  background: var(--bubble-in);
  color: var(--text);
  border-radius: var(--r-bubble);
  padding: 8px 13px;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  max-width: 100%;
}
.m.out .bub { background: var(--bubble-out); color: var(--bubble-out-text, #fff); }

.m.grp-top.in    .bub { border-bottom-left-radius: var(--r-tight); }
.m.grp-mid.in    .bub { border-top-left-radius: var(--r-tight); border-bottom-left-radius: var(--r-tight); }
.m.grp-bot.in    .bub { border-top-left-radius: var(--r-tight); }
.m.grp-top.out   .bub { border-bottom-right-radius: var(--r-tight); }
.m.grp-mid.out   .bub { border-top-right-radius: var(--r-tight); border-bottom-right-radius: var(--r-tight); }
.m.grp-bot.out   .bub { border-top-right-radius: var(--r-tight); }

.bub--media { padding: 0; overflow: hidden; background: transparent; }
.m.out .bub--media { background: transparent; }
.bub--gone {
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); font-style: italic; font-size: 14.5px;
}
.m.out .bub--gone { background: transparent; color: var(--muted); }

/* Odkazy v správach */
.msg-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  word-break: break-all;
  -webkit-user-select: text; user-select: text;
}
.m.in .msg-link { color: #7FC4FF; }
.m.out .msg-link { color: #EAF4FF; }
.msg-link:active { opacity: .7; }

.bub__reply {
  margin: -2px -5px 6px; padding: 6px 10px;
  background: rgba(255,255,255,.12); border-radius: 12px;
  font-size: 13.5px; opacity: .9;
}
.m.in .bub__reply { background: rgba(255,255,255,.07); }
html[data-bs-theme="light"] .m.in .bub__reply { background: rgba(0,0,0,.06); }
.bub__reply b { display: block; font-size: 12px; font-weight: 600; margin-bottom: 1px; }

/* Citovaná príloha s náhľadom. */
.bub__reply.has-thumb { display: flex; align-items: center; gap: 8px; }
.bub__reply-img {
  width: 38px; height: 38px; flex: none;
  border-radius: 7px; object-fit: cover; display: block;
  background: var(--surface-3);
}
.bub__reply-ico {
  width: 38px; height: 38px; flex: none; border-radius: 7px;
  background: var(--surface-3); display: grid; place-items: center;
  color: var(--text-2);
}
.bub__reply-txt { min-width: 0; flex: 1; }
.bub__reply { cursor: pointer; }
.bub__reply:active { opacity: .75; }

/* Náhľad v pruhu nad polom na písanie. */
.reply-thumb {
  width: 34px; height: 34px; flex: none;
  border-radius: 7px; object-fit: cover;
  background: var(--surface-3);
}

.m__meta { font-size: 11px; color: var(--muted); margin: 3px 6px 6px; }
.m__meta .seen { color: var(--blue); }

/* --------------------------------------------------- prílohy v bubline */
/* Fotka si drží vlastný pomer strán. object-fit: cover ju predtým orezával
   a v kombinácii s pevnou šírkou pôsobila natiahnuto. */
.mm-img {
  display: block;
  width: auto; height: auto;
  max-width: min(260px, 100%);
  max-height: 340px;
  object-fit: contain;
  border-radius: var(--r-bubble);
  background: var(--surface-2);
  cursor: zoom-in;
}
.mm-video { display: block; width: 100%; max-width: 280px; border-radius: var(--r-bubble); background: #000; }
.mm-cap {
  margin-top: 4px; padding: 8px 13px;
  background: var(--bubble-in); border-radius: var(--r-bubble); font-size: 16px;
}
.m.out .mm-cap { background: var(--bubble-out); color: var(--bubble-out-text, #fff); }

.mm-voice {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; min-width: 210px; max-width: 280px;
  background: var(--bubble-in); border-radius: var(--r-bubble);
}
.m.out .mm-voice { background: var(--bubble-out); }
.mm-voice audio { display: none; }

/* Prehrávanie hlasovky s vlnovkou. */
.voice { display: flex; align-items: center; gap: 10px; width: 100%; }
.voice__p {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text);
  font-size: 14px;
}
.m.out .voice__p { background: rgba(255,255,255,.22); color: #fff; }

.voice__w {
  flex: 1; min-width: 0; height: 30px;
  display: flex; align-items: center; gap: 2px;
  cursor: pointer;
}
.voice__b {
  flex: 1; border-radius: 2px; min-height: 3px;
  background: var(--text-2); opacity: .35;
  transition: opacity .12s, background .12s;
}
.voice__b.on { opacity: 1; background: var(--blue); }
.m.out .voice__b { background: #fff; }
.m.out .voice__b.on { background: #fff; opacity: 1; }

.voice__t {
  flex: none; font-size: 11.5px; color: var(--text-2);
  font-variant-numeric: tabular-nums; min-width: 34px; text-align: right;
}
.m.out .voice__t { color: rgba(255,255,255,.8); }

.mm-file {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; min-width: 200px; max-width: 280px;
  background: var(--bubble-in); border-radius: var(--r-bubble); color: var(--text);
}
.m.out .mm-file { background: var(--bubble-out); color: var(--bubble-out-text, #fff); }
.mm-file__ico {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: rgba(255,255,255,.15); display: grid; place-items: center;
}
.mm-file__ico svg { width: 20px; height: 20px; }
.mm-file__n { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-file__s { font-size: 12px; opacity: .75; }

/* Príloha s limitom zobrazení – jantár nesie význam „toto zmizne“ */
.mm-lock {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 16px 13px 13px; min-width: 220px; max-width: 280px;
  border-radius: var(--r-bubble); text-align: left;
  background: rgba(245,166,35,.13);
  border: 1px solid rgba(245,166,35,.42);
  color: var(--text);
}
.mm-lock.dead { opacity: .55; border-style: dashed; cursor: default; }
.mm-lock__ring {
  --pct: 100;
  width: 46px; height: 46px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--burn) calc(var(--pct) * 1%), rgba(245,166,35,.2) 0);
}
.mm-lock__ring::after {
  content: attr(data-left); position: absolute; inset: 4px;
  background: var(--bg); border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700; color: var(--burn);
}
.mm-lock__t { font-size: 15px; font-weight: 600; }
.mm-lock__s { font-size: 12.5px; color: var(--burn); }
/* Vyčerpaný limit — text stráca výstražnú farbu, už niet čo strážiť. */
.mm-lock__s--dead { color: var(--muted); }

/* Príloha a tlačidlo uloženia vedľa seba. */
/* Náhľady príloh pripravených na odoslanie. */
.files { display: flex; gap: 5px; flex: none; align-items: center; }
.files__i {
  position: relative; width: 40px; height: 40px; flex: none;
  border-radius: 8px; overflow: hidden; background: var(--surface-3);
  display: grid; place-items: center;
}
.files__i img { width: 100%; height: 100%; object-fit: cover; display: block; }
.files__i--icon { color: var(--text-2); }
.files__x {
  position: absolute; top: 0; right: 0;
  width: 17px; height: 17px; border-radius: 0 8px 0 8px;
  background: rgba(0,0,0,.62); color: #fff;
  font-size: 13px; line-height: 15px; text-align: center;
  cursor: pointer;
}
.files__more {
  flex: none; padding: 2px 8px; border-radius: 10px;
  background: var(--surface-3); color: var(--text-2);
  font-size: 12px; font-weight: 700;
}

.mm-wrap { display: flex; align-items: flex-start; gap: 6px; }
.m.out .mm-wrap { flex-direction: row-reverse; }

.mm-save {
  flex: none; align-self: flex-end; margin-bottom: 4px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2);
}
.mm-save svg { width: 16px; height: 16px; }
.mm-save.on { border-color: var(--green); color: var(--green); background: rgba(49,209,88,.16); }
.mm-save:active { opacity: .65; }
@media (hover: hover) { .mm-save:hover { background: var(--surface-3); } }

/* Poznámka odosielateľovi, že si jeho miznúcu prílohu niekto uložil. */
.saved-note {
  font-size: 11.5px; color: var(--green);
  margin: 3px 6px 0;
}
.mm-lock.dead .mm-lock__s { color: var(--muted); }

.views-note {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--burn); margin: 3px 6px 0;
}

/* ------------------------------------------------------------- reakcie */
.rx {
  display: flex; gap: 3px; align-items: center;
  background: var(--surface-2); border: 2px solid var(--bg);
  border-radius: 14px; padding: 1px 6px 1px 4px;
  font-size: 13px; line-height: 1.6;
  margin: -12px 8px 2px; align-self: flex-start; position: relative; z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.m.out .rx { align-self: flex-end; }
.rx b { font-size: 11.5px; font-weight: 600; color: var(--text-2); }

/* Panel s emoji, ako keď v Messengeri podržíš správu */
.rxbar {
  position: fixed; z-index: 1620;
  display: flex; gap: 2px; padding: 6px;
  background: var(--surface-2); border-radius: 26px;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  animation: rxpop .16s cubic-bezier(.2,1.3,.5,1);
}
@keyframes rxpop { from { transform: scale(.7); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.rxbar button {
  width: 42px; height: 42px; border-radius: 50%;
  font-size: 26px; line-height: 1; display: grid; place-items: center;
  transition: transform .12s;
}
.rxbar button:active { transform: scale(1.35); }
@media (hover: hover) { .rxbar button:hover { transform: scale(1.28); } }
.rxbar button.on { background: rgba(10,124,255,.25); }

.rxveil { position: fixed; inset: 0; z-index: 1610; background: rgba(0,0,0,.4); }

/* Kontextové menu správy */
.mmenu {
  position: fixed; z-index: 1620; min-width: 190px;
  background: var(--surface-2); border-radius: 14px; padding: 6px;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
}
.mmenu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border-radius: 9px; font-size: 15px; text-align: left;
}
.mmenu button:active { background: var(--surface-3); }
@media (hover: hover) { .mmenu button:hover { background: var(--surface-3); } }
.mmenu button.danger { color: var(--danger); }
.mmenu svg { width: 19px; height: 19px; flex: none; }

/* ------------------------------------------------------------- píše… */
.typing { display: flex; align-items: center; gap: 7px; padding: 6px 12px 12px; }
.typing__b { display: flex; gap: 4px; background: var(--bubble-in); border-radius: 18px; padding: 11px 14px; }
.typing__b i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: tb 1.3s infinite; }
.typing__b i:nth-child(2) { animation-delay: .18s; }
.typing__b i:nth-child(3) { animation-delay: .36s; }
@keyframes tb { 0%,60%,100% { opacity: .35; transform: none } 30% { opacity: 1; transform: translateY(-4px) } }

/* ============================================================ COMPOSER */
.comp {
  flex: none; background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 7px 8px calc(7px + var(--safe-b));
}

.comp__strip {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border-radius: 12px;
  padding: 7px 10px; margin-bottom: 7px; font-size: 13.5px;
}
.comp__strip .bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--blue); flex: none; }
.comp__strip.burn .bar { background: var(--burn); }
.comp__strip .txt { flex: 1; min-width: 0; }
.comp__strip .txt b { display: block; font-size: 12px; color: var(--blue); }
.comp__strip.burn .txt b { color: var(--burn); }
.comp__strip .sm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.comp__thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }

.comp__row { display: flex; align-items: flex-end; gap: 2px; }
.comp__tools { display: flex; align-items: center; }
.comp__field {
  flex: 1; display: flex; align-items: flex-end; gap: 6px; min-width: 0;
  background: var(--surface-2); border-radius: 20px; padding: 3px 6px 3px 14px;
}
.comp__field textarea {
  flex: 1; min-width: 0; resize: none; border: none; background: none;
  font-size: 16px; line-height: 1.35; padding: 8px 0; max-height: 120px;
  /* Výšku riadi autoGrow(), posúvač je preto zbytočný. Pri dlhšom texte
     sa obsah posúva, ale lišta sa nekreslí — v bubline pôsobí rušivo. */
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.comp__field textarea::-webkit-scrollbar { width: 0; height: 0; display: none; }
.comp__field textarea:focus { outline: none; }
.comp__field textarea::placeholder { color: var(--muted); }

.views-btn {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; align-self: flex-end; margin-bottom: 3px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  border: 1.5px dashed var(--surface-3);
}
.views-btn.on { color: var(--burn); border-style: solid; border-color: var(--burn); background: rgba(245,166,35,.14); }

.send { color: var(--blue); }
.send[disabled] { color: var(--muted); opacity: .5; }

/* ---------------------------------------------- priebeh nahrávania */
.upl {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px 4px;
}
.upl__cloud { width: 52px; height: 34px; flex: none; }
.upl__cloud svg { width: 100%; height: 100%; overflow: visible; }
.upl__outline {
  fill: var(--surface-2);
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linejoin: round;
}
.upl__fill { fill: var(--blue); transition: y .35s ease-out; }
.upl__txt { flex: 1; min-width: 0; line-height: 1.3; }
.upl__txt b {
  display: block; font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upl__txt small { font-size: 12.5px; color: var(--text-2); }

/* jemné pulzovanie, kým sa čaká na server */
.upl.working .upl__outline { animation: uplPulse 1.6s ease-in-out infinite; }
@keyframes uplPulse {
  0%, 100% { stroke-opacity: 1; }
  50%      { stroke-opacity: .45; }
}

.rec {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px 2px; font-size: 15px;
}
.rec__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--danger); animation: rp 1.1s infinite; }
@keyframes rp { 0%,100% { opacity: 1 } 50% { opacity: .2 } }
.rec__t { font-variant-numeric: tabular-nums; flex: 1; }
.btn-sm { padding: 7px 15px; border-radius: 18px; font-size: 14px; font-weight: 600; background: var(--surface-2); }
.btn-sm.blue { background: var(--blue); color: #fff; }
.btn-sm.green { background: var(--green); color: #04240F; }
.btn-sm.red { background: var(--danger); color: #fff; }
.btn-sm:disabled { opacity: .5; }

/* Na tmavom podklade musí byť malé tlačidlo vidieť aj bez variantu. */
.story .btn-sm,
.callbox .btn-sm,
.viewer .btn-sm {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.story .btn-sm.red,
.callbox .btn-sm.red { background: var(--danger); color: #fff; }
.story .btn-sm.green { background: var(--green); color: #04240F; }

/* ============================================================ HÁRKY / MODÁLY */
.sheet-veil {
  /* Nad prehliadačom príspevkov, hovorom aj prehliadačom príloh —
     hárok je vždy to, s čím človek práve pracuje. */
  position: fixed; inset: 0; z-index: 1600;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 520px;
  background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 8px 0 calc(10px + var(--safe-b));
  max-height: 88%; display: flex; flex-direction: column;
  animation: up .22s cubic-bezier(.2,.9,.3,1);
}
@keyframes up { from { transform: translateY(100%) } to { transform: none } }
.sheet__grab { width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 6px auto 10px; flex: none; }
.sheet__title { font-size: 18px; font-weight: 700; padding: 0 18px 10px; flex: none; }
.sheet__body { overflow-y: auto; padding: 0 10px; }
.sheet__item {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 13px 12px; border-radius: 11px; font-size: 16px; text-align: left;
}
.sheet__item:active { background: var(--surface-2); }
@media (hover: hover) { .sheet__item:hover { background: var(--surface-2); } }
.sheet__item.danger { color: var(--danger); }
.sheet__item svg { width: 22px; height: 22px; flex: none; color: var(--text-2); }
.sheet__item.danger svg { color: var(--danger); }
.sheet__hint { padding: 4px 18px 10px; font-size: 13px; color: var(--muted); }

@media (min-width: 861px) {
  .sheet-veil { align-items: center; }
  .sheet { border-radius: 16px; max-width: 460px; animation: none; }
}

/* Prehliadač príloh */
/* Prehliadač je vždy na tmavom pozadí, preto sú ovládacie prvky biele
   bez ohľadu na zvolenú tému. Vo svetlom režime predtým splývali. */
.viewer {
  position: fixed; inset: 0; z-index: 1400;
  background: rgba(0,0,0,.94);
  display: flex; flex-direction: column;
  color: #FFFFFF;
}
.viewer .ibtn { color: #FFFFFF; }
.viewer .ibtn:active { background: rgba(255,255,255,.16); }
@media (hover: hover) { .viewer .ibtn:hover { background: rgba(255,255,255,.14); } }
.viewer .btn { background: rgba(255,255,255,.16); color: #FFFFFF; }
.viewer .btn--blue { background: var(--blue); color: #FFFFFF; }
.viewer__top {
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-t)) 10px 8px; color: #fff; flex: none;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
}
.viewer__meta { flex: 1; font-size: 13.5px; color: #FFC565; }
.viewer__body { flex: 1; min-height: 0; display: grid; place-items: center; padding: 10px; }
.viewer__body img, .viewer__body video { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* Používateľské riadky vo vyhľadávaní */
.urow { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 11px; }
.urow:active { background: var(--surface-2); }
.urow__m { flex: 1; min-width: 0; }
.urow__n { font-size: 16px; font-weight: 500; }
.urow__s { font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow .btn-sm { flex: none; }

/* --------------------------------------------------------- hlasový hovor */
/* Obrazovka hovoru je vždy tmavá, aj vo svetlej téme — preto má vlastné
   farby textu a neriadi sa premennými, ktoré by v svetlom režime splynuli. */
/* ==================================================================
   Obrazovka hovoru

   Obraz je hlavný a vypĺňa celú plochu; ovládanie na ňom len leží.
   Klepnutím do obrazu sa dá schovať, aby nič neprekážalo.
   ================================================================== */
.callbox {
  position: fixed; inset: 0; z-index: 1450;
  background: radial-gradient(120% 90% at 50% 0%, #1B3350 0%, #0A0B0D 70%);
  color: #F2F5F7;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* Obraz druhej strany. */
.callbox__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000; z-index: 0;
}

/* Vlastný náhľad — malý, zaoblený, dá sa chytiť a presunúť. */
.callbox__self {
  position: absolute; z-index: 4;
  right: 14px; top: calc(76px + var(--safe-t));
  width: clamp(96px, 26vw, 132px); aspect-ratio: 3 / 4;
  object-fit: cover; border-radius: 18px;
  background: #11141A;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
  border: 2px solid rgba(255,255,255,.18);
  transform: scaleX(-1);
  cursor: grab; touch-action: none;
}
.callbox__self.dragging { cursor: grabbing; border-color: rgba(255,255,255,.4); }

/* Horný pruh: meno, stav, čas. */
.callbox__top {
  position: relative; z-index: 3; flex: none;
  display: flex; align-items: flex-start; gap: 12px;
  padding: calc(12px + var(--safe-t)) 14px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.6), transparent);
  transition: opacity .2s;
}
.callbox__min {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.14);
  transform: rotate(-90deg);
}
.callbox__head { flex: 1; min-width: 0; text-align: center; }
.callbox__name {
  font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0,0,0,.7);
}
.callbox__state { font-size: 13px; color: #C3CCD6; margin-top: 2px; }
.callbox__time {
  font-size: 13px; color: #fff; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Stred: avatar pri hlasovom hovore, dlaždice pri skupine. */
.callbox__inner {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px;
  padding: 0 20px; min-height: 0; text-align: center;
}
.callbox .av { color: #fff; }
.callbox__hint {
  font-size: 12px; color: #8B96A1; max-width: 260px; line-height: 1.5;
}

/* Spodné ovládanie — plávajúci pruh s okrúhlymi tlačidlami. */
.callbox__dock {
  position: relative; z-index: 3; flex: none;
  margin: 0 auto calc(18px + var(--safe-b));
  padding: 12px 16px; border-radius: 34px;
  background: rgba(22,26,32,.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; gap: clamp(10px, 4vw, 20px);
  box-shadow: 0 10px 34px rgba(0,0,0,.45);
  transition: opacity .2s, transform .2s;
}
.callbox__row { display: contents; }

/* Skryté ovládanie po klepnutí do obrazu. */
.callbox--bare .callbox__top,
.callbox--bare .callbox__dock { opacity: 0; pointer-events: none; }

/* Okrúhle tlačidlo. */
.callbtn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: #E8EDF2; font-size: 10.5px; font-weight: 500;
  min-width: 52px;
}
.callbtn svg { width: 23px; height: 23px; }
.callbtn > :first-child {
  width: clamp(46px, 13vw, 56px); height: clamp(46px, 13vw, 56px);
  border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.16);
  transition: transform .12s, background .15s;
}
.callbtn:active > :first-child { transform: scale(.9); }
.callbtn--green > :first-child { background: var(--online); color: #04240F; }
.callbtn--red > :first-child { background: var(--danger); }
.callbtn--grey > :first-child { background: rgba(255,255,255,.16); }
.callbtn--grey.on > :first-child { background: #fff; color: #12161B; }

/* Prichádzajúci hovor: prijať a odmietnuť ďaleko od seba. */
.callbox--incoming .callbox__dock { gap: clamp(40px, 22vw, 90px); }

/* Dlaždice účastníkov skupinového hovoru. */
.ctiles {
  display: grid; gap: 10px; width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  max-height: 52vh; overflow-y: auto;
}
.ctile {
  text-align: center; padding: 12px 6px;
  background: rgba(255,255,255,.07); border-radius: 16px;
  border: 2px solid transparent;
}
.ctile.on { border-color: var(--online); background: rgba(49,209,88,.12); }
.ctile .av { margin: 0 auto 8px; }
.ctile__n {
  font-size: 13px; font-weight: 600; color: #F2F5F7;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctile__s { font-size: 11.5px; color: #9AA5B0; margin-top: 2px; }

.callbox--group .callbox__name { font-size: 19px; }

/* Tlačidiel je pri videohovore päť — pevná medzera by ich vytlačila
   mimo obrazovku, preto sa prispôsobujú šírke. */
.callbox__row {
  display: flex; justify-content: center; align-items: flex-start;
  gap: clamp(8px, 4vw, 30px);
  margin-top: 36px; flex-wrap: wrap;
  max-width: 100%;
}
.callbox__row .callbtn { flex: 0 0 auto; }

.callbtn {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  color: #E8EDF2; font-size: 13px; font-weight: 500;
}
.callbtn svg { width: 26px; height: 26px; }
.callbtn > :first-child {
  /* Krúžok sa prispôsobí šírke — pri piatich tlačidlách vedľa seba
     by pevných 66 px pretieklo cez okraj telefónu. */
  width: clamp(48px, 14vw, 66px);
  height: clamp(48px, 14vw, 66px);
  border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  transition: transform .12s;
}
.callbtn:active > :first-child { transform: scale(.92); }
.callbtn--green > :first-child { background: var(--online); color: #04240F; }
.callbtn--red > :first-child { background: var(--danger); }
.callbtn--grey > :first-child { background: rgba(255,255,255,.18); color: #FFFFFF; }
.callbtn--grey.on > :first-child { background: var(--blue); }

/* ------------------------------------------------- upozornenia zhora */
.banners {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1470;
  padding: calc(8px + var(--safe-t)) 10px 0;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.banner {
  pointer-events: auto;
  display: flex; align-items: center; gap: 11px; width: 100%;
  max-width: 480px; margin: 0 auto;
  padding: 10px 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  animation: bannerIn .2s cubic-bezier(.2,.9,.3,1);
}
@keyframes bannerIn { from { transform: translateY(-16px); opacity: 0 } to { transform: none; opacity: 1 } }
.banner__m { flex: 1; min-width: 0; }
.banner__t { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner__b { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner__x { flex: none; color: var(--muted); display: inline-flex; padding: 4px; }

/* ------------------------------------------------------ série v zozname */
.streaks { display: inline-flex; gap: 5px; margin-left: 6px; vertical-align: middle; }
.streaks__i {
  font-size: 11.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 9px;
  background: rgba(245,166,35,.16); color: var(--burn);
  white-space: nowrap;
}
.streaks__i.risk { background: rgba(255,90,95,.16); color: var(--danger); }

.chead__sub.here { color: var(--blue); }

/* -------------------------------------------------------------- toasty */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + var(--safe-b)); z-index: 1700;
  width: min(440px, calc(100vw - 28px));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--surface-3); color: var(--text);
  padding: 11px 15px; border-radius: 12px; font-size: 14.5px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  animation: up2 .18s ease-out;
}
.toast.err { background: var(--danger); color: #fff; }
@keyframes up2 { from { transform: translateY(12px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ===================================================== DESKTOP: dva panely */
@media (min-width: 861px) {
  /* Na počítači je spoločná lišta viditeľná, takže s jej výškou musí
     rátať aj rozloženie. Kým bola skrytá, bola tu nula. */
  :root { --nav-h: 58px; }

  .pane-list {
    width: 380px; flex: none;
    border-right: 1px solid var(--line);
  }
  .pane-chat { display: flex; }
  .app.chat-open .pane-list { display: flex; }

  /* Na počítači je lišta hore cez celú šírku, takže tú v paneli skryjeme. */
  .pane-list > .nav { display: none; }
  /**
   * Lišta na počítači nesmie plávať nad obsahom.
   *
   * Kým bola pripnutá naspodok, prekrývala pole na písanie — panel sa
   * síce skrátil, ale lišta ležala nad ním. Zaradíme ju preto do
   * bežného toku pod panel; spolu potom zaberú presne výšku okna.
   */
  .app ~ .nav--fixed {
    display: flex;
    position: static;
    height: 62px;
    flex: none;
  }
  .app { height: calc(var(--app-h) - 62px); }

  /* Obrazovka chatu sa nesmie posúvať, inak pole na písanie spadne pod
     okraj. Podstránky posúvanie potrebujú, preto len trieda locked. */
  body.locked { height: 100%; overflow: hidden; }
  .chead__back { display: none; }

  .m__col { max-width: 66%; }
  .mm-img { max-width: 320px; }
  .mm-video { max-width: 360px; }

  .scroll { padding: 16px 22px 6px; }
  .comp { padding: 10px 16px 14px; }
  .lhead { padding-top: 14px; }

  .chat-empty {
    flex: 1; display: grid; place-items: center; text-align: center; padding: 40px;
  }
  .chat-empty h2 { font-size: 21px; margin: 0 0 6px; }
  .chat-empty p { color: var(--text-2); margin: 0; font-size: 15px; }
}

@media (max-width: 860px) {
  .chat-empty { display: none; }
}

/* ===================================================== PODSTRÁNKY (profil…) */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 14px calc(72px + env(safe-area-inset-bottom, 0px));
}

.phead {
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-t)) 6px 10px;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line);
  max-width: 720px; margin: 0 auto 14px;
}
.phead h1 { font-size: 22px; font-weight: 700; margin: 0; flex: 1; }

.card {
  background: var(--surface); border-radius: var(--r-card);
  padding: 18px; margin-bottom: 14px;
}
.card h2 { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.card__hint { font-size: 13.5px; color: var(--text-2); margin: 0 0 16px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.inp {
  width: 100%; height: 48px; padding: 0 15px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 11px;
  font-size: 16px;
}
textarea.inp { height: auto; padding: 12px 15px; resize: vertical; }
.inp:focus { outline: none; border-color: var(--blue); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 11px;
  font-size: 16px; font-weight: 600; background: var(--surface-2); color: var(--text);
}
.btn--blue { background: var(--blue); color: #fff; }
.btn--danger { color: var(--danger); }
.btn--full { width: 100%; }
.btn[disabled] { opacity: .5; }

.switch { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.switch__t { flex: 1; font-size: 15.5px; }
.switch__t small { display: block; font-size: 12.5px; color: var(--muted); }
.switch input { appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--surface-3); position: relative; flex: none; transition: background .18s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch input:checked { background: var(--blue); }
.switch input:checked::after { transform: translateX(20px); }

.alert { padding: 12px 15px; border-radius: 11px; font-size: 14.5px; margin-bottom: 14px; }
.alert--ok { background: rgba(49,209,88,.16); color: #7BE59B; }
.alert--err { background: rgba(255,90,95,.16); color: #FF9A9D; }
html[data-bs-theme="light"] .alert--ok { color: #1B7A38; }
html[data-bs-theme="light"] .alert--err { color: #B3272C; }

/* ---------------------------------------------------------------- streak */
.streak {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(140deg, rgba(245,166,35,.16), rgba(224,98,63,.10));
  border: 1px solid rgba(245,166,35,.35);
}
.streak--risk { border-color: rgba(255,90,95,.5); background: linear-gradient(140deg, rgba(255,90,95,.14), rgba(245,166,35,.08)); }
.streak__flame { font-size: 46px; line-height: 1; flex: none; filter: saturate(1.2); }
.streak__flame--off { filter: grayscale(1); opacity: .35; }
.streak__body { min-width: 0; }
.streak__n { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.streak__t { font-size: 14px; color: var(--text-2); }
.streak__warn { font-size: 13px; color: var(--danger); margin-top: 6px; }
.streak__ok { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* streak v hlavičke chatu */
.streak-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 8px 1px 6px; border-radius: 11px;
  background: rgba(245,166,35,.18); color: var(--burn);
  font-size: 12px; font-weight: 700; flex: none;
}
.streak-pill.risk { background: rgba(255,90,95,.18); color: var(--danger); }

/* ------------------------------------------------------------ štatistiky */
/* Smer hovoru v histórii. */
.call-dir {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
  background: var(--surface-2); color: var(--text-2);
}
.call-dir.out { color: var(--green); background: rgba(49,209,88,.14); }
.call-dir.in { color: var(--blue); background: rgba(10,124,255,.14); }
.call-dir.missed { color: var(--danger); background: rgba(255,90,95,.14); }

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat {
  background: var(--surface); border-radius: var(--r-card);
  padding: 15px 16px;
}
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.stat small { font-size: 12.5px; color: var(--text-2); }

.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 4px; background: var(--bubble-out); }

/* --------------------------------------------------------------- galéria */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 5px; }
.gal__cell {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center; color: var(--muted);
}
.gal__cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal__cell--vid::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,.25);
}
/* Uložená príloha musí byť rozoznateľná na prvý pohľad — predtým to bola
   len tenká linka, ktorá na fotkách zanikla. */
.gal__saved {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px;
  background: var(--green); color: #05240F;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.gal__cell--saved {
  outline: 3px solid var(--green);
  outline-offset: -3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35) inset;
}
/* Jemný zelený nádych, aby sa uložené dali odlíšiť aj periférne. */
.gal__cell--saved::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(160deg, rgba(49,209,88,.22), transparent 55%);
  pointer-events: none;
}
.gal__play {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  font-size: 22px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6);
  pointer-events: none;
}
.gal__when {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 12px 6px 4px; font-size: 10.5px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  pointer-events: none;
}
.gal__tag {
  flex: none; padding: 2px 8px; border-radius: 9px;
  background: rgba(49,209,88,.16); color: var(--green);
  font-size: 11px; font-weight: 700;
}

/* ------------------------------------------------------ členovia skupiny */
.mem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; width: 100%; text-align: left; }
.mem:active { background: var(--surface-2); }
@media (hover: hover) { .mem:hover { background: var(--surface-2); } }
.mem__m { flex: 1; min-width: 0; }
.mem__n { font-size: 15.5px; font-weight: 500; }
.mem__r { font-size: 12.5px; color: var(--text-2); }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 9px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.badge--owner { background: rgba(245,166,35,.18); color: var(--burn); }
.badge--admin { background: rgba(10,124,255,.18); color: var(--blue); }

/* ------------------------------------------------------------- profil */
.cover {
  position: relative;
  height: 180px;
  border-radius: 0 0 var(--r-card) var(--r-card);
  background: linear-gradient(140deg, #1E3A5F, #2E9AA8) center/cover no-repeat;
  margin: 0 -14px 0;
}
.cover__edit {
  position: absolute; right: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 18px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cover__edit svg { width: 16px; height: 16px; }
.cover__edit--del { right: auto; left: 12px; padding: 7px 9px; }

/* Priebeh nahrávania hlavičky. */
.cover__bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(0,0,0,.35); overflow: hidden;
  border-radius: 0 0 var(--r-card) var(--r-card);
}
.cover__bar span {
  display: block; height: 100%; width: 0;
  background: var(--blue); transition: width .2s;
}

/* Naznačí, že sa na hlavičku dá klepnúť. */
.cover { cursor: pointer; }

.profile-top { text-align: center; margin-top: -52px; position: relative; z-index: 2; }
.profile-top .av {
  border: 4px solid var(--bg);
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.profile-name { font-size: 23px; font-weight: 700; margin: 12px 0 2px; letter-spacing: -.02em; }
.profile-handle { font-size: 14.5px; color: var(--text-2); margin: 0 0 10px; }
.profile-bio { font-size: 15px; margin: 0 auto 14px; max-width: 460px; line-height: 1.55; }

.facts { display: flex; flex-direction: column; gap: 11px; }
.fact { display: flex; align-items: flex-start; gap: 11px; font-size: 15px; }
.fact svg { width: 20px; height: 20px; color: var(--text-2); flex: none; margin-top: 2px; }
.fact b { font-weight: 600; }
.fact a { word-break: break-all; }

@media (min-width: 861px) {
  .cover { margin: 0; border-radius: var(--r-card); height: 220px; }
}

/* ==================================================================
   Sprievodca pri prvom spustení
   ================================================================== */
.guide {
  position: fixed; inset: 0; z-index: 1500;
  display: grid; place-items: center; padding: 18px;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: guideIn .22s ease-out;
}
@keyframes guideIn { from { opacity: 0; } to { opacity: 1; } }
.guide--out { opacity: 0; transition: opacity .2s; }

.guide__card {
  position: relative; width: 100%; max-width: 400px;
  max-height: 92vh; overflow-y: auto;
  padding: 20px 22px 22px; border-radius: 22px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  text-align: center;
  animation: guideCard .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes guideCard {
  from { transform: translateY(14px) scale(.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.guide__x {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 22px; line-height: 1; color: var(--muted);
  background: var(--surface-2);
}

.guide__artbox { margin: 4px 0 14px; }
.guide__art svg { width: 100%; height: auto; display: block; }

.guide__t { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.guide__lead {
  font-size: 14.5px; font-weight: 600; color: var(--blue);
  margin-top: 5px;
}
.guide__b {
  font-size: 14px; line-height: 1.55; color: var(--text-2);
  margin: 10px 0 0;
}

.guide__dots {
  display: flex; justify-content: center; gap: 7px; margin: 18px 0 16px;
}
.guide__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line); cursor: pointer;
  transition: width .2s, background .2s;
}
.guide__dot.on { width: 22px; border-radius: 4px; background: var(--blue); }

.guide__row { display: flex; gap: 10px; }
.guide__row .btn { flex: 1; }
.guide__back { flex: 0 0 auto !important; min-width: 96px; }

/* Poradie kariet v menu. */
.navorder { display: flex; flex-direction: column; gap: 6px; }
.navorder__i {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px; background: var(--surface-2);
}
.navorder__n { color: var(--muted); font-size: 13px; min-width: 18px; }
.navorder__t { flex: 1; font-size: 14.5px; font-weight: 600; }
.navorder__b {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--surface-3); color: var(--text-2); font-size: 15px;
}
.navorder__b:active { background: var(--blue); color: #fff; }

/* Výber hodín pre sťahovanie noviniek. */
.hours {
  display: grid; gap: 5px;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
}
.hour {
  position: relative; text-align: center; cursor: pointer;
  padding: 8px 0; border-radius: 9px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hour input { position: absolute; opacity: 0; pointer-events: none; }
.hour.on { background: var(--blue); color: #fff; }

/* Karty v nastaveniach. */
.stabs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -14px 18px; padding: 0 14px 4px;
}
.stabs::-webkit-scrollbar { display: none; }
.stab {
  flex: none; padding: 8px 15px; border-radius: 18px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.stab.on { background: var(--blue); color: #fff; }

/* --------------------------------------------------- kategórie nastavení */
.sect { margin-bottom: 26px; }
.sect__head {
  display: flex; align-items: center; gap: 9px;
  padding: 0 4px 8px;
}
.sect__ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: rgba(10,124,255,.15); color: var(--blue);
}
.sect__ico svg { width: 18px; height: 18px; }
.sect__t { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }

/* riadky v karte oddelené linkou, ako v systémových nastaveniach */
.rows { background: var(--surface); border-radius: var(--r-card); overflow: hidden; }
.rows > * { border-bottom: 1px solid var(--line); }
.rows > *:last-child { border-bottom: none; }

.row-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 16px; text-align: left; color: var(--text); font-size: 16px;
}
.row-link:active { background: var(--surface-2); }
@media (hover: hover) { .row-link:hover { background: var(--surface-2); } }
.row-link__t { flex: 1; min-width: 0; }
.row-link__t small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row-link__arrow { color: var(--muted); flex: none; }
.row-link svg { flex: none; }
.row-link.danger { color: var(--danger); }

.row-switch { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.row-switch .switch__t { flex: 1; font-size: 15.5px; }
.row-switch .switch__t small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.row-field { padding: 13px 16px; }
.row-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.row-note { padding: 10px 16px 14px; font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------ prihlásenie */
.auth-wrap {
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 18px calc(48px + var(--safe-b));
}
.auth {
  width: 100%; max-width: 380px; text-align: center;
}
.auth__logo {
  width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 18px;
  background: var(--bubble-out); display: grid; place-items: center; color: #fff;
}
.auth__logo svg { width: 42px; height: 42px; }
.auth h1 { font-size: 26px; font-weight: 700; margin: 0 0 6px; }
.auth p.sub { color: var(--text-2); font-size: 15px; margin: 0 0 24px; }
.auth .field { text-align: left; }
.auth .inp { height: 52px; border-radius: 26px; background: var(--surface-2); }
.auth .btn { height: 52px; border-radius: 26px; }
.sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0 16px; }
.sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth__foot { margin-top: 26px; font-size: 15px; color: var(--text-2); }

/* ==================================================================
   Farebné témy

   Každá mení len zvýrazňujúcu farbu a odchádzajúcu bublinu. Pozadie,
   text a plochy zostávajú neutrálne — inak by sa téma bila
   s čitateľnosťou a svetlý aj tmavý režim by prestali fungovať.
   ================================================================== */

/* Oceán */
html[data-palette="ocean"],
.pane-chat[data-palette="ocean"] {
  --blue:       #1E88E5;
  --bubble-out: linear-gradient(135deg, #1E88E5, #00ACC1);
  --bubble-out-flat: #1E88E5;
  --bubble-out-text: #FFFFFF;
}

/* Západ slnka */
html[data-palette="sunset"],
.pane-chat[data-palette="sunset"] {
  --blue:       #FF6B4A;
  --bubble-out: linear-gradient(135deg, #FF6B4A, #FF9E3D);
  --bubble-out-flat: #FF6B4A;
  --bubble-out-text: #2A1005;
}

/* Les */
html[data-palette="forest"],
.pane-chat[data-palette="forest"] {
  --blue:       #2E9E5B;
  --bubble-out: linear-gradient(135deg, #2E9E5B, #57B94A);
  --bubble-out-flat: #2E9E5B;
  --bubble-out-text: #04240F;
}

/* Levanduľa */
html[data-palette="lavender"],
.pane-chat[data-palette="lavender"] {
  --blue:       #8B6FE8;
  --bubble-out: linear-gradient(135deg, #8B6FE8, #B487F0);
  --bubble-out-flat: #8B6FE8;
  --bubble-out-text: #FFFFFF;
}

/* Ruža */
html[data-palette="rose"],
.pane-chat[data-palette="rose"] {
  --blue:       #E8467C;
  --bubble-out: linear-gradient(135deg, #E8467C, #FF7BA6);
  --bubble-out-flat: #E8467C;
  --bubble-out-text: #FFFFFF;
}

/* Jantár */
html[data-palette="amber"],
.pane-chat[data-palette="amber"] {
  --blue:       #E39A18;
  --bubble-out: linear-gradient(135deg, #E39A18, #F5C542);
  --bubble-out-flat: #E39A18;
  --bubble-out-text: #2B1D00;
}

/* Mäta */
html[data-palette="mint"],
.pane-chat[data-palette="mint"] {
  --blue:       #17B3A3;
  --bubble-out: linear-gradient(135deg, #17B3A3, #4CD8B6);
  --bubble-out-flat: #17B3A3;
  --bubble-out-text: #03241F;
}

/* Hrozno */
html[data-palette="grape"],
.pane-chat[data-palette="grape"] {
  --blue:       #7B4BC9;
  --bubble-out: linear-gradient(135deg, #7B4BC9, #A15FD8);
  --bubble-out-flat: #7B4BC9;
  --bubble-out-text: #FFFFFF;
}

/* Koral */
html[data-palette="coral"],
.pane-chat[data-palette="coral"] {
  --blue:       #F2635B;
  --bubble-out: linear-gradient(135deg, #F2635B, #FF8A73);
  --bubble-out-flat: #F2635B;
  --bubble-out-text: #2B0C09;
}

/* Obloha */
html[data-palette="sky"],
.pane-chat[data-palette="sky"] {
  --blue:       #2AA5E0;
  --bubble-out: linear-gradient(135deg, #2AA5E0, #63C9F0);
  --bubble-out-flat: #2AA5E0;
  --bubble-out-text: #03222E;
}

/* Oliva */
html[data-palette="olive"],
.pane-chat[data-palette="olive"] {
  --blue:       #7A9138;
  --bubble-out: linear-gradient(135deg, #7A9138, #A3B84E);
  --bubble-out-flat: #7A9138;
  --bubble-out-text: #12180A;
}

/* Čerešňa */
html[data-palette="cherry"],
.pane-chat[data-palette="cherry"] {
  --blue:       #D62E4E;
  --bubble-out: linear-gradient(135deg, #D62E4E, #F0566E);
  --bubble-out-flat: #D62E4E;
  --bubble-out-text: #FFFFFF;
}

/* Tyrkys */
html[data-palette="teal"],
.pane-chat[data-palette="teal"] {
  --blue:       #0E8C8C;
  --bubble-out: linear-gradient(135deg, #0E8C8C, #2BB8B0);
  --bubble-out-flat: #0E8C8C;
  --bubble-out-text: #022222;
}

/* Piesok */
html[data-palette="sand"],
.pane-chat[data-palette="sand"] {
  --blue:       #C69A63;
  --bubble-out: linear-gradient(135deg, #C69A63, #E0BC8C);
  --bubble-out-flat: #C69A63;
  --bubble-out-text: #2A1D0C;
}

/* Indigo */
html[data-palette="indigo"],
.pane-chat[data-palette="indigo"] {
  --blue:       #4B5BD6;
  --bubble-out: linear-gradient(135deg, #4B5BD6, #6E7FEE);
  --bubble-out-flat: #4B5BD6;
  --bubble-out-text: #FFFFFF;
}

/* Plameniak */
html[data-palette="flamingo"],
.pane-chat[data-palette="flamingo"] {
  --blue:       #F0568F;
  --bubble-out: linear-gradient(135deg, #F0568F, #FF8FB8);
  --bubble-out-flat: #F0568F;
  --bubble-out-text: #2E0718;
}

/* Limetka */
html[data-palette="lime"],
.pane-chat[data-palette="lime"] {
  --blue:       #6BAF20;
  --bubble-out: linear-gradient(135deg, #6BAF20, #96D63F);
  --bubble-out-flat: #6BAF20;
  --bubble-out-text: #0E1A03;
}

/* Bridlica */
html[data-palette="slate"],
.pane-chat[data-palette="slate"] {
  --blue:       #5A7189;
  --bubble-out: linear-gradient(135deg, #5A7189, #7D97AF);
  --bubble-out-flat: #5A7189;
  --bubble-out-text: #FFFFFF;
}

/* Slivka */
html[data-palette="plum"],
.pane-chat[data-palette="plum"] {
  --blue:       #9B3C8C;
  --bubble-out: linear-gradient(135deg, #9B3C8C, #C25BAF);
  --bubble-out-flat: #9B3C8C;
  --bubble-out-text: #FFFFFF;
}

/* Hrdza */
html[data-palette="rust"],
.pane-chat[data-palette="rust"] {
  --blue:       #B85427;
  --bubble-out: linear-gradient(135deg, #B85427, #DE7A45);
  --bubble-out-flat: #B85427;
  --bubble-out-text: #FFFFFF;
}

/* Azúr */
html[data-palette="cyan"],
.pane-chat[data-palette="cyan"] {
  --blue:       #0E9FCC;
  --bubble-out: linear-gradient(135deg, #0E9FCC, #3FC4E8);
  --bubble-out-flat: #0E9FCC;
  --bubble-out-text: #01212B;
}

/* Med */
html[data-palette="honey"],
.pane-chat[data-palette="honey"] {
  --blue:       #D9A227;
  --bubble-out: linear-gradient(135deg, #D9A227, #F0C551);
  --bubble-out-flat: #D9A227;
  --bubble-out-text: #2B1E02;
}

/* Smaragd */
html[data-palette="emerald"],
.pane-chat[data-palette="emerald"] {
  --blue:       #159E68;
  --bubble-out: linear-gradient(135deg, #159E68, #3ECC8E);
  --bubble-out-flat: #159E68;
  --bubble-out-text: #022116;
}

/* Lesné plody */
html[data-palette="berry"],
.pane-chat[data-palette="berry"] {
  --blue:       #A6295C;
  --bubble-out: linear-gradient(135deg, #A6295C, #CF4E82);
  --bubble-out-flat: #A6295C;
  --bubble-out-text: #FFFFFF;
}

/* Oceľ */
html[data-palette="steel"],
.pane-chat[data-palette="steel"] {
  --blue:       #3F7EA8;
  --bubble-out: linear-gradient(135deg, #3F7EA8, #5FA3CC);
  --bubble-out-flat: #3F7EA8;
  --bubble-out-text: #FFFFFF;
}

/* Káva */
html[data-palette="mocha"],
.pane-chat[data-palette="mocha"] {
  --blue:       #8A5A44;
  --bubble-out: linear-gradient(135deg, #8A5A44, #AD7A5F);
  --bubble-out-flat: #8A5A44;
  --bubble-out-text: #FFFFFF;
}

/* Fialka */
html[data-palette="violet"],
.pane-chat[data-palette="violet"] {
  --blue:       #6E45D6;
  --bubble-out: linear-gradient(135deg, #6E45D6, #9068F0);
  --bubble-out-flat: #6E45D6;
  --bubble-out-text: #FFFFFF;
}

/* Borovica */
html[data-palette="pine"],
.pane-chat[data-palette="pine"] {
  --blue:       #256B52;
  --bubble-out: linear-gradient(135deg, #256B52, #3F9170);
  --bubble-out-flat: #256B52;
  --bubble-out-text: #FFFFFF;
}

/* Uhlík */
html[data-palette="ember"],
.pane-chat[data-palette="ember"] {
  --blue:       #D14A28;
  --bubble-out: linear-gradient(135deg, #D14A28, #F07348);
  --bubble-out-flat: #D14A28;
  --bubble-out-text: #FFFFFF;
}

/* Odkazy v odchádzajúcej bubline sa prispôsobujú téme. */
.m.out .msg-link { color: var(--bubble-out-text, #fff); }

/* Ukážka témy vo výbere. */
.palettes {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
}
.pal {
  border-radius: 12px; padding: 9px 6px 8px; text-align: center;
  background: var(--surface-2); border: 2px solid transparent;
}
.pal.on { border-color: var(--text); }
.pal__dot {
  width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.pal__n {
  font-size: 11px; color: var(--text-2); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ==================================================================
   Môj deň
   ================================================================== */
.rail {
  display: flex; gap: 4px; flex: none;
  padding: 14px 10px 12px; overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.rail::-webkit-scrollbar { display: none; }

.rail__i {
  flex: none; width: 96px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}

/* Bublina drží tvar aj vtedy, keď v nej nič nie je — inak by dlaždice
   s poznámkou a bez nej boli rôzne vysoké a pás by poskakoval. */
.rail__note {
  height: 44px; display: flex; align-items: flex-end;
  justify-content: center; margin-bottom: -6px;
  position: relative; z-index: 2;
}

.note {
  position: relative;
  max-width: 94px;
  padding: 7px 10px; border-radius: 15px;
  background: var(--surface-3); color: var(--text);
  font-size: 11px; line-height: 1.3; font-weight: 500;
  text-align: center;
}
/* Chvostík z dvoch guličiek smerom k avatarovi, ako to má Instagram. */
.note::before,
.note::after {
  content: ''; position: absolute; border-radius: 50%;
  background: var(--surface-3);
}
.note::before { width: 8px; height: 8px; left: 14px; bottom: -5px; }
.note::after  { width: 4px; height: 4px; left: 10px; bottom: -11px; }

.note__t {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}

/* Vlastná poznámka a výzva na jej napísanie. */
.note--add {
  color: var(--muted);
  background: var(--surface-2);
}
.note--add::before, .note--add::after { background: var(--surface-2); }

/* Okno na písanie poznámky s ukážkou, ako bude vyzerať. */
.notebox { padding: 6px 14px 14px; }
.notebox .note {
  display: block; max-width: 180px; margin: 0 auto 20px;
  font-size: 12.5px; padding: 9px 13px;
}
.notebox__c {
  text-align: right; font-size: 11.5px; color: var(--muted); margin-top: 6px;
}

.rail__ring {
  position: relative; display: block; width: 76px; height: 76px;
  border-radius: 50%; padding: 3px;
}
.rail__ring.fresh { background: linear-gradient(135deg, #F5A623, #E8467C, #8B6FE8); }
.rail__ring.seen  { background: var(--surface-3); }
.rail__ring.add   { background: var(--surface-3); }
.rail__ring.plain { background: transparent; padding: 3px; }
.rail__ring .av {
  width: 100%; height: 100%; font-size: 26px;
  border: 2px solid var(--bg);
}
.rail__ring.plain .av { border-color: transparent; }

.rail__plus {
  position: absolute; right: 0; bottom: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue); color: #fff;
  border: 2px solid var(--bg);
  font-size: 17px; line-height: 20px; font-weight: 700;
}
.rail__n {
  display: block; margin-top: 6px;
  font-size: 12px; color: var(--text-2);
  max-width: 92px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* prehliadač príspevkov */
.story {
  position: fixed; inset: 0; z-index: 1440;
  background: #000; color: #fff;
  display: flex; flex-direction: column;
}
.story__bars {
  display: flex; gap: 3px; flex: none;
  padding: calc(8px + var(--safe-t)) 10px 6px;
}
.story__bar {
  flex: 1; height: 2.5px; border-radius: 2px;
  background: rgba(255,255,255,.3); overflow: hidden;
}
.story__bar span { display: block; height: 100%; width: 0; background: #fff; }
.story__bar.done span { width: 100%; }

.story__top {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 6px 10px 10px;
}
.story__who { flex: 1; min-width: 0; line-height: 1.25; }
.story__who b { font-size: 14.5px; display: block; }
.story__who small { font-size: 11.5px; color: rgba(255,255,255,.65); }
.story .ibtn { color: #fff; }
.story .ibtn:active { background: rgba(255,255,255,.18); }
@media (hover: hover) { .story .ibtn:hover { background: rgba(255,255,255,.14); } }

/* Hlavička leží nad obsahom, takže potrebuje čitateľný podklad. */
.story__top {
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
}
.story__mine { padding-bottom: 4px; }

.story__stage {
  flex: 1; min-height: 0; position: relative;
  display: grid; place-items: center; overflow: hidden;
}
.story__stage img, .story__stage video {
  max-width: 100%; max-height: 100%;
  object-fit: contain; display: block;
}

.story__cap {
  flex: none; padding: 10px 16px; font-size: 15px; line-height: 1.45;
  text-align: center; background: rgba(0,0,0,.4);
}

.story__foot { flex: none; padding: 10px 12px calc(12px + var(--safe-b)); }
.story__mine { display: flex; gap: 8px; justify-content: center; }
.story__reply { display: flex; flex-direction: column; gap: 10px; }
.story__reply input {
  width: 100%; height: 44px; border-radius: 22px; padding: 0 18px;
  background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.25); font-size: 15px;
}
.story__reply input::placeholder { color: rgba(255,255,255,.6); }
.story__reply input:focus { outline: none; border-color: #fff; }

.story__emo { display: flex; justify-content: space-around; }
.story__e {
  font-size: 26px; line-height: 1; padding: 4px 6px;
  transition: transform .12s;
}
.story__e:active, .story__e.on { transform: scale(1.35); }

/* ==================================================================
   Príspevky, komentáre a oznámenia
   ================================================================== */

/* Spodná lišta na podstránkach a priestor pod obsahom, aby ju nezakryla. */
/* Archív Môjho dňa. */
.arch {
  display: grid; gap: 6px; padding: 4px 14px 14px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.arch__i {
  position: relative; aspect-ratio: 9 / 16; border-radius: 10px;
  overflow: hidden; background: var(--surface-2);
}
.arch__i img { width: 100%; height: 100%; object-fit: cover; display: block; }
.arch__d {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 4px 6px; font-size: 11px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.arch__v {
  position: absolute; top: 5px; right: 5px;
  padding: 2px 7px; border-radius: 9px; font-size: 11px;
  background: rgba(0,0,0,.55); color: #fff;
}

/* Kontajner jednostránkovej navigácie. Vlastné odsadenie nemá — nesie si
   ho vložená stránka, inak by sa okraje spočítali dvakrát. */
#spaView { min-height: 50vh; }

/* Kým je zobrazená vymenená sekcia, dokument sa posúva ako na podstránke.
   Trieda locked, ktorú potrebuje obrazovka chatu, tu prekáža. */
body.spa-page {
  height: auto;
  overflow: visible;
  overscroll-behavior: auto;
}

/* ==================================================================
   Zmenšený hovor

   Nie je nalepený na okraj a nezaberá celú šírku — dá sa chytiť
   a presunúť, aby neprekrýval to, na čo sa človek práve pozerá.
   ================================================================== */
.callpill {
  position: fixed; z-index: 1430;
  left: 14px; top: calc(64px + var(--safe-t));
  width: auto; max-width: min(280px, calc(100% - 28px));
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 24px;
  background: rgba(22,26,32,.86); color: #fff;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  cursor: grab; touch-action: none; user-select: none;
}
.callpill.dragging { cursor: grabbing; box-shadow: 0 14px 36px rgba(0,0,0,.6); }

/* Živý náhľad v zmenšenom pruhu. */
.callpill__v {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  object-fit: cover; background: #000;
  transform: scaleX(-1);
}
.callpill--video .callpill__d { display: none; }

/* Fotka v hlavičke hovoru. */
.callbox__topav {
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-grid; place-items: center;
  margin-bottom: 6px; font-size: 18px; font-weight: 700;
  background-size: cover; background-position: center;
  background-color: var(--surface-2);
  box-shadow: 0 3px 10px rgba(0,0,0,.45);
}

/* Zelená bodka, že hovor stále beží. */
.callpill__d {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 3px rgba(49,209,88,.22);
}
.callpill__t {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  text-align: left; line-height: 1.25;
}
.callpill__t b {
  font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.callpill__t small {
  font-size: 11.5px; color: #B9C3CC;
  font-variant-numeric: tabular-nums;
}
.callpill__m,
.callpill__e {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
}
.callpill__m { background: rgba(255,255,255,.16); transform: rotate(90deg); }
.callpill__e { background: var(--danger); }

body.spa-page .callpill { position: fixed; }
body.spa-loading { cursor: progress; }
body.spa-loading #spaView { opacity: .5; transition: opacity .15s; }

.nav--fixed {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  background: var(--surface); border-top: 1px solid var(--line);
  height: var(--nav-h);
}

/* Zoznam chatov má vlastnú lištu v paneli, takže tú spoločnú
   na mobile skryjeme — inak by boli dve nad sebou.
   Len čo sa však zobrazí iná sekcia, lišta v paneli zmizne s ňou
   a spoločná musí nastúpiť, inak by menu nebolo vidieť vôbec. */
.app ~ .nav--fixed { display: none; }
body.spa-page .nav--fixed { display: flex; }

/* Na počítači lišta v paneli chatov nie je, takže spoločná musí ostať.
   Pravidlo patrí sem, za skrytie — v CSS rozhoduje pri rovnakej váhe
   poradie a to skoršie v súbore by prehralo. */
@media (min-width: 861px) {
  .app ~ .nav--fixed { display: flex; }

  /* Lišta je pripnutá naspodok obrazovky, takže by prekryla pole na
     písanie. Panel chatu preto o jej výšku skrátime. */
  .app { height: calc(var(--app-h) - 58px); }
}
.page--nav { padding-bottom: calc(78px + var(--safe-b)); }

/* --- riadok, ktorý otvorí editor --- */
.starter {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: var(--r-card);
  padding: 12px 14px; margin-bottom: 12px;
}
.starter__f {
  flex: 1; text-align: left; padding: 10px 16px;
  background: var(--surface-2); border-radius: 20px;
  color: var(--text-2); font-size: 15.5px;
}
.starter__m { color: var(--green); display: inline-flex; padding: 6px; }

/* --- editor príspevku --- */
.editor {
  position: fixed; inset: 0; z-index: 1500;
  background: var(--bg); display: flex; flex-direction: column;
}
.editor__head {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  border-bottom: 1px solid var(--line);
}
.editor__head b { flex: 1; text-align: center; font-size: 16px; }
.btn--sm { height: 34px; padding: 0 16px; font-size: 14px; }

.editor__who { display: flex; align-items: center; gap: 11px; padding: 12px 14px 6px; flex: none; }
.editor__who b { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
}
.chip svg { width: 14px; height: 14px; }

.editor__stage { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px; }
.editor__stage textarea {
  width: 100%; border: none; background: transparent; resize: none;
  color: var(--text); font-family: inherit; font-size: 17px; line-height: 1.5;
  min-height: 120px;
}
.editor__stage textarea:focus { outline: none; }
.editor__stage--big textarea { font-size: 24px; line-height: 1.35; font-weight: 500; }
.editor__stage--bg {
  margin: 6px 14px; padding: 26px 20px; border-radius: 14px;
  display: grid; place-items: center; flex: none; min-height: 240px;
}
.editor__stage--bg textarea {
  text-align: center; color: #fff; font-size: 26px; font-weight: 600;
  min-height: 0;
}
.editor__stage--bg textarea::placeholder { color: rgba(255,255,255,.7); }

.editor__files { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 14px; flex: none; }
.edfile {
  position: relative; width: 76px; height: 76px; border-radius: 10px;
  overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center; color: var(--text-2);
}
.edfile img { width: 100%; height: 100%; object-fit: cover; }
.edfile__fx {
  position: absolute; left: 2px; bottom: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 12px; line-height: 21px; text-align: center; cursor: pointer;
}
.edfile__x {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 15px; line-height: 19px; text-align: center; cursor: pointer;
}

/* Označení ľudia v editore. */
.editor__tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px; flex: none; }
.tagchip {
  padding: 5px 11px; border-radius: 14px; cursor: pointer;
  background: rgba(10,124,255,.14); color: var(--blue);
  font-size: 13px; font-weight: 600;
}
.tagchip::after { content: ' ×'; opacity: .7; }

/* Označení ľudia na vlastnom riadku pod textom. */
.post__ppl {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px 10px; color: var(--text-2); font-size: 14px;
}
.post__ppl svg { flex: none; opacity: .7; }
.post__pplT { min-width: 0; overflow-wrap: anywhere; }
/* Tlačidlo sa musí správať ako slovo v texte, inak zaň prehliadač
   pridá medzeru a čiarka odskočí. */
.post__tag {
  color: var(--text); font-weight: 600; font-size: 14px;
  padding: 0; margin: 0; vertical-align: baseline;
  display: inline; line-height: inherit;
}

/* Výber filtra na fotku. */
.fx {
  position: fixed; inset: 0; z-index: 1560;
  background: #000; color: #fff;
  display: flex; flex-direction: column;
}
.fx__head {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: calc(10px + var(--safe-t)) 12px 10px;
}
.fx__head b { flex: 1; text-align: center; font-size: 16px; }
.fx__head .ibtn { color: #fff; font-size: 20px; }
.fx__stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.fx__stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* Označovanie klepnutím do fotky. */
.fx__stage--tag { padding: 10px; }
.tagwrap { position: relative; display: inline-block; max-width: 100%; max-height: 100%; }
.tagwrap img { max-width: 100%; max-height: 70vh; display: block; cursor: crosshair; }
.tagwrap .ptag { cursor: pointer; }
.fx__nav {
  display: flex; gap: 10px; justify-content: center; flex: none;
  padding: 10px 12px calc(16px + var(--safe-b));
}
.fx__nav .btn { background: rgba(255,255,255,.16); color: #fff; }
.fx__nav .btn:disabled { opacity: .4; }
.ibtn.on { color: var(--blue); }

/* Kategórie filtrov. */
.fx__cats {
  display: flex; gap: 6px; flex: none;
  padding: 4px 12px 8px; overflow-x: auto; scrollbar-width: none;
}
.fx__cats::-webkit-scrollbar { display: none; }
.fxcat {
  flex: none; padding: 6px 13px; border-radius: 15px;
  background: rgba(255,255,255,.12); color: #C7CDD4;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.fxcat.on { background: #fff; color: #111; }

.fx__strip {
  display: flex; gap: 10px; flex: none;
  padding: 12px 12px calc(16px + var(--safe-b));
  overflow-x: auto; scrollbar-width: none;
}
.fx__strip::-webkit-scrollbar { display: none; }
.fxi { flex: none; width: 66px; text-align: center; }
.fxi img {
  width: 62px; height: 62px; object-fit: cover;
  border-radius: 10px; border: 2px solid transparent; display: block;
}
.fxi.on img { border-color: #fff; }
.fxi__n { display: block; font-size: 11px; color: #C7CDD4; margin-top: 4px; }

.editor__bg {
  display: flex; gap: 8px; padding: 10px 14px; flex: none;
  overflow-x: auto; scrollbar-width: none;
}
.editor__bg::-webkit-scrollbar { display: none; }
.bgdot {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  border: 2px solid transparent;
}
.bgdot.on { border-color: var(--text); }
.bgdot--none { background: var(--surface-2); }

.bg-b1 { background: linear-gradient(135deg, #0A7CFF, #00B2FF); }
.bg-b2 { background: linear-gradient(135deg, #E8467C, #FF8A73); }
.bg-b3 { background: linear-gradient(135deg, #2E9E5B, #8BD44A); }
.bg-b4 { background: linear-gradient(135deg, #7B4BC9, #C25BAF); }
.bg-b5 { background: linear-gradient(135deg, #E39A18, #F5C542); }
.bg-b6 { background: linear-gradient(135deg, #17B3A3, #63C9F0); }
.bg-b7 { background: linear-gradient(135deg, #242526, #4A4C50); }
.bg-b8 { background: linear-gradient(135deg, #D62E4E, #F0566E); }

.editor__opt {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: 10px 14px; border-top: 1px solid var(--line);
}
.editor__opt .switch__t { flex: 1; font-size: 14.5px; }
.editor__opt .switch__t small {
  display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px;
}

.editor__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px calc(14px + var(--safe-b)); flex: none;
  border-top: 1px solid var(--line);
}
.editor__barT { font-size: 14px; font-weight: 600; }
.editor__bar .ibtn { color: var(--green); }
.editor__status {
  flex: none; padding: 8px 14px; text-align: center;
  font-size: 13px; color: var(--text-2);
  background: var(--surface-2);
}
.editor__progress { height: 3px; background: var(--surface-3); flex: none; }
.editor__progress span {
  display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s;
}

/* --- karta príspevku --- */
.post {
  background: var(--surface); border-radius: var(--r-card);
  margin-bottom: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.14);
}
.post__head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px; }
.post__who { flex: 1; min-width: 0; line-height: 1.3; }
.post__n {
  display: flex; align-items: center; gap: 5px; font-size: 15px;
  min-width: 0;
}
.post__n b { max-width: 100%; overflow-wrap: anywhere; }
.post__n b { font-weight: 600; }
.post__follow { color: var(--blue); font-weight: 600; font-size: 14px; }
.post__sep { color: var(--muted); }
.post__meta {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--text-2); margin-top: 1px;
}
.post__aud { font-size: 11px; }
.ibtn--sm { width: 34px; height: 34px; font-size: 17px; letter-spacing: 1px; }

/* Skrátený text s odkazom na rozbalenie. */
.post__body--clamp .post__text {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post__more {
  color: var(--text-2); font-size: 15px; font-weight: 500;
  margin-left: 4px;
}

.post__body {
  padding: 0 14px 12px; font-size: 15px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.post__body--big { font-size: 21px; line-height: 1.4; font-weight: 500; }
.post__body--bg {
  padding: 40px 24px; margin-bottom: 0;
  min-height: 240px; display: grid; place-items: center;
  text-align: center; color: #fff;
  font-size: 24px; font-weight: 600; line-height: 1.35;
}

/* --- mriežka príloh --- */
/* Fotky idú od okraja po okraj karty — tak to má Facebook a obrázok
   tým dostane maximum miesta. */
.pmedia { display: grid; gap: 2px; background: var(--surface-2); }
.pmedia--1 { grid-template-columns: 1fr; }
/* Jediná fotka si nesie vlastný pomer strán — príspevok sa jej prispôsobí
   a nič sa neoreže ani nedopĺňa prázdnym miestom. */
.pmedia--1 .pcell { aspect-ratio: var(--ratio, 1.25); }
.pmedia--1 .pcell img { object-fit: cover; }
.pmedia--2 { grid-template-columns: 1fr 1fr; }
.pmedia--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.pmedia--3 .pcell:first-child { grid-row: span 2; }
.pmedia--4 { grid-template-columns: 1fr 1fr; }
.pmedia--5 { grid-template-columns: repeat(6, 1fr); }
.pmedia--5 .pcell:nth-child(-n+2) { grid-column: span 3; }
.pmedia--5 .pcell:nth-child(n+3) { grid-column: span 2; }

.pcell {
  position: relative; aspect-ratio: var(--ratio, 1); overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center;
}
.pcell img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Jediná fotka a fotka v karuseli sa zobrazia celé. Orezanie má zmysel
   v mriežke, kde ide o prehľad, nie pri hlavnej fotke príspevku. */
.pmedia--1 .pcell img,
.carousel__s .pcell img { object-fit: contain; }
.pcell--none { color: var(--muted); }
/* Označení ľudia priamo na fotke. */
.pcell__tagbtn {
  position: absolute; left: 10px; bottom: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px;
  background: rgba(0,0,0,.55); color: #fff;
}
.ptag {
  position: absolute; transform: translate(-50%, 0);
  padding: 5px 10px; border-radius: 6px;
  background: rgba(0,0,0,.72); color: #fff;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  pointer-events: auto;
}
.ptag::before {
  content: ''; position: absolute; top: -5px; left: 50%; margin-left: -5px;
  border: 5px solid transparent; border-top: none;
  border-bottom-color: rgba(0,0,0,.72);
}
.ptags { position: absolute; inset: 0; pointer-events: none; }

/* Menovka, ktorou sa dá pohnúť. */
.ptag--drag { cursor: grab; touch-action: none; padding-right: 24px; }
.ptag--drag.on { cursor: grabbing; background: var(--blue); }
.ptag__x {
  position: absolute; right: 5px; top: 50%; margin-top: -8px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,.28); color: #fff;
  font-size: 12px; line-height: 15px; text-align: center; cursor: pointer;
}

.fx__hint {
  flex: none; padding: 0 16px 8px; text-align: center;
  font-size: 12.5px; color: #A9B6C2; line-height: 1.4;
}

/* Označení v Môjom dni. */
.story__tagbtn {
  position: absolute; left: 12px; bottom: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px;
  background: rgba(0,0,0,.55); color: #fff;
}
.story__ppl {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  padding: 7px 12px; border-radius: 14px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 13px; text-align: center;
}

.pcell__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 30px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6);
  pointer-events: none;
}
.pcell__more {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.5); color: #fff; font-size: 26px; font-weight: 700;
  pointer-events: none;
}

.post__sum {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 8px; font-size: 13px; color: var(--text-2);
  border-bottom: 1px solid var(--line);
}
.post__sumL { display: inline-flex; align-items: center; gap: 6px; }
.post__sumL b { font-weight: 500; color: var(--text-2); }

/* Prekrývajúce sa reakcie ako na Facebooku. */
.rstack { display: inline-flex; }
.rstack__e {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px;
  background: var(--surface); border: 2px solid var(--surface);
  margin-left: -6px;
}
.rstack__e:first-child { margin-left: 0; }
.post__sumR { color: var(--text-2); font-size: 13px; }

.post__bar { display: flex; }
.post__act {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 10px 6px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2);
}
.post__act.on { color: var(--blue); }
.post__act--off { opacity: .5; }
.post__act:active { background: var(--surface-2); }
@media (hover: hover) { .post__act:hover { background: var(--surface-2); } }
.post__emo { font-size: 17px; line-height: 1; }
.post__act--icon { flex: 0 0 54px; font-size: 17px; }
.post__act--icon.on { color: var(--blue); }

/* panel reakcií nad tlačidlom */
.rbar {
  position: fixed; z-index: 1550;
  display: flex; gap: 4px; padding: 6px 10px;
  background: var(--surface); border-radius: 24px;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  animation: rbarIn .16s cubic-bezier(.2,.9,.3,1);
}
@keyframes rbarIn { from { transform: translateY(8px) scale(.9); opacity: 0 } to { transform: none; opacity: 1 } }
.rbar__e { font-size: 26px; line-height: 1; padding: 2px 3px; transition: transform .12s; }
.rbar__e:active { transform: scale(1.35); }
@media (hover: hover) { .rbar__e:hover { transform: scale(1.3); } }

/* ukážka komentárov pod príspevkom */
.post__cmts { padding: 6px 14px 12px; border-top: 1px solid var(--line); }
.post__cmtsMore {
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  padding: 6px 0; display: block;
}
.pcmt { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; width: 100%; text-align: left; }
.pcmt__b {
  background: var(--surface-2); border-radius: 15px; padding: 7px 12px;
  min-width: 0; font-size: 14px; line-height: 1.4;
}
.pcmt__b b { display: block; font-size: 12.5px; font-weight: 600; }
.pcmt__t { word-break: break-word; }

/* --- komentáre --- */
.cmts {
  position: fixed; inset: 0; z-index: 1450;
  background: var(--bg); display: flex; flex-direction: column;
}
.cmts__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + var(--safe-t)) 14px 12px;
  border-bottom: 1px solid var(--line); flex: none; font-size: 16px;
}
.cmts__list { flex: 1; overflow-y: auto; padding: 12px 14px; }

.cmt { margin-bottom: 14px; }
.cmt--reply { margin-left: 38px; margin-top: 10px; margin-bottom: 6px; }
.cmt__row { display: flex; gap: 9px; align-items: flex-start; }
.cmt__b {
  background: var(--surface-2); border-radius: 15px;
  padding: 8px 13px; max-width: 100%; min-width: 0;
}
.cmt__b b { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 1px; }
.cmt__t { font-size: 14.5px; line-height: 1.45; word-break: break-word; }
.cmt__acts {
  display: flex; align-items: center; gap: 14px;
  margin: 4px 0 0 47px; font-size: 12px; color: var(--text-2);
}
.cmt--reply .cmt__acts { margin-left: 41px; }
.cmt__a { font-size: 12px; font-weight: 600; color: var(--text-2); }
.cmt__a.on { color: var(--danger); }
.cmt__w { color: var(--muted); }

.cmts__reply {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: var(--surface-2);
  font-size: 13px; color: var(--text-2); flex: none;
}
.cmts__foot {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 10px 12px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
}
.cmts__foot input {
  flex: 1; height: 42px; border-radius: 21px; padding: 0 16px;
  background: var(--surface-2); border: none; color: var(--text); font-size: 16px;
}
.cmts__foot input:focus { outline: none; box-shadow: 0 0 0 2px var(--blue) inset; }

/* --- oznámenia --- */
.notif {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 12px; border-radius: 13px; text-align: left;
  margin-bottom: 4px; position: relative;
}
.notif.fresh { background: rgba(10,124,255,.08); }
.notif:active { background: var(--surface-2); }
@media (hover: hover) { .notif:hover { background: var(--surface-2); } }
.notif__m { flex: 1; min-width: 0; }
.notif__t { font-size: 14.5px; line-height: 1.4; }
.notif__p {
  font-size: 13px; color: var(--text-2); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif__w { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.notif__dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--blue); align-self: center;
}

/* Malý odznak pri avatare hovorí, o aký druh oznámenia ide. */
.notif__av { position: relative; flex: none; }
.notif__k {
  position: absolute; right: -3px; bottom: -3px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px;
  background: var(--surface-3); border: 2px solid var(--bg);
}
.notif__k.k-calls  { background: rgba(49,209,88,.9); }
.notif__k.k-people { background: rgba(10,124,255,.9); }

/* Vypnuté komentáre */
.post__act--off { opacity: .5; }
.cmts__off {
  flex: none; padding: 14px; text-align: center;
  font-size: 13.5px; color: var(--text-2);
  border-top: 1px solid var(--line);
}

/* Značka na konci nástenky, ktorá spúšťa dopĺňanie. */
.feed__auto { opacity: .6; }

/* --- vzhľad bližšie k Messengeru --- */
.post { box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.post__head { padding: 12px 14px 8px; }
.post__body { font-size: 15px; }
.post__sum { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.post__act { font-size: 13.5px; }

/* Na širokej obrazovke drží nástenka rozumnú šírku, inak sa text ťahá. */
@media (min-width: 861px) {
  .page--nav { max-width: 620px; margin-left: auto; margin-right: auto; }

  /* Na počítači je lišta vodorovná hore, nie prilepená dole — dolný okraj
     širokej obrazovky je od očí najďalej a lišta sa tam ľahko prehliadne. */
  /* Menu zostáva dole aj na počítači — hore by sa bilo s hlavičkou
     stránky a človek ho hľadá tam, kde ho pozná z telefónu. */
  .nav--fixed { justify-content: center; gap: 10px; }
  .nav--fixed a { flex: 0 0 92px; padding: 14px 0; }
  .nav--fixed a.on { color: var(--blue); }
}

/* ==================================================================
   Editor s formátovaním a karusel
   ================================================================== */

/* Lišta nástrojov nad písacím poľom. */
.edtools {
  display: flex; align-items: center; gap: 2px; flex: none;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.edtools::-webkit-scrollbar { display: none; }
.edtools button {
  flex: none; min-width: 34px; height: 32px; padding: 0 8px;
  border-radius: 8px; color: var(--text-2);
  font-size: 15px; line-height: 1;
}
.edtools button.on { background: var(--surface-3); color: var(--text); }
.edtools button:active { background: var(--surface-2); }
.edtools__sep { width: 1px; height: 20px; background: var(--line); margin: 0 5px; flex: none; }

/* Písacie pole. Prázdne ukazuje výzvu, lebo contenteditable ju nemá. */
.edtext {
  min-height: 120px; font-size: 17px; line-height: 1.5;
  color: var(--text); outline: none; word-break: break-word;
}
.edtext.empty::before {
  content: attr(data-ph); color: var(--muted); pointer-events: none;
}
.edtext b, .edtext strong { font-weight: 700; }
.edtext blockquote,
.post__text blockquote {
  margin: 8px 0; padding: 4px 0 4px 12px;
  border-left: 3px solid var(--line); color: var(--text-2);
}
.edtext ul, .edtext ol,
.post__text ul, .post__text ol { margin: 6px 0; padding-left: 22px; }
.edtext li, .post__text li { margin: 2px 0; }
.post__text a { color: var(--blue); }

.editor__stage--bg .edtext {
  text-align: center; color: #fff; font-size: 26px; font-weight: 600;
  min-height: 0;
}
.editor__stage--bg .edtext.empty::before { color: rgba(255,255,255,.7); }
.editor__stage--big .edtext { font-size: 24px; line-height: 1.35; font-weight: 500; }

/* Karusel príloh. */
.carousel { position: relative; background: var(--surface-2); }
.carousel__t {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.carousel__t::-webkit-scrollbar { display: none; }
.carousel__s { flex: 0 0 100%; scroll-snap-align: center; }
.carousel__s .pcell { aspect-ratio: var(--ratio, 1.25); width: 100%; }

/* Fotka s výrazne iným pomerom sa vojde celá, zvyšok doplní tmavé pole —
   je to lepšie než odrezať polovicu záberu. */
.pcell img { background: #0B0B0C; }

.carousel__c {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 10px; border-radius: 12px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 12px; font-weight: 600; pointer-events: none;
}
.carousel__d {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 5px; pointer-events: none;
}
.carousel__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.5);
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
  transition: background .15s, transform .15s;
}
.carousel__dot.on { background: #fff; transform: scale(1.25); }

.carousel__a {
  position: absolute; top: 50%; margin-top: -18px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0,0,0,.5); color: #fff;
}
.carousel__a--l { left: 8px; transform: rotate(45deg); }
.carousel__a--r { right: 8px; transform: rotate(-135deg); }
@media (hover: none) { .carousel__a { display: none; } }

/* Spodné menu ukazuje len ikony — popisy zaberali miesto a pri piatich
   položkách sa aj tak orezávali. */
.nav a span:not(.nav__badge) { display: none; }
.nav a { padding: 12px 0; }
.nav__badge { top: 6px; margin-left: 6px; }
