/* Plumbix note: shared visual styling for support chat pro. */
/* Plumbix — Chat assistente stile e-commerce premium */

.plumbix-chat-pro {
  --chat-primary: #1a66d9;
  --chat-primary-dark: #0e4ea8;
  --chat-bg: #f4f7fb;
  --chat-surface: #ffffff;
  --chat-border: #e2eaf4;
  --chat-user: linear-gradient(135deg, #1a66d9 0%, #0e4ea8 100%);
  --chat-bot: #ffffff;
  --chat-radius: 16px;
  --chat-shadow: 0 6px 28px rgba(14, 78, 168, 0.1);
  font-family: Inter, system-ui, sans-serif;
}

.plumbix-chat-pro .chat-shell {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 340px);
  gap: 0;
  border-radius: var(--chat-radius);
  overflow: hidden;
  border: 1px solid var(--chat-border);
  box-shadow: var(--chat-shadow);
  background: var(--chat-surface);
  min-height: 520px;
}

.plumbix-chat-pro .chat-main {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  background: var(--chat-bg);
}

.plumbix-chat-pro .chat-messenger-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(120deg, #1a66d9 0%, #0e4ea8 55%, #0a3d7a 100%);
  color: #fff;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.plumbix-chat-pro .chat-agent-info {
  flex: 1;
  min-width: 140px;
}

.plumbix-chat-pro .chat-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.plumbix-chat-pro .chat-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.plumbix-chat-pro .chat-header-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.5);
}

.plumbix-chat-pro .chat-header-btn--outline {
  background: transparent;
}

.plumbix-chat-pro .chat-topic-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin: 0;
  padding: 8px 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plumbix-chat-pro .chat-topic-mount {
  background: #fff;
  border-bottom: 1px solid var(--chat-border);
}

.plumbix-chat-pro .chat-welcome-card {
  font-size: 0.88rem;
  line-height: 1.55;
}

.plumbix-chat-pro .chat-welcome-lead {
  margin: 0 0 12px;
}

.plumbix-chat-pro .chat-welcome-links {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plumbix-chat-pro .chat-welcome-links li { margin: 0; }

.plumbix-chat-pro .chat-welcome-links .chat-product-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin: 0;
}

.plumbix-chat-pro .chat-welcome-tip {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
}

.plumbix-chat-pro .chat-inline-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.plumbix-chat-pro .chat-inline-notice > i {
  font-size: 1.1rem;
  margin-top: 2px;
}

.plumbix-chat-pro .chat-inline-notice p {
  margin: 4px 0 0;
  font-size: 0.8rem;
  opacity: 0.9;
}

.plumbix-chat-pro .chat-inline-notice--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.plumbix-chat-pro .chat-inline-notice--ticket {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0c4a6e;
}

.plumbix-chat-pro .chat-inline-cta {
  margin-top: 10px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: var(--chat-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.plumbix-chat-pro .chat-composer-inner:focus-within {
  border-color: var(--chat-primary);
  box-shadow: 0 0 0 3px rgba(26, 102, 217, 0.12);
}

.plumbix-chat-pro .chat-composer-inner.is-sending {
  opacity: 0.85;
}

.plumbix-chat-pro .chat-send-btn.is-loading {
  pointer-events: none;
}

.plumbix-chat-pro .chat-messages {
  background-image: linear-gradient(180deg, #f8fafc 0%, var(--chat-bg) 48px);
}

.plumbix-chat-pro .chat-agent-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.plumbix-chat-pro .chat-agent-info h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.plumbix-chat-pro .chat-agent-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  opacity: 0.92;
  margin-top: 2px;
}

.plumbix-chat-pro .chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35);
  animation: chatPulse 2s infinite;
}

.plumbix-chat-pro .chat-status-dot--ai {
  background: #a78bfa;
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.4);
}

@keyframes chatPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.plumbix-chat-pro .chat-trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--chat-border);
  font-size: 0.7rem;
  color: #5a6b7d;
}

.plumbix-chat-pro .chat-trust-bar span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #f0f6ff;
  border-radius: 20px;
  font-weight: 500;
}

.plumbix-chat-pro .chat-trust-bar i { color: var(--chat-primary); }

.plumbix-chat-pro .chat-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 16px 0;
}

