/* PPI FAQ assistant — floating widget */
.ppi-chat-toggle {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9998;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(15, 118, 110, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ppi-chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(15, 118, 110, 0.55);
}
.ppi-chat-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}
.ppi-chat-toggle[aria-expanded="true"] {
  background: #334155;
}

.ppi-chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  z-index: 9997;
  width: min(100vw - 2rem, 22rem);
  max-height: min(70vh, 28rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.ppi-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ppi-chat-header {
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #fff;
}
.ppi-chat-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.ppi-chat-header p {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  opacity: 0.92;
}

.ppi-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  min-height: 10rem;
  max-height: 16rem;
  background: #f8fafc;
}
.ppi-chat-msg {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}
.ppi-chat-msg--bot {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  margin-right: 1.5rem;
}
.ppi-chat-msg--user {
  background: #0d9488;
  color: #fff;
  margin-left: 1.5rem;
  text-align: right;
}
.ppi-chat-msg strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  color: #0f766e;
}
.ppi-chat-msg--user strong {
  color: rgba(255, 255, 255, 0.95);
}

.ppi-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.75rem 0.5rem;
  background: #f8fafc;
}
.ppi-chat-chip {
  font-size: 0.7rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ppi-chat-chip:hover {
  border-color: #0d9488;
  color: #0f766e;
  background: #ecfdf5;
}

.ppi-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.ppi-chat-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  font-family: inherit;
}
.ppi-chat-input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}
.ppi-chat-send {
  padding: 0.5rem 0.85rem;
  border: none;
  border-radius: 0.5rem;
  background: #0d9488;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.ppi-chat-send:hover {
  background: #0f766e;
}

.ppi-chat-footer {
  font-size: 0.65rem;
  color: #64748b;
  padding: 0 0.75rem 0.5rem;
  text-align: center;
  background: #fff;
}
.ppi-chat-footer a {
  color: #0d9488;
  font-weight: 600;
}

@media (max-width: 480px) {
  .ppi-chat-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 5rem;
  }
}
