:root {
  --bg-main: #0b0f19;
  --bg-surface: #131b2e;
  --bg-card: #19233c;
  --bg-card-hover: #1f2b49;
  --border-color: rgba(148, 163, 184, 0.14);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

.app-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

/* БОКОВАЯ ПАНЕЛЬ */
.sidebar {
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-btn.active {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  font-weight: 600;
}

.nav-icon {
  font-size: 18px;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.nav-badge.muted {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.streak-widget {
  background: var(--bg-card);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.streak-fire {
  font-weight: 700;
  font-size: 15px;
  color: #fbbf24;
  margin-bottom: 4px;
}

.streak-goal-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-bar-mini {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill-mini {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.3s ease;
}

.sync-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.sync-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.sync-dot.offline {
  background: var(--warning);
}

/* ОСНОВНАЯ ОБЛАСТЬ */
.main-content {
  padding: 28px 36px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar h1 {
  font-size: 26px;
  font-weight: 800;
}

.profile-pill {
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* КНОПКИ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-accent {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
}

.btn-glow {
  background: #fff;
  color: #1e1b4b;
  font-weight: 700;
  padding: 12px 22px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.btn-glow:hover {
  transform: translateY(-2px);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 12px 20px;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.24);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--accent);
  transform: scale(1.06);
}

/* МЕТРИКИ ДАШБОРДА */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.metric-card.urgent { border-left: 4px solid var(--danger); }
.metric-card.info { border-left: 4px solid var(--info); }
.metric-card.warning { border-left: 4px solid var(--warning); }
.metric-card.success { border-left: 4px solid var(--success); }

.metric-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 4px;
}

.metric-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* БАННЕР СТАРТА */
.hero-study-banner {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}

.hero-study-info h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.hero-study-info p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  max-width: 600px;
}

.hero-study-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 20px;
}

/* СЕТКА КОЛОД */
.decks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.deck-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.deck-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.45);
}

.deck-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.deck-icon-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.deck-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.deck-name {
  font-size: 17px;
  font-weight: 700;
}

.deck-level {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.deck-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.deck-counts {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.count-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.count-pill.due { color: #f87171; font-weight: 700; background: rgba(239, 68, 68, 0.12); }
.count-pill.new { color: #38bdf8; }
.count-pill.mastered { color: #34d399; }

.deck-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ТРЕНИРОВКА И КАРТОЧКА SM-2 */
.study-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-surface);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.study-controls-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-secondary);
}

.mode-switcher {
  display: flex;
  gap: 6px;
  background: var(--bg-main);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.mode-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.mode-btn.active {
  background: var(--accent);
  color: #fff;
}

.session-progress-wrap {
  margin-bottom: 20px;
}

.session-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.progress-bar-session {
  height: 8px;
  background: var(--bg-surface);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill-session {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #ec4899);
  transition: width 0.25s ease;
}

.flashcard-container {
  max-width: 720px;
  margin: 0 auto;
}

.flashcard {
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 22px;
  padding: 32px 36px;
  min-height: 330px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.flashcard:hover {
  border-color: rgba(99, 102, 241, 0.55);
}

.card-status-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.badge.muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.word-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

.study-word {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.study-phonetics {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 17px;
  margin-bottom: 20px;
}

.part-of-speech {
  font-style: italic;
  color: #38bdf8;
  font-size: 14px;
}

.card-prompt-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 36px;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 22px 0;
}

.translation-box {
  text-align: center;
  margin-bottom: 20px;
}

.translation-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.translation-text {
  font-size: 28px;
  font-weight: 700;
  color: #34d399;
}

.context-box {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 12px;
}

.context-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-inline-audio {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  border: none;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.example-en {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.example-ru {
  font-size: 14px;
  color: var(--text-secondary);
}

.notes-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.show-answer-bar {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.kbd-hint {
  font-size: 12px;
  opacity: 0.8;
  margin-left: 6px;
}

/* КНОПКИ SM-2 */
.sm2-rating-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.sm2-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.sm2-btn:hover {
  transform: translateY(-2px);
}

.sm2-interval {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.sm2-title {
  font-size: 16px;
  font-weight: 800;
}

.sm2-key {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.sm2-btn.again { border-bottom: 4px solid var(--danger); }
.sm2-btn.again .sm2-interval { color: #f87171; }
.sm2-btn.again:hover { background: rgba(239, 68, 68, 0.15); }

.sm2-btn.hard { border-bottom: 4px solid var(--warning); }
.sm2-btn.hard .sm2-interval { color: #fbbf24; }
.sm2-btn.hard:hover { background: rgba(245, 158, 11, 0.15); }

.sm2-btn.good { border-bottom: 4px solid var(--success); }
.sm2-btn.good .sm2-interval { color: #34d399; }
.sm2-btn.good:hover { background: rgba(16, 185, 129, 0.15); }

.sm2-btn.easy { border-bottom: 4px solid var(--info); }
.sm2-btn.easy .sm2-interval { color: #38bdf8; }
.sm2-btn.easy:hover { background: rgba(56, 189, 248, 0.15); }

/* КВИЗ И ПРАВОПИСАНИЕ */
.quiz-card, .spelling-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.quiz-instruction {
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quiz-option-btn {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
}

.quiz-option-btn.correct {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--success);
  color: #6ee7b7;
}

.quiz-option-btn.wrong {
  background: rgba(239, 68, 68, 0.22);
  border-color: var(--danger);
  color: #fca5a5;
}

.quiz-feedback {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.quiz-feedback.ok { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.quiz-feedback.err { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

.quiz-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.spelling-translation {
  font-size: 28px;
  color: #34d399;
  margin: 10px 0;
}

.spelling-definition {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.spelling-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 440px;
  margin: 0 auto;
}

.spelling-input {
  font-size: 22px !important;
  text-align: center;
  font-weight: 700;
}

.spelling-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.study-empty {
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ТАБЛИЦА СЛОВ */
.words-filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 240px;
}

.words-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.words-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.words-table th, .words-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.words-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.4);
}

.words-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ФОРМЫ И МОДАЛЬНЫЕ ОКНА */
.input-text, .input-select, .input-textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  width: 100%;
}

.input-text:focus, .input-select:focus, .input-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
  overflow-y: auto;
}

.modal-sm {
  max-width: 460px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* ГРАФИКИ И СИНХРОНИЗАЦИЯ */
.charts-grid, .sync-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

.chart-card, .sync-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.chart-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  height: 180px;
  padding-top: 20px;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar-val {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.bar-fill {
  width: 100%;
  max-width: 38px;
  background: linear-gradient(180deg, #818cf8, #4f46e5);
  border-radius: 6px 6px 0 0;
  min-height: 6px;
  transition: height 0.3s ease;
}

.bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.sync-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 10px 0;
}

.sync-form-row, .sync-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.sync-form-row .input-text {
  flex: 1;
}

.lan-urls-box {
  background: var(--bg-surface);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-family: monospace;
  font-size: 14px;
  color: #38bdf8;
}

.goal-inline-input {
  width: 90px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.toast {
  background: #1e293b;
  border-left: 4px solid var(--accent);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: fadeIn 0.2s ease;
}

.hidden {
  display: none !important;
}

/* 10 СТУПЕНЕЙ ПАМЯТИ И ВИЗУАЛЬНАЯ ШКАЛА */
.card-ten-steps-bar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  margin-bottom: 18px;
}

.step-segment {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.25s ease;
}

.step-segment.filled {
  background: linear-gradient(90deg, #6366f1, #10b981);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}

.step-segment.current {
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.step-dots-indicator {
  font-weight: 700;
  color: #a5b4fc;
}

.steps-intro-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(16, 185, 129, 0.14));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.steps-intro-card p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 720px;
  margin-top: 6px;
}

.steps-ladder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 14px;
}

.step-rung-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.step-rung-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.step-rung-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.step-number-pill {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.step-interval-tag {
  font-size: 12px;
  font-weight: 700;
  color: #34d399;
}

.step-rung-title {
  font-size: 16px;
  font-weight: 700;
}

.step-rung-task {
  font-size: 12px;
  color: var(--text-secondary);
}

.step-rung-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* МИКРО-УРОКИ ПО 5 СЛОВ ДЛЯ ТЕЛЕФОНА */
.micro-lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.micro-lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.micro-lesson-words {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* СБОРКА СЛОВА ИЗ БУКВ-ПЛИТОК (ДЛЯ ТЕЛЕФОНА) */
.tile-answer-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  margin: 18px 0;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(148, 163, 184, 0.3);
}

.letter-slot {
  width: 40px;
  height: 46px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 2px solid rgba(99, 102, 241, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-transform: lowercase;
}

.letter-slot.filled {
  background: var(--accent);
  border-color: #818cf8;
}

.tile-bank-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}

.tile-btn {
  min-width: 48px;
  height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease, background 0.15s ease;
  user-select: none;
}

.tile-btn:active:not(:disabled) {
  transform: translateY(2px);
}

.tile-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.tile-controls-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

/* QR-КОД ДЛЯ ТЕЛЕФОНА */
.qr-and-urls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.qr-image {
  width: 136px;
  height: 136px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  border: 1px solid var(--border-color);
}

/* МОБИЛЬНАЯ НИЖНЯЯ ПАНЕЛЬ НАВИГАЦИИ */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    padding-bottom: 78px;
  }
  .sidebar {
    display: none;
  }
  .main-content {
    padding: 16px 14px 88px;
  }
  .topbar h1 {
    font-size: 20px;
  }
  .study-word {
    font-size: 32px;
  }
  .flashcard, .quiz-card, .spelling-card {
    padding: 22px 18px;
  }
  .sm2-rating-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .sm2-btn {
    padding: 16px 10px;
  }
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
  .quiz-option-btn {
    padding: 16px;
    font-size: 16px;
  }
  .full-mobile-btn {
    width: 100%;
    padding: 16px;
    font-size: 17px;
  }
  .form-row.two-cols {
    grid-template-columns: 1fr;
  }
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(19, 27, 46, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 150;
  }
  .mob-nav-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 2px;
    border-radius: 10px;
    cursor: pointer;
  }
  .mob-nav-btn .mob-icon {
    font-size: 19px;
  }
  .mob-nav-btn.active {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.16);
  }
  .mob-nav-btn.highlight .mob-icon {
    background: var(--accent);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ЖИВЫЕ АНИМАЦИИ ЭМОДЗИ И КАРТИНКИ ИЗ УЧЕБНИКА ДЛЯ БЫСТРОГО ПОНИМАНИЯ */
.visual-helper-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.visual-emoji-stage {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.22), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(129, 140, 248, 0.32);
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.emoji-actor {
  font-size: 38px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.visual-tag-caption {
  font-size: 12px;
  font-weight: 700;
  color: #c7d2fe;
  max-width: 220px;
  text-align: left;
}

/* Типы живых анимаций эмодзи под смысл слова */
.anim-float {
  animation: emojiFloat 2.4s ease-in-out infinite;
}
.anim-pulse {
  animation: emojiPulse 1.8s ease-in-out infinite;
}
.anim-spin {
  animation: emojiSpin 6s linear infinite;
}
.anim-bounce-up {
  animation: emojiBounceUp 1.4s ease-in-out infinite;
}
.anim-drop-down {
  animation: emojiDropDown 1.6s ease-in-out infinite;
}
.anim-wave {
  animation: emojiWave 2s ease-in-out infinite;
}
.anim-expand {
  animation: emojiExpand 2s ease-in-out infinite;
}

@keyframes emojiFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(4deg); }
}
@keyframes emojiPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}
@keyframes emojiSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes emojiBounceUp {
  0%, 100% { transform: translateY(4px); }
  50% { transform: translateY(-9px) scale(1.12); }
}
@keyframes emojiDropDown {
  0%, 100% { transform: translateY(-6px); }
  50% { transform: translateY(7px) scale(0.92); }
}
@keyframes emojiWave {
  0%, 100% { transform: rotate(-10deg) translateX(-4px); }
  50% { transform: rotate(10deg) translateX(4px); }
}
@keyframes emojiExpand {
  0%, 100% { transform: scale(0.88); }
  50% { transform: scale(1.26); }
}

/* Кнопка и блок иллюстрации из книги Career Paths: Science */
.book-image-toggle-btn {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.book-image-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.25);
}

.book-unit-image-box {
  width: 100%;
  max-width: 560px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.22s ease;
}

.book-unit-image-box img {
  width: 100%;
  height: auto;
  display: block;
}

/* Салют частиц-эмодзи при правильном ответе */
.fx-particle {
  position: fixed;
  pointer-events: none;
  font-size: 26px;
  z-index: 999;
  animation: particleFly 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes particleFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.6) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(1.35) rotate(var(--rot));
  }
}
