/* Czat z Emulka - wspolny dla karty produktu i Dzis (czat.js). */
/* CZAT Z EMULKA - jak rozmowa na Instagramie (wlasciciel 25.11.2026: „ma byc uczucie, ze jestes
   w czacie na Instagramie”): naglowek z awatarem w kolorowej obwodce, nazwa i podpis, cienka linia;
   data na srodku; produkt jak udostepniony post; szare dymki Emulki, kolorowe moje; awatar tylko przy
   ostatnim dymku serii; pole-pigulka na dole. Logika w czat.js. */
/* wysokosc = WIDOCZNA czesc strony (top/bottom 0). Pas pod nia (pasek gestu w Safari) nalezy do
   przegladarki - ma kolor tla strony, dlatego na czas czatu html i body sa biale. 100lvh chowalo
   pole za krawedzia (25.11.2026). */
html.czat-on body>*:not(#czat):not(.a-scrim):not(.a-sheet){visibility:hidden!important}   /* arkusz logowania (fav.js) nad czatem */
#czat{position:fixed;left:0;right:0;top:0;bottom:0;z-index:60;overflow:hidden;transition:height .28s cubic-bezier(.2,.8,.2,1);background:#fff;display:flex;flex-direction:column;
  font-family:'Geist','Geist zapas',system-ui,sans-serif;color:#2B1A22;animation:czIn .22s ease-out}
#czat[hidden]{display:none}
@keyframes czIn{from{opacity:0;transform:translateX(24px)}}
#czat .cz-g{padding:calc(env(safe-area-inset-top) + 6px) 8px 8px;border-bottom:1px solid #EFE7EA;background:#fff}
#czat .cz-pas{max-width:460px;margin:0 auto;display:flex;align-items:center;gap:6px}
#czat .cz-wr{width:40px;height:44px;border:0;background:none;color:#2B1A22;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
#czat .cz-kto{flex:1;min-width:0;display:flex;align-items:center;gap:10px}
#czat .cz-ring{width:44px;height:44px;border-radius:22px;padding:2px;flex-shrink:0;box-sizing:border-box;
  background:conic-gradient(from 210deg,#F6B26B,#E27D9C,#9C8FE6,#E27D9C,#F6B26B)}
#czat .cz-ring img{display:block;width:100%;height:100%;border-radius:50%;border:2px solid #fff;box-sizing:border-box;object-fit:cover}
#czat .cz-imie{min-width:0;display:flex;flex-direction:column}
#czat .cz-imie b{font-size:16px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#czat .cz-lg{display:inline-flex;align-items:flex-end;padding-top:2px}
#czat .cz-lg span{font-family:'Fredoka',sans-serif;font-size:23px;line-height:1;font-weight:700;display:inline-block;margin-right:-.3px}
#czat .cz-imie small{font-size:13px;color:#9A8890;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#czat .cz-lista{flex:1;min-height:0;overflow-x:hidden;overflow-y:auto;touch-action:pan-y;overscroll-behavior:contain;padding:14px 12px 12px;display:flex;flex-direction:column;gap:3px;
  max-width:460px;width:100%;margin:0 auto;box-sizing:border-box}
#czat .cz-data{align-self:center;margin:4px 0 6px;font-size:12px;font-weight:600;color:#9A8890}
#czat .cz-info{align-self:center;max-width:280px;margin:0 0 14px;font-size:12px;line-height:1.4;color:#9A8890;text-align:center}
#czat .cz-prod{text-decoration:none;box-sizing:border-box;align-self:center;width:240px;margin:0 0 18px;border:1px solid #EFE7EA;border-radius:18px;background:#fff;padding:10px;
  display:flex;align-items:center;gap:10px;color:#2B1A22;font-family:inherit;text-align:left;cursor:pointer}
#czat .cz-mini{width:46px;height:46px;border-radius:12px;background:#FBF3F1;flex-shrink:0;overflow:hidden;display:flex;align-items:center;justify-content:center}
#czat .cz-mini img{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply}
#czat .cz-pt{flex-grow:1;min-width:0;display:flex;flex-direction:column;gap:2px}
#czat .cz-pt small{font-size:11px;font-weight:600;letter-spacing:.05em;color:#9A8890;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#czat .cz-pt b{font-size:14px;font-weight:700;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#czat .cz-ja{align-self:flex-end;max-width:75%;margin-top:10px;border-radius:22px;
  background:#3A2430;color:#fff;padding:10px 14px;font-size:15px;line-height:1.35}
#czat .cz-on{align-self:flex-start;max-width:85%;display:flex;align-items:flex-end;gap:8px;margin-top:10px}
#czat .cz-av{width:28px;height:28px;border-radius:14px;flex-shrink:0;overflow:hidden}
#czat .cz-av img{display:block;width:100%;height:100%;object-fit:cover}
#czat .cz-dym{min-width:0;border-radius:22px;background:#F1ECEE;padding:10px 14px;display:flex;flex-direction:column;gap:8px}
#czat .cz-dym>span{font-size:15px;line-height:1.4}
#czat .cz-zr{font-size:12px;line-height:1.35;color:#9A8890}
#czat .cz-pisze{display:flex;gap:4px;padding:5px 2px}
#czat .cz-pisze i{width:7px;height:7px;border-radius:4px;background:#A99BA1;animation:czKr 1s infinite}
#czat .cz-pisze i:nth-child(2){animation-delay:.15s}#czat .cz-pisze i:nth-child(3){animation-delay:.3s}
@keyframes czKr{0%,80%,100%{opacity:.3}40%{opacity:1}}
#czat .cz-msg{animation:czM .2s ease}@keyframes czM{from{opacity:0;transform:translateY(6px)}}
#czat .cz-d{padding:6px 12px max(8px,calc(env(safe-area-inset-bottom) - 12px));background:#fff;display:flex;flex-direction:column;gap:8px;
  max-width:460px;width:100%;margin:0 auto;box-sizing:border-box}
