:root {
  color-scheme: light;
  --bg: #f6f8f5;
  --surface: #ffffff;
  --ink: #1d3430;
  --muted: #7a8982;
  --line: #e4eae4;
  --green: #1d6651;
  --green-dark: #154c3d;
  --mint: #e7f2e8;
  --mint-ink: #376449;
  --peach: #f6e9dc;
  --peach-ink: #925c36;
  --error: #b44842;
  --error-bg: #fff0ec;
  --shadow: 0 12px 40px #294a3710;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, a, input { touch-action: manipulation; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #8bbda4; outline-offset: 4px; }
button:disabled { cursor: default; opacity: .55; }
button { border: 0; }
button, input, .word-row { transition: background .16s, transform .16s, border-color .16s; }
button:active:not(:disabled) { transform: scale(.98); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(29px, 8vw, 38px); line-height: 1.14; letter-spacing: -1.3px; font-weight: 750; }
h2 { font-size: 21px; letter-spacing: -.5px; }
h3 { font-size: 17px; letter-spacing: -.3px; }
p { line-height: 1.55; }
.app-shell { max-width: 620px; margin: auto; padding: calc(23px + env(safe-area-inset-top, 0px)) 24px calc(105px + env(safe-area-inset-bottom, 0px)); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 38px; }
.brand { display: inline-flex; gap: 9px; align-items: center; font-size: 25px; font-weight: 800; letter-spacing: -.9px; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 32px; color: var(--green); }
.brand-mark svg { width: 30px; height: 30px; }
.language-tag { display: flex; gap: 7px; align-items: center; font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 30px; padding: 8px 12px; }
.eyebrow { color: var(--muted); font-weight: 650; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.page-heading { margin: 0 0 23px; }
.page-heading .eyebrow { margin-bottom: 9px; }
.page-heading .subtext { margin-top: 11px; max-width: 380px; }
.subtext { color: var(--muted); font-size: 14px; line-height: 1.55; }
.hero { border-radius: 26px; overflow: hidden; padding: 25px; background: var(--mint); position: relative; margin-bottom: 17px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.hero .eyebrow { color: var(--mint-ink); }
.hero-count { margin: 13px 0 5px; font-size: 52px; letter-spacing: -2.8px; line-height: 1; font-weight: 740; }
.hero-copy { color: var(--mint-ink); font-size: 14px; }
.hero-illustration { position: relative; width: 120px; height: 122px; flex: 0 0 120px; margin-top: 6px; }
.floating-card { position: absolute; display: grid; align-content: center; gap: 8px; border-radius: 15px; width: 79px; height: 102px; background: #fafdf8; box-shadow: 0 7px 15px #294a3710; border: 1px solid #ffffffa6; }
.floating-card.back { transform: rotate(-17deg); left: 1px; top: 9px; background: #accdaf; }
.floating-card.front { transform: rotate(11deg); top: 1px; right: 6px; color: #386b4a; }
.floating-card .card-letter { font-family: Georgia, serif; text-align: center; font-size: 42px; line-height: 1; }
.card-lines { margin: auto; width: 34px; height: 4px; border-radius: 6px; background: #bcd7bf; box-shadow: 0 8px #e3ece0; }
.spark { position: absolute; right: -1px; top: -14px; color: #639575; font-size: 28px; }
.hero-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 23px; gap: 10px; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 53px; padding: 14px 19px; background: var(--green); color: white; border-radius: 15px; font-size: 15px; font-weight: 650; }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.primary.full, .secondary.full { width: 100%; }
.hero-footer .primary { flex: 1; }
.session-time { color: var(--mint-ink); font-size: 12px; white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mini-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 29px; }
.metric { padding: 17px 16px; border-radius: 19px; background: var(--surface); border: 1px solid var(--line); }
.metric-top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.metric-top .icon { width: 16px; height: 16px; color: var(--green); }
.metric-number { font-size: 24px; font-weight: 730; letter-spacing: -.6px; margin-top: 9px; }
.metric-number small { font-size: 13px; font-weight: 450; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.goal-line { height: 4px; border-radius: 4px; background: var(--line); margin-top: 12px; overflow: hidden; }
.goal-line > span { display: block; height: 100%; background: #92bda0; border-radius: inherit; }
.section-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 25px 0 13px; }
.section-title h2 { font-size: 18px; }
.text-button { background: none; color: var(--green); font-size: 13px; font-weight: 600; padding: 10px 0 10px 8px; min-height: 40px; }
.word-list { border: 1px solid var(--line); background: var(--surface); border-radius: 21px; overflow: hidden; }
.word-row { display: flex; width: 100%; text-align: left; background: none; align-items: center; gap: 12px; padding: 16px; }
.word-row + .word-row { border-top: 1px solid var(--line); }
.word-row:hover { background: var(--mint); }
.word-initial { width: 41px; height: 43px; border-radius: 12px; display: grid; place-items: center; background: var(--mint); color: var(--mint-ink); font-family: Georgia, serif; font-size: 24px; flex: 0 0 auto; }
.word-row:nth-child(3n+2) .word-initial { background: var(--peach); color: var(--peach-ink); }
.word-row:nth-child(3n+3) .word-initial { background: #edf0f8; color: #666c92; }
.word-text { min-width: 0; flex: 1; }
.word-term { font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.word-translation { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.word-row > .icon { width: 15px; color: var(--muted); }
.word-dots { display: flex; gap: 3px; }
.word-dots span { width: 5px; height: 5px; border-radius: 100%; background: var(--line); }
.word-dots span.filled { background: #7aaa8a; }
.insight { display: flex; gap: 12px; padding: 18px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.insight .icon { margin-top: 2px; color: #8c9a8b; }
.bottom-nav { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; z-index: 20; left: 50%; bottom: 0; width: min(100%, 620px); transform: translateX(-50%); padding: 9px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--bg); }
.nav-button { display: flex; align-items: center; flex-direction: column; gap: 5px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 600; padding: 8px 12px; border-radius: 14px; min-height: 54px; }
.nav-button .icon { width: 23px; height: 23px; }
.nav-button.active { color: var(--green); background: var(--mint); }
.search-box { position: relative; margin-bottom: 14px; }
.search-box > .icon { position: absolute; top: 16px; left: 16px; color: var(--muted); }
input { width: 100%; min-height: 53px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; outline: none; }
input::placeholder { color: var(--muted); }
.search-box input { padding-left: 47px; }
input:focus { border-color: #7daa8d; }
.filters { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin: 0 -24px 18px; padding: 1px 24px 5px; }
.filter { padding: 9px 13px; min-height: 37px; border-radius: 25px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.filter.active { color: white; background: var(--green); border-color: var(--green); }
.add-button { display: flex; align-items: center; justify-content: center; gap: 9px; background: none; width: 100%; border: 1px dashed #b6c8b8; border-radius: 16px; min-height: 52px; margin-top: 15px; color: var(--green); font-size: 14px; font-weight: 600; }
.empty { padding: 28px 22px; border: 1px solid var(--line); background: var(--surface); border-radius: 22px; text-align: center; }
.empty .empty-icon { display: grid; place-items: center; margin: 0 auto 16px; background: var(--mint); border-radius: 18px; width: 61px; height: 61px; color: var(--green); }
.empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { margin-bottom: 9px; }
.empty .primary { margin-top: 22px; }
.empty .text-button { display: block; margin: 9px auto 0; }
.progress-hero { display: flex; gap: 24px; align-items: center; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); margin-bottom: 17px; }
.progress-ring { width: 116px; height: 116px; flex: 0 0 auto; padding: 8px; border-radius: 50%; background: conic-gradient(var(--green) var(--progress, 0%), var(--mint) 0); }
.progress-ring-inner { background: var(--surface); border-radius: 50%; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.progress-ring strong { font-size: 30px; letter-spacing: -1px; }
.progress-ring small { margin-top: 3px; font-size: 11px; color: var(--muted); }
.progress-hero h3 { margin-bottom: 8px; }
.progress-hero .subtext { font-size: 12px; }
.progress-stages { display: grid; gap: 17px; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.stage-top { display: flex; justify-content: space-between; font-size: 13px; gap: 10px; }
.stage-top strong { color: var(--green); }
.stage .goal-line { margin-top: 9px; height: 5px; }
.secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: 14px; font-weight: 600; }
.icon-button { display: inline-grid; place-items: center; width: 42px; height: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; flex: 0 0 auto; }
.gate { display: flex; min-height: 100dvh; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 35px; max-width: 460px; margin: auto; }
.gate .brand { margin-bottom: 42px; }
.gate-visual { display: grid; place-items: center; width: 98px; height: 98px; border-radius: 29px; background: var(--mint); color: var(--green); margin: 0 0 28px; transform: rotate(-6deg); }
.gate-visual .icon { width: 42px; height: 42px; transform: rotate(6deg); }
.gate h1 { font-size: 29px; margin-bottom: 13px; }
.gate .subtext { margin-bottom: 26px; }
.gate .gate-note { margin-top: 28px; font-size: 12px; color: var(--muted); }
.loader { width: 25px; height: 25px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog { width: min(100% - 26px, 500px); max-height: calc(100dvh - 50px); padding: 25px; border: 1px solid var(--line); border-radius: 25px; background: var(--bg); color: var(--ink); box-shadow: 0 30px 100px #102e3450; }
dialog::backdrop { background: #18342e66; backdrop-filter: blur(5px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 23px; }
.dialog-header h2 { overflow-wrap: anywhere; }
.dialog-header .icon-button { width: 35px; height: 35px; }
.dialog-translation { font-size: 20px; margin-bottom: 9px; }
.dialog-meaning { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.example { background: var(--mint); border-radius: 15px; padding: 17px; margin: 18px 0; }
.example p { font-size: 15px; }
.example .subtext { margin-top: 7px; font-size: 12px; }
.source { padding: 12px 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.source strong { display: block; color: var(--ink); font-weight: 550; margin-bottom: 4px; }
.dialog-actions { display: grid; gap: 9px; margin-top: 21px; }
.dialog-actions .text-button { color: var(--muted); }
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.form-note { color: var(--muted); font-size: 12px; margin: 12px 0 22px; }
.error-message { padding: 12px 14px; border-radius: 12px; background: var(--error-bg); color: var(--error); font-size: 13px; margin: 13px 0; }
.session-shell { max-width: 620px; min-height: 100dvh; padding: calc(20px + env(safe-area-inset-top, 0px)) 24px calc(28px + env(safe-area-inset-bottom, 0px)); margin: auto; display: flex; flex-direction: column; }
.session-header { display: flex; align-items: center; gap: 16px; margin-bottom: 35px; }
.session-progress { flex: 1; height: 7px; border-radius: 8px; background: var(--line); overflow: hidden; }
.session-progress > span { display: block; height: 100%; border-radius: 8px; background: #83b391; transition: width .25s ease; }
.session-count { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.exercise-label { color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; margin-bottom: 12px; }
.exercise-title { font-size: 26px; letter-spacing: -.65px; line-height: 1.2; }
.exercise-card { margin: 25px 0; padding: 30px 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 25px; text-align: center; box-shadow: var(--shadow); }
.exercise-term { font-size: clamp(30px, 10vw, 48px); font-weight: 700; letter-spacing: -1.3px; overflow-wrap: anywhere; line-height: 1.12; }
.exercise-translation { color: var(--muted); margin-top: 13px; font-size: 18px; }
.exercise-card .example { text-align: left; margin-bottom: 0; }
.exercise-image { display: block; max-width: 100%; max-height: 190px; object-fit: contain; margin: 0 auto 22px; border-radius: 15px; }
.audio-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; background: var(--mint); color: var(--green); border-radius: 13px; min-height: 44px; padding: 11px 17px; margin-top: 19px; font-size: 13px; font-weight: 600; }
.audio-button.large { display: flex; width: 92px; height: 92px; border-radius: 30px; margin: 3px auto 16px; }
.audio-button.large .icon { width: 37px; height: 37px; }
.listening-note { font-size: 13px; color: var(--muted); }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 13px; text-align: left; padding: 15px 16px; min-height: 58px; border: 1px solid var(--line); background: var(--surface); border-radius: 15px; font-size: 15px; }
.option-index { font-size: 11px; font-weight: 600; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.option.selected { border-color: var(--green); background: var(--mint); }
.option.selected .option-index { background: var(--green); color: white; border-color: var(--green); }
.answer-input { font-size: 18px; min-height: 60px; }
.answer-form .primary { margin-top: 13px; }
.exercise-footer { margin-top: auto; padding-top: 25px; text-align: center; }
.exercise-footer .text-button { color: var(--muted); }
.feedback { margin-top: 22px; padding: 23px; border-radius: 22px; background: var(--mint); }
.feedback.incorrect { background: var(--peach); }
.feedback.neutral { background: var(--surface); border: 1px solid var(--line); }
.feedback-title { display: flex; gap: 9px; align-items: center; font-size: 20px; font-weight: 700; }
.feedback .feedback-answer { font-size: 23px; font-weight: 650; overflow-wrap: anywhere; margin: 16px 0 5px; }
.feedback .subtext { color: var(--mint-ink); font-size: 13px; }
.feedback.incorrect .subtext { color: var(--peach-ink); }
.feedback .example { padding: 0; background: none; margin-bottom: 0; }
.feedback .primary { margin-top: 24px; }
.completion { display: flex; align-items: center; flex-direction: column; flex: 1; justify-content: center; text-align: center; padding: 20px 0 40px; }
.completion-art { width: 125px; height: 125px; display: grid; place-items: center; background: var(--mint); border-radius: 39px; margin-bottom: 31px; transform: rotate(-7deg); }
.completion-art .icon { width: 62px; height: 62px; color: var(--green); transform: rotate(7deg); }
.completion h1 { margin-bottom: 13px; }
.completion .subtext { max-width: 340px; }
.completion-metrics { display: flex; width: 100%; gap: 12px; margin: 30px 0; }
.completion-metrics .metric { flex: 1; }
.completion-metrics .metric-top { justify-content: center; }
#toast { position: fixed; z-index: 100; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; color: white; background: #264e41; max-width: min(90%, 450px); width: max-content; padding: 13px 19px; border-radius: 15px; font-size: 13px; box-shadow: 0 8px 30px #102e3430; transition: opacity .2s, transform .2s; }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-theme='dark'] { color-scheme: dark; --bg: #17241f; --surface: #203029; --ink: #e8eee6; --muted: #a0b0a5; --line: #34463a; --green: #91c5a5; --green-dark: #a5d4b6; --mint: #2a4433; --mint-ink: #b2d4b7; --peach: #423b2e; --peach-ink: #dfbe97; --error: #f4ada3; --error-bg: #4d302e; --shadow: 0 12px 40px #09130d22; }
[data-theme='dark'] .primary, [data-theme='dark'] .filter.active, [data-theme='dark'] .option.selected .option-index { color: #173625; }
[data-theme='dark'] .word-row:nth-child(3n+3) .word-initial { background: #33394d; color: #bcc5ef; }
@media (min-width: 600px) { .app-shell { padding-top: 35px; } .hero { padding: 30px; } .hero-illustration { margin-right: 25px; } .session-shell { padding-top: 30px; } }
@media (max-width: 360px) { .app-shell, .session-shell { padding-left: 17px; padding-right: 17px; } .hero { padding: 20px; } .hero-illustration { width: 98px; flex-basis: 98px; } .hero-count { font-size: 45px; } .progress-hero { gap: 15px; padding: 20px; } .progress-ring { width: 94px; height: 94px; } .hero-footer { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.refresh-button { width: 35px; height: 35px; border-radius: 50%; background: transparent; }
.refresh-button .icon { width: 17px; height: 17px; color: var(--muted); }

.dialog-translation, .dialog-meaning, .example, .option, .exercise-translation { overflow-wrap: anywhere; }
