/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top, #111827 0%, #020617 45%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.6s ease-out;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 400px;
  padding: 40px 24px;
  text-align: center;
}

.loading-avatar {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-weight: 700;
  font-size: 28px;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.25), 0 20px 60px rgba(37,99,235,0.28);
  animation: avatarPulse 2s ease-in-out infinite;
}

.loading-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 2s ease-in-out infinite alternate;
}

.loading-subtitle {
  font-size: 14px;
  color: #9ca3af;
  letter-spacing: 0.025em;
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(55, 65, 81, 0.4);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
  border-radius: 999px;
  width: 0%;
  animation: progressFill 2.5s ease-out infinite;
  box-shadow: 0 0 20px rgba(37,99,235,0.32);
}

.loading-dots {
  display: flex;
  gap: 8px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  animation: loadingBounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

/* Loading Animations */
@keyframes avatarPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), 0 18px 48px rgba(37,99,235,0.24);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.08), 0 30px 70px rgba(37,99,235,0.28);
  }
}

@keyframes titleGlow {
  0% {
    filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.28));
  }
  100% {
    filter: drop-shadow(0 0 12px rgba(59,130,246,0.44));
  }
}

@keyframes progressFill {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

@keyframes loadingBounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Rest of your existing CSS stays exactly the same... */

:root {
  --input-bar-height: 88px;
  --bg-main: #050509;
  --bg-chat: #050509;
  --bg-sidebar: #0d0d12;
  --bg-input: #0f1015;
  --bg-bot: #1f2933;
  --bg-page-color: #020617;
  --border-subtle: #22232b;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #2563eb;
  --accent-soft: rgba(37,99,235,0.06);
  --accent-strong: rgba(37,99,235,0.12);
  --accent-glow: rgba(59,130,246,0.12);
  --danger: #ef4444;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.6);
  --header-height: 56px; /* used to calculate chat height on mobile */

}

html {
  height: calc(var(--vh, 1vh) * 100);
  background-color: var(--bg-page-color);
  background-image: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
  background-repeat: no-repeat;
  background-attachment: scroll;
  -webkit-text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
  -webkit-fill-available: fill-available;
  /* avoid transitions on the root that could cause visual flicker */
  transition: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", sans-serif;
  color: var(--text-main);
  height: calc(var(--vh, 1vh) * 100);
  min-height: 100%;
  background-image: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
  background-color: var(--bg-page-color);
  background-repeat: no-repeat;
  display: flex;
  -webkit-transform: translateZ(0); /* promote to its own layer to reduce repaint flicker */
  transform: translateZ(0);
}

.app {
  display: flex;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  position: relative; /* needed for overlay and sidebar toggling */

}

/* ensure the chat has room under the fixed input */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* add bottom padding equal to input bar so last messages remain visible */
  padding-bottom: calc(var(--input-bar-height) + 18px);
}

html.vh-updating * {
  transition: none !important;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #020617 0%, #020617 55%, #020617 100%);
  border-right: 1px solid #111827;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeInSlide 0.6s ease-out;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  transform: translateX(-110%);
  transition: transform 0.28s cubic-bezier(.2,.9,.2,1);
  z-index: 1100;
}

/* when open */
.app.sidebar-open .sidebar {
  transform: translateX(0);
}

/* page overlay used to close the menu when clicking the background */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 1050;
}

.app.sidebar-open .overlay {
  opacity: 1;
  pointer-events: auto;
  aria-hidden: false;
}

/* hamburger */
.hamburger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  margin-right: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
  flex-shrink: 0;
}

.hamburger-btn:hover { background: rgba(255,255,255,0.02); transform: translateY(-1px); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, rgba(37,99,235,0.06), transparent);
}

.brand-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 0 0 1px rgba(37,99,235,0.28);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
}

.brand-role {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin: 4px 4px 6px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  color: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease,
    box-shadow 0.12s ease;
}

.nav-item span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-item small {
  font-size: 11px;
  color: #6b7280;
}

