* { box-sizing: border-box; }
body {
  margin: 0;
  background: #0f0720;
  color: #e0e0e0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.launch-screen {
  max-width: 480px;
  margin: 3rem auto;
  padding: 2rem;
  text-align: center;
}
.launch-screen h1 { margin: 0 0 .6rem; }
.launch-screen p { color: #b0a8c9; line-height: 1.5; margin: 0 0 1.4rem; }

.aria-avatar {
  width: 120px; height: 120px; border-radius: 50%;
  border: 3px solid #a78bfa;
  box-shadow: 0 0 30px rgba(124,58,237,.5);
  margin-bottom: 1rem;
}
.aria-avatar-sm {
  width: 22px; height: 22px; border-radius: 50%;
  vertical-align: middle; margin-right: .4rem;
}

.btn-english-ai {
  background: linear-gradient(135deg, #059669, #34d399);
  color: #fff;
  border: none;
  padding: .6rem 1.4rem;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-english-ai:hover { opacity: .88; }

.sweetheart-link-row {
  font-size: .85rem !important;
  color: #8a7fa8 !important;
  margin: -0.6rem 0 1.4rem !important;
}
.sweetheart-link-row a { color: #c4b5fd; }
.sweetheart-link-row a:hover { color: #a78bfa; }

.gate-form {
  display: flex; flex-direction: column; gap: .7rem; align-items: stretch;
  max-width: 320px; margin: 0 auto;
}
.gate-form input {
  padding: .65rem .9rem; border-radius: 8px; border: 1px solid #4c1d95;
  background: #1a0f2e; color: #e0e0e0; font-size: .92rem;
}
.gate-form input:focus { outline: none; border-color: #a78bfa; }

.gate-panel { margin-top: .5rem; }
.gate-price { font-size: 1rem; font-weight: 600; color: #c4b5fd; margin: 0 0 1rem; }
.gate-qr { margin: 1rem auto; width: fit-content; }
.gate-qr svg { display: block; background: #fff; border-radius: 8px; padding: 6px; }
.gate-hint { font-size: .82rem; color: #999; line-height: 1.5; margin: .8rem 0; }
.gate-hint strong { color: #c4b5fd; }

.message-status { font-size: .82rem; margin-top: .6rem; }
.message-status.error, #premiumUtrStatus { color: #f87171; }

.voice-ai-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10002;
  background: linear-gradient(135deg, #0f0720 0%, #1a0a3e 100%);
  border-bottom: 2px solid #7c3aed;
  box-shadow: 0 8px 40px rgba(124,58,237,.45);
  padding: 1.5rem 2rem;
  animation: slideDown .3s ease;
}
.voice-ai-overlay.open { display: block; }
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.voice-ai-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem;
}
.voice-ai-title { font-size: 1.1rem; font-weight: 700; color: #a78bfa; }
.voice-ai-close {
  background: none; border: none; color: #a78bfa; font-size: 1.4rem; cursor: pointer; line-height: 1;
}

.voice-ai-body {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}

.mic-btn {
  width: 70px; height: 70px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  background-color: #7c3aed;
  background-size: cover; background-position: center;
  border: 3px solid #a78bfa;
  color: #fff; font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 0 rgba(167,139,250,.5);
  transition: transform .15s, border-color .2s;
}
.mic-btn:hover { transform: scale(1.06); }
@keyframes micPulse {
  0%   { box-shadow: 0 0 0 0 rgba(248,113,113,.6); }
  70%  { box-shadow: 0 0 0 18px rgba(248,113,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(248,113,113,0); }
}

/* English Practice AI — always-on mic indicator (Aria's avatar), no click
   target (hands-free). State is shown via the border/glow ring so the
   avatar image stays visible underneath instead of being replaced. */
.english-mic-indicator { cursor: default; }
.english-mic-indicator.hearing {
  animation: micPulse 1.2s infinite;
  border-color: #f87171;
}
.english-mic-indicator.thinking {
  animation: micThinking 1s infinite ease-in-out;
  border-color: #fbbf24;
}
.english-mic-indicator.speaking {
  animation: micPulse 1.2s infinite;
  border-color: #34d399;
}
@keyframes micThinking {
  0%, 100% { opacity: 1; }
  50%      { opacity: .5; }
}

.voice-ai-convo {
  flex: 1; min-width: 260px; max-height: 160px; overflow-y: auto;
  display: flex; flex-direction: column; gap: .6rem;
}
.voice-bubble {
  padding: .55rem .9rem; border-radius: 12px; font-size: .88rem; line-height: 1.45; max-width: 90%;
}
.voice-bubble.user {
  background: #2e1065; color: #e0e0e0; align-self: flex-end; border-bottom-right-radius: 3px;
}
.voice-bubble.ai {
  background: #1e0f3a; color: #c4b5fd; align-self: flex-start; border-bottom-left-radius: 3px;
  border-left: 3px solid #7c3aed;
}
.voice-bubble.status { color: #888; font-style: italic; font-size: .8rem; align-self: center; }

.voice-ai-hint { font-size: .75rem; color: #666; margin-top: .5rem; text-align: center; }

.support-chat-fab {
  position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 10001;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff; font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 4px 16px rgba(124,58,237,.5);
}
.support-chat-fab:hover { opacity: .9; }

.support-chat-panel {
  position: fixed; bottom: 5.2rem; right: 1.2rem; z-index: 10001;
  width: 320px; max-width: calc(100vw - 2.4rem);
  background: linear-gradient(135deg, #0f0720 0%, #1a0a3e 100%);
  border: 1px solid #4c1d95; border-radius: 12px;
  box-shadow: 0 8px 40px rgba(124,58,237,.45);
  display: flex; flex-direction: column; overflow: hidden;
}
.support-chat-panel[hidden] { display: none; }
.support-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem; font-weight: 600; color: #a78bfa;
  border-bottom: 1px solid #4c1d95;
}
.support-chat-convo {
  flex: 1; max-height: 260px; min-height: 120px; overflow-y: auto;
  padding: .8rem 1rem; display: flex; flex-direction: column; gap: .6rem;
}
.support-chat-form {
  display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid #4c1d95;
}
.support-chat-form input {
  flex: 1; padding: .55rem .8rem; border-radius: 8px; border: 1px solid #4c1d95;
  background: #1a0f2e; color: #e0e0e0; font-size: .88rem;
}
.support-chat-form input:focus { outline: none; border-color: #a78bfa; }
.support-chat-form .btn-english-ai { padding: .55rem 1rem; font-size: .85rem; }

/* ── Light theme: white background (overrides the dark purple defaults above) ── */
body { background: #fff; color: #1f2937; }
.launch-screen p { color: #4b5563; }
.sweetheart-link-row { color: #6b7280 !important; }
.sweetheart-link-row a { color: #7c3aed; }
.sweetheart-link-row a:hover { color: #6d28d9; }
.gate-form input { background: #fff; color: #111827; border: 1px solid #c4b5fd; }
.gate-form input:focus { border-color: #7c3aed; }
.gate-price { color: #6d28d9; }
.gate-hint { color: #6b7280; }
.gate-hint strong { color: #6d28d9; }
.voice-ai-overlay { background: #fff; box-shadow: 0 8px 40px rgba(124,58,237,.2); }
.voice-ai-title, .voice-ai-close { color: #6d28d9; }
.voice-bubble.user { background: #ede9fe; color: #1f2937; }
.voice-bubble.ai { background: #f5f3ff; color: #4c1d95; }
.voice-bubble.status { color: #6b7280; }
.voice-ai-hint { color: #6b7280; }
.support-chat-panel { background: #fff; border: 1px solid #c4b5fd; box-shadow: 0 8px 40px rgba(124,58,237,.2); }
.support-chat-header { color: #6d28d9; border-bottom: 1px solid #ddd6fe; }
.support-chat-form { border-top: 1px solid #ddd6fe; }
.support-chat-form input { background: #fff; color: #111827; border: 1px solid #c4b5fd; }
.support-chat-form input:focus { border-color: #7c3aed; }

/* ── SEO content section below the launch screen ── */
.seo-content { max-width: 640px; margin: 0 auto; padding: 0 1.5rem 4rem; color: #374151; line-height: 1.65; }
.seo-content h2 { color: #6d28d9; font-size: 1.25rem; margin: 2rem 0 .6rem; }
.seo-content h3 { color: #4c1d95; font-size: 1rem; margin: 1.1rem 0 .3rem; }
.seo-content p { margin: 0 0 .8rem; }
.seo-content ol, .seo-content ul { padding-left: 1.3rem; margin: 0 0 .8rem; }
.seo-content li { margin-bottom: .45rem; }

/* ── Chemistry Tutor ── */
.tutor-logo { font-size: 72px; line-height: 1; margin-bottom: .6rem; }
.tutor-overlay { position: fixed; inset: 0; z-index: 10002; display: none; flex-direction: column; background: #0f0720; }
.tutor-overlay.open { display: flex; }
.tutor-header { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid #2a1850; }
.tutor-title { font-weight: 600; flex: 1; }
.tutor-header select { background: #1a0f2e; color: #e0e0e0; border: 1px solid #4c1d95; border-radius: 8px; padding: .35rem .5rem; font-size: .85rem; max-width: 52vw; }
.tutor-convo { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .8rem; max-width: 760px; width: 100%; margin: 0 auto; }
.tutor-bubble { padding: .7rem .9rem; border-radius: 12px; line-height: 1.55; max-width: 92%; word-wrap: break-word; }
.tutor-bubble .tutor-text { white-space: pre-wrap; }
.tutor-bubble img { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; margin-bottom: .4rem; }
.tutor-bubble.user   { align-self: flex-end; background: #4c1d95; color: #fff; }
.tutor-bubble.ai     { color: #e0e0e0; align-self: flex-start; background: #1a0f2e; border: 1px solid #2a1850; }
.tutor-bubble.status { align-self: center; color: #8a7fa8; font-size: .88rem; text-align: center; }
.tutor-preview { position: relative; padding: .4rem 1rem 0; max-width: 760px; width: 100%; margin: 0 auto; }
.tutor-preview img { max-height: 90px; border-radius: 8px; border: 1px solid #4c1d95; }
.tutor-preview button { position: absolute; top: 0; margin-left: -10px; background: #7c3aed; color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.tutor-form { display: flex; gap: .5rem; align-items: flex-end; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); border-top: 1px solid #2a1850; max-width: 760px; width: 100%; margin: 0 auto; }
.tutor-form textarea { flex: 1; resize: none; max-height: 140px; padding: .6rem .8rem; border-radius: 8px; border: 1px solid #4c1d95; background: #1a0f2e; color: #e0e0e0; font: inherit; font-size: .95rem; }
.tutor-form textarea:focus { outline: none; border-color: #a78bfa; }
.tutor-photo-btn { font-size: 1.5rem; cursor: pointer; padding: .2rem .3rem; }
.tutor-form button:disabled { opacity: .5; cursor: default; }
.tutor-bubble .katex-display { overflow-x: auto; overflow-y: hidden; }
