:root {
  color-scheme: light;
  --canvas: #f7f6f0;
  --surface: #fffefa;
  --ink: #1b3229;
  --muted: #52645a;
  --green: #1a4938;
  --green-dark: #113b2d;
  --line: #e3e5d9;
  --mint: #e2eee2;
  --peach: #fae8d9;
  --lavender: #eeebf7;
  --yellow: #f7efd3;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #b65722; outline-offset: 4px; }
main:focus { outline: none; }
svg { width: 20px; height: 20px; vertical-align: middle; flex: 0 0 auto; }
h1, h2, p { margin: 0; }
p { color: var(--muted); }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar, main, footer { width: min(1120px, calc(100% - 72px)); margin-inline: auto; }
.bar { min-height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; justify-self: start; font: bold 32px/1 var(--serif); letter-spacing: -.055em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; margin-right: 9px; padding-bottom: 5px; border-radius: 10px; background: var(--green); color: #f3f2db; font-size: 25px; }
.dot { color: #c96735; }
nav { display: flex; gap: 7px; }
nav a { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 650; white-space: nowrap; }
nav a:hover { color: var(--green-dark); background: var(--canvas); }
nav a[aria-current="page"] { background: #e8f0e5; color: var(--green-dark); }
.install { justify-self: end; }

.primary, .secondary { border: 1px solid transparent; display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 44px; padding: 10px 17px; border-radius: 9px; line-height: 1.25; font-size: 14px; font-weight: 700; }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.primary:disabled { background: #e0e7db; color: #4f6155; }
.secondary { background: var(--surface); border-color: #d8dfd3; color: var(--green-dark); }
.secondary:hover { background: #edf3ea; }
.text-link { display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--green); font-size: 14px; font-weight: 750; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-link svg { width: 17px; height: 17px; }
main { flex: 1; padding-block: 50px 58px; }
.intro { margin-bottom: 28px; }
.eyebrow, .hero-label, .number, .speaker { display: block; color: var(--green); font-size: 11px; letter-spacing: .14em; font-weight: 800; }
h1 { margin: 7px 0 7px; font: 700 clamp(2.45rem, 5vw, 4rem)/1.04 var(--serif); letter-spacing: -.058em; text-wrap: balance; }
.intro p { margin-top: 10px; }
.intro p:empty { display: none; }

.overview { display: grid; grid-template-columns: 2.2fr 1fr; gap: 20px; }
.hero { display: grid; grid-template-columns: .92fr 1fr; min-height: 276px; overflow: hidden; border-radius: 20px; background: #dcebdc; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; align-items: start; padding: 26px 12px 30px 32px; }
.hero-label { color: #2d624d; line-height: 1.35; }
.hero h2 { margin-top: 8px; font: bold clamp(1.85rem, 3.6vw, 3.1rem)/1.05 var(--serif); letter-spacing: -.065em; }
.hero p { margin-top: 8px; }
.hero .primary { margin-top: 22px; }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; mask-image: linear-gradient(to right, transparent, #000 16%); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 23px; }
.panel-heading { display: flex; align-items: center; gap: 11px; }
.panel-heading h2 { font-size: 16px; letter-spacing: -.02em; }
.tile { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; color: var(--green); border-radius: 12px; }
.tile svg { width: 23px; height: 23px; }
.mint { background: var(--mint); }
.lavender { background: var(--lavender); color: #4f456b; }
.peach { background: var(--peach); color: #985129; }
.yellow { background: var(--yellow); color: #745e2c; }
.stat { color: var(--ink); margin: 13px 0 1px; font-size: 23px; letter-spacing: -.05em; font-weight: 750; }
.progress-card > p:not(.stat), .course-progress > p:not(.stat) { font-size: 14px; }
.week { display: flex; justify-content: space-between; gap: 2px; margin: 16px 0; max-width: 320px; }
.week-day { display: grid; justify-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 650; }
.day { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #f0f1e9; }
.day.today { border: 1px solid #a9b7a7; }
.day.done { background: #d9ead9; color: var(--green); }
.day svg { width: 15px; height: 15px; }

.path { margin-top: 38px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.section-heading h2 { font: bold clamp(1.75rem, 3vw, 2.3rem)/1.12 var(--serif); letter-spacing: -.045em; }
.section-heading p, .progress-label { font-size: 13px; margin-top: 4px; }
.progress-label { color: var(--green); font-weight: 700; white-space: nowrap; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lesson-card { display: flex; min-width: 0; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.lesson-card:hover { border-color: #94ad99; background: #fcfdf8; }
.lesson-caption { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.lesson-caption strong { font-size: 16px; line-height: 1.4; }
.lesson-caption > span:last-child { color: var(--muted); font-size: 12px; }
.number { font-size: 10px; }
.lesson-arrow { color: var(--green); }
.lesson-arrow svg { width: 16px; height: 16px; }

.progress-page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.course-progress progress { margin-block: 15px 8px; }
.course-progress .text-link { margin-top: 18px; }
progress { appearance: none; display: block; border: 0; border-radius: 99px; background: #e6ece1; width: 100%; height: 9px; overflow: hidden; }
progress::-webkit-progress-bar { background: #e6ece1; }
progress::-webkit-progress-value { background: #47825d; border-radius: 99px; }
progress::-moz-progress-bar { background: #47825d; border-radius: 99px; }
.practice-panel { max-width: 610px; padding: 30px; }
.practice-panel h2 { margin-top: 13px; font-size: 22px; }
.practice-panel .primary, .practice-panel .button-row { margin-top: 18px; }
.practice-panel .button-row .primary { margin-top: 0; }
.flashcard { text-align: center; }
.flashcard h2 { margin-top: 0; }
.flashcard .button-row { justify-content: center; }
.spanish-answer { margin-block: 8px 16px; font: bold 2rem var(--serif); color: var(--green); }

.lesson-view { max-width: 740px; }
.back { margin-bottom: 22px; }
.lesson-progress { display: grid; grid-template-columns: max-content 1fr max-content; align-items: center; gap: 13px; margin-bottom: 30px; color: var(--muted); font-size: 13px; font-weight: 700; }
.lesson-view h1 { font-size: clamp(2.25rem, 5.4vw, 3.5rem); }
.dialogue, .exercise { padding: 26px; }
.lines { display: grid; gap: 10px; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
.line p[lang="es"] { font-size: 18px; color: var(--ink); font-weight: 700; }
.line .audio span { display: none; }
.line .audio { width: 44px; padding-inline: 8px; }
.note { background: var(--mint); margin-block: 20px; padding: 15px; border-radius: 10px; }
.note p { margin-top: 3px; color: #304b3c; }
.button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.exercise .button-row { margin-block: 14px; }
.choices { display: grid; gap: 9px; margin-block: 16px; }
.choice { background: var(--surface); border: 1px solid #cbd8cc; text-align: left; min-height: 45px; border-radius: 9px; color: var(--ink); padding: 9px 13px; }
.choice:not(:disabled):hover, .choice[aria-pressed="true"] { background: var(--mint); border-color: #679775; }
.choice:disabled:not([aria-pressed="true"]) { opacity: .78; }
.blank-sentence { color: var(--ink); font-size: 1.2rem; line-height: 1.9; margin-bottom: 12px; }
.blank-sentence input { width: 13ch; max-width: 100%; min-height: 44px; padding: 4px 10px; border: 1px solid #aebfaf; border-bottom: 2px solid var(--green); border-radius: 7px; color: var(--green-dark); background: var(--mint); font: inherit; }
.blank-sentence input[readonly] { background: var(--surface); }
.production-prompt { font-size: 1.13rem; font-weight: 650; color: var(--ink); margin-bottom: 16px; }
.exercise label { display: block; margin-bottom: 5px; font-weight: 650; }
#draft { display: block; width: 100%; margin-bottom: 13px; border: 1px solid #aebfaf; border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; padding: 10px; resize: vertical; }
.model strong:not(:first-child) { display: block; margin-top: 14px; }
.model .audio { margin-top: 10px; }
.transcript { margin: 12px 0; }
.transcript summary { cursor: pointer; color: var(--green); font-weight: 700; }
.transcript p, #voice-feedback p:last-child { margin: 6px 0 12px; }
.choice.answer-correct { opacity: 1; background: var(--mint); border-color: #679775; }
.level-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 19px; }
.level-filters .secondary { min-width: 52px; }
.level-filters .secondary[aria-pressed="true"] { background: var(--green); color: white; border-color: var(--green); }
.level-section + .level-section { margin-top: 23px; }
.level-section h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 9px; font-size: 15px; }
.level-section h3 span { color: var(--green-dark); background: var(--mint); padding: 3px 7px; border-radius: 6px; font-size: 12px; }
.course-progress .level-progress-label { margin-top: 12px; font-weight: 700; }
.course-progress .level-progress-label + progress { margin-top: 4px; }
.feedback { margin-bottom: 9px; padding: 8px 10px; border-radius: 8px; }
.correct { color: var(--green-dark); background: var(--mint); }
.retry { color: #6a381f; background: var(--peach); }

footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 69px; padding-block: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer > div { display: flex; align-items: center; gap: 10px; }
.foot-brand { font: bold 19px var(--serif); letter-spacing: -.06em; color: var(--ink); }
.connection-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #61946c; margin-right: 6px; }
dialog { width: min(420px, calc(100% - 32px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
dialog::backdrop { background: #152f2777; }
dialog p, dialog form { margin-top: 14px; }

@media (max-width: 900px) {
  .overview { grid-template-columns: 1.65fr 1fr; gap: 14px; }
  .progress-page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .bar, main, footer { width: calc(100% - 32px); }
  .bar { grid-template-columns: 1fr auto; padding-top: 12px; gap: 7px; }
  nav { grid-area: 2 / 1 / 3 / 3; justify-content: space-between; padding-bottom: 8px; }
  nav a { justify-content: center; flex: 1; padding: 0 5px; }
  main { padding-block: 32px 38px; }
  .overview, .progress-page { grid-template-columns: 1fr; }
  .hero { min-height: 225px; }
  .hero-copy { padding: 20px 0 22px 18px; }
  .path { margin-top: 26px; }
  .lesson-grid { grid-template-columns: 1fr; gap: 8px; }
  .lesson-card { padding: 12px; }
  .dialogue, .exercise { padding: 15px; }
}
@media (max-width: 410px) {
  footer .foot-brand + span { display: none; }
  .panel { padding: 15px; }
}
@media (max-width: 680px) {
  .hero { grid-template-columns: 1.15fr 1fr; }
  .hero img { align-self: center; height: auto; mask-image: radial-gradient(ellipse at center, #000 64%, transparent 98%); }
  .lesson-progress { grid-template-columns: minmax(0, 1.6fr) minmax(48px, 1fr) max-content; gap: 8px; }
  .hero .primary { white-space: nowrap; }
}
