/* AMM Support Agent — contact chat */

.amm-support {
  --amm-fg: #0e0e0e;
  --amm-bg: #ffffff;
  --amm-muted: #6b6b6b;
  --amm-border: rgba(14, 14, 14, 0.12);
  --amm-accent: #ffe757;
  --amm-card: #f7f7f5;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 2rem 0 1rem;
  max-width: 1100px;
}

@media (min-width: 992px) {
  .amm-support {
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
  }
}

.amm-support-rail {
  background: var(--amm-fg);
  color: #fff;
  border-radius: 1.5rem;
  padding: 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: fit-content;
}

@media (min-width: 992px) {
  .amm-support-rail {
    position: sticky;
    top: 6rem;
    padding: 1.75rem 1.5rem;
  }
}

.amm-support-rail-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.amm-support-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.amm-support-rail-title {
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.2;
}

.amm-support-rail-sub {
  font-size: 0.75rem;
  opacity: 0.7;
}

.amm-support-rail-blurb {
  font-size: 0.875rem;
  line-height: 1.6;
  opacity: 0.85;
  display: none;
}

@media (min-width: 992px) {
  .amm-support-rail-blurb {
    display: block;
  }
}

.amm-support-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.amm-support-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.amm-support-direct {
  display: none;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
  opacity: 0.75;
  line-height: 1.6;
}

@media (min-width: 992px) {
  .amm-support-direct {
    display: block;
  }
}

.amm-support-direct strong {
  display: block;
  opacity: 1;
  margin-bottom: 0.35rem;
}

.amm-support-direct a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.amm-support-panel {
  border: 1px solid var(--amm-border);
  background: var(--amm-bg);
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

@media (min-width: 992px) {
  .amm-support-panel {
    height: 720px;
    min-height: 0;
  }
}

.amm-support-panel-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--amm-border);
  background: var(--amm-bg);
}

.amm-support-panel-label {
  font-size: 0.875rem;
  font-weight: 700;
  display: none;
}

@media (min-width: 576px) {
  .amm-support-panel-label {
    display: block;
  }
}

.amm-support-reset {
  position: relative;
  z-index: 6;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  min-width: 4.5rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--amm-border);
  background: transparent;
  cursor: pointer;
  color: var(--amm-fg);
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
}

.amm-support-reset:disabled,
.amm-support-reset[disabled] {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
}

.amm-support-reset:hover {
  background: var(--amm-card);
}

.amm-lead-pending {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.amm-support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

@media (min-width: 576px) {
  .amm-support-messages {
    padding: 1.25rem 1.5rem;
  }
}

.amm-msg {
  display: flex;
}

.amm-msg-user {
  justify-content: flex-end;
}

.amm-msg-assistant {
  justify-content: flex-start;
}

.amm-msg-bubble {
  max-width: 90%;
  font-size: 0.9rem;
  line-height: 1.55;
}

.amm-msg-user .amm-msg-bubble {
  max-width: 85%;
  background: var(--amm-fg);
  color: #fff;
  border-radius: 1rem 1rem 0.25rem 1rem;
  padding: 0.65rem 1rem;
  white-space: pre-wrap;
}

.amm-msg-assistant .amm-msg-bubble {
  color: var(--amm-fg);
}

.amm-msg-assistant .amm-msg-bubble p {
  margin: 0.4rem 0;
}

.amm-msg-assistant .amm-msg-bubble p:first-child {
  margin-top: 0;
}

.amm-msg-assistant .amm-msg-bubble p:last-child {
  margin-bottom: 0;
}

.amm-msg-assistant .amm-msg-bubble strong {
  font-weight: 700;
}

.amm-msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.amm-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--amm-border);
  background: var(--amm-bg);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--amm-fg);
  white-space: nowrap;
}

.amm-chip:hover {
  background: var(--amm-fg);
  color: #fff;
}

.amm-support-quick {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.amm-support-quick::-webkit-scrollbar {
  display: none;
}

@media (min-width: 576px) {
  .amm-support-quick {
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
  }
}

.amm-support-composer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid transparent;
}

.amm-support-composer.has-border {
  border-top-color: var(--amm-border);
}

.amm-support-input {
  flex: 1;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--amm-border);
  background: var(--amm-bg);
  padding: 0 1.2rem;
  font-size: 1rem;
  color: var(--amm-fg);
}

.amm-support-input:disabled {
  opacity: 0.55;
}

.amm-support-send {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 0;
  background: var(--amm-fg);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.amm-support-disclaimer {
  padding: 0 1rem 0.65rem;
  font-size: 0.65rem;
  line-height: 1.35;
  color: var(--amm-muted);
}

.amm-support-banner {
  border-radius: 1rem;
  border: 1px solid var(--amm-border);
  background: var(--amm-card);
  padding: 1rem 1.1rem;
  font-size: 0.85rem;
  color: var(--amm-muted);
}

.amm-support-banner strong {
  display: block;
  color: var(--amm-fg);
  margin-bottom: 0.35rem;
}

.amm-support-banner .amm-msg-actions {
  margin-top: 0.75rem;
}

.amm-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(14, 14, 14, 0.2);
  border-top-color: var(--amm-fg);
  border-radius: 50%;
  animation: amm-spin 0.7s linear infinite;
}

@keyframes amm-spin {
  to {
    transform: rotate(360deg);
  }
}

.amm-lead-form {
  border: 1px solid var(--amm-border);
  border-radius: 1rem;
  background: var(--amm-card);
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.75rem;
}

.amm-lead-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--amm-fg);
}

.amm-lead-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem;
  color: var(--amm-muted);
}

.amm-lead-grid {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 576px) {
  .amm-lead-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.amm-lead-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--amm-fg);
}

.amm-lead-field input,
.amm-lead-field textarea {
  width: 100%;
  border: 1px solid var(--amm-border);
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  background: #fff;
  color: var(--amm-fg);
}

.amm-lead-field textarea {
  min-height: 6rem;
  resize: vertical;
}

.amm-lead-submit {
  border: 0;
  border-radius: 999px;
  background: var(--amm-fg);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
}

.amm-lead-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.amm-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--amm-fg);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.amm-toast.show {
  opacity: 1;
}

.amm-support-map-wrap {
  margin-top: 2rem;
}

.amm-support-map-wrap .google-maps iframe {
  width: 100%;
  min-height: 280px;
  border-radius: 1rem;
}
