/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:         #09090f;
  --surface:    #111118;
  --surface-2:  #1a1a24;
  --surface-3:  #22222e;
  --border:     rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);

  --accent:     #7c3aed;
  --accent-2:   #2563eb;
  --accent-glow: rgba(124,58,237,0.35);

  --text:       #f1f5f9;
  --text-2:     #94a3b8;
  --text-3:     #475569;

  --success:    #10b981;
  --warning:    #f59e0b;
  --danger:     #ef4444;

  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 48px rgba(0,0,0,0.6);

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Typography ────────────────────────────────────────────────────────────── */
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text-2); }

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.hidden { display: none !important; }

/* ── Gradient text ─────────────────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  font-family: inherit;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 28px var(--accent-glow);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 8px 12px;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-hover); }

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

/* ── Form elements ──────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
input::placeholder { color: var(--text-3); }

/* ── Card ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ── Alert ──────────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.25); color: #6ee7b7; }

/* ── Badge ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-purple { background: rgba(124,58,237,0.18); color: #a78bfa; border: 1px solid rgba(124,58,237,0.25); }
.badge-blue   { background: rgba(37,99,235,0.18);  color: #60a5fa; border: 1px solid rgba(37,99,235,0.25); }

/* ── Spinner ────────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════════
   AUTH PAGE
═══════════════════════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(124,58,237,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(37,99,235,0.12) 0%, transparent 60%),
    var(--bg);
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo .logo-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  display: block;
}
.auth-logo h1 { font-size: 1.6rem; }
.auth-logo p  { font-size: 0.9rem; margin-top: 6px; }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.auth-tab.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .btn-primary { margin-top: 8px; }

.auth-divider {
  text-align: center;
  color: var(--text-3);
  font-size: 0.8rem;
  margin: 16px 0;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.languages-preview {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
}
.lang-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-3);
}
.lang-pill span:first-child { font-size: 1.5rem; }

/* ═══════════════════════════════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,9,15,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.nav-brand .brand-icon { font-size: 1.4rem; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-2);
}
.nav-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════════════════════════════ */
.dashboard-page {
  min-height: calc(100vh - 64px);
  padding: 40px 24px 120px;
  max-width: 1100px;
  margin: 0 auto;
}

.dashboard-header {
  margin-bottom: 40px;
}
.dashboard-header p { margin-top: 8px; font-size: 1rem; }

/* Step labels */
.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.step-num {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.step-label h2 { font-size: 1rem; color: var(--text-2); font-weight: 500; }

/* ── Language cards ──────────────────────────────────────────────────────────── */
.language-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.language-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.language-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(37,99,235,0.04));
  opacity: 0;
  transition: opacity var(--transition);
}
.language-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.language-card:hover::before { opacity: 1; }
.language-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px rgba(124,58,237,0.2);
}
.language-card.selected::before { opacity: 1; }

.lang-flag  { font-size: 3rem; margin-bottom: 12px; }
.lang-name  { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.lang-native { font-size: 0.85rem; color: var(--text-3); }

.lang-check {
  position: absolute;
  top: 12px; right: 12px;
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
}
.language-card.selected .lang-check { display: flex; }

/* ── Topic grid ──────────────────────────────────────────────────────────────── */
.category-section { margin-bottom: 32px; }

.category-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.topic-card:hover { border-color: var(--border-hover); background: var(--surface-2); transform: translateY(-1px); }
.topic-card.selected {
  border-color: var(--accent);
  background: rgba(124,58,237,0.08);
  box-shadow: 0 0 0 1px rgba(124,58,237,0.3);
}
.topic-icon { font-size: 1.4rem; }
.topic-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.topic-desc { font-size: 0.75rem; color: var(--text-3); line-height: 1.4; }

/* ── Start button (floating) ─────────────────────────────────────────────────── */
.start-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  background: rgba(9,9,15,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transform: translateY(100%);
  transition: transform var(--transition);
  z-index: 50;
}
.start-bar.visible { transform: translateY(0); }

.start-selection-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-2);
}
.start-selection-info .badge { font-size: 0.82rem; }

