/* Self-contained product chat, designed for narrow screens first. */
.rp-chat, .rp-chat * { box-sizing: border-box; }
.rp-chat { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.rp-chat button, .rp-chat textarea { font: inherit; }
.rp-chat-launch { position: fixed; z-index: 95; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 7px 17px 7px 7px; border: 1px solid rgba(255,255,255,.25); border-radius: 100px; background: #14191b; color: white; box-shadow: 0 12px 36px rgba(0,0,0,.25); cursor: pointer; font-size: 13px; font-weight: 650; letter-spacing: -.01em; transition: transform .2s, box-shadow .2s; }
.rp-chat-launch:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.rp-chat-launch-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: #39d98a; color: #082317; }
.rp-chat svg { display: block; width: 21px; height: 21px; }
.rp-chat-panel[hidden] { display: none; }
.rp-chat-panel { position: fixed; max-width: 100vw; z-index: 100; inset: auto 0 var(--rp-chat-bottom, 0px) 0; width: 100%; height: var(--rp-chat-height, min(740px, 100dvh)); display: flex; flex-direction: column; overflow: hidden; border-radius: 24px 24px 0 0; border: 1px solid rgba(255,255,255,.5); background: #f7f9f7; color: #18201e; box-shadow: 0 -20px 70px rgba(0,0,0,.3); }
.rp-chat.is-open::before { content: ''; position: fixed; z-index: 99; inset: 0; background: rgba(4,14,10,.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.rp-chat.is-open .rp-chat-launch { display: none; }
.rp-chat-head { min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 12px 14px; flex: none; background: linear-gradient(130deg, #141b1b, #25312c); color: #f6f9f6; }
.rp-chat-badge { width: 41px; height: 41px; display: grid; place-items: center; flex: none; border-radius: 13px; background: #38d98a; color: #092718; font-size: 23px; font-weight: 850; letter-spacing: -.1em; }
.rp-chat-badge span { font-size: 11px; margin-left: 2px; }
.rp-chat-heading { min-width: 0; flex: 1; }
.rp-chat-heading strong { display: block; font-size: 14px; letter-spacing: .055em; white-space: nowrap; }
.rp-chat-heading small { display: flex; align-items: center; gap: 6px; color: #acbbb6; font-size: 11px; }
.rp-chat-heading i { width: 6px; height: 6px; border-radius: 50%; background: #38d98a; box-shadow: 0 0 0 3px rgba(56,217,138,.12); }
.rp-chat-icon-button { width: 35px; height: 35px; flex: none; display: grid; place-items: center; border: 0; border-radius: 11px; background: rgba(255,255,255,.08); color: #d6e0dc; cursor: pointer; }
.rp-chat-icon-button:hover { background: rgba(255,255,255,.16); }
.rp-chat-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 26px 17px 16px; }
.rp-chat-intro { max-width: 300px; margin: 0 auto 22px; text-align: center; }
.rp-chat-spark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 17px; background: #e1f9e9; color: #16895b; font-size: 29px; }
.rp-chat-intro h2 { margin: 0 0 8px; color: #17221c; font-size: 21px; font-weight: 740; letter-spacing: -.04em; line-height: 1.15; }
.rp-chat-intro p { margin: 0; color: #66746b; font-size: 13px; line-height: 1.45; }
.rp-chat-messages { display: flex; flex-direction: column; gap: 13px; }
.rp-chat-row { display: flex; }
.rp-chat-row-user { justify-content: flex-end; }
.rp-chat-bubble { max-width: 90%; padding: 12px 15px; border-radius: 17px; background: #e8eeea; color: #25332b; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-chat-bubble a { color: #1e8a3a; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.rp-chat-row-user .rp-chat-bubble { border-bottom-right-radius: 5px; background: #162c22; color: white; }
.rp-chat-row-assistant .rp-chat-bubble { border-bottom-left-radius: 5px; }
.rp-chat-row-error .rp-chat-bubble { background: #fff0e8; color: #97441e; }
.rp-chat-row.is-pending .rp-chat-bubble { color: #738078; animation: rp-chat-pulse 1.2s ease-in-out infinite alternate; }
.rp-chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.rp-chat-suggestions button { padding: 9px 12px; border: 1px solid #c9ded1; border-radius: 100px; background: white; color: #246747; cursor: pointer; font-size: 12px; line-height: 1.2; text-align: left; }
.rp-chat-suggestions button:hover { background: #e9f8ee; }
.rp-chat-form { display: flex; align-items: flex-end; gap: 9px; flex: none; margin: 0 12px; padding: 7px 7px 7px 14px; border: 1px solid #cbd9d0; border-radius: 19px; background: white; box-shadow: 0 4px 15px rgba(0,0,0,.04); }
.rp-chat-form:focus-within { border-color: #49b882; box-shadow: 0 0 0 3px rgba(57,217,138,.14); }
/* iOS Safari zooms the page into any focused field under 16px. */
.rp-chat-form textarea { width: 100%; min-height: 29px; max-height: 126px; padding: 5px 0 3px; resize: none; border: 0; outline: 0; background: transparent; color: #18251e; font-size: 16px; line-height: 21px; }
.rp-chat-form textarea::placeholder { color: #83918a; }
.rp-chat-send { width: 37px; height: 37px; display: grid; place-items: center; flex: none; border: 0; border-radius: 12px; background: #33cc7d; color: #0a2a18; cursor: pointer; }
.rp-chat-send:hover { background: #4ce195; }
.rp-chat-send:disabled { opacity: .5; cursor: wait; }
.rp-chat-note { margin: 8px 14px max(9px, env(safe-area-inset-bottom)); color: #7b8980; font-size: 10px; line-height: 1.2; text-align: center; }
.rp-chat-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.rp-chat button:focus-visible { outline: 2px solid #18b56b; outline-offset: 2px; }
@media (min-width: 600px) { .rp-chat-head { border-radius: 21px 21px 0 0; } .rp-chat-panel { inset: auto 22px 85px auto; width: min(390px, calc(100vw - 44px)); height: min(640px, calc(100dvh - 110px)); border-radius: 22px; box-shadow: 0 22px 70px rgba(0,0,0,.27); } .rp-chat.is-open::before { display: none; } .rp-chat-scroll { padding: 28px 20px 18px; } }
/* Efekty otwierania (sterowane z chat.js): nakładka w kolorze przycisku, odblask i warstwa iskier. */
.rp-chat-panel { transform-origin: 100% 100%; isolation: isolate; }
.rp-chat-panel.is-morphing { will-change: transform, clip-path; }
/* Safari nie przycina dzieci z własną warstwą (animacja 3D) do border-radius
   rodzica, więc nagłówek ma własne zaokrąglenie (promień panelu minus ramka). */
.rp-chat-head { border-radius: 23px 23px 0 0; }
.rp-chat-cloak { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: flex-end; padding: 7px; background: #14191b; opacity: 0; pointer-events: none; }
.rp-chat-cloak .rp-chat-launch-icon { flex: none; box-shadow: 0 0 30px rgba(57,217,138,.7); }
.rp-chat-sheen { position: absolute; z-index: 6; top: -10%; bottom: -10%; left: 0; width: 45%; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.55) 45%, rgba(190,255,220,.35) 55%, rgba(255,255,255,0)); mix-blend-mode: soft-light; opacity: 0; pointer-events: none; }
.rp-chat-fx { position: fixed; inset: 0; z-index: 101; width: 100vw; height: 100vh; pointer-events: none; }
.rp-chat-panel.is-entering .rp-chat-head { animation: rp-chat-layer .55s .18s cubic-bezier(.2,.9,.3,1.1) both; }
.rp-chat-panel.is-entering .rp-chat-intro { animation: rp-chat-layer .6s .3s cubic-bezier(.2,.9,.3,1.1) both; }
.rp-chat-panel.is-entering .rp-chat-spark { animation: rp-chat-spin 1s .36s cubic-bezier(.3,.8,.3,1) both; }
.rp-chat-panel.is-entering .rp-chat-messages, .rp-chat-panel.is-entering .rp-chat-suggestions { animation: rp-chat-layer .6s .42s cubic-bezier(.2,.9,.3,1.1) both; }
.rp-chat-panel.is-entering .rp-chat-form { animation: rp-chat-layer .6s .5s cubic-bezier(.2,.9,.3,1.1) both; }
.rp-chat-launch { transition: transform .25s, box-shadow .25s; }
.rp-chat-launch:hover .rp-chat-launch-icon { animation: rp-chat-spin .7s ease both; }
@keyframes rp-chat-layer { from { opacity: 0; -webkit-transform: perspective(700px) translate3d(0, 22px, -80px) rotateX(-22deg); transform: perspective(700px) translate3d(0, 22px, -80px) rotateX(-22deg); } to { opacity: 1; -webkit-transform: none; transform: none; } }
@keyframes rp-chat-spin { from { transform: perspective(400px) rotateY(-180deg) scale(.6); } to { transform: perspective(400px) rotateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .rp-chat-launch, .rp-chat-launch-icon, .rp-chat-row.is-pending .rp-chat-bubble, .rp-chat-panel, .rp-chat-panel * { transition: none !important; animation: none !important; } .rp-chat-cloak, .rp-chat-sheen, .rp-chat-fx { display: none; } }
@keyframes rp-chat-pulse { to { opacity: .55; } }
