﻿.support-launcher {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: var(--navy-900);
  color: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 12px 34px rgba(10, 27, 51, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.support-launcher svg {
  width: 20px;
  height: 20px;
  color: #ffb27a;
}

.support-launcher:hover {
  background: var(--navy-800);
  transform: translateY(-2px);
}

.support-panel {
  position: fixed;
  right: 1.4rem;
  bottom: 5.2rem;
  z-index: 1210;
  display: flex;
  width: min(390px, calc(100vw - 2rem));
  max-height: min(680px, calc(100vh - 7rem));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(10, 27, 51, 0.24);
}

.support-panel[hidden],
.support-form-view[hidden],
.support-chat[hidden] {
  display: none;
}

.support-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--navy-950);
  color: #fff;
}

.support-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  line-height: 1.3;
}

.support-badge {
  margin: 0.2rem 0 0;
  color: #8fb8f5;
  font-size: 0.66rem;
  font-weight: 600;
}

.support-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.support-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.support-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.support-chat {
  display: flex;
  min-height: 420px;
  flex-direction: column;
}

.support-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
  background: #f6f9fd;
}

.support-message {
  display: flex;
}

.support-message p {
  max-width: 88%;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.support-message.assistant p {
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  background: #fff;
  color: var(--ink);
}

.support-message.visitor {
  justify-content: flex-end;
}

.support-message.visitor p {
  border-bottom-right-radius: 4px;
  background: var(--blue);
  color: #fff;
}

.support-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.7rem 0.9rem 0;
}

.support-chip {
  padding: 0.34rem 0.6rem;
  border: 1px solid #cfe0f5;
  border-radius: 999px;
  background: #fff;
  color: var(--blue-dark);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.support-chip:hover {
  background: var(--blue-soft);
}

.support-input {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.75rem 0.9rem;
}

.support-input textarea {
  flex: 1;
  min-height: 42px;
  max-height: 110px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
}

.support-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 0.85rem;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.support-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.support-human {
  padding: 0 0.9rem 0.9rem;
}

.support-human-btn {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--navy-800);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.support-human-btn:hover {
  border-color: var(--navy-800);
}

.support-form-view {
  padding: 1rem;
  background: #fff;
}

.support-form-view h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.support-notice {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.support-form {
  display: grid;
  gap: 0.65rem;
}

.support-field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.support-field > span {
  color: var(--navy-800);
  font-size: 0.72rem;
  font-weight: 700;
}

.support-field input,
.support-field select,
.support-field textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.45;
}

.support-field textarea {
  resize: vertical;
}

.support-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.support-consent input {
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.support-consent a {
  color: var(--blue-dark);
}

.support-turnstile {
  min-height: 0;
}

.support-error {
  margin: 0;
  color: #b42318;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.5;
}

.support-form-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.3rem;
}

.support-form-actions .support-send {
  flex: 1;
}

.support-cancel {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--navy-800);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

body.support-open {
  overflow: hidden;
}

@media (max-width: 575.98px) {
  .support-launcher {
    right: 1rem;
    bottom: 1rem;
    padding: 0.7rem 0.9rem;
  }

  .support-panel {
    inset: 0;
    width: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .support-chat {
    min-height: 0;
    flex: 1;
  }

  .support-header {
    padding-top: max(1rem, env(safe-area-inset-top));
  }

  .support-human {
    padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-launcher,
  .support-chip,
  .support-send,
  .support-human-btn {
    transition: none;
  }
}
