#pwc-root, #pwc-root * { box-sizing: border-box; }
#pwc-root {
  --pwc-color: #231D68;
  position: fixed; right: 24px; bottom: 100px; z-index: 99990;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.45; color: #1e293b;
}

.pwc-bubble {
  position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--pwc-color); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); transition: transform .15s ease;
}
.pwc-bubble:hover { transform: scale(1.06); }
.pwc-bubble:focus-visible, .pwc-btn:focus-visible, .pwc-close:focus-visible { outline: 3px solid #f5c542; outline-offset: 2px; }
.pwc-bubble svg { width: 30px; height: 30px; display: block; }
.pwc-bubble svg, .pwc-bubble svg path { fill: #fff !important; }
.pwc-badge {
  position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #e11d48; color: #fff; font-size: 12px; font-weight: 700; display: none; align-items: center; justify-content: center;
}
.pwc-badge.show { display: flex; }

.pwc-panel {
  position: absolute; right: 0; bottom: 72px; width: 360px; max-width: calc(100vw - 24px);
  height: 480px; max-height: calc(100vh - 210px); display: none; flex-direction: column;
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.pwc-panel.open { display: flex; }

.pwc-head { background: var(--pwc-color); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.pwc-head strong { font-size: 16px; }
.pwc-close { background: transparent; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }

.pwc-body { flex: 1; overflow-y: auto; padding: 14px; background: #f8fafc; }
.pwc-intro { color: #475569; margin: 0 0 12px; }

.pwc-msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pwc-msg.visitor { margin-left: auto; background: var(--pwc-color); color: #fff; border-bottom-right-radius: 3px; }
.pwc-msg.agent { background: #fff; border: 1px solid #e2e8f0; border-bottom-left-radius: 3px; }
.pwc-note { text-align: center; color: #64748b; font-size: 13px; margin: 8px 0; }
.pwc-note .pwc-link { background: none; border: 0; color: var(--pwc-color); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

.pwc-form { display: flex; flex-direction: column; gap: 10px; }
.pwc-form label { font-size: 12px; font-weight: 600; color: #475569; display: block; margin-bottom: 3px; }
.pwc-form input[type=text], .pwc-form input[type=email], .pwc-form input[type=tel], .pwc-form textarea {
  width: 100%; font: inherit; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #1e293b;
}
.pwc-form input:focus, .pwc-form textarea:focus, .pwc-compose textarea:focus { outline: 2px solid var(--pwc-color); outline-offset: 0; }
.pwc-form textarea { resize: vertical; min-height: 70px; }
.pwc-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: #475569; }
.pwc-consent input { margin-top: 3px; }
.pwc-consent label { margin: 0; font-weight: 400; font-size: 12.5px; }
.pwc-consent a { color: var(--pwc-color); }
.pwc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pwc-error { color: #b91c1c; font-size: 13px; min-height: 0; margin: 0; }
.pwc-ok { color: #047857; font-weight: 600; }

.pwc-btn { background: var(--pwc-color); color: #fff; border: 0; border-radius: 8px; padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.pwc-btn:disabled { opacity: .55; cursor: not-allowed; }

.pwc-compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e2e8f0; background: #fff; }
.pwc-compose textarea { flex: 1; font: inherit; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; resize: none; height: 40px; max-height: 96px; }

@media (max-width: 480px) {
  #pwc-root { right: 14px; bottom: 132px; }
  .pwc-panel { position: fixed; right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%; height: 85vh; max-height: 100vh; border-radius: 14px 14px 0 0; }
}
@media (prefers-reduced-motion: reduce) { .pwc-bubble { transition: none; } }

.pwc-inline-form { width: 100%; max-width: none; font-family: inherit; color: #1e293b; }
.pwc-inline-form .pwc-title, .pwc-inline-form .pwc-inline-title { margin: 0 0 14px; color: var(--pwc-color); }
.pwc-inline-form .pwc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.pwc-inline-form .pwc-form > :nth-child(n+5) { grid-column: 1 / -1; }
.pwc-inline-form .pwc-form input[type=text],
.pwc-inline-form .pwc-form input[type=email],
.pwc-inline-form .pwc-form input[type=tel] { padding: 8px 12px; }
.pwc-inline-form .pwc-form textarea { min-height: 64px; height: 64px; padding: 8px 12px; }
.pwc-inline-form .pwc-error { min-height: 0; }
.pwc-inline-form .pwc-error:empty { display: none; }
@media (max-width: 640px) {
  .pwc-inline-form .pwc-form { grid-template-columns: 1fr; }
}