.nav-item.active {
  border-color: rgba(59,130,246,0.18);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.nav-item:hover {
  background: #020617;
  border-color: #1f2937;
  transform: translateY(-1px);
}

.nav-item-pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #1f2937;
  color: #9ca3af;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  color: #6b7280;
  border-top: 1px solid #111827;
  padding-top: 10px;
}

.sidebar-footer span {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pill-green {
  color: #bfdbfe;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,0.45);
  padding: 2px 8px;
  font-size: 10px;
  background: rgba(37,99,235,0.06);
}

.pill-outline {
  border-radius: 999px;
  border: 1px solid #374151;
  padding: 2px 8px;
  font-size: 10px;
  color: #9ca3af;
}

/* Main */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(var(--vh, 1vh) * 100);
  animation: fadeInSlideUp 0.7s ease-out;
  z-index: 0;
}

.main-header {
  padding: 10px 18px;
  border-bottom: 1px solid #111827;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: linear-gradient(to bottom, #020617aa, #020617ee 40%, #020617 100%);
  backdrop-filter: blur(12px);
}

.main-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start; /* ensure title + subtitle are left-aligned */
  margin-left: 8px; /* small gap after the hamburger */
}

.main-title {
  font-size: 16px;
  font-weight: 600;
}

.main-subtitle {
  font-size: 12px;
  color: #6b7280;
}

.main-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto; /* keep CTAs on the far right */
}

.badge {
  font-size: 11px;
  color: #a5b4fc;
  border-radius: 999px;
  border: 1px solid #4f46e5;
  padding: 3px 8px;
  background: #312e81aa;
}

.badge-ghost {
  font-size: 11px;
  color: #9ca3af;
  border-radius: 999px;
  border: 1px solid #374151;
  padding: 3px 8px;
  background: #020617;
}

.chat-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at top, #111827 0, #020617 40%, #020617 100%);
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 12px;
  padding-bottom: calc(var(--input-bar-height) + 25px);
  scroll-behavior: smooth;
}

.chat-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  animation: bubbleIn 0.22s ease-out forwards;
}

.message-bubble {
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.5);
  border: 1px solid #111827;
}

.message-bot .message-bubble {
  background: #020617;
  border-color: #111827;
}

.message-user {
  justify-content: flex-end;
}

.message-user .message-bubble {
  background: linear-gradient(180deg, #1e40af, #1f3bb3);
  color: #ecfdf5;
  border: none;
  border-bottom-right-radius: 4px;
}

.message-bot .avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, #2563eb, #60a5fa);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  box-shadow: 0 0 0 1px rgba(37,99,235,0.22);
}

.message-user .avatar {
  display: none;
}

.message-meta {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}

.message-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.message-list {
  margin: 4px 0 0 14px;
  padding: 0;
}

.message-list li {
  margin: 2px 0;
}

.welcome-card {
  background: radial-gradient(circle at top left, #1d4ed833, #020617 55%);
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid #1f2937;
  box-shadow: var(--shadow-soft);
  margin-bottom: 4px;
  animation: fadeInSoft 0.4s ease-out;
}

.welcome-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.welcome-subtitle {
  font-size: 13px;
  color: #9ca3af;
}

.welcome-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.welcome-tag {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #374151;
  color: #9ca3af;
  background: #020617;
}

.suggestions-bar {
  position: relative;
  width: 100%;
  max-width: 780px;
  display: flex;
  justify-content: center;
  margin: 0 auto 8px;
  pointer-events: auto;
  z-index: 1300;
}

.suggestions-btn {
  padding: 8px 14px;
  background: linear-gradient(90deg, rgba(37,99,235,0.06), rgba(96,165,250,0.02));
  color: var(--text-main);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.02);
  cursor: pointer;
  font-weight: 700;
  min-width: 120px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 140ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 8px 28px rgba(2,6,23,0.28);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transform: translateY(-25%);
}

.suggestions-btn:focus { outline: none; box-shadow: 0 10px 34px rgba(2,6,23,0.55), 0 0 0 3px rgba(16,163,127,0.06); }

