@font-face{font-family:Literata;src:url(fonts/literata.ttf) format('truetype');font-display:swap}
:root{--paper:#faf8f1;--surface:#fffefa;--ink:#233e37;--muted:#596b61;--green:#204f46;--line:#d8dfd4;--soft:#edf2e9;--orange:#a84828;--radius:12px}
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);font-family:'Segoe UI',sans-serif;font-size:16px;line-height:1.5}
::selection{background:#e7c77c;color:var(--ink)}
[hidden]{display:none!important}
a{color:var(--green);text-underline-offset:4px}
button,input,select{font:inherit}
button,select,input,a{-webkit-tap-highlight-color:transparent}
button{cursor:pointer;transition:background .15s,color .15s,border-color .15s}
button:disabled{cursor:default;opacity:.55}
button:hover:not(:disabled){filter:brightness(.94)}
button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible,select:focus-visible{outline:3px solid var(--orange);outline-offset:4px}
h1,h2,h3,p{margin:0}
h1{font-size:30px;font-weight:650;letter-spacing:-.025em;line-height:1.2}
h2{font-size:22px;font-weight:600;line-height:1.3}
h3{font-size:18px;font-weight:600}
header{max-width:1184px;margin:auto;padding:24px 32px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;flex-shrink:0}
.brand-mark{font-family:Literata,Georgia,serif;font-size:38px;line-height:44px;text-align:center;width:44px;height:48px;color:var(--green)}
.brand strong{display:block;font-size:20px;font-weight:650;line-height:1.2}
.brand small{display:block;font-size:12px;color:var(--muted);margin-top:4px}
#profile-status{display:flex;align-items:center;gap:16px;justify-content:flex-end;font-size:13px;color:var(--muted);min-width:0}
.account-name{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
main{max-width:1184px;margin:auto;padding:0 32px;min-height:calc(100vh - 192px)}
nav{display:flex;gap:32px;border-bottom:1px solid var(--line);margin-bottom:32px}
nav button{border:0;border-bottom:3px solid transparent;background:none;color:var(--muted);padding:14px 0;min-height:48px;font-size:15px;font-weight:600;white-space:nowrap}
nav button[aria-current]{color:var(--green);border-color:var(--green)}
.page-heading{margin-bottom:28px}
.in-lesson .page-heading{display:none}
.primary{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;border:1px solid var(--green);background:var(--green);color:white;padding:12px 24px;border-radius:8px;font-weight:600}
.text-button{min-height:44px;padding:10px 0;border:0;background:none;color:var(--green);font-weight:600;font-size:14px}
.text-button:hover{text-decoration:underline;text-underline-offset:4px}
.study-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr);gap:64px;align-items:start}
.today{padding:32px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.today h2{font-size:28px;letter-spacing:-.02em}
.today>p{margin:12px 0 24px;max-width:52ch;color:var(--muted);font-size:15px}
.lesson-preview{display:flex;align-items:center;flex-wrap:wrap;gap:12px 24px;margin:32px 0;font-family:Literata,Georgia,serif;font-size:36px;line-height:1.3}
.lesson-preview>span{overflow-wrap:anywhere;max-width:100%}
.lesson-preview .preview-more{font-family:'Segoe UI',sans-serif;font-size:14px;color:var(--muted)}
.lesson-meta{display:flex;flex-wrap:wrap;gap:8px 24px;font-size:13px;color:var(--muted);margin-bottom:24px}
.course-heading{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:8px}
.course-heading h2{font-size:18px}
.course-heading>span,.stage-heading>span{font-size:13px;font-variant-numeric:tabular-nums;color:var(--muted);white-space:nowrap}
.course-stage{padding:20px 0;border-bottom:1px solid var(--line)}
.stage-heading{display:flex;align-items:baseline;justify-content:space-between;gap:16px;font-size:14px}
.stage-heading strong{font-weight:500}
.stage-meter{height:4px;background:var(--line);border-radius:2px;margin-top:12px;overflow:hidden}
.stage-meter>div{background:var(--green);height:100%;border-radius:2px}
.course-caption{font-size:12px;color:var(--muted);margin-top:12px}
.practice-shortcut{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:24px 0;margin-top:32px;border-top:1px solid var(--line)}
.practice-shortcut h2{font-size:18px}
.practice-shortcut p{margin-top:6px;color:var(--muted);font-size:14px}
.practice-shortcut button{flex-shrink:0}
.auth-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:8px}
.auth-secondary{min-height:48px;border:1px solid #9aac9f;background:transparent;color:var(--green);border-radius:8px;padding:12px 20px;font-weight:600}
#auth-error{font-size:14px;color:#923716}
#auth-error:empty{display:none}
.today .auth-note{font-size:13px;margin:24px 0 0}
.lesson-audio{display:flex;align-items:center;justify-content:flex-end;gap:24px;min-height:44px;margin:-16px 0 16px;color:var(--muted);font-size:13px}
.lesson-audio label{display:flex;align-items:center;gap:8px;min-height:44px;cursor:pointer}
.lesson-audio input{width:18px;height:18px;accent-color:var(--green)}
.lesson-audio button{font-size:13px}
.study-session{max-width:720px;margin:auto}
.session-top{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;font-size:13px;font-variant-numeric:tabular-nums;color:var(--muted)}
.flashcard{padding:28px 36px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);text-align:center}
.study-identity{display:flex;align-items:center;justify-content:center;gap:24px;flex-wrap:wrap}
.flashcard h2{font-family:Literata,Georgia,serif;font-size:76px;font-weight:400;line-height:1.25;overflow-wrap:anywhere;max-width:100%}
.flashcard h2.combination{font-size:34px}
.reveal-answer{font-size:28px;line-height:1.3;color:var(--green)}
.study-sound{display:flex;align-items:baseline;justify-content:center;gap:12px;font-size:14px;color:var(--muted);margin-top:16px}
.study-sound strong{font-size:24px;font-weight:500;color:var(--ink)}
.study-explanation{max-width:52ch;margin:16px auto 24px;font-size:15px}
.study-example{border-top:1px solid var(--line);padding-top:20px}
.study-example>p{font-size:12px;color:var(--muted);margin-bottom:8px}
.spoken-examples{display:flex;justify-content:center;flex-wrap:wrap;gap:8px 16px;font-family:Literata,Georgia,serif;font-size:28px;overflow-wrap:anywhere}
.spoken-examples>span{max-width:100%}
.spoken-examples mark,.reading-examples mark{background:#f4dfac;color:#253e31;padding:0 2px;border-radius:3px;font-weight:600}
.flash-audio{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:20px 0 12px}
.audio-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 14px;border:1px solid #b9caba;background:transparent;color:var(--green);border-radius:7px;font-size:13px}
.audio-btn svg{width:18px;height:18px;flex-shrink:0}
.repeat-prompt{font-size:13px;color:var(--muted)}
.review-actions{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px}
.review-actions button{min-height:64px;border:1px solid #9aac9f;background:transparent;color:var(--green);border-radius:8px;padding:12px;font-size:16px;font-weight:600}
.review-actions button:last-child{background:var(--green);border-color:var(--green);color:white}
.review-actions small{display:block;font-size:11px;font-weight:400;margin-top:4px}
.save-error{font-size:14px;color:#923716;margin-top:12px}
.study-result{padding:40px 0;text-align:center}
.study-result h2{font-size:30px;letter-spacing:-.02em}
.study-result p{margin:16px auto 28px;max-width:52ch;color:var(--muted)}
.quiz-actions{display:flex;justify-content:center;gap:24px;flex-wrap:wrap}
.lesson-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:40px;align-items:start}
.section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}
.section-heading h2{font-size:18px}
.section-heading>span{font-family:Literata,Georgia,serif;color:var(--muted)}
.letter-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.letter-tile{min-width:0;min-height:76px;padding:8px 2px;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:8px;position:relative}
.letter-tile .glyph{display:block;font-family:Literata,Georgia,serif;font-size:28px}
.letter-tile small{font-size:11px;color:var(--muted)}
.letter-tile.vowel:after{content:'';width:4px;height:4px;background:var(--orange);border-radius:50%;position:absolute;top:8px;right:8px}
.letter-tile.learned{border-color:#809978}
.letter-tile[aria-pressed=true]{background:var(--green);border-color:var(--green);color:white}
.letter-tile[aria-pressed=true] small{color:#d9e8e0}
.letter-tile[aria-pressed=true]:after{background:#f4dfac}
.legend{display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12px;color:var(--muted);margin-top:16px}
.legend i{width:4px;height:4px;border-radius:50%;background:var(--orange)}
.legend span{width:100%;margin-top:2px}
.letter-card{background:var(--soft);border-radius:var(--radius);padding:24px;display:flex;flex-direction:column}
.card-top{display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}
.letter-display{display:flex;align-items:center;gap:24px;margin:16px 0}
.large-glyph{font-family:Literata,Georgia,serif;font-size:88px;letter-spacing:-.03em;line-height:1.25}
.letter-name h2{font-size:28px;font-weight:500}
.letter-name p{font-size:14px;color:var(--muted);margin-top:4px}
.name-audio{margin-top:12px}
.sound-line{display:flex;align-items:baseline;gap:12px;border-top:1px solid #cdd7c7;padding-top:16px;font-size:13px;color:var(--muted)}
.sound-line strong{font-size:24px;color:var(--ink);font-weight:500}
.letter-note{font-size:14px;margin:8px 0 24px}
.example{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-top:auto}
.example>div{min-width:0;width:100%}
.example-label{display:block;font-size:12px;color:var(--muted)}
.example-word{font-family:Literata,Georgia,serif;font-size:26px;overflow-wrap:anywhere}
.card-navigation{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid #cdd7c7;padding-top:12px;margin-top:20px}
.card-navigation button{min-height:44px;padding:8px 0;background:none;border:0;color:var(--green);font-size:13px}
.card-navigation span{font-size:12px;color:var(--muted);text-align:center}
.bottom-note{display:flex;align-items:center;gap:24px;border-top:1px solid var(--line);padding:24px 0;margin-top:32px}
.note-symbol{font-family:Literata,Georgia,serif;font-size:28px;color:var(--orange);white-space:nowrap}
.bottom-note p{font-size:14px;color:var(--muted)}
.bottom-note strong{color:var(--ink);font-weight:600}
.bottom-note button{margin-left:auto;white-space:nowrap}
.rules-head p{max-width:70ch;color:var(--muted);font-size:15px}
.rule-lessons{margin-top:32px}
.reading-group{margin-top:40px}
.reading-group:first-child{margin-top:0}
.reading-group h3{font-size:22px;font-weight:600;line-height:1.35}
.reading-intro{font-size:14px;color:var(--muted);margin:8px 0 16px;max-width:75ch}
.reading-rows{border-top:1px solid var(--line)}
.reading-row{display:grid;grid-template-columns:320px 1fr auto;gap:24px;align-items:center;padding:20px 0;border-bottom:1px solid var(--line)}
.reading-pair{display:grid;grid-template-columns:1fr 24px 64px;gap:12px;align-items:center}
.reading-letters{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;font-family:Literata,Georgia,serif;font-size:27px;line-height:1.5}
.letter-separator{font-size:18px;color:var(--muted)}
.reading-arrow{color:var(--muted)}
.reading-sound{font-size:24px;color:var(--green);white-space:nowrap}
.reading-context p{font-size:14px;color:var(--muted);margin-bottom:8px;max-width:57ch}
.reading-context strong{color:var(--ink)}
.reading-examples{display:flex;flex-wrap:wrap;gap:8px 16px;font-family:Literata,Georgia,serif;font-size:22px;line-height:1.6}
.reading-examples>span{white-space:nowrap}
.source-table{margin-top:32px;padding:20px 0;border-top:1px solid var(--line)}
summary{cursor:pointer;min-height:44px;padding:10px 0;font-weight:600;font-size:15px}
.source-table>p{max-width:80ch;margin:16px 0;font-size:14px;color:var(--muted)}
.reference-group{margin:24px 0 8px}
.reference-row{display:grid;grid-template-columns:1.2fr .8fr 1fr auto;gap:16px;align-items:center;padding:16px 0;border-bottom:1px solid var(--line);font-size:14px}
.rule-label{font-weight:600}
.reference-row small{display:block;color:var(--muted)}
.practice-wrap{max-width:760px;margin:auto}
.practice-top{display:flex;justify-content:flex-end;align-items:center;margin-bottom:12px}
.practice-top label{font-size:13px;color:var(--muted)}
select{max-width:100%;padding:10px 12px;margin-left:8px;min-height:44px;border:1px solid #9aac9f;border-radius:6px;background:var(--surface);color:var(--ink);font-size:14px}
.practice-scope{font-size:13px;color:var(--muted);margin-bottom:16px}
.quiz-panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:28px 36px;text-align:center}
.quiz-counter{display:flex;justify-content:space-between;gap:16px;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.quiz-progress{height:4px;background:var(--line);margin:12px 0 28px;border-radius:2px;overflow:hidden}
.quiz-progress>div{height:100%;background:var(--green)}
.quiz-prompt{font-size:16px;font-weight:500}
.quiz-letter{font-family:Literata,Georgia,serif;font-size:76px;line-height:1.4;margin:8px 0 24px}
.quiz-letter.word{font-size:40px;overflow-wrap:anywhere}
.quiz-listen{margin:28px 0}
.answers{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.answer{min-height:50px;border:1px solid #9aac9f;border-radius:8px;background:var(--surface);padding:12px;color:var(--ink);font-weight:500}
.answer.correct{background:var(--green);border-color:var(--green);color:white}
.answer.incorrect{background:#f5e1d6;color:#873619;border-color:#bd775a}
.answer:disabled{opacity:1}
.feedback{text-align:left;font-size:14px}
.feedback:not(:empty){border-top:1px solid var(--line);padding-top:20px;margin-top:24px}
.feedback>strong{display:block;font-size:16px}
.feedback-reading{display:flex;align-items:baseline;flex-wrap:wrap;gap:12px 24px;margin:8px 0}
.feedback-reading [lang]{font-family:Literata,Georgia,serif;font-size:25px}
.feedback .spoken-examples{justify-content:flex-start;margin:16px 0}
.feedback .flash-audio{justify-content:flex-start}
#next-quiz{margin-top:24px;min-width:160px}
.quiz-end{padding:40px 24px}
.quiz-end h3{font-size:28px;letter-spacing:-.02em}
.quiz-end p{max-width:52ch;margin:16px auto 28px;color:var(--muted)}
.profile-numbers{display:grid;grid-template-columns:repeat(4,1fr);gap:24px;padding:24px 0 32px;border-bottom:1px solid var(--line);margin-bottom:32px}
.profile-numbers strong{display:block;color:var(--green);font-size:36px;font-weight:500;font-variant-numeric:tabular-nums}
.profile-numbers strong small{font-size:18px;color:var(--muted)}
.profile-numbers span{font-size:13px;color:var(--muted)}
.profile-numbers strong.time-total{font-size:28px;line-height:54px}
.profile-details{display:grid;grid-template-columns:1fr 1fr;gap:64px}
.week-chart{display:grid;grid-template-columns:repeat(7,1fr);gap:12px;margin-top:24px}
.week-day{text-align:center;font-size:13px}
.week-day>span{color:var(--muted)}
.bar-track{height:100px;display:flex;align-items:end;border-bottom:1px solid var(--line);margin:8px 0}
.bar-track>div{width:100%;background:#7d9d81;border-radius:4px 4px 0 0}
.week-day strong,.week-day small{display:block}
.week-day small{font-size:11px;color:var(--muted)}
.stats-list{margin:12px 0}
.stats-list>div{display:flex;justify-content:space-between;gap:20px;padding:12px 0;border-bottom:1px solid var(--line);font-size:14px}
.stats-list dt{color:var(--muted)}
.stats-list dd{margin:0;font-weight:600;font-variant-numeric:tabular-nums}
.study-hint{font-size:13px;color:var(--muted);margin-top:20px;max-width:75ch}
.stats-help{margin-top:32px;border-top:1px solid var(--line);padding-top:8px}
.stats-help p{font-size:14px;color:var(--muted);max-width:75ch;margin:12px 0}
#audio-status:not(:empty){position:fixed;bottom:20px;left:50%;transform:translateX(-50%);padding:12px 20px;background:var(--green);color:white;border-radius:8px;width:max-content;max-width:90vw;font-size:14px;box-shadow:0 5px 20px #203b3226;z-index:10}
#audio-status{pointer-events:none}
@media(max-width:1000px){.study-layout{gap:32px;grid-template-columns:minmax(0,1.4fr) minmax(240px,1fr)}.letter-grid{grid-template-columns:repeat(4,1fr)}.lesson-layout{gap:24px}.large-glyph{font-size:72px}.letter-display{gap:16px}.reading-row{grid-template-columns:280px 1fr;gap:12px 24px}.reading-pair{grid-row:span 2}.reading-audio{grid-column:2}.profile-details{gap:32px}}
@media(max-width:650px){
 header{padding:16px 20px;gap:12px}.brand{gap:8px}.brand-mark{font-size:32px;width:32px;height:40px;line-height:38px}.brand strong{font-size:17px}.brand small{font-size:10px}.account-name{max-width:84px}#profile-status{gap:10px;font-size:12px}#profile-status .text-button{font-size:12px}
 main{padding:0 20px;min-height:calc(100vh - 166px)}nav{gap:0;justify-content:space-between;margin-bottom:24px;flex-wrap:wrap}nav button{font-size:12px;padding:12px 4px;min-height:44px}.page-heading{margin-bottom:20px}h1{font-size:25px}
 .study-layout{grid-template-columns:1fr;gap:32px}.today{padding:24px}.today h2{font-size:25px}.today>p{font-size:14px}.lesson-preview{font-size:30px;gap:12px 20px;margin:24px 0}.lesson-meta{gap:8px 16px}.today>.primary{width:100%}.course-stage{padding:16px 0}.practice-shortcut{align-items:flex-start;flex-direction:column;gap:8px;margin-top:24px}.auth-actions{display:grid;grid-template-columns:1fr;width:100%;gap:10px}.auth-actions button{width:100%}
 .lesson-audio{justify-content:space-between;margin:-12px 0 8px;gap:16px}.session-top{margin-bottom:8px}.flashcard{padding:24px 20px}.flashcard h2{font-size:64px}.flashcard h2.combination{font-size:28px}.study-identity{gap:8px 20px}.reveal-answer{font-size:24px}.study-explanation{font-size:14px;margin-bottom:20px}.spoken-examples{font-size:25px}.flash-audio{gap:8px;margin-top:16px}.audio-btn{padding:10px 12px;font-size:12px}.review-actions{gap:10px}.review-actions button{font-size:15px;padding:12px 6px}.review-actions small{font-size:10px}.study-result{padding:24px 0}.study-result h2{font-size:26px}
 .lesson-layout{grid-template-columns:1fr;gap:24px}.letter-grid{grid-template-columns:repeat(6,1fr);gap:6px}.letter-tile{min-height:52px;padding:4px 0}.letter-tile .glyph{font-size:24px}.letter-tile small{display:none}.legend{font-size:11px}.legend span{margin-top:4px}.letter-card{padding:20px}.large-glyph{font-size:82px}.letter-display{gap:24px}.bottom-note{flex-wrap:wrap;align-items:flex-start;gap:16px}.bottom-note p{flex:1;font-size:13px}.bottom-note button{margin-left:0}.note-symbol{font-size:25px}
 .rules-head p{font-size:14px}.reading-group{margin-top:32px}.reading-group h3{font-size:20px}.reading-row{grid-template-columns:1fr;gap:12px;padding:20px 0}.reading-pair{grid-row:auto;grid-template-columns:1fr 24px 64px}.reading-audio{grid-column:1}.reading-context{min-width:0}.reading-examples{font-size:21px;overflow-wrap:anywhere}.reading-examples>span{white-space:normal}.reference-row{grid-template-columns:1fr 1fr;gap:12px}.reference-row .audio-btn{justify-self:start}
 .practice-top{justify-content:flex-start}.practice-top label{display:flex;align-items:center;gap:8px;width:100%}select{margin:0;min-width:0;flex:1;font-size:13px}.quiz-panel{padding:20px}.quiz-letter{font-size:68px}.quiz-letter.word{font-size:32px}.answers{gap:8px}.answer{font-size:14px;padding:12px 6px}.quiz-counter{font-size:12px}.feedback .spoken-examples{font-size:24px}.quiz-end h3{font-size:24px}
 .profile-numbers{grid-template-columns:1fr 1fr;gap:20px;padding:8px 0 24px}.profile-numbers strong{font-size:32px}.profile-numbers strong.time-total{font-size:24px;line-height:48px}.profile-details{grid-template-columns:1fr;gap:32px}.week-chart{gap:8px}.stats-list>div{font-size:13px}.stats-help{margin-top:24px}
}
@media(max-width:360px){header{align-items:flex-start}.brand small{max-width:110px}.account-name{max-width:64px}#profile-status{gap:4px;flex-wrap:wrap}.brand strong{font-size:16px}nav button{font-size:11px;padding:12px 2px}.today{padding:20px}.flashcard{padding:20px 16px}.flashcard h2{font-size:58px}.study-identity{gap:8px 12px}.reveal-answer{font-size:22px}.flash-audio{flex-direction:column;align-items:stretch}.review-actions small{font-size:10px}.quiz-panel{padding:20px 16px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
/* App navigation stays within thumb reach and clears device safe areas. */
.nav-icon{display:none;width:22px;height:22px;flex-shrink:0}
body{min-height:100dvh;overscroll-behavior-y:none}
header{padding-top:max(20px,env(safe-area-inset-top))}
main{padding-bottom:40px}
@media(max-width:650px){
 header{padding-top:max(12px,env(safe-area-inset-top));padding-bottom:12px;background:var(--paper);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5}
 main{padding-top:24px;padding-bottom:calc(100px + env(safe-area-inset-bottom));padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right))}
 nav{position:fixed;bottom:0;left:0;right:0;z-index:6;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));margin:0;padding:8px max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));border:0;border-top:1px solid var(--line);background:var(--surface);gap:4px}
 nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:0;border-radius:8px;min-height:52px;padding:6px 0;font-size:10px}
 nav button[aria-current]{background:var(--soft);color:var(--green)}
 .nav-icon{display:block}
 .in-lesson main{padding-top:16px}
 #audio-status:not(:empty){bottom:calc(84px + env(safe-area-inset-bottom))}
}

@media(max-width:650px){html{scroll-padding-top:84px;scroll-padding-bottom:100px}}

.answer.answer-letter{font-family:Literata,Georgia,serif;font-size:32px;font-weight:400;line-height:1.4;min-height:68px}

/* Sound occupies the primary position beside the glyph. */
.letter-sound .name-label,.letter-name .name-label{display:block;font-size:12px;color:var(--muted);font-weight:400}
.letter-sound strong{display:block;font-size:40px;line-height:1.3;font-weight:500;color:var(--green)}
.secondary-name{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px 12px;padding-top:16px;border-top:1px solid var(--line);font-size:14px;color:var(--muted)}
#letter-card .secondary-name{justify-content:flex-start}
.secondary-name .russian-name{font-size:12px;color:var(--muted)}
.feedback-sound strong{font-size:30px;font-weight:500;color:var(--green)}
@media(max-width:650px){.letter-sound strong{font-size:36px}.letter-display{gap:20px}}

.practice-stats{margin-top:32px;padding-top:24px;border-top:1px solid var(--line)}
.practice-stats h2{font-size:20px;margin-bottom:20px}
#practice-save:not(:empty){margin-top:16px;color:var(--muted)}

/* Compact phone layout: retain touch targets, reduce surrounding space. */
@media(max-width:650px){
 header{padding:4px 16px;padding-top:max(4px,env(safe-area-inset-top));gap:8px}
 .brand small{display:none}.brand-mark{font-size:27px;width:28px;height:36px;line-height:36px}
 .brand strong{font-size:16px}
 main,.in-lesson main{padding:12px 16px calc(68px + env(safe-area-inset-bottom));min-height:0}
 nav{padding:4px 8px max(4px,env(safe-area-inset-bottom));gap:2px}
 nav button{min-height:48px;padding:4px 0;gap:2px}.nav-icon{width:20px;height:20px}
 html{scroll-padding-top:60px;scroll-padding-bottom:72px}
 .page-heading{margin-bottom:12px}h1{font-size:22px}
 .lesson-audio{margin:0;min-height:44px;gap:8px;font-size:12px}
 .session-top{margin-bottom:4px}.session-top .text-button{font-size:13px}
 .flashcard{padding:14px}.flashcard h2{font-size:48px}.flashcard h2.combination{font-size:24px}
 .study-identity{gap:8px 16px}.letter-sound strong{font-size:30px}.reveal-answer{font-size:22px}
 .secondary-name{padding-top:8px;gap:4px 10px;font-size:13px}
 .study-explanation{margin:10px auto;font-size:14px;line-height:1.4}
 .study-example{padding-top:10px}.study-example>p{margin-bottom:2px}
 .spoken-examples,.feedback .spoken-examples{font-size:22px;gap:4px 12px}
 .flash-audio{flex-direction:row;align-items:center;gap:6px;margin:10px 0 4px}
 .audio-btn{min-height:44px;padding:8px;font-size:12px;gap:6px}
 .repeat-prompt{font-size:12px}.review-actions{margin-top:8px;gap:8px}
 .review-actions button{min-height:48px;padding:8px;font-size:15px}.review-actions small{display:none}
 .practice-top{margin-bottom:4px}.practice-scope{margin-bottom:8px;font-size:12px}
 .quiz-panel{padding:14px}.quiz-progress{margin:8px 0 12px}
 .quiz-prompt{font-size:15px}.quiz-letter{font-size:48px;line-height:1.25;margin:8px 0 12px}
 .quiz-letter.word{font-size:26px}.quiz-listen{margin:12px 0}
 .answer,.answer.answer-letter{min-height:46px;padding:8px 6px}.answer.answer-letter{font-size:25px;line-height:1.2}
 .feedback:not(:empty){padding-top:10px;margin-top:12px}.feedback>strong{font-size:15px}
 .feedback-reading{gap:4px 12px;margin:6px 0}.feedback-reading [lang]{font-size:22px}
 .feedback-sound strong{font-size:24px}.feedback .spoken-examples{margin:8px 0}
 .feedback .flash-audio{margin:8px 0 4px}.chosen-answer{color:var(--muted);font-size:13px;margin-bottom:4px}
 .quiz-answered .quiz-prompt,.quiz-answered .quiz-letter,.quiz-answered .quiz-listen,.quiz-answered .answers{display:none}
 .quiz-answered .feedback{border:0;margin-top:0;padding-top:0}
 #next-quiz{margin-top:12px;min-height:44px;padding:8px 20px;width:100%}
 .today{padding:16px}.today h2{font-size:22px}.today>p{margin:8px 0 14px}
 .lesson-preview{font-size:26px;margin:16px 0;gap:8px 16px}.lesson-meta{margin-bottom:16px}
 .study-layout{gap:20px}.course-stage{padding:12px 0}.practice-shortcut{margin-top:16px;padding:16px 0}
 .section-heading{margin-bottom:10px}.letter-grid{gap:4px}.letter-tile{min-height:44px}.letter-tile .glyph{font-size:21px}
 .legend{margin-top:8px}.lesson-layout{gap:14px}.letter-card{padding:14px}
 .large-glyph{font-size:58px}.letter-display{margin:8px 0;gap:16px}.letter-note{margin:8px 0 12px}
 .example{gap:6px}.example>div{width:auto;flex:1}.example-word{font-size:23px}
 .card-navigation{padding-top:4px;margin-top:10px}.bottom-note{padding:16px 0;margin-top:16px}
 .profile-numbers{gap:12px;padding:8px 0 16px;margin-bottom:16px}.profile-numbers strong{font-size:27px}
 .profile-numbers strong.time-total{font-size:23px;line-height:40px}
 .practice-stats{margin-top:16px;padding-top:0;border-top:0}.practice-stats h2{margin-bottom:8px;font-size:18px}
 .profile-details{gap:20px}.week-chart{margin-top:12px}.bar-track{height:70px}
 .reading-group{margin-top:24px}.rule-lessons{margin-top:20px}.reading-row{padding:12px 0;gap:8px}
}

/* Lesson layout follows the task → choices → feedback grouping of the references. */
@media(max-width:650px){
 .in-lesson main{min-height:calc(100dvh - 53px - env(safe-area-inset-top));padding-top:16px}
 .in-lesson #study-session{max-width:520px;margin-inline:auto}
 .session-top{margin-bottom:12px}
 .guided-card{padding:0;background:transparent;border:0;text-align:left}
 .guided-card .study-identity{min-height:156px;padding:20px 16px;background:var(--soft);border-radius:12px;gap:16px 24px}
 .guided-card h2{font-size:76px}.guided-card h2.combination{font-size:26px}
 .guided-card .letter-sound strong{font-size:36px}
 .guided-card .secondary-name{border:0;justify-content:flex-start;padding:12px 0 0;font-size:16px}
 .guided-card .study-explanation{max-width:none;margin:16px 0;font-size:15px;line-height:1.5}
 .guided-card .study-example{padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
 .guided-card .spoken-examples{justify-content:flex-start;font-size:30px}
 .guided-card .study-example>p{margin-bottom:4px}
 .guided-card .flash-audio{justify-content:flex-start;margin:16px 0 8px}
 .guided-card .repeat-prompt{margin-bottom:16px}
 .review-actions{margin-top:12px;padding-top:16px;border-top:1px solid var(--line)}
 .review-actions button{min-height:50px}
 .practice-wrap{max-width:520px}
 .practice-top{margin-bottom:4px}.practice-scope{margin-bottom:16px}
 .quiz-panel{background:transparent;border:0;padding:0;text-align:left}
 .quiz-progress{margin:8px 0 20px}
 .quiz-prompt{font-size:20px;font-weight:600;line-height:1.3}
 .quiz-letter,.quiz-listen{display:flex;align-items:center;justify-content:center;min-height:144px;margin:16px 0 20px;background:var(--soft);border-radius:12px}
 .quiz-letter{font-size:76px}.quiz-letter.word{font-size:28px;padding:16px}
 .quiz-listen .audio-btn{flex-direction:column;gap:8px;border:0;min-width:96px;min-height:96px;font-size:13px}
 .quiz-listen .audio-btn svg{width:40px;height:40px}
 .answers{gap:12px}
 .answer{min-height:76px;font-size:18px;font-weight:500;border-color:#b9caba}
 .answer.answer-letter{min-height:88px;font-size:36px}
 .quiz-answered .quiz-prompt,.quiz-answered .quiz-letter,.quiz-answered .quiz-listen{display:none}
 .quiz-answered .answers{display:flex;gap:8px;margin:0 0 12px}
 .quiz-answered .answer{flex:1}
 .quiz-answered .answer:not(.correct):not(.incorrect){display:none}
 .quiz-answered .chosen-answer{display:none}
 .quiz-answered .answer,.quiz-answered .answer.answer-letter{min-height:44px;font-size:20px;padding:6px}
 .quiz-answered .feedback{margin:0;padding:16px;background:var(--soft);border-radius:10px}
 .feedback-reading{margin:8px 0}.feedback>strong{font-size:16px}
 .feedback .spoken-examples{font-size:26px;margin:12px 0}
 .feedback .flash-audio{margin:12px 0 8px;gap:6px}
 #next-quiz{margin-top:16px;min-height:50px}
 .save-error:empty{display:none}
}
@media(max-width:650px) and (max-height:780px){
 .guided-card .study-identity{min-height:120px;padding:12px 16px}
 .guided-card h2{font-size:64px}.guided-card h2.combination{font-size:24px}
 .guided-card .study-explanation{margin:12px 0}
}

@media(min-width:651px){
 .profile-details>section{display:flex;flex-direction:column;min-width:0}
 .profile-details .week-chart{flex:1}
 .profile-details .week-day{display:flex;flex-direction:column}
 .profile-details .bar-track{flex:1;min-height:100px}
 .profile-details .study-hint{margin-bottom:12px}
}

.voice-setting{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:8px 0 24px}
.voice-setting label{font-weight:600}
.voice-setting select{font:inherit;min-height:44px;padding:8px 32px 8px 12px;border:1px solid var(--line);border-radius:8px;color:var(--green);background:var(--paper,#faf9f3)}
.voice-setting>span{font-size:13px;color:var(--muted)}
/* Account settings use the same typography and controls as lessons. */
.settings-button{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;background:transparent;border:0;color:var(--green);border-radius:8px}
.settings-button:hover{background:#edf1e8}.settings-button svg{width:23px;height:23px}
.account-avatar{display:inline-flex;width:32px;height:32px;flex-shrink:0;border-radius:50%;align-items:center;justify-content:center;object-fit:cover;background:#e1e9dd;color:var(--green);font-size:17px;font-weight:600}
.account-avatar.large{width:72px;height:72px;font-size:30px}
.settings-layout{max-width:960px}
.settings-panel{background:var(--surface);border-radius:16px;padding:32px;box-shadow:0 4px 24px #233e3708}
.account-overview{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:32px}
.account-identity{display:flex;align-items:center;gap:20px;min-width:0}
.account-summary{display:grid;gap:4px;overflow-wrap:anywhere;min-width:0}.account-summary>span{font-size:13px;color:var(--muted)}.account-summary strong{font-size:18px;font-weight:600}
.photo-settings{flex-shrink:0}.avatar-actions{display:flex;align-items:center;gap:16px}
.secondary-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 16px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--green);font-size:14px;font-weight:600;cursor:pointer}.secondary-button:hover{background:var(--soft)}
.field-hint{margin-top:8px;font-size:12px;color:var(--muted)}
.settings-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:32px}
.settings-fields form,.voice-preference{display:grid;align-content:start;gap:10px;min-width:0}.settings-fields label{font-size:14px;font-weight:500}
.setting-controls{display:grid;grid-template-columns:minmax(0,1fr) 120px;gap:12px}
.setting-controls input,.setting-controls select{width:100%;min-width:0;height:48px;font:inherit;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink)}
.setting-controls .primary,.setting-controls .audio-btn{width:100%;height:48px;min-height:48px;padding:10px 12px;justify-content:center;font-size:14px;border-radius:8px;white-space:nowrap}
.setting-controls .audio-btn{background:var(--soft);border-color:transparent}
.form-message{font-size:14px;line-height:1.5;overflow-wrap:anywhere}.form-message:empty{display:none}
.settings-panel>#avatar-status:not(:empty){margin-bottom:20px}.settings-panel>#google-status:not(:empty){margin-top:16px}
.session-actions{display:flex;flex-wrap:wrap;gap:0 24px;margin-top:24px}.session-actions button{min-height:44px;font-weight:400}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0!important}
.upload-label:has(+input:focus-visible){outline:2px solid var(--green);outline-offset:4px}
@media(max-width:850px){.settings-panel{padding:24px}.settings-fields{gap:24px}.setting-controls{grid-template-columns:minmax(0,1fr) 112px;gap:8px}.account-overview{align-items:flex-start}.account-summary strong{font-size:16px}}
@media(max-width:650px){#profile-status{gap:6px}.account-name{max-width:90px}.settings-panel{padding:20px;border-radius:12px}.account-overview{display:grid;gap:16px;margin-bottom:24px}.account-identity{gap:16px}.account-avatar.large{width:64px;height:64px;font-size:28px}.photo-settings{padding-left:80px}.settings-fields{grid-template-columns:1fr;gap:24px}.setting-controls input,.setting-controls select{font-size:16px}.session-actions{gap:0 20px;margin-top:24px}.session-actions button{font-size:13px}}
@media(max-width:360px){.settings-panel{padding:16px}.photo-settings{padding-left:0}.setting-controls{grid-template-columns:minmax(0,1fr) 104px}.setting-controls .primary,.setting-controls .audio-btn{font-size:13px}.account-summary strong{font-size:14px}}
@media(max-width:360px){#profile-status .account-avatar{display:none}}
.google-button{display:inline-flex;justify-content:center;align-items:center;gap:12px;min-height:44px;padding:10px 16px;border:1px solid #747775;border-radius:4px;background:#fff;color:#1f1f1f;font-family:Arial,sans-serif;font-size:14px;font-weight:500}
.google-button:hover{background:#f8fafd}.google-button svg{flex-shrink:0}.google-button:disabled{opacity:.6;cursor:wait}
.auth-panel [data-google-entry]:not(:empty){margin:20px 0 24px}.auth-panel .google-button{width:100%}
.google-connection:not(:empty){margin-bottom:20px}.google-connection .form-message:empty{display:none}
