/* Public support chat widget */
.support-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9000;
  font-family: inherit;
}
.support-chat [hidden] {
  display: none !important;
}
.support-chat__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--color-secondary, #16a34a);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.support-chat__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(360px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  background: var(--surface-card, #fff);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.support-chat__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--color-primary, #2563eb);
  color: #fff;
}
.support-chat__body {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.support-chat__footer {
  flex-shrink: 0;
  max-height: 55%;
  overflow-y: auto;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--surface-card, #fff);
}
.support-chat__status {
  display: block;
  font-size: 12px;
  opacity: 0.85;
}
.support-chat__close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.support-chat__messages {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 60px;
}
.support-chat__bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}
.support-chat__bubble--bot {
  align-self: flex-start;
  background: rgba(37, 99, 235, 0.08);
  color: inherit;
}
.support-chat__bubble--user {
  align-self: flex-end;
  background: var(--color-primary, #2563eb);
  color: #fff;
}
.support-chat__typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
}
.support-chat__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary, #2563eb);
  opacity: 0.45;
  animation: supportChatTyping 1.2s infinite ease-in-out;
}
.support-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.support-chat__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes supportChatTyping {
  0%, 80%, 100% { transform: scale(0.75); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; }
}
.support-chat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
  flex-shrink: 0;
}
.support-chat__chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}
.support-chat__chip--primary {
  background: var(--color-secondary, #16a34a);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.support-chat__form {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  overflow-y: auto;
}
.support-chat__form .field { margin: 0; }
.support-chat__form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.support-chat__form .field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text, #0f172a);
}
.support-chat__form .field label .hint {
  font-weight: 400;
  color: var(--color-text-muted, #64748b);
}
.support-chat__form .input,
.support-chat__form .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-surface-2, #f8fafc);
  color: var(--color-text, #0f172a);
  font: inherit;
  box-sizing: border-box;
}
.support-chat__form .textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.5;
}
.support-chat__form .input:focus,
.support-chat__form .textarea:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
}
.support-chat__form .btn--block {
  width: 100%;
  margin-top: 4px;
}
.support-chat__error { color: #b91c1c; font-size: 0.85rem; }
.support-chat__fallback {
  margin: 0;
  padding: 0 14px 14px;
  font-size: 0.85rem;
}
