:root {
  --ink: #172b2a;
  --muted: #687775;
  --paper: #f6f3ed;
  --white: #fffefa;
  --green: #176c5c;
  --mint: #dceee5;
  --line: #e7e4dc;
  --shadow: 0 12px 35px #2038320d;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

button { font: inherit; cursor: pointer; }

.app { max-width: 1160px; margin: 0 auto; padding: 26px 30px 50px; }
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 22px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: var(--green); color: white; font-size: 27px; font-weight: 700; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: -0.03em; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.streak { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: #60502b; font-size: 13px; }

.layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding-top: 34px; }
.sidebar { display: flex; flex-direction: column; gap: 6px; }
.nav-group { display: flex; flex-direction: column; gap: 6px; }
.nav-label { margin: 14px 12px 5px; color: #98a09a; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }
.nav { display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 12px; background: transparent; color: #61716d; text-align: left; font-size: 14px; }
.nav span { width: 22px; text-align: center; font-size: 18px; }
.nav:hover, .nav.active { background: var(--mint); color: #145c4d; font-weight: 650; }
.side-note { margin-top: auto; padding: 16px; border-radius: 16px; background: #f0eadc; color: #68624f; font-size: 12px; line-height: 1.55; }
.side-note strong { display: block; margin-bottom: 4px; color: #473f2e; font-size: 13px; }

main { min-width: 0; }
.welcome { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.eyebrow { margin: 2px 0 10px; color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.welcome h2 { margin: 0; font-family: Georgia, serif; font-size: 36px; line-height: 1.1; letter-spacing: -0.04em; }
.welcome p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.date-pill { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--muted); font-size: 12px; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 25px; }
.stat { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.stat-label { color: var(--muted); font-size: 11px; }
.stat-value { margin-top: 6px; font-family: Georgia, serif; font-size: 27px; }
.stat-value small { color: #89938d; font: 13px system-ui, sans-serif; }
.stat-foot { margin-top: 3px; color: #89938d; font-size: 11px; }

.continue { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 22px 24px; border-radius: 19px; background: var(--green); color: white; box-shadow: var(--shadow); }
.continue .eyebrow { margin: 0 0 7px; color: #a7ddc6; }
.continue h3 { margin: 0; font-size: 20px; }
.continue p { margin: 6px 0 0; color: #d5e9df; font-size: 12px; }
.continue button { padding: 12px 17px; border: 0; border-radius: 12px; background: #f4dfad; color: #44381c; font-weight: 700; }
.progress-track { max-width: 400px; height: 5px; margin-top: 16px; overflow: hidden; border-radius: 8px; background: #ffffff3b; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: 8px; background: #efca71; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 25px 0 12px; }
.section-head h3 { margin: 0; font-size: 15px; }
.section-head button { border: 0; background: none; color: var(--green); font-size: 12px; font-weight: 650; }

.letters { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; }
.letter { min-height: 88px; padding: 9px 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); text-align: center; transition: 0.15s; }
.letter:hover { transform: translateY(-2px); border-color: #9bc8b4; box-shadow: var(--shadow); }
.letter .he { direction: rtl; font-family: Arial, sans-serif; font-size: 30px; line-height: 1.05; }
.letter .trans { margin-top: 5px; font-size: 11px; font-weight: 650; }
.letter .name { margin-top: 2px; color: #929b95; font-size: 9px; }

.view { display: none; }
.view.active { display: block; }
.alphabet-title { display: flex; align-items: end; justify-content: space-between; margin: 5px 0 16px; }
.alphabet-title h2 { margin: 0; font: 34px Georgia, serif; letter-spacing: -0.04em; }
.alphabet-title p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.filter { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); }
.practice-card { max-width: 620px; margin: 26px auto; padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: var(--white); text-align: center; box-shadow: var(--shadow); }
.practice-modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.mode { padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); color: var(--muted); }
.mode:hover, .mode.active { border-color: var(--green); background: var(--mint); color: var(--green); font-weight: 650; }
.practice-kind { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.prompt { direction: rtl; margin: 20px; font: 76px/1.1 Arial, sans-serif; }
.answer-area { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.answer-area[hidden] { display: none; }
.answer { min-width: 95px; padding: 12px 17px; border: 1px solid var(--line); border-radius: 11px; background: white; font-weight: 600; }
.answer:hover { border-color: var(--green); color: var(--green); }
.answer.correct { border-color: #8fc5a0; background: #e4f4e9; color: #205c35; }
.answer.wrong { border-color: #e0aaa0; background: #fff0ed; color: #983d32; }
.text-answer { display: flex; justify-content: center; gap: 9px; margin-top: 20px; }
.text-answer input { width: min(100%, 280px); min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); font: inherit; }
.text-answer input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.text-answer[hidden] { display: none; }
.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; }
.feedback { min-height: 25px; margin-top: 15px; color: var(--muted); font-size: 13px; }
.next { padding: 12px 22px; border: 0; border-radius: 11px; background: var(--green); color: white; font-weight: 650; }
.empty { padding: 35px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); color: var(--muted); text-align: center; }
.path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.path-card { position: relative; min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); transition: 0.2s; }
.path-card.active { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green), var(--shadow); }
.path-card.complete { background: var(--mint); }
.path-number { float: right; color: #a3aaa5; font: 24px Georgia, serif; }
.path-status { color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.path-card h3 { margin: 11px 0 5px; font-size: 17px; }
.path-card p { min-height: 38px; margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.path-progress { height: 4px; margin: 16px 0 12px; overflow: hidden; background: var(--line); }
.path-progress i { display: block; width: 0; height: 100%; background: var(--green); transition: width 0.3s ease; }
.path-link { padding: 0; border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 700; text-align: left; }
.path-link:hover { text-decoration: underline; }
.step-kicker { display: flex; justify-content: space-between; margin: 0 0 18px; color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: 0.12em; }
.step-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.step-footer p { max-width: 540px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.practice-count { margin-bottom: 16px; color: var(--green); font-size: 11px; font-weight: 700; }
.practice-completion { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); text-align: left; }
.practice-completion[hidden] { display: none; }
.practice-completion strong { color: var(--green); font-size: 15px; }
.practice-completion p { margin: 6px 0 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.lesson-note { margin: 16px 0 18px; padding: 17px 19px; border-left: 4px solid var(--green); background: var(--mint); color: var(--ink); font-size: 13px; line-height: 1.65; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lesson-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.lesson-card h3 { margin: 8px 0 5px; font-size: 15px; }
.lesson-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.lesson-hebrew { direction: rtl; color: var(--ink); font: 42px/1.2 Arial, sans-serif; text-align: center; }
.vowel-sound { margin-top: 5px; color: var(--green); font-family: Georgia, serif; font-size: 22px; font-weight: 700; text-align: center; }
.sound-pair { display: grid; gap: 7px; margin-top: 12px; padding: 11px; background: var(--paper); font-size: 12px; }
.genesis { margin-top: 38px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.genesis h3 { margin: 5px 0 12px; font: 24px Georgia, serif; }
.genesis p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.genesis .genesis-hebrew { color: var(--ink); font: 30px/1.9 Arial, sans-serif; }
.genesis .genesis-transliteration { color: var(--green); font-style: italic; }
.answer-area[hidden] { display: none; }

@media (max-width: 780px) {
  .app { padding: 18px 16px 35px; }
  .layout { grid-template-columns: 1fr; gap: 22px; padding-top: 20px; }
  .sidebar { flex-direction: row; overflow: auto; }
  .nav-label, .side-note { display: none; }
  .nav { padding: 10px; white-space: nowrap; }
  .welcome h2 { font-size: 30px; }
  .letters { grid-template-columns: repeat(5, 1fr); }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path-grid { grid-template-columns: 1fr; }
  .path-card { padding: 15px; }
  .path-card p { min-height: 0; }
}

@media (max-width: 460px) {
  .date-pill { display: none; }
  .stats { gap: 7px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 22px; }
  .letters { grid-template-columns: repeat(4, 1fr); }
  .continue { padding: 18px; }
  .continue button { padding: 11px; }
  .welcome h2 { font-size: 28px; }
  .lesson-grid { grid-template-columns: 1fr; }
  .genesis { padding: 18px; }
  .genesis .genesis-hebrew { font-size: 25px; }
  .step-footer { align-items: stretch; flex-direction: column; }
  .step-footer .next { width: 100%; }
}
