/* Ailona – czat w prawym dolnym rogu (07.11.2026). Przycisk ze znakiem Pillchata (bez twarzy), twarz Ailony tylko w rozmowie.
   Warstwy: przycisk 27 (nad .of-fab 26, pod szufladą 28), okno 75 (pod ⌘K 80, oknem zgłoszenia 200 i banerem zgód). */
.ai-l { position: fixed; right: 20px; bottom: 20px; z-index: 27; width: 56px; height: 56px; border: 0; border-radius: 50%; background: #0d4b5c; color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 22px rgba(13,75,92,.28); }
.ai-l:hover { background: #08323e; }
.ai-l:focus-visible { outline: 3px solid #14a085; outline-offset: 3px; }
.ai-l svg { width: 30px; height: 30px; }
.ai-l svg path[fill] { fill: #2fd19a; }

.ai-g { position: fixed; right: 88px; bottom: 24px; z-index: 27; display: flex; align-items: flex-start; gap: 4px; max-width: 280px; background: #fff; border-radius: 10px; box-shadow: 0 8px 22px rgba(13,75,92,.18); padding: 4px 4px 4px 0; font: 400 14px/1.4 "Source Sans 3", system-ui, sans-serif; color: #13404f; }
.ai-g[hidden] { display: none; }
/* Dymek wysuwa się spod przycisku i tak samo chowa (uwaga usera 07.11.2026): rozwijanie od prawej (clip-path),
   lekki przesuw i przezroczystość. visibility opóźnione przy chowaniu, żeby animacja zdążyła się zagrać. */
.ai-g { opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(14px);
	clip-path: inset(0 0 0 100% round 10px);
	transition: clip-path .42s cubic-bezier(.2,.8,.2,1), opacity .3s ease, transform .42s cubic-bezier(.2,.8,.2,1), visibility 0s linear .42s; }
.ai-g.is-on { opacity: 1; visibility: visible; pointer-events: auto; transform: none; clip-path: inset(0 0 0 0 round 10px);
	transition: clip-path .42s cubic-bezier(.2,.8,.2,1), opacity .3s ease, transform .42s cubic-bezier(.2,.8,.2,1), visibility 0s; }
@media (prefers-reduced-motion: reduce) { .ai-g, .ai-g.is-on { transition: opacity .2s ease, visibility 0s; transform: none; clip-path: none; } }
.ai-g-t { border: 0; background: none; text-align: left; padding: 6px 4px 6px 12px; font: inherit; color: inherit; cursor: pointer; }
.ai-g-t b { display: block; font: 700 13px "Onest", system-ui, sans-serif; color: #0d4b5c; }
.ai-g-x { flex: none; border: 0; background: none; width: 28px; height: 28px; border-radius: 6px; color: #6b8088; font-size: 18px; line-height: 1; cursor: pointer; }
.ai-g-x:hover { background: #f1f5f5; }

.ai-p { position: fixed; right: 20px; bottom: 88px; z-index: 75; width: 380px; height: min(580px, calc(100vh - 120px)); background: #fff; border-radius: 12px; box-shadow: 0 14px 40px rgba(13,75,92,.22); display: flex; flex-direction: column; overflow: hidden; font-family: "Source Sans 3", system-ui, sans-serif; color: #13404f; }
.ai-p[hidden] { display: none; }
.ai-h { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 12px; border-bottom: 1px solid #e3eaea; }
.ai-h-t { min-width: 0; flex: 1; }
.ai-h-t b { display: block; font: 700 15px "Onest", system-ui, sans-serif; color: #0d4b5c; }
.ai-h-t small { display: block; font-size: 12px; color: #6b8088; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-h button { border: 0; background: none; color: #4f6770; border-radius: 8px; min-height: 36px; padding: 0 8px; font: 600 12.5px "Onest", system-ui, sans-serif; cursor: pointer; }
.ai-h button:hover { background: #f1f5f5; color: #0d4b5c; }
.ai-h .ai-zamknij { font-size: 20px; width: 36px; padding: 0; }

.ai-rozm { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; line-height: 1.5; overscroll-behavior: contain; }
.ai-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; display: block; }
.ai-av--ja { display: grid; place-items: center; background: #dfe9ea; color: #0d4b5c; font: 700 11.5px "Onest", system-ui, sans-serif; overflow: hidden; }
.ai-av--ja img { width: 100%; height: 100%; object-fit: cover; }
.ai-m { display: flex; gap: 8px; align-items: flex-end; }
.ai-m--ja { flex-direction: row-reverse; }
.ai-dym { background: #f4f7f7; border-radius: 12px 12px 12px 4px; padding: 9px 12px; max-width: 280px; min-width: 0; overflow-wrap: anywhere; }
.ai-m--ja .ai-dym { background: #0d4b5c; color: #fff; border-radius: 12px 12px 4px 12px; }
.ai-dym p { margin: 0 0 6px; }
.ai-dym p:last-child { margin-bottom: 0; }
.ai-dym b { color: #0d4b5c; }
.ai-stan { color: #4f6770; }
.ai-stan-t { transition: opacity .18s ease; }
.ai-stan-t.zmiana { opacity: 0; }
/* „pisze…”: trzy kropki na końcu zdania, bez łamania do nowej linii */
.ai-kropki { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.ai-kropki i { width: 5px; height: 5px; border-radius: 50%; background: #14a085; animation: ai-kropka 1.2s ease-in-out infinite; }
.ai-kropki i:nth-child(2) { animation-delay: .2s; }
.ai-kropki i:nth-child(3) { animation-delay: .4s; }
@keyframes ai-kropka { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
@keyframes ai-puls { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .ai-kropki i { animation: none; opacity: .6; } .ai-stan-t { transition: none; } }
.ai-czyt { display: block; margin-top: 8px; font: 600 13px/1.35 "Onest", system-ui, sans-serif; color: #0d4b5c; text-decoration: underline; text-decoration-color: rgba(13,75,92,.35); text-underline-offset: 2px; }
.ai-czyt:hover { text-decoration-color: currentColor; }
.ai-zewn { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: #20558a; color: #fff; font-size: 11px; text-decoration: none; vertical-align: 1px; }
.ai-partner { display: block; margin-top: 2px; font: 400 12px "Source Sans 3", system-ui, sans-serif; color: #6b4b14; text-decoration: none; }
.ai-wiecej { margin-top: 6px; font-size: 13px; }
.ai-wiecej summary { cursor: pointer; color: #4f6770; }
.ai-wiecej ul { margin: 4px 0 0; padding-left: 16px; }
.ai-wiecej a { color: #0d4b5c; }
.ai-uwaga { margin-top: 8px !important; font-size: 12.5px; color: #4f6770; }
.ai-luka { margin-top: 6px !important; font-size: 12.5px; color: #4f6770; }
.ai-luka-b, .ai-ponow { border: 0; background: none; padding: 0; color: #0d4b5c; font: 600 12.5px "Onest", system-ui, sans-serif; text-decoration: underline; cursor: pointer; }
.ai-ponow { display: block; margin-top: 6px; }
.ai-blad { color: #7a2f47; }
.ai-dal { display: grid; gap: 5px; margin-left: 38px; }
.ai-dal-t { margin: 2px 0 1px; font: 600 12.5px "Onest", system-ui, sans-serif; color: #4f6770; }
.ai-dq { text-align: left; border: 0; border-radius: 8px; background: rgba(20,160,133,.09); padding: 8px 10px; font: 500 13.5px/1.35 "Source Sans 3", system-ui, sans-serif; color: #0d4b5c; cursor: pointer; }
.ai-dq:hover { background: rgba(20,160,133,.16); }

.ai-form { display: flex; gap: 6px; align-items: flex-end; padding: 8px; border-top: 1px solid #e3eaea; }
.ai-form textarea { flex: 1; min-width: 0; border: 1px solid #c9d4d7; border-radius: 8px; padding: 9px 10px; font: 400 16px/1.35 "Source Sans 3", system-ui, sans-serif; color: #13404f; resize: none; max-height: 120px; }
.ai-form textarea:focus { outline: 0; border-color: #0d4b5c; box-shadow: 0 0 0 3px rgba(13,75,92,.12); }
.ai-wyslij { flex: none; width: 44px; height: 42px; border: 0; border-radius: 8px; background: #0d4b5c; color: #fff; display: grid; place-items: center; cursor: pointer; }
.ai-wyslij:hover { background: #08323e; }
.ai-mik { flex: none; width: 42px; height: 42px; border: 1px solid #c9d4d7; border-radius: 8px; background: #fff; color: #0d4b5c; display: grid; place-items: center; cursor: pointer; }
.ai-mik[hidden] { display: none; }
.ai-mik:hover { border-color: #0d4b5c; }
.ai-mik.on { background: #cc3266; border-color: #cc3266; color: #fff; animation: ai-mik 1.2s ease-in-out infinite; }
@keyframes ai-mik { 50% { box-shadow: 0 0 0 5px rgba(204,50,102,.18); } }
@media (prefers-reduced-motion: reduce) { .ai-mik.on { animation: none; } }
.ai-stopka { margin: 0; padding: 0 12px 8px; font-size: 11.5px; color: #8a9aa0; }

/* Telefon: okno na cały ekran, przycisk mniejszy nad dolną krawędzią. */
@media (max-width: 860px) {
	.ai-l { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 52px; height: 52px; }
	.ai-g { right: 76px; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: calc(100vw - 100px); }
	.ai-p { inset: 0; width: auto; height: auto; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
	html.ailona-otw, html.ailona-otw body { overflow: hidden; }
	.ai-h { min-height: 56px; }
	.ai-h button { min-height: 44px; }
	.ai-h .ai-zamknij { width: 44px; }
	.ai-dym { max-width: calc(100vw - 80px); }
	.ai-dq { min-height: 44px; }
	.ai-czyt, .ai-luka-b, .ai-ponow { padding: 6px 0; }
}

/* Pisanie odpowiedzi (07.11.2026): słowa ukryte do swojej kolejki, akapit pojawia się z pierwszym słowem. */
.ai-w { display: none; }
.ai-w.on { display: inline; }
.ai-czeka { display: none !important; }
.ai-wejdz { animation: ai-wejdz .4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes ai-wejdz { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ai-wejdz { animation: none; } }

/* Kafelek „Czytaj też” (07.11.2026): zdjęcie wyróżniające przez filtr marki #0151, zastępnik ze znakiem portalu. */
.ai-karta { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 6px; background: #fff; border-radius: 8px; text-decoration: none; color: inherit; box-shadow: inset 0 0 0 1px #e3eaea; }
.ai-karta:hover { box-shadow: inset 0 0 0 1px #9fc4c6; }
.ai-karta > img, .ai-karta-ph { flex: none; width: 72px; height: 54px; border-radius: 6px; object-fit: cover; filter: var(--of-ffilt, none); }
.ai-karta-ph { display: grid; place-items: center; background: #0d4b5c; filter: none; }
.ai-karta-ph img { width: 22px; height: 22px; opacity: .9; }
.ai-karta-ph--zewn { background: #20558a; color: #fff; font: 700 12.5px "Onest", system-ui, sans-serif; }
.ai-karta-t { min-width: 0; }
.ai-karta-t small { display: block; font: 600 11.5px "Onest", system-ui, sans-serif; color: #6b8088; }
.ai-karta-t b { display: block; font: 600 13.5px/1.35 "Onest", system-ui, sans-serif; color: #0d4b5c; }

/* PubMed na liście źródeł: ikona-plakietka i opis Vancouver (07.11.2026). */
.ai-wiecej li.ai-li-pm { list-style: none; margin-left: -16px; display: flex; gap: 6px; align-items: baseline; }
.ai-pm { flex: none; display: inline-block; padding: 1px 5px; border-radius: 4px; background: #20558a; color: #fff; font: 700 10.5px/1.5 "Onest", system-ui, sans-serif; }
.ai-wiecej li { margin: 0 0 6px; line-height: 1.4; }

/* Gość po pytaniu próbnym: zaloguj się / załóż konto (07.11.2026). Kształt przycisków jak w motywie (promień 8). */
.ai-wejscie { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-wejscie a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 8px; font: 700 13.5px "Onest", system-ui, sans-serif; text-decoration: none; }
.ai-w-login { background: #0d4b5c; color: #fff; }
.ai-w-login:hover { background: #08323e; }
.ai-w-konto { background: #fff; color: #0d4b5c; box-shadow: inset 0 0 0 1px #c9d4d7; }
.ai-form textarea:disabled { background: #f4f7f7; }
.ai-form button:disabled { opacity: .45; cursor: default; }
@media (max-width: 860px) { .ai-wejscie a { min-height: 44px; } }

/* Dymek z propozycją rozwinięcia (07.11.2026): bez awatara, zaraz pod odpowiedzią. */
.ai-av--pusty { width: 30px; height: 30px; flex: none; }
.ai-m--rozwin { margin-top: -6px; }
.ai-rozwin-tak { border: 0; cursor: pointer; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 8px; background: #0d4b5c; color: #fff; font: 700 13px "Onest", system-ui, sans-serif; }
.ai-rozwin-tak:hover { background: #08323e; }
@media (max-width: 860px) { .ai-rozwin-tak { min-height: 44px; } }
