/* ===== СБРОС ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --spacing: 8px;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

/* ===== БАЗА ===== */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 32px 0; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* Контейнер */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; width: 100%; }

/* ===== НАВИГАЦИЯ ===== */
.site-header {
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-size: 1.125rem; font-weight: 700; color: var(--text); }
.logo:hover { color: var(--text); }
.site-header nav { display: flex; gap: 4px; align-items: center; }
.site-header nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.site-header nav a:hover { background: var(--primary-light); color: var(--primary); }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); padding: 4px; }

/* ===== ГЕРОЙ ===== */
.hero {
  text-align: center;
  padding: 64px 0 48px;
  max-width: 680px;
  margin: 0 auto;
}
.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.02em; }
.hero p { font-size: 1.0625rem; color: var(--text-muted); margin-bottom: 24px; }

/* ===== СЕТКА КАРТОЧЕК ===== */
.grid-4 { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-bottom: 40px; }
.grid-4 > * { flex: 1 1 220px; max-width: calc(25% - 12px); }

/* ===== КАРТОЧКА ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.15s, transform 0.15s;
  box-shadow: var(--shadow);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-icon { font-size: 1.5rem; margin-bottom: 8px; }
.card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { color: inherit; }
.memory-info { background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; font-size: 0.9375rem; color: #6d28d9; }
.memory-info strong { color: #5b21b6; }

/* ===== ДИКТАНТЫ ===== */
.section-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 16px; }
.dictation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 32px; }
.dictation-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.dictation-card:hover { box-shadow: var(--shadow-md); }
.dictation-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.meta { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 8px; }
.meta .badge { margin-right: 6px; vertical-align: middle; }
.preview { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dictation-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

/* ===== ПАМЯТЬ ===== */

.memory-card { background: linear-gradient(135deg, #f5f3ff, #ede9fe); border: 2px solid #7c3aed; border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-md); }
.memory-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.memory-icon { font-size: 2rem; line-height: 1; }
.memory-header h3 { font-size: 1.125rem; font-weight: 700; margin: 0; color: #5b21b6; }
.memory-header p { font-size: 0.875rem; color: #6d28d9; margin: 2px 0 0; }
.memory-text { font-size: 1.0625rem; line-height: 1.9; padding: 20px; background: #fff; border: 1px solid #ddd6fe; border-radius: var(--radius-sm); color: #1e1b4b; font-family: Georgia, serif; user-select: all; }
#memory-progress { width: 100%; height: 6px; background: #ddd6fe; border-radius: 3px; margin-top: 16px; overflow: hidden; }
#memory-bar { height: 100%; background: linear-gradient(90deg, #7c3aed, #a78bfa); border-radius: 3px; transition: width 0.3s; width: 0%; }

/* ===== БЕЙДЖИ СЛОЖНОСТИ ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.5; }
.badge-easy { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-medium { background: #fff7ed; color: #d97706; border: 1px solid #fed7aa; }
.badge-hard { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-type { background: #f0f4ff; color: #6366f1; border: 1px solid #c7d2fe; }
.badge-text { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-memory { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }

/* ===== КНОПКИ ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 20px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none; line-height: 1.4; white-space: nowrap;
}
.btn:hover { background: var(--bg); border-color: var(--text-muted); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-small { padding: 4px 12px; font-size: 0.8125rem; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

/* ===== ФОРМЫ ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 6px; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 0.875rem; }
.checkbox-group input[type="checkbox"] { width: auto; margin: 0; }
.form-input, .form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-family: inherit; background: var(--surface); color: var(--text);
  transition: border-color 0.15s;
}
.form-input:focus, .form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group textarea { resize: vertical; min-height: 160px; color: #000000; background: #ffffff; color-scheme: light; forced-color-adjust: none; -webkit-text-fill-color: #000000; caret-color: #000000; }

.speed-indicator { margin-top: 8px; font-size: 0.8125rem; color: var(--text-muted); }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); max-width: 640px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ===== ТЕКСТОВЫЙ ПРЕВЬЮ ===== */
.text-preview-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; box-shadow: var(--shadow); }
.text-preview-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.text-preview-header h3 { font-size: 0.875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.text-preview { font-size: 1.0625rem; line-height: 1.8; padding: 16px; background: #fafafa; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text); user-select: all; }

/* ===== КНОПКА ИЗБРАННОГО ===== */
.btn-fav {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 10px; font-size: 0.875rem; cursor: pointer;
  color: var(--text-muted); transition: all 0.15s;
  line-height: 1.4;
}
.btn-fav:hover { border-color: #f59e0b; color: #f59e0b; background: #fffbeb; }
.btn-fav.active { border-color: #f59e0b; color: #f59e0b; background: #fffbeb; }
.btn-fav .star { font-size: 1rem; line-height: 1; }
.btn-fav.loading { opacity: 0.5; pointer-events: none; }

/* ===== КНОПКА ПЕРЕКЛЮЧЕНИЯ ТЕМЫ ===== */
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 1rem; cursor: pointer; line-height: 1;
  color: var(--text-muted); transition: all 0.15s;
}
.theme-toggle:hover { background: var(--bg); }

/* ===== МЕНЮ ПОЛЬЗОВАТЕЛЯ ===== */
.user-menu { position: relative; }
.user-menu-btn {
  padding: 8px 12px; font-size: 0.875rem; font-weight: 600;
  border: none; background: none; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; line-height: 1.4;
}
.user-menu-btn:hover { color: var(--text); }
.user-menu-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); min-width: 180px; z-index: 200;
  padding: 4px; overflow: hidden;
}
.user-menu-dropdown.open { display: block; }
.user-menu-dropdown a,
.user-menu-dropdown .dropdown-item {
  display: block; width: 100%; padding: 8px 14px; font-size: 0.875rem; font-weight: 500;
  color: var(--text); text-decoration: none; border: none; border-radius: var(--radius-sm);
  background: none; cursor: pointer; text-align: left; white-space: nowrap;
  transition: background 0.1s;
}
.user-menu-dropdown a:hover,
.user-menu-dropdown .dropdown-item:hover { background: var(--bg); color: var(--primary); }

.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 1rem; cursor: pointer; line-height: 1;
  color: var(--text-muted); transition: all 0.15s;
}
.theme-toggle:hover { background: var(--bg); }

/* ===== ОШИБКИ ПУНКТУАЦИИ ===== */
.punct-errors { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.punct-errors li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 0.9375rem; font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.punct-errors li .punct-icon {
  flex-shrink: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 0.8125rem; font-weight: 700;
}
.punct-errors li .punct-icon.missed { background: #fef2f2; color: #dc2626; }
.punct-errors li .punct-icon.extra { background: #fffbeb; color: #d97706; }
.punct-errors li .punct-icon.wrong { background: #eff6ff; color: #2563eb; }
.punct-errors li .punct-char {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 6px;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 1.0625rem;
  font-family: Georgia, serif;
}
.punct-errors li .punct-char.missed { background: #fef2f2; color: #dc2626; border: 1px dashed #fecaca; }
.punct-errors li .punct-char.extra { background: #fffbeb; color: #d97706; border: 1px dashed #fed7aa; }
.punct-errors li .punct-char.wrong-expected { background: #eff6ff; color: #2563eb; border: 1px dashed #c7d2fe; }
.punct-errors li .punct-char.wrong-got { background: #fef2f2; color: #dc2626; border: 1px dashed #fecaca; }

/* ===== ФИЛЬТР ПО ТИПУ ===== */
.type-filter { display: flex; gap: 6px; margin-bottom: 20px; }
.type-filter .btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== СЕКЦИИ ПО ТИПУ ===== */
.type-section { margin-bottom: 32px; }
.type-section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.type-section-icon { font-size: 1.25rem; }
.type-section-header h2 { font-size: 1.125rem; font-weight: 700; color: var(--text); margin: 0; }
.type-section-count {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; border-radius: 12px;
  background: var(--primary-light); color: var(--primary);
  font-size: 0.75rem; font-weight: 700; padding: 0 8px;
}

/* ===== ФИЛЬТР КАТЕГОРИЙ ===== */
.category-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.category-filter .btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== TTS ПЛЕЕР ===== */
.tts-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; box-shadow: var(--shadow); }
.tts-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tts-row select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.875rem; background: var(--surface); flex: 1; min-width: 120px; }
.tts-row select:focus { outline: none; border-color: var(--primary); }

/* Нативный аудио-плеер */
.tts-player { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.tts-play { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s, border-color 0.15s, color 0.15s; line-height: 1; padding-left: 2px; }
.tts-play:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.tts-play:active { transform: scale(0.95); }
.tts-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; cursor: pointer; position: relative; }
.tts-fill { height: 100%; background: var(--primary); border-radius: 3px; width: 0%; pointer-events: none; }
.tts-time { font-size: 0.8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== ТАБЛИЦЫ ===== */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-muted); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ===== СТАТИСТИКА ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 24px 0; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); }
.stat-card h3 { font-size: 1.75rem; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.stat-card p { font-size: 0.8125rem; color: var(--text-muted); }

/* ===== ПРОФИЛЬ ===== */
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.profile-card p { margin-bottom: 4px; font-size: 0.9375rem; }
.profile-card strong { font-weight: 600; }

/* ===== РЕЗУЛЬТАТЫ ===== */
.result-summary { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.result-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 32px; text-align: center; box-shadow: var(--shadow); min-width: 120px; }
.result-stat.good { border-left: 3px solid #16a34a; }
.result-stat.medium { border-left: 3px solid #f59e0b; }
.result-stat.bad { border-left: 3px solid #dc2626; }
.result-score, .result-errors { font-size: 2rem; font-weight: 700; }
.result-errors { color: #dc2626; }
.text-compare { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; line-height: 1.7; white-space: pre-wrap; font-size: 0.9375rem; }
.text-compare h3 { font-size: 0.875rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.03em; }

/* Оригинальный текст — книжный стиль */
.text-original {
  margin-bottom: 20px;
  position: relative;
}
.text-original::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #b8860b, #daa520, #b8860b);
  border-radius: 2px;
  margin-bottom: 0;
}
.text-original-inner {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.125rem;
  line-height: 1.9;
  color: #2d1f00;
  background: linear-gradient(135deg, #fefcf5 0%, #fffdf7 40%, #fcf8ee 100%);
  border: 1px solid #e8dcc8;
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 28px 32px;
  white-space: pre-wrap;
  box-shadow: inset 0 1px 3px rgba(139, 109, 56, 0.06), 0 2px 6px rgba(0,0,0,0.04);
  position: relative;
}
.text-original-inner::first-letter {
  font-size: 2.4em;
  font-weight: 700;
  float: left;
  line-height: 1;
  margin-right: 8px;
  margin-top: 2px;
  color: #8b6914;
  font-family: Georgia, serif;
}
.error-word { background: #fef2f2; color: #dc2626; padding: 1px 3px; border-radius: 2px; }
.error-extra { background: #fffbeb; color: #d97706; padding: 1px 3px; border-radius: 2px; }
.error-missed { background: #f0fdf4; color: #16a34a; padding: 1px 3px; border-radius: 2px; text-decoration: underline; }

/* ===== УВЕДОМЛЕНИЯ ===== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 16px; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ===== СТРАНИЦЫ ПОЛИТИКИ ===== */
.privacy-section { max-width: 760px; margin: 0 auto; line-height: 1.9; font-size: 0.9375rem; padding: 0 16px 48px; }
.privacy-section h3 { font-size: 1.0625rem; font-weight: 700; margin: 24px 0 8px; }
.privacy-section ul { padding-left: 20px; margin-bottom: 12px; }
.privacy-section ul li { margin-bottom: 4px; }
.privacy-section hr { margin: 24px 0; border: none; border-top: 1px solid var(--border); }

/* ===== ПОДВАЛ ===== */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; text-align: center; font-size: 0.8125rem; color: var(--text-muted); margin-top: 32px; }

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .site-header nav { display: none; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px; gap: 2px; }
  .site-header nav.open { display: flex; }
  .grid-4 > * { max-width: calc(50% - 8px); }
  .hero { padding: 40px 0 32px; }
  .hero h1 { font-size: 1.5rem; }
  .dictation-grid { grid-template-columns: 1fr; }
  .result-summary { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Адаптивность для очень маленьких экранов (до 480px) */
@media (max-width: 480px) {
  .grid-4 > * { max-width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .container { padding: 0 12px; }
}

/* ===== ТЁМНАЯ ТЕМА ===== */
.dark-mode {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --primary-light: #1e3a5f;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
}
.dark-mode .form-group textarea {
  background: #1e293b; color: #f1f5f9; -webkit-text-fill-color: #f1f5f9;
}
.dark-mode .memory-card { background: linear-gradient(135deg, #2d1b4e, #1e1b2e); border-color: #7c3aed; }
.dark-mode .memory-info { background: #1e1b2e; border-color: #4a3a6e; color: #c4b5fd; }
.dark-mode .memory-info strong { color: #a78bfa; }
.dark-mode .memory-text { background: #1a1a2e; color: #e0d6f0; border-color: #4a3a6e; }
.dark-mode .memory-header h3 { color: #a78bfa; }
.dark-mode .memory-header p { color: #c4b5fd; }
.dark-mode .text-preview { background: #1e293b; }
.dark-mode .text-original-inner {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-color: #334155; color: #e2dcc8;
}
.dark-mode .btn-fav:hover { background: #3d2e00; }
.dark-mode .btn-fav.active { background: #3d2e00; }
.dark-mode .badge-type { background: #1e1b4b; color: #a5b4fc; border-color: #312e81; }
.dark-mode .tts-row select { background: #1e293b; color: #f1f5f9; }
.dark-mode .tts-play { background: #1e293b; color: #f1f5f9; border-color: #475569; }
.dark-mode .user-menu-btn { color: var(--text-muted); }
.dark-mode .user-menu-btn:hover { color: var(--text); }
.dark-mode .user-menu-dropdown { background: var(--surface); border-color: var(--border); }
.dark-mode .user-menu-dropdown a:hover,
.dark-mode .user-menu-dropdown .dropdown-item:hover { background: var(--bg); }