/* small caret that flips when opened */
.suggestions-btn::after {
  content: "▾";
  font-size: 12px;
  opacity: 0.9;
  transition: transform 200ms ease;
}

.app.suggestions-open .suggestions-btn {
  transform: translateY(-2px);
  background: linear-gradient(90deg, rgba(10,12,16,0.38), rgba(6,10,14,0.24));
  box-shadow: 0 14px 40px rgba(2,6,23,0.62);
}

.app.suggestions-open .suggestions-btn::after {
  transform: rotate(180deg);
}

/* dropdown: lighter and matched to sidebar */
.suggestions-inner {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.98);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: min(640px, 92%);
  padding: 10px;
  background: linear-gradient(180deg, rgba(6,12,24,0.92), var(--bg-sidebar));
  border-radius: 12px;
  border: 1px solid #0f172a;
  box-shadow: 0 10px 40px rgba(2,6,23,0.45);
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom center;
  transition: opacity 220ms cubic-bezier(.2,.9,.2,1), transform 220ms cubic-bezier(.2,.9,.2,1);
}

/* reveal with gentle pop animation */
.app.suggestions-open .suggestions-inner {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
  animation: popIn 260ms cubic-bezier(.2,.9,.2,1);
  z-index: 1450;
}

@keyframes popIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.98); }
  60% { opacity: 1; transform: translateX(-50%) translateY(-6px) scale(1.02); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* subtle, theme-consistent chips */
.suggestions-inner .suggestion-chip {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.01), rgba(37,99,235,0.03));
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 160ms ease, background 140ms ease;
  box-shadow: 0 6px 22px rgba(2,6,23,0.36);
  font-weight: 600;
  min-width: 100px;
  text-align: center;
  margin: 4px;
}

.suggestions-inner .suggestion-chip span {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.95;
}

.suggestions-inner .suggestion-chip:hover,
.suggestions-inner .suggestion-chip:focus {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 48px rgba(2,6,23,0.55);
  background: linear-gradient(90deg, rgba(59,130,246,0.08), rgba(37,99,235,0.03));
  border-color: rgba(37,99,235,0.12);
}

/* responsive: allow more wrapping and smaller chips on narrow screens */
@media (max-width: 600px) {
  .suggestions-inner .suggestion-chip { min-width: 88px; padding: 7px 10px; font-size: 13px; }
  .suggestions-inner { width: calc(100% - 24px); left: 50%; }
  .suggestions-bar { margin-bottom: 6px; }
  :root { --input-bar-height: 96px; }
  .input-bar { padding: 10px 12px calc(env(safe-area-inset-bottom, 12px) + 10px); }
}

/* Input */
.input-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: env(safe-area-inset-bottom, 0);
  height: var(--input-bar-height);
  padding: 10px 16px calc(env(safe-area-inset-bottom, 12px) + 8px);
  z-index: 1400;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.6);
  transition: transform 140ms ease; /* keep small transition for scrollIntoView */
}

.input-inner {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding-bottom: 4px;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #020617;
  border-radius: 999px;
  padding: 6px 6px 6px 14px;
  border: 1px solid #374151;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.8);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.input-shell:focus-within {
  border-color: rgba(37,99,235,0.36);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.12), 0 18px 50px rgba(6, 20, 52, 0.9);
  transform: translateY(-1px);
}

.input-field {
  border: none;
  outline: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 14px;
  resize: none;
  max-height: 90px;
  width: 100%;
  padding: 7px 0 6px;
}

.input-field::placeholder {
  color: #6b7280;
}

.send-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,0.28);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent);
  box-shadow: none;
  flex-shrink: 0;
  transform: translateY(0);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.send-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(37,99,235,0.06);
  background: rgba(37,99,235,0.03);
}

.send-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(37,99,235,0.04);
}

.send-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #022e6f;
  stroke-width: 1.8;
}

.input-bottom-text {
  margin-top: 6px;
  font-size: 11px;
  color: #6b7280;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.input-bottom-text span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #4b5563;
}

