:root {
  --support-chat-teal: #00b8c1;
  --support-chat-teal-dark: #0aa2ad;
  --support-chat-ink: #0b1f2a;
  --support-chat-muted: #5a6a76;
  --support-chat-panel: #ffffff;
  --support-chat-bg: #f2f6f9;
}

body.support-chat-open {
  overflow: hidden;
}

.support-chat-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1200;
  --support-chat-offset: clamp(4.5rem, 9vh, 6.5rem);
  --support-chat-bottom: clamp(0.75rem, 2.5vh, 1.5rem);
}

.support-chat-modal.is-open {
  display: block;
}

.support-chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 30, 0.55);
  backdrop-filter: blur(6px);
}

.support-chat-window {
  position: relative;
  width: min(720px, 94vw);
  height: calc(100vh - var(--support-chat-offset) - var(--support-chat-bottom));
  height: calc(100dvh - var(--support-chat-offset) - var(--support-chat-bottom));
  margin: var(--support-chat-offset) auto var(--support-chat-bottom);
  border-radius: 22px;
  background: var(--support-chat-panel);
  box-shadow: 0 40px 90px rgba(6, 25, 40, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.support-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(135deg, #dff6f7, #c8f0f2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.support-chat-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--support-chat-muted);
}

.support-chat-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--support-chat-ink);
}

.support-chat-close {
  border: none;
  background: #ffffff;
  color: #0e3843;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(5, 28, 40, 0.12);
}

.support-chat-body {
  flex: 1 1 auto;
  padding: 1.25rem 1.4rem;
  background: var(--support-chat-bg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.support-chat-message {
  max-width: 78%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 0.98rem;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(10, 24, 40, 0.08);
}

.support-chat-message-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin-bottom: 0.42rem;
  color: var(--support-chat-muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
}

.support-chat-message-author {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-chat-copy-btn {
  margin-left: auto;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  background: rgba(16, 58, 114, 0.08);
  color: #0f366e;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  line-height: 1;
}

.support-chat-copy-btn:hover,
.support-chat-copy-btn:focus-visible {
  background: rgba(16, 58, 114, 0.16);
  color: #08284e;
  outline: none;
}

.support-chat-copy-btn .material-icons {
  font-size: 1rem;
  line-height: 1;
}

.support-chat-message-content {
  min-width: 0;
}

.support-chat-thinking {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: fit-content;
  padding: 0.72rem 0.95rem;
  border: 1px solid rgba(0, 184, 193, 0.2);
  border-radius: 16px;
  background: #ffffff;
  color: var(--support-chat-muted);
  box-shadow: 0 10px 24px rgba(10, 24, 40, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
}

.support-chat-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
}

.support-chat-thinking-dots span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--support-chat-teal-dark);
  animation: support-chat-thinking 1.1s ease-in-out infinite;
}

.support-chat-thinking-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.support-chat-thinking-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes support-chat-thinking {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-0.25rem); opacity: 1; }
}

.support-chat-message.is-bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid rgba(0, 184, 193, 0.18);
  color: var(--support-chat-ink);
}

.support-chat-message.is-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--support-chat-teal), #22d7de);
  color: #01242d;
  white-space: pre-line;
}

.support-chat-message.is-user .support-chat-message-header {
  color: rgba(1, 36, 45, 0.72);
}

.support-chat-message.is-user .support-chat-copy-btn {
  background: rgba(255, 255, 255, 0.62);
}

.support-chat-message.is-system {
  align-self: center;
  background: rgba(12, 35, 52, 0.08);
  color: var(--support-chat-muted);
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: none;
}

.support-chat-message p {
  margin: 0 0 0.6rem;
}

.support-chat-message p:last-child {
  margin-bottom: 0;
}

.support-chat-message h4 {
  margin: 0.85rem 0 0.35rem;
  color: var(--support-chat-ink);
  font-size: 0.98rem;
}

.support-chat-message h4:first-child {
  margin-top: 0;
}

.support-chat-message ul {
  margin: 0.4rem 0 0.6rem 1.1rem;
  padding: 0;
}

.support-chat-message ol {
  margin: 0.4rem 0 0.6rem 1.3rem;
  padding: 0;
}

.support-chat-message li {
  margin: 0.25rem 0;
}