#czat .cz-sug{display:flex;gap:8px;overflow-x:auto;margin:0 -12px;padding:2px 12px;scrollbar-width:none}
#czat .cz-sug:empty{display:none}
#czat .cz-sug::-webkit-scrollbar{display:none}
#czat .cz-sug button{flex-shrink:0;height:36px;padding:0 14px;border-radius:18px;border:1px solid #E6DADF;background:#fff;
  color:#2B1A22;font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;white-space:nowrap}
#czat .cz-pole{box-sizing:border-box;min-height:48px;border-radius:24px;background:#F1ECEE;display:flex;align-items:flex-end;gap:8px;padding:5px 6px}
/* kolko profilu przy polu - jak kolko w rogu Dzis (inicjal zalogowanej albo ikonka osoby) */
#czat .cz-ty{width:38px;height:38px;border-radius:19px;flex-shrink:0;display:flex;align-items:center;justify-content:center;
  background:#F4E3E3;color:#2B1A22}
#czat .cz-ty.z{background:#F7C6D4;color:#3D1526;font-size:17px;font-weight:800}
#czat .cz-ty.z{overflow:hidden}
/* pole rosnie z tekstem: textarea i jej niewidoczna kopia (::after) w tej samej komorce siatki - kopia ustala
   wysokosc (1-5 linii), textarea ja wypelnia; powyzej 5 linii przewija sie w srodku */
#czat .cz-rost{flex-grow:1;min-width:0;display:grid}
#czat .cz-rost::after{content:attr(data-v) " ";visibility:hidden;white-space:pre-wrap;max-height:120px;overflow:hidden}
#czat .cz-rost::after,#czat .cz-pole textarea{grid-area:1/1/2/2;box-sizing:border-box;margin:0;border:0;padding:8px 4px;
  font-family:inherit;font-size:16px;line-height:22px;overflow-wrap:anywhere;word-break:break-word}
#czat .cz-pole textarea{width:100%;height:100%;min-height:38px;outline:none;-webkit-appearance:none;appearance:none;border-radius:0;
  background:transparent;color:#2B1A22;resize:none;overflow-y:auto;overscroll-behavior:contain}
#czat .cz-pole textarea::placeholder{color:#9A8890;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Wiadomosci uzytkowniczki i „Wyślij” w czerni przyciskow (wlasciciel 26.11.2026). */
#czat .cz-wy{height:34px;margin:2px 0;align-self:end;padding:0 14px;border:0;border-radius:17px;background:#3A2430;color:#fff;font-family:inherit;font-size:15px;font-weight:700;cursor:pointer;flex-shrink:0}
#czat .cz-pole:not(.pisze) .cz-wy{display:none}
#czat .sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (prefers-reduced-motion: reduce){#czat,#czat .cz-msg,#czat .cz-pisze i{animation:none}}
/* polecone produkty pod odpowiedzia (czat ogolny na Dzis) - JEDEN POD DRUGIM, wciete jak dymek Emulki.
   Pas przewijany w bok przesuwal na iPhonie cala rozmowe na lewo (wlasciciel 25.11.2026). */
