/* ============================================================
   ДАРСУ-ЛЬ-АРАБИЯ — общие стили
   Mobile-first. Apple-стиль. Liquid Glass на ключевых блоках.
   ============================================================ */

/* ---------- ТОКЕНЫ ---------- */
:root {
  --bg: #ffffff;
  --bg-section: #fbfbfd;
  --bg-card: #f5f5f7;
  --ink: #1d1d1f;
  --ink-soft: #424245;
  --ink-muted: #6e6e73;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --accent: #b04a2c;
  --accent-soft: #f4e6df;
  --accent-deep: #8a3a22;
  --success: #2d7a3e;
  --success-bg: #e8f4eb;
  --error: #c0392b;
  --error-bg: #fbeae7;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;

  /* Liquid Glass tokens */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(0, 0, 0, 0.03);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-section: #0a0a0a;
    --bg-card: #1d1d1f;
    --ink: #f5f5f7;
    --ink-soft: #d2d2d7;
    --ink-muted: #86868b;
    --line: #2c2c2e;
    --line-soft: #1d1d1f;
    --accent: #d97a55;
    --accent-soft: #3a261c;
    --accent-deep: #e89274;
    --success: #6abf7c;
    --success-bg: #1c3322;
    --error: #e07565;
    --error-bg: #3a1f1c;

    --glass-bg: rgba(28, 28, 30, 0.55);
    --glass-bg-strong: rgba(28, 28, 30, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
    --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  }
}

/* ---------- БАЗОВЫЕ ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.47;
  font-size: 17px;
  letter-spacing: -0.022em;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Тёплый градиентный фон под Liquid Glass */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 10%, rgba(176, 74, 44, 0.10) 0%, transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(176, 74, 44, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(244, 230, 223, 0.6) 0%, transparent 60%),
    var(--bg);
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(circle at 15% 10%, rgba(217, 122, 85, 0.12) 0%, transparent 35%),
      radial-gradient(circle at 85% 85%, rgba(217, 122, 85, 0.08) 0%, transparent 40%),
      var(--bg);
  }
}

/* ---------- LIQUID GLASS ---------- */
/* Базовый класс — для крупных блоков */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  border-radius: var(--radius-lg);
}

/* Усиленный — для шапок и фиксированных элементов */
.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 4px 16px rgba(0, 0, 0, 0.04);
}
@media (prefers-color-scheme: dark) {
  .glass-strong {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

/* ---------- АРАБСКИЙ ---------- */
.ar {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Arabic UI Text', 'Tahoma', sans-serif;
  direction: rtl;
}
.ar-block {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Arabic UI Text', 'Tahoma', sans-serif;
  direction: rtl;
  text-align: right;
  line-height: 1.9;
  word-wrap: normal;
  word-break: keep-all;
}

/* ---------- HERO (общий) ---------- */
.hero {
  text-align: center;
  padding: 90px 22px 70px;
  position: relative;
}
.hero-eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin-bottom: 18px;
}
.hero-ar {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  font-size: clamp(28px, 6vw, 48px);
  color: var(--ink-soft);
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 28px;
}
.hero-lead {
  max-width: 580px;
  margin: 0 auto;
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.4;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}

/* ============================================================
   ГЛАВНАЯ — index.html
   ============================================================ */

.total-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 22px 0;
}
.total {
  padding: 24px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.total-ring { width: 64px; height: 64px; flex-shrink: 0; }
.total-ring-bg { stroke: var(--line); }
.total-ring-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset .6s cubic-bezier(0.4, 0, 0.2, 1);
}
.total-pct { font-size: 14px; fill: var(--ink); font-weight: 600; }
.total-text { flex: 1; }
.total-text .label { font-size: 13px; color: var(--ink-muted); margin-bottom: 2px; }
.total-text .value { font-size: 16px; font-weight: 600; }