.support-chat-message a {
  color: var(--support-chat-teal-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.support-chat-message a:hover {
  color: var(--support-chat-teal);
}

.support-chat-feedback {
  align-self: flex-start;
  width: min(100%, 32rem);
  padding: 0.82rem 0.95rem;
  border: 1px solid rgba(12, 35, 52, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--support-chat-ink);
  box-shadow: 0 8px 20px rgba(10, 24, 40, 0.06);
}

.support-chat-feedback-question,
.support-chat-feedback-note,
.support-chat-handoff p {
  margin: 0;
}

.support-chat-feedback-question {
  font-size: 0.9rem;
  font-weight: 650;
}

.support-chat-feedback-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.support-chat-feedback-btn,
.support-chat-handoff-btn {
  border: 1px solid rgba(0, 184, 193, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: #0a4c55;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.support-chat-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-width: 4.7rem;
  padding: 0.48rem 0.72rem;
}

.support-chat-feedback-btn .material-icons {
  font-size: 1.05rem;
}

.support-chat-feedback-btn:hover:not(:disabled),
.support-chat-feedback-btn:focus-visible,
.support-chat-handoff-btn:hover:not(:disabled),
.support-chat-handoff-btn:focus-visible {
  border-color: var(--support-chat-teal-dark);
  background: #e8f9fa;
  outline: none;
  transform: translateY(-1px);
}

.support-chat-feedback-btn.is-selected {
  border-color: var(--support-chat-teal-dark);
  background: #dff6f7;
}

.support-chat-feedback-btn:disabled,
.support-chat-handoff-btn:disabled {
  cursor: default;
  opacity: 0.72;
  transform: none;
}

.support-chat-feedback-note {
  margin-top: 0.62rem;
  color: var(--support-chat-muted);
  font-size: 0.84rem;
}

.support-chat-handoff {
  display: grid;
  gap: 0.72rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(12, 35, 52, 0.1);
  font-size: 0.9rem;
  line-height: 1.45;
}

.support-chat-handoff-field {
  display: grid;
  gap: 0.34rem;
}

.support-chat-handoff-field label {
  color: var(--support-chat-ink);
  font-size: 0.82rem;
  font-weight: 650;
}

.support-chat-handoff-field input {
  width: 100%;
  min-height: 2.65rem;
  box-sizing: border-box;
  border: 1px solid rgba(12, 35, 52, 0.2);
  border-radius: 12px;
  background: #ffffff;
  color: var(--support-chat-ink);
  font: inherit;
  padding: 0.62rem 0.72rem;
}

.support-chat-handoff-field input:focus-visible {
  border-color: var(--support-chat-teal-dark);
  outline: 3px solid rgba(0, 184, 193, 0.18);
  outline-offset: 1px;
}

.support-chat-handoff-field span {
  color: var(--support-chat-muted);
  font-size: 0.76rem;
}

.support-chat-handoff-btn {
  justify-self: start;
  padding: 0.62rem 0.95rem;
  background: linear-gradient(135deg, #dff6f7, #eefcfc);
}

.support-chat-handoff-privacy {
  color: var(--support-chat-muted);
  font-size: 0.78rem;
}

.support-chat-handoff-error {
  color: #b3261e;
}

.support-chat-handoff.is-complete .support-chat-handoff-btn {
  border-color: rgba(28, 124, 84, 0.35);
  background: #e7f6ee;
  color: #155c3f;
}

.support-chat-input {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.4rem 0.75rem;
  background: #ffffff;
  border-top: 1px solid rgba(12, 35, 52, 0.08);
}

.support-chat-input textarea {
  flex: 1 1 auto;
  border-radius: 16px;
  border: 1px solid rgba(12, 35, 52, 0.18);
  padding: 0.75rem 0.9rem;
  font-size: 0.98rem;
  resize: none;
  min-height: 56px;
  font-family: inherit;
}

.support-chat-input textarea:focus {
  outline: none;
  border-color: var(--support-chat-teal);
  box-shadow: 0 0 0 3px rgba(0, 184, 193, 0.18);
}

.support-chat-input button {
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--support-chat-teal), var(--support-chat-teal-dark));
  color: #01242d;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 184, 193, 0.35);
}

.support-chat-input button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.support-chat-status {
  margin: 0 1.4rem 0.75rem;
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: var(--support-chat-muted);
}

.support-chat-status[data-state="success"] {
  color: #1c7c54;
}

.support-chat-status[data-state="error"] {
  color: #b3261e;
}

.support-chat-footnote {
  margin: 0 1.4rem 1.1rem;
  font-size: 0.85rem;
  color: var(--support-chat-muted);
}

.support-chat-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--support-chat-teal), #15d1d9);
  color: #01242d;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(0, 184, 193, 0.35);
}

.contact-page .contact-chat-section {
  display: flex;
  justify-content: center;
  padding: 0 1.25rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.contact-page .contact-chat-card {
  width: 100%;
  max-width: 720px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e6f8f9, #f9feff);
  border: 1px solid rgba(0, 184, 193, 0.35);
  padding: clamp(1.6rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: flex-start;
  box-shadow: 0 24px 50px rgba(6, 33, 61, 0.12);
}

.contact-page .contact-chat-card h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.7rem);
  color: var(--support-chat-ink);
}

.contact-page .contact-chat-card p {
  margin: 0;
  color: var(--support-chat-muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.support-chat-login-prompt {
  display: grid;
  gap: 0.75rem;
  margin: 0.25rem 0 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(0, 147, 164, 0.3);
  border-radius: 16px;
  background: rgba(0, 147, 164, 0.07);
}

.support-chat-login-prompt p {
  margin: 0;
  color: var(--support-chat-text);
}

.support-chat-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: fit-content;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: var(--support-chat-teal);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.support-chat-login-btn:hover,
.support-chat-login-btn:focus-visible {
  background: var(--support-chat-teal-dark);
  outline: 3px solid rgba(0, 147, 164, 0.2);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .support-chat-window {
    height: calc(100vh - var(--support-chat-offset) - 0.75rem);
    height: calc(100dvh - var(--support-chat-offset) - 0.75rem);
  }
  .support-chat-input {
    flex-direction: column;
  }
  .support-chat-input button {
    width: 100%;
  }

  .support-chat-message {
    max-width: 90%;
  }

  .support-chat-handoff-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-chat-thinking-dots span {
    animation: none;
    opacity: 0.75;
  }
}