/* Typing indicator (loading animation) */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

.typing-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #9ca3af;
  animation: typingBounce 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.32s;
}

/* Animations */
@keyframes typingBounce {
  0%, 80%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-3px) scale(1.1);
    opacity: 1;
  }
}

@keyframes bubbleIn {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  70% {
    opacity: 1;
    transform: translateY(-1px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInSoft {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInSlide {
  0% {
    opacity: 0;
    transform: translateX(-14px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInSlideUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile */
@media (max-width: 900px) {
  .main-header {
    padding: 10px 14px;
  }
  .chat {
    padding: 16px 12px 8px;
   /* height uses dynamic viewport; subtract header + input bar + small gap */
   height: calc(var(--vh, 1vh) * 100 - var(--header-height) - var(--input-bar-height) - 12px);
   max-height: calc(var(--vh, 1vh) * 100 - var(--header-height) - var(--input-bar-height) - 12px);
    overflow-y: auto;
  }
  .suggestions-bar {
    padding-inline: 10px;
  }
  .suggestions-inner {
    max-width: none;
  }
  .input-bar {
    padding-inline: 10px;
  }
  .input-shell {
    border-radius: 18px;
  }
}

@media (max-width: 480px) {
  .welcome-title {
    font-size: 16px;
  }
  .suggestion-chip {
    font-size: 11px;
  }
  .input-field {
    font-size: 13px;
  }
}

/* Contact modal styles (theme-matched) */
.contact-modal {
  /* make the dialog cover the viewport and center the content */
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 48px;
  background: transparent;
  z-index: 2200;
  box-sizing: border-box;
  width: 70vh;
}

.contact-modal::backdrop {
  background: rgba(0,0,0,0.6);
}
.contact-modal-content {
  /* content width is full within the dialog padding; cap to a sane max */
  width: 100%;
  max-width: 2400px; /* Increased max-width for a wider modal */
  background: linear-gradient(180deg, rgba(6,12,24,0.96), var(--bg-sidebar));
  border: 1px solid #0f172a;
  padding: 24px;
  border-radius: 12px;
  color: var(--text-main);
  box-shadow: 0 20px 60px rgba(2,6,23,0.6);
  box-sizing: border-box;
}

/* reduce dialog padding on smaller screens so content uses available width */
@media (max-width: 900px) {
  .contact-modal { padding: 16px; }
  .contact-modal-content { padding: 18px; max-width: calc(100% - 32px); }
}
.contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.contact-header h3 {
  margin: 0;
  font-size: 18px;
}
.contact-modal .close-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
}
.contact-modal .form-group { margin-bottom: 10px; }
.contact-modal label { display:block; font-size:13px; margin-bottom:6px; color:var(--text-muted); }
.contact-modal input[type="text"], .contact-modal input[type="tel"], .contact-modal input[type="email"], .contact-modal textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #263141;
  background: rgba(255,255,255,0.02);
  color: var(--text-main);
  font-size: 14px;
  box-shadow: none;
}
.contact-modal textarea { min-height: 96px; resize: vertical; }
.contact-modal .contact-links { display:flex; gap:8px; margin-top:8px; flex-direction: column; }
.contact-modal .contact-link { color: var(--accent); text-decoration: none; }
.contact-modal .submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(37,99,235,0.28);
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 120ms ease, box-shadow 140ms ease, background 120ms ease;
}
.contact-modal .submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(37,99,235,0.06);
  background: rgba(37,99,235,0.03);
}
.contact-modal .submit-btn:active { transform: translateY(0); }
.contact-modal .submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.contact-modal .submit-loading { margin-left: 8px; color: rgba(2,6,23,0.6); }

/* Contact CTA shown inside chat message (transparent with blue border) */
.contact-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(37,99,235,0.28);
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 140ms ease, background 120ms ease;
}
.contact-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(37,99,235,0.06);
  background: rgba(37,99,235,0.03);
}
.contact-cta:active { transform: translateY(0); }

