/* אנגלית בקליק - styles v5 (professional redesign) */
:root {
  --bg: #eef2fb;
  --card: #ffffff;
  --text: #101a33;
  --muted: #55648a;
  --primary: #2458e6;
  --primary-2: #4f46e5;
  --primary-dark: #1c46c2;
  --primary-soft: #e3ebff;
  --success: #0f7a3d;
  --success-2: #16a34a;
  --success-soft: #ddf5e6;
  --danger: #b91c1c;
  --danger-soft: #fde5e5;
  --amber: #b45309;
  --amber-soft: #fdeed3;
  --border: #dde5f5;
  --ring: rgba(36, 88, 230, 0.35);
  --shadow-sm: 0 1px 2px rgba(16, 26, 51, 0.05), 0 2px 8px rgba(16, 26, 51, 0.05);
  --shadow-md: 0 2px 4px rgba(16, 26, 51, 0.05), 0 10px 24px -6px rgba(16, 26, 51, 0.12);
  --shadow-lg: 0 4px 10px rgba(16, 26, 51, 0.06), 0 18px 38px -8px rgba(16, 26, 51, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
}
html.dark {
  --bg: #0b1120;
  --card: #151f38;
  --text: #eaeffb;
  --muted: #98a6c9;
  --primary: #6d8dff;
  --primary-2: #8b7bff;
  --primary-dark: #4f6ee6;
  --primary-soft: #1e2a4a;
  --success: #4ade80;
  --success-2: #34d399;
  --success-soft: #12301f;
  --danger: #f87171;
  --danger-soft: #391b1b;
  --amber: #fbbf24;
  --amber-soft: #33270e;
  --border: #263352;
  --ring: rgba(109, 141, 255, 0.45);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 24px -6px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.4), 0 18px 38px -8px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Rubik", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  padding-bottom: 86px;
  position: relative;
}
/* soft ambient background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(46rem 30rem at 110% -8%, rgba(79, 70, 229, 0.14), transparent 60%),
    radial-gradient(40rem 28rem at -12% 12%, rgba(36, 88, 230, 0.12), transparent 60%),
    radial-gradient(30rem 24rem at 50% 118%, rgba(22, 163, 74, 0.08), transparent 60%);
}
html.dark body::before {
  background:
    radial-gradient(46rem 30rem at 110% -8%, rgba(139, 123, 255, 0.12), transparent 60%),
    radial-gradient(40rem 28rem at -12% 12%, rgba(109, 141, 255, 0.10), transparent 60%),
    radial-gradient(30rem 24rem at 50% 118%, rgba(52, 211, 153, 0.06), transparent 60%);
}

/* accessibility */
.skip-link {
  position: absolute;
  top: -60px;
  right: 8px;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus { top: 8px; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
h1:focus { outline: none; }

/* header */
.app-header {
  background: var(--card);
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.logo-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--primary);
  padding: 4px;
  letter-spacing: -0.01em;
}
.logo-icon {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-radius: 12px;
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.header-stats { display: flex; align-items: center; gap: 8px; }
.hdr-stat {
  font-weight: 700;
  font-size: 0.92rem;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.icon-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* layout */
main {
  max-width: 780px;
  margin: 0 auto;
  padding: 22px 16px 34px;
}
.view:not([hidden]) { animation: viewIn 0.28s ease both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 10px 0 4px;
}
#view-home h1 { font-size: 1.85rem; }
h2 { font-size: 1.18rem; font-weight: 700; }
.subtitle { color: var(--muted); margin: 4px 0 18px; }
.section-title { margin: 26px 0 12px; }
.hint { color: var(--muted); font-size: 0.9rem; }

/* buttons */
.btn {
  border: none;
  border-radius: 14px;
  padding: 13px 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 6px 16px -4px var(--ring);
}
.btn.primary:hover { box-shadow: 0 8px 22px -4px var(--ring); transform: translateY(-1px); }
.btn.ghost {
  background: var(--card);
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn.ghost:hover { background: var(--primary-soft); }
.btn.success { background: linear-gradient(135deg, var(--success-2), var(--success)); color: #fff; box-shadow: 0 6px 16px -6px rgba(22, 163, 74, 0.5); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 8px 15px; font-size: 0.9rem; border-radius: 11px; }
.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
  font-family: inherit;
}
.back-btn:hover { text-decoration: underline; }

/* stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  font-size: 1.35rem;
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  margin-bottom: 3px;
}
.stats-row .stat-card:nth-child(1) .stat-icon { background: var(--amber-soft); }
.stats-row .stat-card:nth-child(2) .stat-icon { background: var(--amber-soft); }
.stats-row .stat-card:nth-child(3) .stat-icon { background: var(--primary-soft); }
.stats-row .stat-card:nth-child(4) .stat-icon { background: var(--success-soft); }
.stat-num { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 0.85rem; }

/* hero cards (path + daily) */
.daily-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #2458e6, #4f46e5 62%, #6d28d9);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  margin: 18px 0;
  box-shadow: var(--shadow-lg);
}
.daily-card::after {
  content: "🎯";
  position: absolute;
  left: -14px;
  bottom: -26px;
  font-size: 7.5rem;
  opacity: 0.14;
  transform: rotate(-12deg);
  pointer-events: none;
}
.daily-card.path-card {
  background: linear-gradient(135deg, #0c7a46, #0d9155 55%, #0e7490);
}
.daily-card.path-card::after { content: "🗺️"; }
.daily-card h2 { margin: 0 0 6px; font-size: 1.25rem; }
.daily-card p { margin: 0 0 16px; opacity: 0.92; max-width: 52ch; }
.daily-card .btn.primary {
  background: #fff;
  color: #1c46c2;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.35);
}
.daily-card.path-card .btn.primary { color: #0c6a3e; }

/* quick grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.quick-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 10px 15px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.quick-btn span[aria-hidden] {
  font-size: 1.5rem;
  width: 54px; height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-soft);
}
.quick-grid .quick-btn:nth-child(1) span[aria-hidden] { background: var(--primary-soft); }
.quick-grid .quick-btn:nth-child(2) span[aria-hidden] { background: var(--amber-soft); }
.quick-grid .quick-btn:nth-child(3) span[aria-hidden] { background: var(--danger-soft); }
.quick-grid .quick-btn:nth-child(4) span[aria-hidden] { background: var(--success-soft); }
.quick-grid .quick-btn:nth-child(5) span[aria-hidden] { background: var(--primary-soft); }
.quick-grid .quick-btn:nth-child(6) span[aria-hidden] { background: var(--amber-soft); }
.quick-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.quick-btn span.mini { font-size: 0.86rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.weak-note { color: var(--muted); margin-top: 18px; text-align: center; }

/* topics */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}
.topic-card, .grammar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 10px 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.topic-card:hover, .grammar-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.topic-icon {
  font-size: 1.7rem;
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-soft);
}
.topic-name { font-weight: 700; }
.topic-count { color: var(--muted); font-size: 0.82rem; }
.topic-bar {
  width: 100%;
  height: 7px;
  background: var(--primary-soft);
  border-radius: 4px;
  overflow: hidden;
  display: block;
}
.topic-bar.wide { height: 10px; }
.topic-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--success-2), var(--success));
  border-radius: 4px;
  transition: width 0.4s ease;
}
.grammar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.level-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 12px;
  flex-wrap: wrap;
}
.level-chip {
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.level-chip.l1 { background: linear-gradient(135deg, #16a34a, #0d9155); }
.level-chip.l2 { background: linear-gradient(135deg, #2458e6, #4f46e5); }
.level-chip.l3 { background: linear-gradient(135deg, #7c3aed, #a21caf); }
.level-desc { color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.grammar-card {
  padding: 16px 14px 14px;
  border-top: 4px solid transparent;
}
.grammar-card.l1 { border-top-color: #16a34a; }
.grammar-card.l2 { border-top-color: #2458e6; }
.grammar-card.l3 { border-top-color: #7c3aed; }
.grammar-card .g-he { font-weight: 800; font-size: 1.05rem; }
.grammar-card .g-en { font-weight: 700; font-size: 0.95rem; }
.grammar-card.l1 .g-en { color: #0f7a3d; }
.grammar-card.l2 .g-en { color: var(--primary); }
.grammar-card.l3 .g-en { color: #7c3aed; }
html.dark .grammar-card.l1 .g-en { color: #4ade80; }
html.dark .grammar-card.l3 .g-en { color: #c084fc; }
.rule-intro { margin: 0 0 12px; font-weight: 600; }
.rule-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rule-point {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
}
.rp-he { font-weight: 600; }
.rp-en {
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 9px;
  padding: 4px 12px;
  text-align: left;
  letter-spacing: 0.01em;
}
.rule-en {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0 0 10px;
  text-align: right;
}
.rule-done {
  background: var(--card);
  border: 2px solid var(--success);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px 16px;
  margin: 18px 0;
  text-align: center;
}
.rule-done .big-result { margin: 4px 0; }
.subtitle.center { text-align: center; }
.topic-actions.center { justify-content: center; }
#rule-score:focus { outline: none; }

/* word list */
.topic-actions { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.word-list { list-style: none; padding: 0; margin: 12px 0; }
.word-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, transform 0.15s;
}
.word-row:hover { border-color: var(--primary); }
.word-texts { display: flex; flex-direction: column; }
.word-en { font-weight: 800; font-size: 1.1rem; color: var(--primary); text-align: left; align-self: flex-start; letter-spacing: 0.01em; }
.word-tr { color: var(--muted); font-size: 0.85rem; }
.word-he { font-size: 0.98rem; }
.speak-btn {
  background: var(--primary-soft);
  border: 1px solid transparent;
  border-radius: 50%;
  min-width: 44px;
  height: 44px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}
.speak-btn:hover { transform: scale(1.08); background: var(--primary); }
.speak-btn.big {
  min-width: 72px; height: 72px;
  font-size: 1.9rem;
  margin: 10px auto;
  display: block;
  box-shadow: 0 6px 18px -6px var(--ring);
}

/* flashcards */
.flashcard {
  position: relative;
  max-width: 400px;
  height: 210px;
  margin: 16px auto;
  cursor: pointer;
  perspective: 900px;
}
.card-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.8rem;
  font-weight: 800;
  backface-visibility: hidden;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
  padding: 14px;
  text-align: center;
}
.card-front { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.card-back { background: var(--card); color: var(--text); border: 2px solid var(--primary); transform: rotateY(180deg); }
.flashcard.flipped .card-front { transform: rotateY(180deg); }
.flashcard.flipped .card-back { transform: rotateY(0); }
.card-tr { font-size: 1rem; font-weight: 400; opacity: 0.9; }
.card-answers { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
#view-cards { text-align: center; }
#view-cards .back-btn { display: block; text-align: right; }
.big-result { font-size: 1.7rem; font-weight: 800; text-align: center; margin: 26px 0 8px; }

/* quiz */
.progress-track {
  height: 9px;
  background: var(--primary-soft);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: 5px;
  transition: width 0.35s ease;
}
.quiz-question {
  text-align: center;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 14px;
}
.quiz-instruction { color: var(--muted); margin: 2px 0; }
.quiz-prompt { font-size: 1.7rem; font-weight: 800; margin: 6px 0; letter-spacing: -0.01em; }
.quiz-prompt.en { direction: ltr; color: var(--primary); }
.quiz-answers { display: grid; gap: 10px; max-width: 480px; margin: 0 auto; }
.answer-btn {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.answer-btn.en { direction: ltr; }
.answer-btn:hover:not(:disabled) { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.answer-btn.correct { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.answer-btn.wrong { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.answer-btn.small { padding: 9px 14px; font-size: 0.95rem; }
.quiz-feedback { text-align: center; font-weight: 700; min-height: 26px; margin: 12px 0 4px; }
.quiz-feedback.good { color: var(--success); }
.quiz-feedback.bad { color: var(--danger); }
#sitquiz-next { display: block; margin: 10px auto; }
.quiz-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
}
.quiz-auto-note { text-align: center; margin: 2px 0 0; }
.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}
.link-btn:hover { color: var(--primary); }

/* end-of-quiz review */
#quiz-review { margin-bottom: 8px; }
.rev-row {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--card);
  border: 1px solid var(--border);
  border-right: 4px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.rev-row.bad { border-right-color: var(--danger); }
.rev-icon { font-size: 1.1rem; font-weight: 800; color: var(--success); }
.rev-row.bad .rev-icon { color: var(--danger); }
.rev-texts { display: flex; flex-direction: column; flex: 1; }
.rev-word { font-weight: 800; color: var(--primary); text-align: left; align-self: flex-start; }
.rev-he { font-size: 0.95rem; }
.rev-given { font-size: 0.85rem; color: var(--danger); }
.spell-form { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.spell-form input {
  padding: 12px 15px;
  font-size: 1.1rem;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  width: min(270px, 60vw);
  text-align: left;
  font-family: inherit;
}
.spell-form input:focus { border-color: var(--primary); }

/* grammar */
.rule-exp {
  background: var(--card);
  border: 1px solid var(--border);
  border-right: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 14px 0;
  box-shadow: var(--shadow-sm);
}
.drill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.drill legend {
  float: right;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 3px 12px;
  margin: 0 0 8px;
}
.drill-q { clear: both; font-size: 1.1rem; font-weight: 700; margin: 4px 0 10px; unicode-bidi: plaintext; }
.drill-opts { display: flex; gap: 8px; flex-wrap: wrap; }

/* learning path */
.path-unit {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: box-shadow 0.15s;
}
.path-unit.locked { opacity: 0.55; }
.path-unit.open {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: var(--shadow-md);
}
.path-unit.done { border-color: var(--success); }
.path-unit-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.path-unit-icon {
  font-size: 1.25rem;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  flex-shrink: 0;
}
.path-unit.done .path-unit-icon { background: var(--success-soft); }
.path-unit-name { font-weight: 800; }
.path-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.path-step {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-soft);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.path-step.open { border-color: var(--primary); background: var(--card); box-shadow: var(--shadow-sm); }
.path-step.open:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.path-step.done { border-color: transparent; background: var(--success-soft); color: var(--success); }
.path-step:disabled { cursor: not-allowed; }
#path-msg { text-align: center; min-height: 24px; }

/* progress view */
.prog-topic-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.prog-topic-name { flex: 0 0 168px; font-size: 0.92rem; font-weight: 600; }
.prog-topic-row .topic-bar { flex: 1; }
.prog-topic-pct { flex: 0 0 44px; color: var(--muted); font-size: 0.88rem; text-align: left; }

/* bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
  box-shadow: 0 -6px 24px -12px rgba(16, 26, 51, 0.25);
}
.nav-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 13px;
  border-radius: 12px;
  font-family: inherit;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.nav-btn span[aria-hidden] { font-size: 1.3rem; transition: transform 0.15s; }
.nav-btn:hover span[aria-hidden] { transform: translateY(-2px); }
.nav-btn[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }

/* back to top */
.to-top {
  position: fixed;
  bottom: 96px;
  left: 16px;
  z-index: 19;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-2px); }

/* consent banner */
.consent-banner {
  position: fixed;
  bottom: 92px;
  right: 12px;
  left: 12px;
  max-width: 620px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.consent-banner p { margin: 0; font-size: 0.92rem; flex: 1 1 260px; }
.consent-banner a { color: var(--primary); font-weight: 600; }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* footer */
.app-footer {
  max-width: 780px;
  margin: 0 auto;
  padding: 10px 16px 26px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.app-footer a { color: var(--primary); font-weight: 600; }
.footnote { font-size: 0.8rem; }

@media (max-width: 480px) {
  h1 { font-size: 1.4rem; }
  #view-home h1 { font-size: 1.55rem; }
  .quiz-prompt { font-size: 1.4rem; }
  .prog-topic-name { flex-basis: 130px; }
  .daily-card { padding: 18px 16px 16px; }
  .nav-btn { padding: 5px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
