:root{--pcw-chat-bg:#071425;--pcw-chat-panel:#0b1c31;--pcw-chat-card:#102640;--pcw-chat-line:#254b70;--pcw-chat-text:#f4f8ff;--pcw-chat-muted:#9eb4ca;--pcw-chat-cyan:#49c8ff;--pcw-chat-blue:#4d6dff;--pcw-chat-green:#42e7a5;--pcw-chat-red:#ff667a}
.pcw-chat{position:fixed;right:24px;bottom:92px;z-index:99990;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--pcw-chat-text)}
.pcw-chat-launcher{min-width:206px;height:58px;border:1px solid rgba(73,200,255,.38);border-radius:18px;background:linear-gradient(135deg,rgba(13,40,68,.96),rgba(8,23,42,.96));box-shadow:0 18px 50px rgba(0,0,0,.3),0 0 0 1px rgba(77,109,255,.08) inset;color:#fff;display:grid;grid-template-columns:38px 1fr 10px;align-items:center;gap:10px;padding:8px 13px;cursor:pointer;text-align:left;transition:.22s ease}
.pcw-chat-launcher:hover{transform:translateY(-2px);border-color:rgba(73,200,255,.7);box-shadow:0 20px 54px rgba(0,0,0,.36),0 0 26px rgba(73,200,255,.12)}
.pcw-chat-launcher-icon{width:36px;height:36px;border-radius:12px;background:rgba(73,200,255,.08);display:grid;place-items:center}.pcw-chat-launcher-icon svg{width:20px;fill:none;stroke:var(--pcw-chat-cyan);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.pcw-chat-launcher-copy{display:flex;flex-direction:column;line-height:1.15}.pcw-chat-launcher-copy strong{font-size:13px}.pcw-chat-launcher-copy small{font-size:10px;color:var(--pcw-chat-muted);margin-top:4px}.pcw-chat-dot{width:8px;height:8px;border-radius:50%;background:var(--pcw-chat-red);box-shadow:0 0 10px rgba(255,102,122,.55)}.pcw-chat-dot.online{background:var(--pcw-chat-green);box-shadow:0 0 12px rgba(66,231,165,.65)}
.pcw-chat-panel{position:absolute;right:0;bottom:72px;width:min(390px,calc(100vw - 28px));height:min(650px,calc(100vh - 120px));background:linear-gradient(180deg,rgba(9,27,47,.985),rgba(5,17,32,.99));border:1px solid rgba(73,200,255,.26);border-radius:24px;overflow:hidden;box-shadow:0 28px 80px rgba(0,0,0,.5),0 0 0 1px rgba(77,109,255,.06) inset;opacity:0;transform:translateY(12px) scale(.985);transition:opacity .18s ease,transform .18s ease;display:flex;flex-direction:column}
.pcw-chat.is-open .pcw-chat-panel{opacity:1;transform:none}.pcw-chat-head{min-height:76px;padding:14px 16px;border-bottom:1px solid rgba(111,167,220,.18);display:flex;align-items:center;justify-content:space-between;background:linear-gradient(90deg,rgba(73,200,255,.06),rgba(77,109,255,.04))}.pcw-chat-brand{display:flex;align-items:center;gap:11px}.pcw-chat-brandmark{width:42px;height:42px;border-radius:50%;background:linear-gradient(135deg,#6615a8,#3926d3);display:grid;place-items:center;font-weight:900;font-size:12px;box-shadow:0 0 22px rgba(100,40,210,.26)}.pcw-chat-brand div{display:flex;flex-direction:column}.pcw-chat-brand strong{font-size:15px}.pcw-chat-brand small{font-size:10px;color:var(--pcw-chat-green);margin-top:3px}.is-offline .pcw-chat-brand small{color:var(--pcw-chat-red)}.pcw-chat-close{border:0;background:transparent;color:#bcd1e5;font-size:28px;width:36px;height:36px;cursor:pointer;border-radius:10px}.pcw-chat-close:hover{background:rgba(255,255,255,.05);color:#fff}
.pcw-chat-body{flex:1;min-height:0;overflow:auto;padding:18px}.pcw-chat-prechat h3{font-size:22px;margin:0 0 8px;color:#fff}.pcw-chat-prechat>p{margin:0 0 18px;color:var(--pcw-chat-muted);font-size:13px;line-height:1.55}.pcw-chat-prechat form{display:grid;gap:12px}.pcw-chat-prechat label{display:grid;gap:6px;color:#dbe9f6;font-size:11px;font-weight:700}.pcw-chat-prechat label span em{font-style:normal;font-weight:400;color:#7895ad}.pcw-chat-prechat input,.pcw-chat-prechat select,.pcw-chat-compose textarea{width:100%;box-sizing:border-box;background:#09192c;border:1px solid #244361;border-radius:12px;color:#fff;padding:11px 12px;outline:0;font:inherit;transition:.15s}.pcw-chat-prechat input:focus,.pcw-chat-prechat select:focus,.pcw-chat-compose textarea:focus{border-color:var(--pcw-chat-cyan);box-shadow:0 0 0 3px rgba(73,200,255,.08)}.pcw-chat-prechat select option{background:#09192c;color:#fff}.pcw-chat-consent{grid-template-columns:18px 1fr!important;align-items:start;gap:9px!important;font-size:10px!important;line-height:1.45;font-weight:400!important;color:#93abc0!important}.pcw-chat-consent input{width:16px;height:16px;margin-top:1px}.pcw-chat-consent a{color:var(--pcw-chat-cyan)}.pcw-chat-primary{height:46px;border:0;border-radius:13px;background:linear-gradient(100deg,var(--pcw-chat-blue),var(--pcw-chat-cyan));color:#fff;font-weight:800;cursor:pointer;box-shadow:0 12px 26px rgba(62,122,255,.2)}.pcw-chat-primary:disabled{opacity:.55;cursor:wait}.pcw-chat-form-error{margin:0;color:#ff98a7;font-size:11px}
.pcw-chat-conversation{height:100%;display:flex;flex-direction:column;min-height:0}.pcw-chat-messages{flex:1;overflow:auto;padding:2px 2px 14px;display:flex;flex-direction:column;gap:9px}.pcw-chat-msg{max-width:83%;display:flex}.pcw-chat-msg>div{padding:10px 12px;border-radius:15px;font-size:13px;line-height:1.45;white-space:pre-wrap;word-break:break-word}.pcw-chat-msg.customer{align-self:flex-end}.pcw-chat-msg.customer>div{background:linear-gradient(135deg,#315fe8,#268bc9);border-bottom-right-radius:5px}.pcw-chat-msg.agent{align-self:flex-start}.pcw-chat-msg.agent>div{background:#112944;border:1px solid rgba(82,142,197,.24);border-bottom-left-radius:5px}.pcw-chat-msg.system>div{background:#3b2430;color:#ffc5cf}.pcw-chat-offline-note{font-size:10px;line-height:1.5;color:#ffc2cb;background:rgba(115,23,43,.2);border:1px solid rgba(255,102,122,.28);border-radius:11px;padding:8px 10px;margin-bottom:9px}.pcw-chat-compose{display:grid;grid-template-columns:1fr 44px;gap:8px;align-items:end;border-top:1px solid rgba(111,167,220,.16);padding-top:12px}.pcw-chat-compose textarea{resize:none;min-height:44px;max-height:110px}.pcw-chat-compose button{width:44px;height:44px;border:0;border-radius:13px;background:linear-gradient(135deg,var(--pcw-chat-blue),var(--pcw-chat-cyan));display:grid;place-items:center;cursor:pointer}.pcw-chat-compose svg{width:20px;fill:none;stroke:#fff;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.pcw-chat-foot{height:34px;border-top:1px solid rgba(111,167,220,.12);display:grid;place-items:center;color:#637f98;font-size:9px;letter-spacing:.02em}
@media(max-width:700px){.pcw-chat{right:12px;bottom:96px}.pcw-chat-launcher{min-width:54px;width:54px;height:54px;border-radius:17px;grid-template-columns:1fr;padding:8px}.pcw-chat-launcher-copy,.pcw-chat-launcher .pcw-chat-dot{display:none}.pcw-chat-launcher-icon{margin:auto}.pcw-chat-panel{position:fixed;inset:10px 10px 74px;width:auto;height:auto;border-radius:20px}.pcw-chat-body{padding:15px}}
@media(prefers-reduced-motion:reduce){.pcw-chat *{transition:none!important;animation:none!important}}

/* v1.0.6 — branding + operator + connection state */
.pcw-chat-head{min-height:88px}
.pcw-chat-brandmark{width:48px;height:48px;border-radius:14px;background:rgba(255,255,255,.04);overflow:hidden;box-shadow:0 0 22px rgba(100,40,210,.2)}
.pcw-chat-brandmark img{width:100%;height:100%;object-fit:contain;display:block}
.pcw-chat-brand>div{gap:1px}.pcw-chat-operator{font-size:11px;font-weight:700;color:#d7e6f4;line-height:1.2}.pcw-chat-brand small{margin-top:2px}
.pcw-chat-connection{display:flex;align-items:center;gap:9px;margin:0 0 12px;padding:10px 12px;border-radius:12px;font-size:11px;font-weight:700;line-height:1.35;border:1px solid rgba(111,167,220,.2);background:rgba(17,41,68,.64);color:#cfe0ef}
.pcw-chat-connection-dot{width:8px;height:8px;border-radius:50%;flex:0 0 8px;background:#f7b955;box-shadow:0 0 11px rgba(247,185,85,.55)}
.pcw-chat-connection.is-waiting{background:rgba(117,83,21,.18);border-color:rgba(247,185,85,.28);color:#ffe4aa}
.pcw-chat-connection.is-connected{background:rgba(20,111,79,.18);border-color:rgba(66,231,165,.28);color:#c8ffe9}.pcw-chat-connection.is-connected .pcw-chat-connection-dot{background:var(--pcw-chat-green);box-shadow:0 0 12px rgba(66,231,165,.65)}
.pcw-chat-connection.is-closed{background:rgba(115,23,43,.18);border-color:rgba(255,102,122,.25);color:#ffcbd3}.pcw-chat-connection.is-closed .pcw-chat-connection-dot{background:var(--pcw-chat-red);box-shadow:0 0 10px rgba(255,102,122,.55)}
@media(max-width:700px){.pcw-chat-head{min-height:84px}.pcw-chat-brandmark{width:44px;height:44px}.pcw-chat-brand strong{font-size:14px}.pcw-chat-operator{font-size:10px}}
.pcw-chat-brandmark{width:122px;height:48px;border-radius:10px;flex:0 0 122px}.pcw-chat-brandmark img{object-fit:contain;object-position:left center}.pcw-chat-brand>div{min-width:112px}
@media(max-width:700px){.pcw-chat-brandmark{width:112px;height:44px;flex-basis:112px}.pcw-chat-brand>div{min-width:100px}}

/* v1.0.7 — właściwy branding PC-Wizard.pl + czytelny stan oczekiwania */
.pcw-chat-brandmark{
  width:58px!important;height:58px!important;border-radius:14px!important;
  background:rgba(255,255,255,.04)!important;padding:3px!important;
  overflow:hidden;box-shadow:0 0 0 1px rgba(111,167,220,.16),0 8px 22px rgba(0,0,0,.18)!important;
}
.pcw-chat-brandmark img{width:100%!important;height:100%!important;object-fit:contain!important;display:block!important;border-radius:11px!important}
.pcw-chat-head{min-height:90px!important}.pcw-chat-brand{gap:12px!important}
.pcw-chat-waiting-help{display:grid;gap:4px;margin:-4px 0 12px;padding:11px 12px;border:1px solid rgba(73,200,255,.18);border-radius:12px;background:rgba(73,200,255,.055);color:#bcd3e7;font-size:11px;line-height:1.45}
.pcw-chat-waiting-help strong{font-size:12px;color:#eef8ff}.pcw-chat-waiting-help[hidden]{display:none!important}
@media(max-width:700px){.pcw-chat-brandmark{width:54px!important;height:54px!important}.pcw-chat-head{min-height:88px!important}}


/* v1.0.10 — security hardening + większy odstęp od przycisku „do góry” */
.pcw-chat-hp{position:absolute!important;left:-10000px!important;top:auto!important;width:1px!important;height:1px!important;overflow:hidden!important;opacity:0!important;pointer-events:none!important}
@media(min-width:701px){#pcw-chat-root.pcw-chat{bottom:92px!important}}
@media(max-width:700px){#pcw-chat-root.pcw-chat{bottom:96px!important}}


/* v1.0.11 — mobile UX / safe-area / brak kolizji z przyciskiem „do góry” */
@media (min-width:701px){
  #pcw-chat-root.pcw-chat{bottom:100px!important}
}
@media (max-width:700px){
  #pcw-chat-root.pcw-chat{
    right:12px!important;
    bottom:calc(148px + env(safe-area-inset-bottom,0px))!important;
  }
  #pcw-chat-root .pcw-chat-launcher{
    width:56px!important;min-width:56px!important;height:56px!important;
    border-radius:18px!important;
    box-shadow:0 14px 34px rgba(0,0,0,.38),0 0 0 1px rgba(73,200,255,.10) inset!important;
  }
  #pcw-chat-root .pcw-chat-panel[hidden]{display:none!important}
  #pcw-chat-root.is-open .pcw-chat-launcher{display:none!important}
  #pcw-chat-root.is-open .pcw-chat-panel{
    display:flex!important;
    position:fixed!important;
    top:max(8px,env(safe-area-inset-top,0px))!important;
    right:8px!important;
    bottom:max(8px,env(safe-area-inset-bottom,0px))!important;
    left:8px!important;
    width:auto!important;
    height:auto!important;
    max-width:none!important;
    max-height:none!important;
    min-height:0!important;
    border-radius:18px!important;
    overflow:hidden!important;
    opacity:1!important;
    transform:none!important;
    z-index:2147483000!important;
  }
  #pcw-chat-root .pcw-chat-head{
    flex:0 0 auto!important;
    min-height:72px!important;
    padding:10px 12px!important;
  }
  #pcw-chat-root .pcw-chat-brand{gap:9px!important;min-width:0!important}
  #pcw-chat-root .pcw-chat-brandmark{
    width:48px!important;height:48px!important;flex:0 0 48px!important;padding:2px!important;
  }
  #pcw-chat-root .pcw-chat-brand>div{min-width:0!important;max-width:calc(100vw - 112px)!important}
  #pcw-chat-root .pcw-chat-operator{font-size:11px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #pcw-chat-root .pcw-chat-brand small{font-size:9.5px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #pcw-chat-root .pcw-chat-close{flex:0 0 40px!important;width:40px!important;height:40px!important;font-size:30px!important}
  #pcw-chat-root .pcw-chat-body{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    padding:13px!important;
  }
  #pcw-chat-root .pcw-chat-prechat{min-height:min-content}
  #pcw-chat-root .pcw-chat-prechat h3{font-size:20px!important}
  #pcw-chat-root .pcw-chat-prechat form{gap:10px!important}
  #pcw-chat-root .pcw-chat-prechat input,
  #pcw-chat-root .pcw-chat-prechat select{font-size:16px!important;min-height:44px!important}
  #pcw-chat-root .pcw-chat-conversation{height:100%!important;min-height:0!important}
  #pcw-chat-root .pcw-chat-messages{
    flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;
  }
  #pcw-chat-root .pcw-chat-compose{
    flex:0 0 auto!important;
    grid-template-columns:minmax(0,1fr) 46px!important;
    padding-top:10px!important;
    padding-bottom:calc(2px + env(safe-area-inset-bottom,0px))!important;
    background:linear-gradient(180deg,rgba(5,17,32,0),rgba(5,17,32,.96) 18%)!important;
  }
  #pcw-chat-root .pcw-chat-compose textarea{
    font-size:16px!important;
    min-height:46px!important;
    max-height:92px!important;
  }
  #pcw-chat-root .pcw-chat-compose button{width:46px!important;height:46px!important}
  #pcw-chat-root .pcw-chat-foot{display:none!important}
}
@media (max-width:380px){
  #pcw-chat-root.pcw-chat{bottom:calc(140px + env(safe-area-inset-bottom,0px))!important}
  #pcw-chat-root.is-open .pcw-chat-panel{top:max(4px,env(safe-area-inset-top,0px))!important;right:4px!important;bottom:max(4px,env(safe-area-inset-bottom,0px))!important;left:4px!important;border-radius:16px!important}
  #pcw-chat-root .pcw-chat-body{padding:11px!important}
}


/* v1.0.12 — interaction isolation: widget must never cover page controls while closed */
#pcw-chat-root.pcw-chat{
  width:0!important;
  height:0!important;
  min-width:0!important;
  min-height:0!important;
  max-width:0!important;
  max-height:0!important;
  overflow:visible!important;
  pointer-events:none!important;
}
#pcw-chat-root .pcw-chat-launcher{
  position:absolute!important;
  right:0!important;
  bottom:0!important;
  pointer-events:auto!important;
  touch-action:manipulation;
}
#pcw-chat-root .pcw-chat-panel{
  pointer-events:none!important;
}
#pcw-chat-root .pcw-chat-panel[hidden]{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
#pcw-chat-root.is-open .pcw-chat-panel{
  visibility:visible!important;
  pointer-events:auto!important;
}
#pcw-chat-root:not(.is-open) .pcw-chat-panel{
  pointer-events:none!important;
}
@media (max-width:700px){
  #pcw-chat-root.pcw-chat{
    width:0!important;
    height:0!important;
    min-width:0!important;
    min-height:0!important;
    max-width:0!important;
    max-height:0!important;
    pointer-events:none!important;
  }
  #pcw-chat-root .pcw-chat-launcher{
    position:absolute!important;
    right:0!important;
    bottom:0!important;
    pointer-events:auto!important;
  }
  #pcw-chat-root:not(.is-open) .pcw-chat-panel{
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  #pcw-chat-root.is-open .pcw-chat-panel{
    display:flex!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
}