.grid-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 22px 80px;
}
.section-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 24px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.lesson-card {
  padding: 20px 18px;
  text-decoration: none;
  color: var(--ink);
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.lesson-card:active { transform: scale(0.97); }
.lesson-card.locked { opacity: 0.5; pointer-events: none; }
.lesson-num {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.lesson-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 6px;
}
.lesson-ar {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  text-align: right;
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.lesson-status { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.lesson-progress {
  flex: 1; height: 4px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
}
.lesson-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width .4s ease;
}
.lesson-pct {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  min-width: 30px;
  text-align: right;
}
.lesson-card.complete .lesson-pct { color: var(--accent); font-weight: 600; }

.footer {
  text-align: center;
  padding: 40px 22px;
  color: var(--ink-muted);
  font-size: 13px;
  border-top: 1px solid var(--line-soft);
  margin-top: 40px;
}
.footer .ar {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

/* ============================================================
   УРОК — lesson.html
   ============================================================ */

/* Шапка */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 48px;
}
.nav-inner {
  max-width: 1024px;
  margin: 0 auto;
  height: 100%;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nav-back {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.nav-title { font-size: 14px; font-weight: 500; }
.nav-title .dim { color: var(--ink-muted); margin: 0 6px; }
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
}
.nav-toggle:active { transform: scale(0.96); }
.nav-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Сегменты */
.segments-wrap {
  position: sticky;
  top: 48px;
  z-index: 90;
  padding: 12px 16px;
}
.segments {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-card);
  border-radius: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.segments::-webkit-scrollbar { display: none; }
.segment {
  flex: 1;
  min-width: max-content;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.segment:active { transform: scale(0.97); }
.segment.active {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}
@media (prefers-color-scheme: dark) {
  .segment.active { background: #2c2c2e; }
}

.container { max-width: 720px; margin: 0 auto; padding: 56px 22px 80px; }

.section { display: none; }
.section.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title-lesson {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin-bottom: 16px;
}
.section-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--ink-soft);
  margin-bottom: 40px;
  max-width: 540px;
  line-height: 1.5;
}

/* Диалог */
.dialogue {
  padding: 8px 0;
  margin-bottom: 56px;
  overflow: hidden;
}
.dialogue-line {
  padding: 18px 24px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.dialogue-line:last-of-type { border-bottom: none; }
.dialogue-line:active { background: rgba(255, 255, 255, 0.4); }
@media (prefers-color-scheme: dark) {
  .dialogue-line:active { background: rgba(255, 255, 255, 0.04); }
}

.speaker-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.dialogue-line.speaker-a .speaker-label { color: var(--accent); }
.dialogue-line.speaker-b .speaker-label { color: var(--success); }

.line-ar {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  text-align: right;
  font-size: clamp(17px, 4vw, 22px);
  line-height: 2;
  color: var(--ink);
  word-wrap: normal;
  word-break: keep-all;
}
.line-tr {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 10px;
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, margin-top .3s ease;
}
.dialogue-line.expanded .line-tr {
  max-height: 200px;
  margin-top: 12px;
}
.dialogue-line.expanded {
  background: rgba(255, 255, 255, 0.5);
}
@media (prefers-color-scheme: dark) {
  .dialogue-line.expanded { background: rgba(255, 255, 255, 0.04); }
}

/* Грамматика */
.grammar {
  margin-bottom: 48px;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
}
.grammar:first-of-type { margin-top: 0; }
.grammar-num {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.grammar h3 {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 10px;
}
.grammar-ar {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  font-size: clamp(26px, 5vw, 38px);
  color: var(--accent);
  margin-bottom: 24px;
  line-height: 1.4;
}
.grammar p {
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.grammar p:last-child { margin-bottom: 0; }

.example {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 20px 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@media (prefers-color-scheme: dark) {
  .example { background: rgba(255, 255, 255, 0.03); }
}
.example-ar {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  text-align: right;
  font-size: clamp(19px, 3.6vw, 26px);
  line-height: 1.8;
  color: var(--ink);
  word-wrap: normal;
  word-break: keep-all;
  margin-bottom: 8px;
}
.example-tr {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Разбор предложения */
.parse {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px 16px;
  margin: 24px 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@media (prefers-color-scheme: dark) {
  .parse { background: rgba(255, 255, 255, 0.03); }
}
.parse-pair {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}
.parse-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}
.parse-word {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 8px;
  position: relative;
}
.parse-word::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 8px;
  background: var(--line);
}
.parse-word.accent { color: var(--accent); font-weight: 700; }
.parse-tag {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  font-size: clamp(12px, 2.4vw, 14px);
  color: var(--ink-muted);
  margin-top: 4px;
}
.parse-divider {
  height: 1px;
  background: var(--line);
  margin: 20px auto;
  width: 60%;
}

/* Таблица */
.ar-table {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 8px 4px;
  margin: 24px 0;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@media (prefers-color-scheme: dark) {
  .ar-table { background: rgba(255, 255, 255, 0.03); }
}
.ar-row {
  direction: rtl;
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  font-size: clamp(18px, 3.6vw, 22px);
  text-align: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.6;
  word-wrap: normal;
  word-break: keep-all;
  white-space: nowrap;
}
.ar-row:last-child { border-bottom: none; }
.ar-row .op { color: var(--ink-muted); font-size: 0.7em; margin: 0 8px; }
.ar-row .res { color: var(--accent); font-weight: 700; }

/* Сетка форм */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 24px 0;
}
@media (min-width: 600px) {
  .forms-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .forms-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .forms-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
}
.form-cell {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@media (prefers-color-scheme: dark) {
  .form-cell { background: rgba(255, 255, 255, 0.03); }
}
.form-cell .ar-form {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  font-size: clamp(20px, 4vw, 26px);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}
.form-cell .lbl { font-size: 12px; color: var(--ink-muted); }

/* Словарь */
.vocab-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 480px) {
  .vocab-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 720px) {
  .vocab-grid { grid-template-columns: repeat(3, 1fr); }
}
.vocab-card {
  padding: 22px 20px;
  cursor: pointer;
  transition: all .25s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--radius);
}
.vocab-card:active { transform: scale(0.98); }
.vocab-card.flipped {
  background: var(--accent-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(176, 74, 44, 0.2);
}
.vocab-ar {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  text-align: right;
  font-size: clamp(24px, 4.5vw, 28px);
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 4px;
  word-wrap: normal;
  word-break: keep-all;
}
.vocab-plural {
  direction: rtl;
  text-align: right;
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  font-size: 15px;
  color: var(--ink-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}
.vocab-tr {
  font-size: 15px;
  color: var(--ink-soft);
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s, padding-top .3s, margin-top .3s, border-top-color .3s;
  border-top: 1px solid transparent;
}
.vocab-card.flipped .vocab-tr {
  max-height: 80px;
  padding-top: 12px;
  margin-top: 12px;
  border-top-color: rgba(176, 74, 44, 0.2);
}
.vocab-mark {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.vocab-card.flipped .vocab-mark { display: flex; }

/* Упражнения */
.exercise {
  padding: 28px 22px;
  margin-bottom: 16px;
}
.exercise-num {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.exercise-title {
  font-size: clamp(20px, 3.5vw, 24px);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  line-height: 1.2;
}
.exercise-instr {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  text-align: right;
  font-size: clamp(15px, 2.8vw, 18px);
  color: var(--ink-soft);
  margin-bottom: 8px;
  line-height: 1.8;
  word-wrap: normal;
  word-break: keep-all;
}
.exercise-instr-ru {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

.tf-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tf-item:last-of-type { border-bottom: none; }
.tf-text {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  text-align: right;
  font-size: clamp(17px, 3.6vw, 21px);
  line-height: 1.8;
  word-wrap: normal;
  word-break: keep-all;
}
.tf-buttons { display: flex; gap: 8px; align-self: flex-end; }
.tf-btn {
  width: 44px;
  height: 32px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-soft);
  font-family: inherit;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}
.tf-btn:active { transform: scale(0.94); }
.tf-btn.selected.ok { background: var(--success); color: #fff; border-color: var(--success); }
.tf-btn.selected.no { background: var(--error); color: #fff; border-color: var(--error); }

.ex-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}
.ex-item:last-of-type { border-bottom: none; }
.ex-num {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.ex-prompt {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  text-align: right;
  font-size: clamp(17px, 3.6vw, 22px);
  line-height: 1.8;
  margin-bottom: 12px;
  word-wrap: normal;
  word-break: keep-all;
}
.ex-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  font-size: clamp(18px, 3.5vw, 22px);
  direction: rtl;
  text-align: right;
  color: var(--ink);
  transition: all .2s;
  -webkit-appearance: none;
}
.ex-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ex-input.correct { background: var(--success-bg); border-color: var(--success); }
.ex-input.wrong { background: var(--error-bg); border-color: var(--error); }

.feedback {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: none;
  color: var(--ink-soft);
}
.feedback.show { display: block; }
.feedback.ok { background: var(--success-bg); color: var(--success); }
.feedback.no { background: var(--error-bg); color: var(--error); }
.feedback .ar-correct {
  display: block;
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  text-align: right;
  font-size: 1.3em;
  margin-top: 6px;
  color: var(--ink);
}

.match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.match-col-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.match-stack { display: flex; flex-direction: column; gap: 8px; }
.match-chip {
  padding: 12px 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  font-size: clamp(18px, 4vw, 22px);
  direction: rtl;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.match-chip:active { transform: scale(0.96); }
.match-chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.match-chip.matched {
  background: var(--success-bg);
  border-color: var(--success);
  pointer-events: none;
}
.match-chip.shake { animation: shake .35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.num-prompt .target { color: var(--accent); font-weight: 700; }

.more-list { padding: 28px 22px; margin-top: 24px; }
.more-list h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.more-list p {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}
.more-list ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
@media (min-width: 600px) {
  .more-list ul { grid-template-columns: 1fr 1fr; }
}
.more-list li {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.4;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@media (prefers-color-scheme: dark) {
  .more-list li { background: rgba(255, 255, 255, 0.03); }
}
.more-list li .num {
  color: var(--accent);
  font-weight: 600;
  margin-right: 8px;
}

/* Прогресс */
.rings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (min-width: 600px) {
  .rings { grid-template-columns: repeat(3, 1fr); }
}
.ring-card {
  padding: 28px 20px;
  text-align: center;
}
.ring-svg {
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  display: block;
}
.ring-bg-c { stroke: var(--line); }
.ring-fg-c {
  stroke: var(--accent);
  transition: stroke-dashoffset .6s cubic-bezier(0.4, 0, 0.2, 1);
  stroke-linecap: round;
}
.ring-pct {
  font-size: 20px;
  fill: var(--ink);
  font-weight: 600;
}
.ring-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.ring-detail { font-size: 13px; color: var(--ink-muted); }

.quote-card { padding: 36px 24px; text-align: center; }
.quote-ar {
  font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Tahoma', sans-serif;
  direction: rtl;
  font-size: clamp(20px, 4vw, 26px);
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.6;
}
.quote-ru {
  font-size: 15px;
  color: var(--ink-muted);
  font-style: italic;
}

.lesson-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 32px;
}
.lesson-nav-btn {
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  transition: all .2s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lesson-nav-btn:active { transform: scale(0.98); }
.lesson-nav-btn.disabled { opacity: 0.4; pointer-events: none; }
.lesson-nav-btn .dir { font-size: 12px; color: var(--ink-muted); margin-bottom: 4px; }
.lesson-nav-btn .name { font-size: 16px; font-weight: 600; }
.lesson-nav-btn.next { text-align: right; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.loading {
  text-align: center;
  padding: 80px 22px;
  color: var(--ink-muted);
}
.loading.error { color: var(--error); }
