.mis-chat-shell {
  position: fixed;
  right: 1.5rem;
  bottom: 5.5rem;
  z-index: 60;
  width: min(24rem, calc(100vw - 2rem));
  max-height: min(42rem, calc(100vh - 8rem));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

.mis-chat-shell[data-open="true"] {
  display: flex;
}

.mis-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #e5e7eb;
  background:
    radial-gradient(circle at top left, rgba(142, 27, 58, 0.12), transparent 40%),
    linear-gradient(135deg, #ffffff, #f8fafc);
}

.mis-chat-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.mis-chat-subtitle {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: #6b7280;
}

.mis-chat-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  cursor: pointer;
}

.mis-chat-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(249, 250, 251, 0.88), rgba(255, 255, 255, 1));
}

.mis-chat-row {
  display: flex;
}

.mis-chat-row[data-role="user"] {
  justify-content: flex-end;
}

.mis-chat-bubble {
  max-width: 88%;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.mis-chat-row[data-role="assistant"] .mis-chat-bubble {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
}

.mis-chat-row[data-role="user"] .mis-chat-bubble {
  background: #8e1b3a;
  color: #ffffff;
}

.mis-chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.mis-chat-quick-actions button {
  border: 1px solid rgba(142, 27, 58, 0.18);
  border-radius: 999px;
  background: #fff8fb;
  color: #8e1b3a;
  padding: 0.55rem 0.8rem;
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
}

.mis-chat-quick-actions button[data-kind="primary"] {
  background: #8e1b3a;
  border-color: #8e1b3a;
  color: #ffffff;
}

.mis-chat-quick-actions button[data-kind="link"] {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.mis-chat-footer {
  border-top: 1px solid #e5e7eb;
  padding: 0.95rem 1rem 1rem;
  background: #ffffff;
}

.mis-chat-form {
  display: flex;
  gap: 0.65rem;
  align-items: flex-end;
}

.mis-chat-input {
  flex: 1 1 auto;
  min-height: 3rem;
  max-height: 7rem;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font: inherit;
  color: #111827;
}

.mis-chat-submit {
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  background: #8e1b3a;
  color: #ffffff;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.mis-chat-submit[disabled],
.mis-chat-input[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.mis-chat-note {
  margin-top: 0.7rem;
  font-size: 0.76rem;
  line-height: 1.4;
  color: #6b7280;
}

.mis-chat-status {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #6b7280;
}

.mis-contact-status {
  margin-top: 1rem;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.mis-contact-status[data-state="idle"] {
  display: none;
}

.mis-contact-status[data-state="success"] {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.mis-contact-status[data-state="error"] {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.mis-contact-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

body.mis-site-menu-open {
  overflow: hidden;
}

.mis-site-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.mis-site-mobile-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mis-site-mobile-panel {
  border-top: 1px solid #e5e7eb;
  background:
    radial-gradient(circle at top left, rgba(142, 27, 58, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98));
}

.mis-site-mobile-panel[hidden] {
  display: none !important;
}

.mis-site-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mis-site-mobile-link {
  display: block;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font-size: 0.98rem;
  font-weight: 500;
  color: #374151;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.mis-site-mobile-link:hover,
.mis-site-mobile-link:focus-visible {
  border-color: rgba(229, 231, 235, 0.95);
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  outline: none;
}

.mis-site-mobile-link[aria-current="page"] {
  border-color: rgba(142, 27, 58, 0.18);
  background: #fff8fb;
  color: #8e1b3a;
}

.mis-site-mobile-cta {
  width: 100%;
}

@media (max-width: 640px) {
  .mis-chat-shell {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 5rem;
    max-height: calc(100vh - 6.5rem);
  }

  .mis-chat-form {
    flex-direction: column;
  }

  .mis-chat-submit {
    width: 100%;
  }

  footer .flex.gap-6.text-sm.text-text-secondary {
    flex-wrap: wrap;
    gap: 0.9rem 1.25rem;
  }
}

@media (min-width: 768px) {
  .mis-site-mobile-toggle,
  .mis-site-mobile-panel {
    display: none !important;
  }
}