.plumbix-chat-pro .chat-topic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: #fff;
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  color: #334155;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  text-align: center;
  line-height: 1.2;
}

.plumbix-chat-pro .chat-topic-btn:focus-visible {
  outline: 2px solid var(--chat-primary);
  outline-offset: 2px;
}

.plumbix-chat-pro .chat-topic-btn i {
  font-size: 1.1rem;
  color: var(--chat-primary);
}

.plumbix-chat-pro .chat-topic-btn:hover {
  border-color: var(--chat-primary);
  background: #f0f6ff;
  transform: translateY(-1px);
}

.plumbix-chat-pro .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
  min-height: 280px;
  max-height: 420px;
  height: auto;
}

.plumbix-chat-pro .message {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  animation: chatMsgIn 0.35s ease;
}

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.plumbix-chat-pro .message.user {
  justify-content: flex-end;
}

.plumbix-chat-pro .message.user .message-wrap {
  align-items: flex-end;
}

.plumbix-chat-pro .message-wrap {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.plumbix-chat-pro .message-meta {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-bottom: 4px;
  padding: 0 4px;
}

.plumbix-chat-pro .message.user .message-meta { text-align: right; }

.plumbix-chat-pro .message-bubble {
  padding: 12px 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  border-radius: 18px;
}

.plumbix-chat-pro .message.bot .message-bubble {
  background: var(--chat-bot);
  color: #1e293b;
  border: 1px solid var(--chat-border);
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.plumbix-chat-pro .message.user .message-bubble {
  background: var(--chat-user);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 2px 8px rgba(26, 102, 217, 0.25);
}

.plumbix-chat-pro .message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--chat-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.plumbix-chat-pro .message.user .message-avatar { display: none; }

.plumbix-chat-pro .chat-suggested-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-left: 42px;
}

.plumbix-chat-pro .message.user + .chat-suggested-replies,
.plumbix-chat-pro .chat-suggested-inline {
  padding-left: 42px;
  margin-bottom: 12px;
}

.plumbix-chat-pro .chat-chip {
  background: #fff;
  border: 1px solid #bdd4fc;
  color: var(--chat-primary);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}

.plumbix-chat-pro .chat-chip:hover {
  background: var(--chat-primary);
  color: #fff;
  border-color: var(--chat-primary);
}

.plumbix-chat-pro .chat-composer {
  padding: 12px 16px 16px;
  background: #fff;
  border-top: 1px solid var(--chat-border);
  flex-shrink: 0;
}

.plumbix-chat-pro .chat-composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  border-radius: 24px;
  padding: 6px 6px 6px 16px;
}

.plumbix-chat-pro .chat-composer input,
.plumbix-chat-pro .chat-composer textarea {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 0.9rem;
  outline: none;
  min-width: 0;
  resize: none;
  line-height: 1.4;
  font-family: inherit;
  max-height: 120px;
  overflow-y: auto;
}

.plumbix-chat-pro .chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--chat-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
  flex-shrink: 0;
}

.plumbix-chat-pro .chat-send-btn:hover { background: var(--chat-primary-dark); }
.plumbix-chat-pro .chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.plumbix-chat-pro .chat-footer-note {
  text-align: center;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 8px;
}