#czat .cz-polec{align-self:stretch;flex-shrink:0;display:flex;flex-direction:column;gap:8px;margin:8px 0 0;padding:0 0 0 36px}
#czat .cz-polec .cz-prod{width:100%;max-width:300px;margin:0;align-self:flex-start;box-sizing:border-box}
#czat .cz-pt em{font-style:normal;font-size:13px;font-weight:600;color:#B8436A}
/* historia konta: „Usuń historię tej rozmowy” nad wczesniejszymi wiadomosciami, znacznik miejsca niewidoczny */
#czat .cz-hist{display:none}
#czat .cz-czysc{align-self:center;border:0;background:none;padding:4px 10px;font-family:inherit;font-size:12.5px;font-weight:600;color:#B8436A;cursor:pointer}
/* „Potwierdź e-mail” w dymku Emulki (asystent tylko z potwierdzonym adresem, 26.11.2026) */
#czat .cz-pot{display:flex;align-items:center;justify-content:center;margin-top:10px;height:40px;padding:0 16px;border-radius:20px;
  background:#3A2430;color:#fff;font-size:14px;font-weight:700;text-decoration:none;width:max-content}
/* POP-UP LIMITU (plansza „Asystent · 7 — limit pytań”, 29.11.2026): po 3 pytaniach dziennie. Śpiąca kropla z „z z”,
   „Chcę więcej pytań” zapisuje na listę (/api/asystent/chce-wiecej) -> „Zapisane!”. */
@keyframes lmFade{from{opacity:0}to{opacity:1}}
@keyframes lmPop{0%{opacity:0;transform:translateY(24px) scale(.86)}60%{opacity:1;transform:translateY(-4px) scale(1.03)}100%{opacity:1;transform:none}}
@keyframes lmDrop{0%{transform:translateY(-6px) rotate(-4deg)}50%{transform:translateY(2px) rotate(4deg)}100%{transform:translateY(-6px) rotate(-4deg)}}
@keyframes lmZ{0%{opacity:0;transform:translate(0,0) scale(.6)}30%{opacity:1}100%{opacity:0;transform:translate(14px,-26px) scale(1.1)}}
#czat .lm-tlo{position:absolute;inset:0;z-index:10;background:rgba(43,26,34,.42);display:flex;align-items:center;justify-content:center;
  padding:0 22px;animation:lmFade .25s ease-out both}
#czat .lm{position:relative;width:100%;max-width:420px;border-radius:32px;background:#fff;padding:0 0 22px;overflow:hidden;display:flex;
  flex-direction:column;align-items:center;text-align:center;box-shadow:0 30px 60px rgba(43,26,34,.35);animation:lmPop .5s cubic-bezier(.2,.9,.3,1) .05s both}
#czat .lm-gora{position:relative;align-self:stretch;height:150px;background:#E3DDF8;overflow:hidden}
#czat .lm-gora .k{position:absolute;border-radius:50%;background:#D6CDF3}
#czat .lm-kropla{position:absolute;left:50%;bottom:10px;margin-left:-46px;width:92px;height:124px;animation:lmDrop 3s ease-in-out infinite;transform-origin:50% 100%}
#czat .lm-z{position:absolute;font-family:'Fredoka',sans-serif;font-weight:700;color:#6A58A8;animation:lmZ 2.4s ease-out infinite}
#czat .lm-x{position:absolute;right:10px;top:10px;width:44px;height:44px;border-radius:22px;border:0;background:rgba(255,255,255,.7);color:#241B55;
  display:flex;align-items:center;justify-content:center;cursor:pointer}
#czat .lm-tresc{display:flex;flex-direction:column;align-items:center;gap:10px;padding:22px 22px 0}
#czat .lm h2{margin:0;font-size:24px;line-height:1.15;font-weight:800;letter-spacing:-.02em;text-wrap:balance}
#czat .lm p{margin:0;font-size:15px;line-height:1.45;color:#6A5560;max-width:270px}
#czat .lm-za{height:30px;padding:0 12px;border-radius:15px;background:#F4E3E3;color:#6A2C45;font-size:12.5px;font-weight:700;display:flex;align-items:center;gap:6px}
#czat .lm-ok{width:44px;height:44px;border-radius:22px;background:#CDEDD9;color:#0F6A40;display:flex;align-items:center;justify-content:center}
#czat .lm-przyc{align-self:stretch;display:flex;flex-direction:column;gap:6px;padding:18px 22px 0}
#czat .lm-przyc button{height:54px;border-radius:27px;border:0;font-family:inherit;font-size:16px;font-weight:800;cursor:pointer}
#czat .lm-wiecej{background:#2B1A22;color:#fff;box-shadow:0 10px 22px rgba(43,26,34,.22)}
#czat .lm-przyc .lm-jutro{height:44px;background:transparent;color:#6A5560;font-size:15px;font-weight:700}
#czat .lm-super{background:#F7C6D4;color:#3D1526}
@media (prefers-reduced-motion:reduce){#czat .lm-tlo,#czat .lm,#czat .lm-kropla,#czat .lm-z{animation:none}}
