:root {
  --ink: #1b2b25;
  --muted: #65766d;
  --green: #187b55;
  --green-dark: #115b40;
  --green-soft: #e6f5ed;
  --line: #e1eae4;
  --paper: #ffffff;
  --bg: #f5fbf7;
  --gold: #f4b942;
  --red: #c84f4f;
  --font-scale: 1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: calc(17px * var(--font-scale));
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #76bda0; outline-offset: 3px; }
.app-shell { min-height: 100vh; padding-bottom: 92px; }
.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; color: var(--muted); gap: 14px; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: var(--green); color: white; font-size: 29px; font-weight: 900; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(245,251,247,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1140px; margin: 0 auto; min-height: 76px; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; border: 0; padding: 0; background: none; text-align: left; color: inherit; }
.brand .brand-mark { width: 43px; height: 43px; border-radius: 15px; font-size: 23px; }
.brand-name { display: block; font-size: 1.1rem; font-weight: 850; letter-spacing: -.04em; line-height: 1.08; }
.brand-tag { display: block; margin-top: 3px; color: var(--muted); font-size: .69rem; font-weight: 650; letter-spacing: .02em; }
.header-stats { display: flex; align-items: center; gap: 10px; }
.stat-pill { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; background: white; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.stat-pill .stat-icon { font-size: 1.05rem; }
.main-wrap { max-width: 1140px; margin: 0 auto; padding: 30px 24px 60px; }
.main-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .85fr); gap: 22px; align-items: start; }
.stack { display: grid; gap: 20px; }
.hero { min-height: 260px; position: relative; overflow: hidden; border-radius: 28px; padding: 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: white; background: linear-gradient(120deg, #155f43, #21845b 68%, #3a9a6f); box-shadow: 0 16px 35px rgba(20,91,62,.13); }
.hero::after { content: ""; position: absolute; width: 280px; height: 280px; right: -72px; top: -100px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 32px rgba(255,255,255,.045), 0 0 0 64px rgba(255,255,255,.035); }
.hero-copy { position: relative; z-index: 1; max-width: 590px; }
.eyebrow { margin: 0 0 9px; font-size: .73rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 850; opacity: .78; }
.hero h1 { max-width: 560px; margin: 0; font-size: clamp(2rem, 4vw, 3.05rem); line-height: 1.03; letter-spacing: -.055em; }
.hero p { max-width: 510px; margin: 14px 0 21px; color: rgba(255,255,255,.86); font-size: .98rem; line-height: 1.55; }
.hero-art { position: relative; z-index: 1; flex: 0 0 142px; width: 142px; height: 142px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 39px; background: rgba(255,255,255,.13); font-size: 4rem; transform: rotate(4deg); }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 49px; padding: 0 20px; border: 0; border-radius: 15px; background: var(--green); color: white; font-size: .91rem; font-weight: 850; box-shadow: 0 5px 0 var(--green-dark); transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:hover { background: #209264; transform: translateY(-1px); box-shadow: 0 6px 0 var(--green-dark); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--green-dark); }
.btn-white { background: white; color: var(--green-dark); box-shadow: 0 5px 0 rgba(8,55,36,.27); }
.btn-white:hover { background: #f1fff6; }
.btn-outline { background: white; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 3px 0 #dce5de; }
.btn-outline:hover { background: #f9fcfa; }
.btn-soft { color: var(--green-dark); background: var(--green-soft); box-shadow: 0 3px 0 #c9e7d6; }
.btn-soft:hover { background: #d8f0e3; }
.btn-small { min-height: 39px; padding: 0 13px; border-radius: 12px; font-size: .82rem; }
.btn-full { width: 100%; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 23px; padding: 23px; box-shadow: 0 7px 22px rgba(30,65,48,.035); }
.panel h2, .panel h3 { margin: 0; letter-spacing: -.035em; }
.panel h2 { font-size: 1.25rem; }
.panel h3 { font-size: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.progress-track { height: 11px; overflow: hidden; border-radius: 99px; background: #e9f0eb; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #20845b, #6fc391); transition: width .25s ease; }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { padding: 15px; border-radius: 17px; background: #f7fbf8; border: 1px solid #edf3ee; }
.stat-card strong { display: block; margin-top: 5px; font-size: 1.35rem; letter-spacing: -.04em; }
.stat-card span { color: var(--muted); font-size: .74rem; font-weight: 700; }
.daily-row { display: flex; align-items: center; gap: 14px; }
.goal-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 16px; background: #fff5df; font-size: 1.55rem; }
.goal-content { flex: 1; min-width: 0; }
.goal-content strong { display: block; }
.goal-content p { margin: 3px 0 0; }
.unit-list { display: grid; gap: 15px; }
.unit-card { padding: 18px; border-radius: 21px; background: white; border: 1px solid var(--line); }
.unit-head { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.unit-icon { width: 45px; height: 45px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; font-size: 1.5rem; }
.unit-icon.mint { background: #e2f5e9; }
.unit-icon.peach { background: #fff0e6; }
.unit-icon.lavender { background: #f0edff; }
.unit-title { min-width: 0; flex: 1; }
.unit-title h3 { margin: 0; font-size: 1rem; letter-spacing: -.025em; }
.unit-title p { margin: 3px 0 0; color: var(--muted); font-size: .77rem; }
.unit-percent { color: var(--green); font-size: .82rem; font-weight: 850; }
.lesson-list { display: grid; gap: 8px; }
.lesson-row { width: 100%; min-height: 61px; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid #edf2ee; border-radius: 15px; background: #fbfdfb; padding: 9px 12px; color: var(--ink); }
.lesson-row:not(:disabled):hover { border-color: #b6ddc6; background: #f4fbf6; }
.lesson-row:disabled { cursor: not-allowed; opacity: .53; }
.lesson-dot { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: var(--green); background: #e5f5eb; font-weight: 900; }
.lesson-dot.complete { color: white; background: var(--green); }
.lesson-dot.locked { color: #819087; background: #edf1ee; }
.lesson-meta { flex: 1; min-width: 0; }
.lesson-meta strong { display: block; font-size: .88rem; }
.lesson-meta span { display: block; margin-top: 2px; color: var(--muted); font-size: .71rem; }
.row-trailing { color: var(--muted); font-size: .75rem; font-weight: 750; }
.section-title { margin: 0 0 7px; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.05em; }
.section-subtitle { max-width: 660px; margin: 0; color: var(--muted); line-height: 1.55; }
.page-heading { margin-bottom: 23px; }
.side-note { padding: 19px; border: 1px solid #dcefe3; border-radius: 20px; background: #eef9f2; }
.side-note strong { display: block; }
.side-note p { margin: 7px 0 0; color: #476456; font-size: .83rem; line-height: 1.55; }
.navbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.navbar-inner { max-width: 760px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 0 auto; }
.nav-item { display: grid; justify-items: center; gap: 4px; padding: 6px 3px; border: 0; border-radius: 12px; background: transparent; color: #829087; font-size: .68rem; font-weight: 800; }
.nav-item .nav-icon { font-size: 1.22rem; line-height: 1; }
.nav-item.active { color: var(--green); background: #edf8f1; }
.lesson-screen { max-width: 760px; margin: 0 auto; }
.lesson-top { display: flex; align-items: center; gap: 13px; margin-bottom: 32px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); font-size: 1.18rem; }
.lesson-progress { flex: 1; }
.lesson-progress .progress-track { height: 12px; }
.lesson-count { color: var(--muted); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.question-card { padding: clamp(22px, 4vw, 36px); border: 1px solid var(--line); border-radius: 25px; background: white; box-shadow: 0 12px 35px rgba(28,70,47,.05); }
.question-label { margin: 0 0 11px; color: var(--green); font-size: .73rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.question-title { margin: 0; font-size: clamp(1.55rem, 4vw, 2.3rem); line-height: 1.15; letter-spacing: -.05em; }
.question-sub { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.prompt-box { margin: 25px 0 21px; padding: 20px; border: 1px solid #e3eee7; border-radius: 18px; background: #f7fbf8; }
.prompt-main { margin: 0; font-size: clamp(1.3rem, 3.5vw, 1.85rem); line-height: 1.25; font-weight: 850; letter-spacing: -.03em; }
.prompt-translation { margin: 9px 0 0; color: var(--muted); font-size: .91rem; line-height: 1.45; }
.sound-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; min-height: 41px; padding: 0 13px; border: 1px solid #cce7d7; border-radius: 12px; background: #eff9f3; color: var(--green-dark); font-size: .82rem; font-weight: 850; }
.sound-btn:hover { background: #e3f4e9; }
.answer-list { display: grid; gap: 10px; }
.answer-option { width: 100%; min-height: 60px; padding: 13px 16px; display: flex; align-items: center; gap: 13px; border: 2px solid #e5ede7; border-radius: 16px; background: white; color: var(--ink); text-align: left; font-weight: 750; }
.answer-option:hover:not(:disabled) { border-color: #9dcfb0; background: #f8fcf9; }
.answer-letter { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: #eef3ef; color: #64746a; font-size: .76rem; font-weight: 900; }
.answer-option.correct { border-color: #39a76e; background: #edfaf2; }
.answer-option.correct .answer-letter { color: white; background: #23945d; }
.answer-option.incorrect { border-color: #d86a6a; background: #fff4f2; }
.answer-option:disabled { cursor: default; }
.type-form { display: flex; gap: 10px; flex-wrap: wrap; }
.type-input { flex: 1 1 250px; min-width: 0; min-height: 55px; padding: 0 16px; border: 2px solid #dfe9e2; border-radius: 15px; background: white; color: var(--ink); font-size: 1rem; }
.type-input::placeholder { color: #99a69d; }
.feedback { display: flex; align-items: flex-start; gap: 12px; margin-top: 20px; padding: 16px; border-radius: 16px; }
.feedback.good { background: #eaf8ef; color: #155f3e; }
.feedback.bad { background: #fff1ef; color: #8f3939; }
.feedback-icon { font-size: 1.2rem; }
.feedback strong { display: block; font-size: .95rem; }
.feedback p { margin: 4px 0 0; font-size: .84rem; line-height: 1.45; }
.lesson-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.tip-card { margin-top: 15px; padding: 16px 18px; border-left: 4px solid #f1bd54; border-radius: 11px; background: #fff9e9; color: #68562d; font-size: .84rem; line-height: 1.5; }
.speaking-box { padding: 22px; border: 1px solid #e3eee7; border-radius: 18px; background: #f7fbf8; text-align: center; }
.speaking-text { margin: 3px 0 8px; font-size: clamp(1.45rem, 4vw, 2rem); font-weight: 850; letter-spacing: -.04em; }
.pronunciation { margin: 0 0 16px; color: var(--muted); font-size: .85rem; }
.speaking-controls { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.transcript { min-height: 25px; margin: 14px 0 0; color: var(--muted); font-size: .82rem; }
.complete-card { padding: 36px 28px; border: 1px solid var(--line); border-radius: 27px; background: white; text-align: center; box-shadow: 0 12px 35px rgba(28,70,47,.05); }
.complete-emoji { width: 90px; height: 90px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 30px; background: #eaf7ef; font-size: 3.2rem; }
.complete-card h1 { margin: 0; font-size: 2.1rem; letter-spacing: -.05em; }
.complete-card p { max-width: 460px; margin: 11px auto 22px; color: var(--muted); line-height: 1.55; }
.complete-rewards { display: flex; justify-content: center; gap: 11px; flex-wrap: wrap; margin: 20px 0 25px; }
.reward-pill { padding: 11px 15px; border: 1px solid var(--line); border-radius: 14px; background: #f9fcfa; font-weight: 850; }
.review-list { display: grid; gap: 10px; }
.review-item { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.review-word { min-width: 0; flex: 1; }
.review-word strong { display: block; }
.review-word span { display: block; color: var(--muted); font-size: .82rem; margin-top: 3px; }
.empty-state { padding: 34px 18px; text-align: center; border: 1px dashed #cbdacf; border-radius: 20px; background: #fbfefc; }
.empty-state .empty-icon { font-size: 2.4rem; }
.empty-state h3 { margin: 9px 0 6px; }
.empty-state p { max-width: 430px; margin: 0 auto 16px; color: var(--muted); line-height: 1.5; font-size: .88rem; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid #edf2ee; }
.settings-row:last-child { border-bottom: 0; }
.font-controls { display: flex; gap: 8px; }
.font-controls button { width: 40px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: white; font-weight: 850; }
.hidden { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 104px; z-index: 60; transform: translateX(-50%); max-width: calc(100vw - 30px); padding: 12px 17px; border-radius: 13px; background: #20372b; color: white; font-size: .85rem; font-weight: 750; box-shadow: 0 10px 30px rgba(0,0,0,.17); }
.confetti { display: inline-block; animation: pop .55s ease both; }
@keyframes pop { 0% { transform: scale(.6) rotate(-12deg); } 65% { transform: scale(1.15) rotate(5deg); } 100% { transform: scale(1) rotate(0); } }
@media (max-width: 800px) {
  .main-grid { grid-template-columns: 1fr; }
  .hero { min-height: 235px; }
  .hero-art { flex-basis: 105px; width: 105px; height: 105px; border-radius: 30px; font-size: 3rem; }
  .side-column { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  :root { font-size: calc(16px * var(--font-scale)); }
  .app-shell { padding-bottom: 82px; }
  .topbar-inner { min-height: 65px; padding: 9px 14px; gap: 8px; }
  .brand .brand-mark { width: 39px; height: 39px; border-radius: 13px; }
  .brand-name { font-size: .97rem; }
  .brand-tag { font-size: .62rem; }
  .header-stats { gap: 6px; }
  .stat-pill { min-height: 36px; gap: 5px; padding: 0 9px; font-size: .75rem; }
  .main-wrap { padding: 20px 14px 36px; }
  .hero { min-height: 0; padding: 25px 21px; border-radius: 23px; }
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: .9rem; margin: 11px 0 17px; }
  .hero-art { flex: 0 0 68px; width: 68px; height: 68px; border-radius: 22px; font-size: 2.15rem; }
  .panel { padding: 18px; border-radius: 19px; }
  .stat-cards { gap: 7px; }
  .stat-card { padding: 11px; }
  .stat-card strong { font-size: 1.1rem; }
  .unit-card { padding: 14px; }
  .unit-head { gap: 10px; }
  .unit-icon { width: 40px; height: 40px; }
  .lesson-row { min-height: 58px; padding: 8px 9px; }
  .lesson-meta strong { font-size: .82rem; }
  .row-trailing { font-size: .67rem; }
  .navbar { padding-left: 9px; padding-right: 9px; }
  .lesson-top { margin-bottom: 22px; }
  .question-card { padding: 20px 16px; border-radius: 21px; }
  .prompt-box { padding: 17px; }
  .answer-option { min-height: 57px; padding: 11px 12px; }
  .lesson-actions .btn { width: 100%; }
  .complete-card { padding: 29px 18px; }
  .side-column { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