/* ═══════════════════════════════════════════════════════════════════════════════
   CONVERSATION PAGE
═══════════════════════════════════════════════════════════════════════════════ */
.conv-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.conv-header {
  background: rgba(9,9,15,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
}

.conv-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.conv-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.conv-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* TTS toggle */
.tts-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.tts-toggle input { display: none; }
.toggle-track {
  width: 36px; height: 20px;
  background: var(--surface-3);
  border-radius: 10px;
  position: relative;
  transition: background var(--transition);
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}
.tts-toggle input:checked + .toggle-track { background: var(--accent); }
.tts-toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* Messages area */
.conv-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Greeting state */
.conv-loading-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  color: var(--text-3);
}
.conv-loading-state .spinner {
  width: 28px; height: 28px;
  border-color: rgba(124,58,237,0.3);
  border-top-color: var(--accent);
}

/* Message bubbles */
.message {
  display: flex;
  gap: 10px;
  max-width: 720px;
  animation: msgIn 0.25s ease both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.assistant { align-self: flex-start; }

.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.message.assistant .msg-avatar { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.message.user .msg-avatar { background: var(--surface-3); }

.msg-body { display: flex; flex-direction: column; gap: 4px; max-width: calc(100% - 44px); }

.msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  line-height: 1.65;
  word-break: break-word;
}
.message.user .msg-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.message.assistant .msg-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}
.message.user .msg-footer { justify-content: flex-end; }

.msg-time { font-size: 0.72rem; color: var(--text-3); }

.msg-play-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}
.msg-play-btn:hover { background: var(--surface-3); color: var(--text-2); }
.msg-play-btn.playing { color: var(--accent); }

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  animation: msgIn 0.25s ease both;
}
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
}
.typing-dots span {
  width: 6px; height: 6px;
  background: var(--text-3);
  border-radius: 50%;
  animation: bounce 1.2s ease infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-6px); }
}

/* Streaming bubble */
.message.streaming .msg-bubble::after {
  content: '▋';
  animation: blink 0.8s step-end infinite;
  color: var(--accent);
  margin-left: 2px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Input area */
.conv-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 800px;
  margin: 0 auto;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

#messageInput {
  width: 100%;
  min-height: 44px;
  max-height: 160px;
  padding: 11px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
  overflow-y: auto;
}
#messageInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
#messageInput::placeholder { color: var(--text-3); }

/* Mic button */
.mic-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  flex-shrink: 0;
}
.mic-btn:hover { background: var(--surface-3); color: var(--text); }
.mic-btn.recording {
  background: rgba(239,68,68,0.15);
  border-color: var(--danger);
  color: var(--danger);
  animation: pulse-ring 1.2s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0   rgba(239,68,68,0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(239,68,68,0);   }
  100% { box-shadow: 0 0 0 0   rgba(239,68,68,0);   }
}

/* Send button */
.send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--accent-glow);
}
.send-btn:hover:not(:disabled) { transform: scale(1.08); box-shadow: 0 0 20px var(--accent-glow); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.input-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 8px;
}

/* ── Voice status bar ────────────────────────────────────────────────────────── */
.voice-status {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--danger);
  margin-bottom: 8px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.voice-status.show { display: flex; }
.voice-dot {
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse-dot 1s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

/* ── Audio indicator ─────────────────────────────────────────────────────────── */
.audio-playing-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--accent);
  padding: 4px 0;
}
.audio-playing-indicator.show { display: flex; }
.audio-bars { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.audio-bars span {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: bar-bounce 0.8s ease infinite;
}
.audio-bars span:nth-child(2) { animation-delay: 0.1s; }
.audio-bars span:nth-child(3) { animation-delay: 0.2s; }
.audio-bars span:nth-child(4) { animation-delay: 0.3s; }
@keyframes bar-bounce {
  0%, 100% { height: 4px; }
  50%       { height: 14px; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
  .language-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .topic-grid    { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Mobile */
@media (max-width: 640px) {
  .dashboard-page { padding: 24px 16px 100px; }
  .language-grid  { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .language-card  { padding: 18px 10px; }
  .lang-flag      { font-size: 2.2rem; }
  .lang-name      { font-size: 0.9rem; }
  .lang-native    { font-size: 0.75rem; }

  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-desc { display: none; }

  .auth-card { padding: 24px 20px; }

  .conv-messages { padding: 16px 12px; }

  .navbar { padding: 0 16px; }
  .nav-user span { display: none; }

  .start-bar { flex-direction: column; gap: 12px; }
  .start-selection-info { flex-wrap: wrap; justify-content: center; }

  .conv-header { padding: 0 12px; }
  .conv-meta .badge:last-child { display: none; }

  .message { max-width: 100%; }

  .input-hint { display: none; }
}

@media (max-width: 380px) {
  .language-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .language-card { padding: 14px 8px; }
}