/* Product cards carousel (Shopify-style) */
.plumbix-chat-pro .chat-product-carousel {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.plumbix-chat-pro .chat-product-card {
  flex: 0 0 200px;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.plumbix-chat-pro .chat-product-card-img {
  height: 100px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.plumbix-chat-pro .chat-product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.plumbix-chat-pro .chat-product-card-img i {
  font-size: 2rem;
  color: #cbd5e1;
}

.plumbix-chat-pro .chat-product-card-body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plumbix-chat-pro .chat-product-card-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plumbix-chat-pro .chat-product-card-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--chat-primary);
}

.plumbix-chat-pro .chat-product-card-sku {
  font-size: 0.65rem;
  color: #94a3b8;
}

.plumbix-chat-pro .chat-product-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.plumbix-chat-pro .chat-product-card-actions-stack {
  flex-direction: column;
}

.plumbix-chat-pro .chat-product-card-meta {
  font-size: 0.62rem;
  color: #94a3b8;
  text-transform: capitalize;
}

.plumbix-chat-pro .chat-product-card-actions-stack .btn-chat-add,
.plumbix-chat-pro .chat-product-card-actions-stack .btn-chat-distinta,
.plumbix-chat-pro .chat-product-card-actions-stack .btn-chat-preventivo {
  flex: none;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
  border: none;
}

.plumbix-chat-pro .btn-chat-distinta {
  background: #f8fafc;
  color: #475569;
  border: 1px solid var(--chat-border) !important;
}

.plumbix-chat-pro .btn-chat-preventivo {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa !important;
}

.plumbix-chat-pro .chat-cart-punti-badge {
  font-size: 0.75rem;
  color: var(--chat-primary);
  background: #f0f6ff;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.plumbix-chat-pro .chat-cart-offer-recap {
  font-size: 0.72rem;
  color: #64748b;
  margin: 8px 0 0;
  line-height: 1.4;
}

.plumbix-chat-pro .chat-sync-summary {
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  font-size: 0.8rem;
}

.plumbix-chat-pro .chat-sync-summary-title {
  font-weight: 700;
  color: var(--chat-primary);
  margin-bottom: 8px;
}

.plumbix-chat-pro .chat-sync-summary-list {
  margin: 0 0 10px;
  padding-left: 18px;
  color: #334155;
}

.plumbix-chat-pro .chat-sync-offer-line {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0 0 10px;
}

.plumbix-chat-pro .chat-sync-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plumbix-chat-pro .btn-chat-cart-sync-confirm {
  background: var(--chat-primary);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.plumbix-chat-pro .btn-chat-cart-sync-cancel {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 6px;
}

.plumbix-chat-pro .chat-product-card-actions a,
.plumbix-chat-pro .chat-product-card-actions button {
  flex: 1;
  text-align: center;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.plumbix-chat-pro .btn-chat-view {
  background: #f0f6ff;
  color: var(--chat-primary);
  border: 1px solid #cfe0ff !important;
}

.plumbix-chat-pro .btn-chat-add {
  background: var(--chat-primary);
  color: #fff;
}

.plumbix-chat-pro .btn-chat-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.plumbix-chat-pro .chat-product-links-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--chat-primary);
  margin: 12px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Side panel carrello */
.plumbix-chat-pro .chat-sidebar {
  background: #fafbfd;
  border-left: 1px solid var(--chat-border);
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.plumbix-chat-pro .chat-sidebar h3 {
  font-size: 0.95rem;
  margin: 0 0 12px;
  color: var(--chat-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.plumbix-chat-pro .chat-cart-panel { flex: 1; overflow-y: auto; }

.plumbix-chat-pro .chat-cart-empty {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.5;
}

.plumbix-chat-pro .chat-cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
  padding: 10px 0;
  border-bottom: 1px solid var(--chat-border);
}

.plumbix-chat-pro .chat-cart-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

/* ============================
   Admin chat page (staff)
   ============================ */
.admin-chat-page.plumbix-chat-pro .chat-card {
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.admin-chat-page.plumbix-chat-pro .chat-header-pro {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(120deg, #0e4ea8 0%, #1a66d9 55%, #0a3d7a 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.admin-chat-page.plumbix-chat-pro .chat-header-pro h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.admin-chat-page.plumbix-chat-pro .chat-agent-status {
  color: rgba(255, 255, 255, 0.9);
}

.admin-chat-page.plumbix-chat-pro .chat-header-btn {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
}

.admin-chat-page.plumbix-chat-pro .chat-messages {
  padding: 18px 18px 20px;
  max-height: min(64vh, 680px);
  background-image: radial-gradient(900px 380px at 12% 0%, rgba(34, 211, 238, 0.12), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, var(--chat-bg) 56px);
}

.admin-chat-page.plumbix-chat-pro .message-wrap {
  max-width: 92%;
}

.admin-chat-page.plumbix-chat-pro .message-bubble {
  font-size: 0.92rem;
  line-height: 1.55;
}

.admin-chat-page.plumbix-chat-pro .chat-suggested-replies,
.admin-chat-page.plumbix-chat-pro .chat-suggested-inline {
  padding-left: 0;
}

.admin-chat-page.plumbix-chat-pro .chat-chip {
  padding: 9px 14px;
  border-radius: 999px;
}

.admin-chat-page.plumbix-chat-pro .chat-composer-wrap {
  background: #fff;
  border-top: 1px solid var(--chat-border);
  padding: 12px 16px 16px;
}

.admin-chat-page.plumbix-chat-pro .chat-composer-inner {
  background: #f1f5f9;
  border-radius: 18px;
  padding: 10px 10px 10px 14px;
}

.admin-chat-page.plumbix-chat-pro .chat-composer-inner textarea {
  font-size: 0.95rem;
  padding: 8px 0;
  max-height: 160px;
}

.admin-chat-page.plumbix-chat-pro .chat-send-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

@media (max-width: 768px) {
  .admin-chat-page.plumbix-chat-pro .chat-messages {
    max-height: min(56vh, 520px);
    padding: 14px 12px 18px;
  }
  .admin-chat-page.plumbix-chat-pro .chat-composer-wrap {
    padding: 10px 12px 14px;
  }
}

.plumbix-chat-pro .btn-chat-cart-sync,
.plumbix-chat-pro .btn-preventivo-analyze {
  background: var(--chat-primary);
  color: #fff;
  border: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.plumbix-chat-pro .btn-chat-cart-clear {
  background: #fff;
  border: 1px solid var(--chat-border);
  padding: 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
}

.plumbix-chat-pro .chat-preventivo-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--chat-border);
}

.plumbix-chat-pro .chat-preventivo-box textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  font-size: 0.8rem;
  font-family: inherit;
  resize: vertical;
  margin: 8px 0;
}

.plumbix-chat-pro .chat-offer-box {
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #fffbeb 0%, #fff8e6 100%);
  border: 1px solid #f0d78c;
  border-radius: 12px;
  font-size: 0.82rem;
}

.plumbix-chat-pro .chat-typing .typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background: var(--chat-primary);
  border-radius: 50%;
  animation: chatDot 1.2s infinite ease-in-out;
}

.plumbix-chat-pro .chat-typing .typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.plumbix-chat-pro .chat-typing .typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.plumbix-chat-pro .chat-ai-badge {
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--chat-primary);
  font-weight: 600;
}

.plumbix-chat-pro .chat-ai-badge--warn {
  color: #b45309;
}

.chat-staff-gate-banner {
  margin: 12px 16px;
  padding: 14px 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  font-size: 0.88rem;
  color: #9a3412;
}

.chat-staff-gate-banner a {
  color: #1a56b0;
  font-weight: 600;
}

.admin-chat-page .chat-section-pro {
  max-width: 960px;
  margin: 0 auto;
}

.plumbix-chat-pro .chat-quote-actions {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  font-size: 0.82rem;
}

.plumbix-chat-pro .chat-quote-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.plumbix-chat-pro .chat-quote-actions .btn-chat-preventivo,
.plumbix-chat-pro .chat-quote-actions .btn-chat-view-cart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.plumbix-chat-pro .chat-quote-actions .btn-chat-preventivo {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.plumbix-chat-pro .chat-quote-actions .btn-chat-view-cart {
  background: #f0f6ff;
  color: var(--chat-primary);
  border: 1px solid #cfe0ff;
}

.plumbix-chat-pro .chat-distinta-preview {
  margin: 8px 0;
  font-size: 0.72rem;
}

.plumbix-chat-pro .chat-distinta-preview pre {
  margin: 6px 0 0;
  padding: 8px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--chat-border);
  white-space: pre-wrap;
  max-height: 140px;
  overflow-y: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1.35;
}

.plumbix-chat-widget-wrap {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  right: max(24px, env(safe-area-inset-right));
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

.plumbix-chat-widget-wrap .plumbix-chat-widget-fab {
  pointer-events: auto;
}

.plumbix-chat-fab-subtitle {
  display: none !important;
  font-size: 0.65rem;
  font-weight: 700;
  color: #0e4ea8;
  background: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  max-width: 140px;
  text-align: center;
  line-height: 1.2;
}

/* Floating widget (sito) */
.plumbix-chat-widget-fab {
  position: relative;
  z-index: 2001;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a66d9, #0e4ea8);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(26, 102, 217, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: transform 0.2s;
}

.plumbix-chat-widget-fab:hover { transform: scale(1.06); }

.plumbix-chat-widget-fab.has-unread .plumbix-chat-fab-badge {
  display: block;
}

.plumbix-chat-fab-badge {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.plumbix-chat-widget-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 2002;
  width: min(380px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
  border: 1px solid #e2eaf4;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: widgetSlide 0.25s ease;
  pointer-events: none;
}

.plumbix-chat-widget-panel.is-open {
  display: flex;
  pointer-events: auto;
}

@keyframes widgetSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.plumbix-chat-widget-panel .widget-head {
  padding: 14px 16px;
  background: linear-gradient(120deg, #1a66d9, #0e4ea8);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.plumbix-chat-widget-panel .widget-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.plumbix-chat-widget-panel .widget-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.plumbix-chat-widget-panel .widget-messages {
  flex: 1;
  min-height: 160px;
  max-height: min(280px, 38vh);
  overflow-y: auto;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2eaf4;
}

.plumbix-chat-widget-panel .widget-messages .message {
  margin-bottom: 10px;
}

.plumbix-chat-widget-panel .widget-messages .message-bubble {
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 10px 12px;
}

.plumbix-chat-widget-panel .widget-messages .message.user .message-bubble {
  background: #1a66d9;
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}

.plumbix-chat-widget-panel .widget-messages .message.bot .message-bubble {
  background: #fff;
  border: 1px solid #e2eaf4;
  border-radius: 14px 14px 14px 4px;
}

.plumbix-chat-widget-panel .widget-messages .chat-suggested-inline {
  padding: 4px 0 0;
  flex-wrap: wrap;
}

.plumbix-chat-widget-panel .widget-messages .chat-chip {
  font-size: 0.72rem;
  padding: 6px 10px;
}

.plumbix-chat-widget-panel .widget-welcome p {
  margin: 0;
  font-size: 0.82rem;
  color: #334155;
}

.plumbix-chat-widget-panel .widget-compose {
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e2eaf4;
  flex-shrink: 0;
}

.plumbix-chat-widget-panel .widget-compose-inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #e2eaf4;
  border-radius: 20px;
  padding: 4px 4px 4px 12px;
}

.plumbix-chat-widget-panel .widget-compose-inner.is-sending {
  opacity: 0.75;
}

.plumbix-chat-widget-panel .widget-compose textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  font-size: 0.85rem;
  line-height: 1.35;
  padding: 8px 0;
  max-height: 88px;
  outline: none;
  font-family: inherit;
}

.plumbix-chat-widget-panel .widget-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #1a66d9;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plumbix-chat-widget-panel .widget-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.plumbix-chat-widget-panel .widget-body {
  padding: 12px 14px 14px;
  overflow-y: auto;
  flex-shrink: 0;
}

.plumbix-chat-widget-panel .widget-body--quick {
  max-height: 200px;
}

.plumbix-chat-widget-panel .widget-quick {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plumbix-chat-widget-panel .widget-quick button {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid #e2eaf4;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
}

.plumbix-chat-widget-panel .widget-quick button:hover {
  border-color: #1a66d9;
  background: #f0f6ff;
}

.plumbix-chat-widget-panel .widget-cta {
  display: block;
  margin-top: 12px;
  text-align: center;
  padding: 12px;
  background: #1a66d9;
  color: #fff !important;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}

/* Widget — polish + admin AI feedback */
.plumbix-chat-widget-panel .widget-head strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.plumbix-chat-widget-panel .widget-messages {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.plumbix-chat-widget-panel .widget-compose-inner {
  transition: box-shadow 0.15s, border-color 0.15s, background 0.15s;
}
.plumbix-chat-widget-panel .widget-compose-inner:focus-within {
  border-color: rgba(26, 102, 217, 0.55);
  box-shadow: 0 0 0 3px rgba(26, 102, 217, 0.12);
  background: #fff;
}
.plumbix-chat-widget-panel .widget-ai-debug {
  border: 1px solid #e2eaf4;
  background: #f8fafc;
  border-radius: 14px;
  padding: 10px 12px;
  margin: 10px 12px 0;
}
.plumbix-chat-widget-panel .widget-ai-debug summary {
  cursor: pointer;
  font-weight: 800;
  color: #0f172a;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.plumbix-chat-widget-panel .widget-ai-debug summary::-webkit-details-marker { display: none; }
.plumbix-chat-widget-panel .widget-ai-debug__hint {
  color: #64748b;
  font-size: 0.75rem;
  margin-top: 6px;
}
.plumbix-chat-widget-panel .widget-ai-debug__grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  font-size: 0.76rem;
  color: #0f172a;
}
.plumbix-chat-widget-panel .widget-ai-debug__grid strong {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}
.plumbix-chat-widget-panel .widget-ai-debug__grid span {
  display: block;
  font-weight: 700;
}
.plumbix-chat-widget-panel .widget-ai-debug__grid pre {
  margin: 6px 0 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e2eaf4;
  background: #fff;
  overflow: auto;
  max-height: 160px;
  font-size: 0.7rem;
  line-height: 1.35;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (max-width: 960px) {
  .plumbix-chat-pro .chat-shell { grid-template-columns: 1fr; }
  .plumbix-chat-pro .chat-sidebar { border-left: none; border-top: 1px solid var(--chat-border); }
  .plumbix-chat-pro .chat-messages { max-height: min(50vh, 420px); }
  .plumbix-chat-pro .chat-topic-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .plumbix-chat-pro .chat-layout,
  .plumbix-chat-pro .chat-main { width: 100%; min-width: 0; }
  .plumbix-chat-pro .message-wrap { max-width: 92%; }
  .plumbix-chat-pro .chat-suggested-replies,
  .plumbix-chat-pro .chat-suggested-inline { padding-left: 8px; }
  .plumbix-chat-pro .chat-chip { white-space: normal; text-align: left; max-width: 100%; }
  .plumbix-chat-pro .chat-quote-actions-row { flex-direction: column; }
  .plumbix-chat-pro .chat-quote-actions-row a,
  .plumbix-chat-pro .chat-quote-actions-row button { width: 100%; justify-content: center; }
  .plumbix-chat-pro .chat-input-row { flex-wrap: wrap; }
  .plumbix-chat-pro .chat-input-row input,
  .plumbix-chat-pro .chat-input-row textarea { font-size: 16px; min-height: 44px; flex: 1 1 100%; }
  .plumbix-chat-pro .chat-input-row button { min-height: 44px; min-width: 44px; }
  .plumbix-chat-widget-fab { width: 56px; height: 56px; }
  .plumbix-chat-widget-panel {
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    bottom: calc(88px + env(safe-area-inset-bottom));
    max-height: min(72vh, calc(100vh - 100px));
  }

  .plumbix-chat-widget-panel.is-open.widget-panel--fullscreen {
    top: max(12px, env(safe-area-inset-top));
    bottom: max(12px, env(safe-area-inset-bottom));
    max-height: none;
  }

  .plumbix-chat-widget-panel .widget-messages {
    max-height: min(36vh, 240px);
  }
  .plumbix-chat-widget-panel .widget-quick button { min-height: 44px; }
}

@media (max-width: 768px) {
  .plumbix-chat-widget-wrap,
  .pro-fab-assist {
    bottom: max(80px, calc(72px + env(safe-area-inset-bottom))) !important;
    right: max(16px, env(safe-area-inset-right)) !important;
  }
  body.has-product-sticky .plumbix-chat-widget-wrap,
  body.has-product-sticky .pro-fab-assist {
    bottom: max(148px, calc(140px + env(safe-area-inset-bottom))) !important;
  }
  body.product-page-main .plumbix-chat-widget-wrap { bottom: max(96px, calc(88px + env(safe-area-inset-bottom))) !important; }
}

@media (max-width: 768px) {
  .plumbix-chat-pro .chat-shell { min-height: auto; border-radius: 12px; }
  .plumbix-chat-pro .chat-main { min-height: 420px; }
  .plumbix-chat-pro .chat-compose input,
  .plumbix-chat-pro .chat-compose textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .plumbix-chat-pro .chat-send-btn,
  .plumbix-chat-pro .chat-chip {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .plumbix-chat-pro .chat-topic-grid { grid-template-columns: repeat(2, 1fr); }
  .plumbix-chat-pro .chat-messenger-header { padding: 14px 16px; }
  .plumbix-chat-pro .chat-header-btn-label { display: none; }
  .plumbix-chat-pro .chat-header-btn { padding: 8px 10px; }
  .plumbix-chat-pro .chat-messages { max-height: min(50vh, 380px); min-height: 220px; }
  .plumbix-chat-pro .chat-sidebar { max-height: 40vh; overflow-y: auto; }
}
