/* Widżet czatu (assets/js/chat-widget.js) */
.pfc { --pfc-gold: var(--color-primary, #DD9933); font-family: var(--font-body, 'Exo 2', sans-serif); }
.pfc-launch { position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 998; width: 58px; height: 58px; border: 0; border-radius: 50%; background: var(--pfc-gold); color: #111; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 26px rgba(0,0,0,0.45); transition: transform 0.2s; }
.pfc-launch:hover { transform: scale(1.06); }
.pfc-dot { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: #e74c3c; border: 2px solid #0d0d0d; color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 18px; text-align: center; box-sizing: border-box; }
.pfc-dot[hidden] { display: none; }

/* Nowa odpowiedź: ikona "dzwoni", pulsuje obwódką, nad nią dymek z podglądem */
.pfc-launch.pfc-ring { animation: pfc-ring 1s ease-in-out 0s 3, pfc-glow 2s ease-out 3s infinite; }
.pfc-launch.pfc-ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--pfc-gold); animation: pfc-wave 1.6s ease-out infinite; pointer-events: none; }
@keyframes pfc-ring {
    0%, 100% { transform: rotate(0) scale(1); }
    10% { transform: rotate(-16deg) scale(1.15); }
    20% { transform: rotate(14deg) scale(1.15); }
    30% { transform: rotate(-12deg) scale(1.15); }
    40% { transform: rotate(10deg) scale(1.1); }
    50% { transform: rotate(-6deg) scale(1.05); }
    60% { transform: rotate(0) scale(1); }
}
@keyframes pfc-glow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes pfc-wave { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.8); opacity: 0; } }
.pfc-peek { position: fixed; right: 24px; bottom: calc(94px + env(safe-area-inset-bottom)); z-index: 1000; max-width: min(300px, calc(100vw - 48px)); padding: 12px 16px; background: #fff; color: #1a1a1a; border: 0; border-radius: 14px 14px 4px 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.45); font: inherit; font-size: 0.9rem; line-height: 1.4; text-align: left; cursor: pointer; animation: pfc-peek-in 0.35s ease-out; }
.pfc-peek[hidden] { display: none; }
@keyframes pfc-peek-in { from { opacity: 0; transform: translateY(12px) scale(0.95); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pfc-launch.pfc-ring, .pfc-launch.pfc-ring::after, .pfc-peek { animation: none; } }
body.has-pfc .back-to-top { bottom: calc(96px + env(safe-area-inset-bottom)); right: 30px; }

.pfc-panel { position: fixed; right: 24px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 1001; width: 370px; height: min(560px, calc(100vh - 130px)); display: flex; flex-direction: column; background: #141414; border: 1px solid #2a2a2a; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.pfc-panel[hidden] { display: none; }
.pfc-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: #1a1a1a; border-bottom: 1px solid #2a2a2a; }
.pfc-head .pfc-head-text { flex: 1; min-width: 0; }
.pfc-avatar { position: relative; flex: none; width: 44px; height: 44px; }
.pfc-avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--pfc-gold); display: block; box-sizing: border-box; }
.pfc-online { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #2ecc71; border: 2px solid #1a1a1a; }
.pfc-is-night .pfc-online { background: #777; }
.pfc-call { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--pfc-gold); color: #111; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: transform 0.15s, background 0.15s; }
.pfc-call:hover { transform: scale(1.08); background: var(--color-primary-dark, #c4832a); }
.pfc-head strong { display: block; color: #fff; font-size: 0.98rem; }
.pfc-head-text span { display: block; color: #8fd19e; font-size: 0.76rem; margin-top: 2px; }
.pfc-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #262626; color: #ddd; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.pfc-msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pfc-msg { max-width: 84%; padding: 9px 13px; border-radius: 14px; font-size: 0.92rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.pfc-client { align-self: flex-end; background: var(--pfc-gold); color: #111; border-bottom-right-radius: 4px; }
.pfc-admin { align-self: flex-start; background: #262626; color: #eee; border-bottom-left-radius: 4px; }
.pfc-typing { display: flex; gap: 4px; padding: 13px 14px; }
.pfc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #999; animation: pfc-typing 1s infinite ease-in-out; }
.pfc-typing i:nth-child(2) { animation-delay: 0.15s; }
.pfc-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pfc-typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.pfc-system { align-self: center; max-width: 94%; background: rgba(221,153,51,0.08); border: 1px solid rgba(221,153,51,0.35); color: #d8c29a; font-size: 0.84rem; text-align: center; }
.pfc-email { padding: 12px 14px; border-top: 1px solid #2a2a2a; background: #1a1a1a; display: flex; flex-direction: column; gap: 8px; }
.pfc-email[hidden] { display: none; }
.pfc-email p { margin: 0; color: #ccc; font-size: 0.85rem; }
.pfc-email textarea { width: 100%; padding: 10px 12px; background: #0d0d0d; border: 1px solid #333; border-radius: 8px; color: #eee; font: inherit; font-size: 16px; box-sizing: border-box; resize: vertical; min-height: 80px; }
.pfc-email textarea:focus { outline: none; border-color: var(--pfc-gold); }
.pfc-head-text span.pfc-off { color: #999; }
.pfc-email input { width: 100%; padding: 10px 12px; background: #0d0d0d; border: 1px solid #333; border-radius: 8px; color: #eee; font: inherit; font-size: 16px; box-sizing: border-box; }
.pfc-email input:focus, .pfc-form textarea:focus { outline: none; border-color: var(--pfc-gold); }
.pfc-email button { padding: 11px; border: 0; border-radius: 8px; background: var(--pfc-gold); color: #111; font: inherit; font-weight: 700; cursor: pointer; }
.pfc-form[hidden] { display: none; }
.pfc-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #2a2a2a; }
.pfc-form textarea { flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 120px; padding: 11px 12px; background: #0d0d0d; border: 1px solid #333; border-radius: 10px; color: #eee; font: inherit; font-size: 16px; box-sizing: border-box; }
.pfc-form button { flex: none; width: 46px; border: 0; border-radius: 10px; background: var(--pfc-gold); color: #111; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pfc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.pfc-legal { margin: 0; padding: 0 12px 10px; font-size: 0.68rem; color: #666; }
.pfc-legal a { color: #888; }

@media (max-width: 640px) {
    .pfc-launch { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 54px; height: 54px; }
    .pfc-peek { right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); }
    .pfc.pfc-is-open .pfc-peek { display: none; }
    body.has-pfc .back-to-top { bottom: calc(82px + env(safe-area-inset-bottom)); right: 20px; }
    .pfc-panel { inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
    .pfc.pfc-is-open .pfc-launch { display: none; }
}
