/* A calm study space: strong contrast, readable type, reachable voice controls. */
:root{--accent:#2c5947;--accent-soft:#edf3e8;--ink:#233b33;--muted:#5c7065;--line:#dce4d8;--bg:#f5f6f0;--focus:#7054cf;--radius:22px}
*,*:before,*:after{box-sizing:border-box}
[hidden]{display:none!important}
body{font-size:16px;line-height:1.55;color:var(--ink);-webkit-text-size-adjust:100%}
button,input,select,textarea{font:inherit}button,label[role=button],summary{touch-action:manipulation}
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--focus)!important;outline-offset:3px}
button:disabled{opacity:.48;cursor:default}.hint{color:var(--muted);font-size:14px;line-height:1.6}
button,.btn,.chip,select{min-height:44px}.btn{background:var(--accent);box-shadow:none;border:1px solid var(--accent);font-weight:700;letter-spacing:0;border-radius:13px;transition:background .15s,transform .15s}
.btn:hover{background:#204737}.btn:active{transform:translateY(1px)}
.btn.quiet,.chip{color:#355246;background:#f0f4eb;border:1px solid #d6e0d0;box-shadow:none}
.btn.quiet:hover,.chip:hover{background:#e5eedc}.chip.on{color:#24482e;background:#dff2bb;border-color:#bed893}
.btn.ghost{color:#35513b;background:#f0f4e8;border-color:#c9d8bc}.btn.ghost:hover{background:#e1ecd6}
.card{box-shadow:0 3px 14px #243e3005;border-color:var(--line);border-radius:var(--radius)}
.stat{background:#eff4e7;border-color:#dce7cf}.stat b{color:#355b3c}.stat span{font-size:13px;color:#576d52}.badge{opacity:1;filter:none;border-color:#dfe4d9;background:#f6f7f1}.badge:not(.earned) .ic{filter:grayscale(1);opacity:.6}.badge.earned{background:#edf5df;border-color:#c5dca8}.badge .t{font-size:15px;color:#3b523b}.badge .d{font-size:13px;color:#61715a;line-height:1.45}.more-badges{flex:1 1 100%;border-top:1px solid #e0e7da;padding-top:6px;margin-top:5px}.more-badges>summary{min-height:44px;align-content:center;color:#506b45;cursor:pointer}.more-badges .badges{margin-top:10px}
.section-kicker{color:#5f7767;font-size:11px;letter-spacing:1.3px}.toast{max-width:calc(100% - 32px);line-height:1.5;background:#244b3c;color:#fff;font-size:14px}
.sidebar{width:218px}.wrap{max-width:1560px}nav button{font-size:15px;min-height:48px}
header{position:relative;gap:10px}header h1{font-size:27px}.eyebrow{color:#617466}header .sub{font-size:13px}
header #subjectPick{font-size:15px!important;max-width:230px}.history-quick{min-height:44px;color:#4d456d;background:#f0edf9;border-color:#ddd7ed}
.header-sound{border:1px solid #cfdcc8;color:#2e5140;background:#f5f9ee;border-radius:13px;font-size:14px;font-weight:700;padding:8px 14px;white-space:nowrap}
.header-sound:before{content:'♫';margin-right:7px;font-size:18px}.mobile-more{display:none}
input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=file]),textarea,select{border:1px solid #bccbbe;border-radius:12px;background:#fff;color:#203b31;padding:11px 13px;font-size:16px;max-width:100%}
input::placeholder,textarea::placeholder{color:#738276;opacity:1}
textarea{line-height:1.5;resize:vertical}a{color:#3f5fb0;text-underline-offset:3px}
.study-strip>*{min-height:48px}.study-confirm input{accent-color:#355e43}.study-label{font-size:16px}
.mission-card>span:not(.mission-icon):not(.mission-label):not(.mission-meta),.subject-world>span:not(.world-icon){font-size:13px}.mission-meta,.learning-route small{font-size:12px}
.welcome-card .hero-intro{font-size:15px!important}.welcome-note{font-size:12px}.hero-topic h3{font-size:17px}.hero-map{font-size:13px}.profile-card .hint{font-size:13px}
.world-description{line-height:1.5}.curiosity-card p{font-size:14px}.learning-route b{font-size:14px}
.plan-topic,.topic-row{overflow-wrap:anywhere}.train-menu{gap:10px}.train-menu button{color:#2b4839;background:#f3f7ec;border-color:#d5e0cd;padding:14px;min-height:74px}.train-menu button span{font-size:13px;color:#596b5e}
.topic-check{width:44px;min-width:44px;font-size:21px;color:#78886b}.topic-ask{font-size:15px;line-height:1.45}.topic.done .topic-check{color:#28633c}.path{overflow-x:auto;scrollbar-width:thin}.path-node{flex:0 0 52px}
#hwMic{font-size:14px;font-weight:700;color:#3c583e;background:#edf3e3;border:1px solid #d4dfc8;width:auto;padding:9px 14px}
/* The conversation occupies the available screen, with a stable composer below it. */
body[data-tab=lesson] #motto,body[data-tab=lesson] #reminder{display:none!important}
body[data-tab=lesson] .wrap{padding-bottom:12px}
#lesson:not([data-mode=daily]):not([data-mode=review]){display:flex;flex-direction:column;height:calc(100dvh - var(--lesson-top,160px) - 18px);min-height:440px;padding:16px 22px 14px;overflow:hidden}
#lesson:not([data-mode=daily]):not([data-mode=review])>.section-kicker,#lesson:not([data-mode=daily]):not([data-mode=review])>h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#lesson .study-lesson-tools{margin:0 0 10px;gap:7px;flex-shrink:0;padding-bottom:10px;border-bottom:1px solid #e4e9df}
#lesson .study-lesson-tools button{padding:8px 12px;font-size:13px;min-height:40px;border-radius:11px}
#lesson .study-lesson-tools .study-sync{flex:1 1 auto;text-align:right;font-size:12px}
#lesson .study-lesson-tools .lesson-practice{background:#f0edf9;border:1px solid #ded7ef;color:#594581}
#lesson .study-spoken{display:none!important}
#lesson .chat{flex:1 1 auto;min-height:120px!important;max-height:none;margin:0;overflow-y:auto;overscroll-behavior:contain;padding:14px 4px 18px;scrollbar-gutter:stable;scroll-behavior:smooth}
.msg{font-size:17px;line-height:1.65;padding:17px 19px;border-radius:18px;max-width:min(88%,780px);overflow-wrap:anywhere}
.msg.bot{background:#f4f6ed;border:1px solid #dfe5d6;color:#2b4035}.msg.me{background:#eeebfa;color:#413758;border:1px solid #e3dff1}
.msg.sys{font-size:14px;background:#fff2d8;color:#74531d}.msg button{font-size:14px;color:#385741;min-height:44px}
.conversation-dock{flex-shrink:0;border-top:1px solid #e0e6db;background:#fff;padding-top:9px;min-width:0}
#lesson[data-mode=daily] .conversation-dock,#lesson[data-mode=daily] .study-lesson-tools,#lesson[data-mode=daily] .study-retry,#lesson[data-mode=daily]>.study-extra{display:none!important}
.help-prompts{display:flex;gap:7px;flex-wrap:nowrap!important;overflow:auto;margin:0 0 9px;padding:2px 2px 5px;scrollbar-width:thin}
.help-prompts>span{display:none}.help-prompts button{flex:0 0 auto!important;white-space:nowrap!important;border:1px solid #dcd5ed;background:#f6f3fc;color:#5b447f;font-size:13px!important;padding:8px 12px!important;min-height:40px;border-radius:12px}
.help-prompts button:hover{background:#eee7fa}
.conversation-dock .composer{display:flex;align-items:flex-end;gap:8px;padding:9px;border-radius:17px;border:1px solid #bbcdb7;background:#f5f8ef;box-shadow:0 2px 0 #284b3110;margin:0}
.conversation-dock .composer textarea{flex:1 1 0;min-width:0;min-height:48px;max-height:120px;padding:11px 10px;border-color:transparent;box-shadow:none;resize:none;font-size:16px!important;line-height:1.5}
.conversation-dock .composer .mic{width:auto;min-width:46px;height:48px;min-height:48px;flex-shrink:0;background:#e6eedc;color:#35533f;border-radius:12px;border:1px solid #ccdbbd;font-size:14px;font-weight:700;padding:8px 12px}
.conversation-dock .composer #attach{display:grid;place-items:center;font-size:22px;padding:8px;width:44px;min-width:44px}
.conversation-dock .composer #mic.live{background:#b83c4b;color:#fff;border-color:#a32c3c;box-shadow:0 0 0 3px #f6dde1;animation:none}
.conversation-dock #send{min-height:48px;padding:9px 16px;font-size:14px}.conversation-dock #send:after{content:' ↗'}
#attachThumb[hidden]{display:none}#attachChipText{overflow-wrap:anywhere;min-width:0}#attachRemove{min-width:44px;min-height:44px}.conversation-dock #attach[aria-disabled=true]{opacity:.5;cursor:wait}
#micFeedback{gap:7px!important;margin:9px 0 0!important;align-items:center;min-height:38px}
#micFeedback .chip{font-size:13px;padding:7px 11px;min-height:38px;border-radius:11px}#micState{font-size:13px;color:#536c59;flex:1 1 200px;line-height:1.45}
#micLevel{width:85px;height:18px;accent-color:#418151}#micLevel::-webkit-meter-optimum-value{background:#428957}
.study-voice-controls{margin:7px 0 0;gap:8px;align-items:center}.study-voice-controls .chip{font-size:13px;min-height:36px;padding:5px 11px;background:transparent;border-color:#dae3d3}.study-voice-controls .chip.on{background:#edf5e2}
.conversation-status{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.conversation-status:has(#speechState:empty):not(:has(#soundResume:not([hidden]))){display:none}
#speechState{font-size:13px;color:#4d664e;padding-top:6px}#soundResume{margin-top:6px;min-height:40px;font-size:14px;background:#e1efc4}
.speech-ctl{margin:0 0 8px;gap:8px}.speech-ctl button{min-height:40px;font-size:14px;padding:8px 15px}.speech-ctl #speechPause{background:#edf2e4;color:#35573d}.speech-ctl #speechStop{background:#fcecef;color:#9c3042}
#lesson>#micHelp{margin:7px 0 0;border:0;padding:0;flex-shrink:0;background:transparent}#micHelp summary{font-size:12px;min-height:30px;padding:4px 0;color:#566c59}#micHelp p{font-size:14px;line-height:1.6;margin:8px 0}#micHelp[open]{max-height:180px;overflow:auto}
#lesson>#voiceNote:empty{display:none}.study-retry{font-size:14px;padding:12px;margin:0 0 8px;max-height:150px;overflow:auto;flex-shrink:0}.study-retry p{margin:4px 0}.study-retry button{font-size:13px;min-height:40px}.study-extra[hidden]{display:none}
/* Native dialogs provide keyboard focus containment and an explicit exit. */
.comfort-dialog{width:min(680px,calc(100% - 32px));max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain;border:1px solid #cbd7c3;border-radius:25px;padding:24px;color:#243d31;background:#fffef8;box-shadow:0 24px 90px #102a2940;font:inherit;line-height:1.55}
.comfort-dialog::backdrop{background:#18352d99;backdrop-filter:blur(3px)}
.reading-dialog[open]{display:flex;flex-direction:column;width:min(760px,calc(100% - 24px));height:min(860px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);padding:0;overflow:hidden}.reading-dialog>.comfort-dialog-head{flex:none;margin:0;padding:20px 22px 14px;border-bottom:1px solid var(--line)}.reading-body{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding:18px 22px}.reading-body .dialog-intro{margin-bottom:14px}.reading-source-tools{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:16px}.reading-source-tools>label:not(.btn){font-size:13px}.reading-source-tools select{display:block;font-size:14px;margin-top:3px;min-width:140px}.reading-file{cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.reading-file[aria-disabled=true]{opacity:.5;cursor:default}.reading-memory{display:flex;gap:7px;align-items:center;min-height:44px}.reading-memory input{width:20px;height:20px;accent-color:var(--accent)}.reading-label{display:block;font-weight:700;margin-bottom:8px}.reading-body textarea{width:100%;font-size:17px;line-height:1.7;resize:vertical}.reading-body textarea[readonly]{background:#fff;color:var(--ink)}#readingHidden{background:#edf3e5;border-radius:13px;padding:18px;color:#4d654b}#readingPeek{margin-top:10px}.reading-status{font-size:14px;color:#42613c;margin:16px 0 10px;line-height:1.6}.reading-error{padding:12px 14px;background:#fff3da;border:1px solid #ead5aa;color:#79521e;border-radius:12px;font-size:14px}.reading-level{display:grid;grid-template-columns:1fr 1fr auto;gap:12px;align-items:center;margin:12px 0;font-size:13px}.reading-level meter,.reading-level progress{width:100%;min-width:0;height:14px;accent-color:var(--accent)}#readingTranscript{border-top:1px solid var(--line);padding-top:8px;margin-top:14px}#readingTranscript summary{min-height:44px;align-content:center;cursor:pointer;font-weight:700}#readingTranscript>label{display:block;font-size:14px;color:var(--muted);margin:8px 0}.reading-reset{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.reading-reset button{font-size:13px}.reading-feedback{border:1px solid #ccddbb;background:#eef5e3;border-radius:15px;padding:16px;margin-top:20px}.reading-feedback h3{font-size:19px;margin:0}.reading-feedback p{white-space:pre-wrap;font-size:15px}#readingAccuracy{font-weight:700}.reading-footer{flex:none;border-top:1px solid var(--line);padding:14px 22px;background:#fffef8}.reading-actions{display:flex;gap:9px;flex-wrap:wrap}.reading-actions>button{flex:1;min-width:120px;min-height:48px;font-size:15px;padding:9px 12px}.reading-footer .hint{font-size:12px;margin:8px 0 0;line-height:1.45}
@media(max-width:800px){.reading-dialog>.comfort-dialog-head{padding:16px 17px 12px}.reading-body{padding:15px 17px}.reading-footer{padding:12px 17px}.reading-actions>button{font-size:14px;min-height:48px}.reading-body .dialog-intro{font-size:13px}.reading-source-tools{gap:8px}.reading-body textarea{font-size:17px}}
.word-dialog{max-width:580px}.word-dialog .comfort-dialog-head{position:sticky;top:0;z-index:2;background:#fffef8;padding-bottom:10px}.word-dialog #wordsContent{min-width:0}.word-dialog .dialog-intro{margin-bottom:16px}.word-start{width:100%}.word-add{border-top:1px solid var(--line);margin-top:24px;padding-top:10px}.word-add summary{cursor:pointer;min-height:44px;align-content:center;font-weight:700}.word-add label{display:block;margin:14px 0 7px;font-size:14px}.word-add-row{display:flex;flex-wrap:wrap;gap:8px}.word-add-row input{flex:1;min-width:150px}.word-add textarea{width:100%;margin-bottom:10px}.word-message{background:#ecf4df;padding:12px;border-radius:12px}.word-counter{margin:8px 0;color:var(--muted);font-size:14px}.word-progress{display:block;width:100%;height:8px;accent-color:var(--accent)}.word-card{padding:30px 0 8px;text-align:center;overflow-wrap:anywhere}.word-card #wWord{font-size:clamp(28px,7vw,40px);font-weight:800;line-height:1.25;margin:0 0 20px}.word-card #wTr{font-size:23px;font-weight:700;margin:12px 0 22px}.word-card #wAudioStatus{min-height:44px;margin:10px 0 0;font-size:14px}.word-actions{display:flex;flex-wrap:wrap;gap:10px}.word-actions>.btn{flex:1;min-width:100px}.word-save-status{font-size:14px;color:#79521e;margin-bottom:8px}.word-dialog #wRetry{width:100%}
.comfort-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin:0 0 12px}.comfort-dialog-head h2{font-size:25px;line-height:1.2;margin:5px 0;letter-spacing:-.5px}.dialog-close{border:1px solid #d0dcc8;background:#f2f6eb;color:#36523c;padding:8px 13px;border-radius:12px;font-size:14px;flex-shrink:0}
#voiceDialog>.comfort-dialog-head{position:sticky;top:0;z-index:2;background:#fffef8;padding-bottom:10px}
.dialog-intro{color:#60715f;margin:0 0 18px;font-size:15px}.comfort-dialog .voice-panel{padding:0;margin:0;background:transparent;border:0;border-radius:0}.voice-heading .section-kicker,.voice-heading h3{display:none}.voice-heading{margin:0 0 12px}.voice-selected{font-size:14px;color:#37533e;background:#edf4e3;border:1px solid #cfddc0;border-radius:10px;padding:8px 11px}
.voice-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px}.voice-option{display:flex;flex-direction:column;align-items:stretch;gap:5px;border:1px solid #d4ddce;border-radius:17px;background:#fff;padding:12px}.voice-option.selected{background:#f2f8e7;border:2px solid #6e9851;padding:11px;box-shadow:0 0 0 2px #dceacb55}
.voice-option label{display:flex;align-items:center;gap:9px;min-height:66px;cursor:pointer;padding:0}.voice-option input{accent-color:#497139;width:18px;height:18px;margin:0}.voice-avatar{width:38px;height:38px;flex-shrink:0;font-size:24px;background:#f2f0e7;display:grid;place-items:center;border-radius:12px}.voice-copy strong{font-size:16px;color:#2b4937}.voice-copy small{font-size:12px;line-height:1.35;color:#61715b}.voice-sample{min-height:44px;border:1px solid #cbd8c1;border-radius:11px;background:#f5f7ef;color:#36563e;font-size:14px;font-weight:600;padding:8px}.voice-sample:hover{background:#e8f0db}.voice-status{font-size:14px;min-height:44px;color:#496040;line-height:1.5;margin:14px 0 5px}
.voice-preferences{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;border-top:1px solid #dde5d4;padding-top:14px;margin-top:10px}.voice-auto{display:flex;align-items:center;gap:10px;font-size:14px;min-height:44px}.voice-auto input{width:21px;height:21px;accent-color:#456b37}.comfort-dialog #rateBtn{font-size:14px}.comfort-dialog .voice-set{border:0;padding:0;margin:12px 0}.comfort-dialog .voice-set summary{font-size:14px;min-height:44px;align-content:center;color:#53674d}.comfort-dialog .voice-set .toolbar{margin:8px 0}.voice-done{width:100%;margin-top:8px}
.more-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.more-destination{border:1px solid #d9e2d2;border-radius:16px;text-align:left;background:#f4f7ed;color:#2d4d38;padding:16px;min-height:76px;font-size:15px}.more-destination strong,.more-destination span{display:block}.more-destination span{font-size:13px;color:#627359;margin-top:4px}.more-destination:hover{background:#e9f1de}
.comfort-dialog .study-extra,.comfort-dialog .study-extra-help,.comfort-dialog .study-board-panel{padding:12px;margin:12px 0;background:#fff}.comfort-dialog .study-extra>summary{font-size:16px}.comfort-dialog .train-menu{margin-top:12px}.comfort-dialog #trainOpen{width:100%;padding:12px;margin-top:10px}.comfort-dialog .study-help-more .btn{font-size:14px}
@media(max-width:1150px) and (min-width:801px){.sidebar{width:190px}.wrap{margin-left:190px;padding:22px}header #subjectPick{max-width:180px}.header-sound{padding-inline:11px}#lesson:not([data-mode=daily]):not([data-mode=review]){padding-inline:16px}.study-lesson-tools .study-sync{display:none}}
@media(max-width:800px){
  :root{--bottom-nav:calc(66px + env(safe-area-inset-bottom,0px))}
  .sidebar{position:fixed;inset:auto 0 0;z-index:100;width:auto;height:var(--bottom-nav);padding:6px 12px calc(6px + env(safe-area-inset-bottom,0px));border:0;border-top:1px solid #d9e2d0;background:#fdfef8f5;backdrop-filter:blur(12px);display:flex;flex-direction:row;align-items:stretch;gap:5px}
  .sidebar>.brand,.sidebar>.nav-label,.sidebar>.sidebar-bottom{display:none}nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex:3;margin:0;gap:5px;overflow:visible}nav button[data-tab=plan],nav button[data-tab=olymp],nav button[data-tab=progress]{display:none}
  nav button,.mobile-more{min-height:52px;padding:5px 2px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;line-height:1.3;white-space:normal;border:1px solid transparent;border-radius:12px;color:#5c705d;background:transparent;box-shadow:none}
  nav .ui-icon{width:22px;height:22px}nav button[aria-selected=true],.mobile-more.selected{background:#e2f1c4;border-color:#cee2aa;color:#2c4a30}.mobile-more{flex:1}.mobile-more>span{font-size:20px;line-height:22px;letter-spacing:2px}
  .wrap{margin:0;padding:16px 16px calc(var(--bottom-nav) + 24px);max-width:none}
  header{margin-bottom:15px;gap:8px;display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center}
  header .heading{grid-column:1/-1;min-width:0}header #headerLogo{display:none}header h1{font-size:22px;margin:0;line-height:1.25;letter-spacing:-.5px}.eyebrow{display:none}header .sub{font-size:12px;margin-top:5px;color:#62735f}
  header #subjectPick{grid-column:1;grid-row:2;width:100%;max-width:none;min-height:42px;font-size:14px!important;padding:7px 10px;border-radius:12px}header .history-quick{grid-column:2;grid-row:2;margin:0;font-size:12px;padding:7px 9px}header .header-sound{grid-column:3;grid-row:2;font-size:12px;padding:7px 10px;min-height:42px}.header-sound:before{font-size:16px;margin-right:4px}
  .card{padding:19px;border-radius:21px}.card>h2{font-size:24px}.section-kicker{font-size:10px}.home-layout{gap:18px}
  #motto{display:none!important}.homework-road{flex-direction:row;gap:8px;padding:10px;margin:14px 0}.homework-road>span{font-size:11px;line-height:1.4;flex:1;display:flex;align-items:flex-start;gap:5px}.homework-road>span b{flex-shrink:0}.drop{min-height:0;padding:16px 13px;gap:9px}.drop>b{font-size:17px}.drop>span{font-size:13px}.drop .btn{font-size:13px;min-height:44px;padding:9px 12px}.drop .toolbar{gap:7px;justify-content:center}.study-photo-tools{gap:7px;margin:10px 0}.study-photo-tools button{font-size:13px;flex:1;padding:8px}#hw .composer{padding:8px}.homework-road>span:nth-child(3){display:none}
  .home-section-head>span{font-size:13px}.home-section-head h2{font-size:21px}.welcome-card h2{font-size:32px}.welcome-card .hero-intro{font-size:14px!important}.hero-topic h3{font-size:15px}.hero-topic .section-kicker{font-size:10px}.hero-map{font-size:13px}.welcome-note{font-size:11px}.hero-actions .btn{font-size:14px;min-height:46px}.mission-card{min-height:132px}.mission-card>b{font-size:17px}.mission-card>span:not(.mission-icon):not(.mission-label):not(.mission-meta){font-size:13px}.mission-label{font-size:10px}.mission-meta{font-size:11px}.learning-route b{font-size:12px}.learning-route small{font-size:10px}.subject-world b{font-size:15px}.subject-world>span:not(.world-icon){font-size:12px}
  #lesson:not([data-mode=daily]):not([data-mode=review]){height:calc(var(--visible-height,100dvh) - var(--lesson-top,130px) - var(--bottom-nav) - 8px);min-height:410px;padding:10px 12px;border-radius:19px}
  #lesson .study-lesson-tools{gap:5px;margin-bottom:0;padding-bottom:8px;flex-wrap:wrap;overflow:visible}
  #lesson .study-lesson-tools button{flex:1 1 86px;min-width:0;padding:7px 9px;font-size:12px;min-height:44px;white-space:normal}#lesson .study-lesson-tools .study-sync{display:none}
  #lesson .chat{padding:12px 0;min-height:110px!important;scrollbar-gutter:auto}.msg{max-width:94%;font-size:16px;padding:13px 14px;line-height:1.6;margin-bottom:12px}
  .conversation-dock{padding-top:6px}.help-prompts{gap:6px;margin-bottom:5px}.help-prompts button{min-height:36px;font-size:12px!important;padding:6px 10px!important}
  .conversation-dock .composer{flex-wrap:wrap;gap:6px;padding:7px;border-radius:14px}.conversation-dock .composer textarea{flex:1 1 calc(100% - 2px);width:100%;min-height:42px;max-height:88px;padding:6px 8px}
  .conversation-dock .composer #attach{height:42px;min-height:42px;min-width:42px;width:42px}.conversation-dock .composer #mic{height:42px;min-height:42px;padding:7px 14px;flex:1;font-size:14px}.conversation-dock #send{min-height:42px;font-size:14px;padding:7px 15px;flex:1.1}
  #micFeedback{gap:6px!important;margin-top:6px!important;min-height:0}#micFeedback .chip{font-size:12px;padding:5px 9px;min-height:34px}#micState{font-size:12px;flex-basis:100%}#micLevel{position:absolute;right:33px;width:65px;margin-top:-34px}
  .study-voice-controls{gap:7px;margin-top:5px}.study-voice-controls .chip{font-size:12px;min-height:32px;padding:4px 9px}#lesson>#micHelp{display:none}#speechState{font-size:12px}.speech-ctl{margin-bottom:6px}.speech-ctl button{min-height:36px;font-size:12px;padding:6px 12px}
  .conversation-status #soundResume{font-size:13px;min-height:36px;margin-top:4px}#lesson .study-retry{max-height:110px;font-size:13px}.study-retry button{font-size:12px;padding:6px 9px;min-height:36px}
  .comfort-dialog{width:calc(100% - 24px);max-height:calc(100dvh - 24px);border-radius:22px;padding:18px}.comfort-dialog-head h2{font-size:23px}.dialog-close{padding:7px 10px;font-size:13px}.dialog-intro{font-size:14px}.voice-choices{gap:9px}.voice-option{padding:10px}.voice-option.selected{padding:9px}.voice-option label{flex-wrap:wrap;gap:7px;min-height:81px;align-content:start}.voice-avatar{width:31px;height:31px;font-size:21px}.voice-copy{flex:1 1 100%}.voice-copy strong{font-size:16px}.voice-copy small{font-size:12px}.voice-sample{font-size:13px;padding:6px;min-height:42px}.voice-selected{font-size:13px}.voice-status{font-size:13px}.voice-auto{font-size:14px}.voice-preferences{gap:7px}.comfort-dialog .hint{font-size:13px}.voice-done{min-height:46px}.more-grid{grid-template-columns:1fr}.more-destination{min-height:64px;padding:13px 15px}.toast{bottom:calc(var(--bottom-nav) + 10px)}
  .history-dialog,.study-dialog,dialog{max-width:calc(100% - 20px);max-height:calc(100dvh - 24px)}.history-heading{gap:7px}.history-heading h3{font-size:22px}.history-filters input{flex-basis:100%;font-size:16px}.study-input-tools{gap:7px}
  body.keyboard-open[data-tab=lesson]{--bottom-nav:0px}body.keyboard-open[data-tab=lesson] .sidebar,body.keyboard-open[data-tab=lesson] header .heading,body.keyboard-open[data-tab=lesson] .help-prompts,body.keyboard-open[data-tab=lesson] #micFeedback,body.keyboard-open[data-tab=lesson] .study-voice-controls{display:none!important}
  body.keyboard-open[data-tab=lesson] .wrap{padding-top:8px}body.keyboard-open[data-tab=lesson] #lesson{min-height:260px}
}
@media(max-width:370px){.wrap{padding-inline:10px}header h1{font-size:20px}header .history-quick{font-size:0;width:42px}header .history-quick:after{content:'Ист.';font-size:12px}#lesson:not([data-mode=daily]):not([data-mode=review]){padding-inline:9px}.voice-preferences{display:block}.voice-choices{gap:7px}.voice-option input{width:17px;height:17px}.voice-copy small{font-size:11px}#micFeedback .chip{font-size:11px}}
.quiz-dialog{width:min(700px,calc(100% - 24px));max-width:700px;max-height:calc(100dvh - 24px);margin:auto;padding:0;border:0;background:transparent;border-radius:22px;overflow:auto;color:var(--ink)}
.quiz-dialog::backdrop{background:#24382499;backdrop-filter:blur(3px)}
.quiz-dialog .quiz-box{width:100%;max-width:none;margin:0;padding:23px;box-shadow:none;border:1px solid #d9e1d0;border-radius:22px}
.quiz-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.quiz-heading h2{font-size:23px;line-height:1.3;margin:0}.quiz-heading>button{flex-shrink:0;min-height:44px}
.quiz-state,.quiz-storage-warning{font-size:14px;line-height:1.6;margin:13px 0;color:#54684e}.quiz-storage-warning{background:#fff2c9;padding:10px;border-radius:10px}
.quiz-dialog .quiz-q{background:#f7f9f1;border-color:#dce4d3}.quiz-dialog textarea{font-size:16px;line-height:1.5}.quiz-dialog textarea[readonly]{color:#334c36;opacity:1}.quiz-dialog .quiz-q>.btn{font-size:13px;margin-top:9px;min-height:44px}
.quiz-dialog .quiz-result-practice{background:#fff6da;border-color:#e9dcae}.quiz-dialog .quiz-result p{font-size:14px;margin:5px 0}
.quiz-dialog .quiz-actions{position:sticky;bottom:0;flex-wrap:wrap;padding:12px 0 8px;background:var(--card);border-top:1px solid #dce4d3}.quiz-dialog .quiz-actions button{min-height:44px}
@media(max-width:560px){.quiz-dialog .quiz-box{padding:17px}.quiz-heading h2{font-size:20px}.quiz-heading>button{padding:7px 10px;font-size:13px}.quiz-dialog .quiz-actions button{flex:1 1 120px;font-size:14px}.quiz-dialog .quiz-q{padding:12px}}
@media(prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}.chat{scroll-behavior:auto!important}*,*:before,*:after{animation:none!important;transition:none!important}}

/* Recovery stays compact and usable alongside the question. */
.study-file-recovery{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0;padding:10px 12px;flex-shrink:0;min-width:0}.study-file-recovery p{flex-basis:100%;font-size:14px;line-height:1.45;margin:0}.study-file-recovery .btn{font-size:13px;line-height:1.3;min-height:44px;padding:8px 10px;flex:1 1 110px;max-width:100%;white-space:normal}#lesson.has-file-recovery{overflow-y:auto!important}
.study-input-tools .study-mic{min-height:44px}
.study-feedback-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:14px 0 20px;max-width:100%}.study-feedback-actions>.btn{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere;font-size:14px}.study-feedback-actions>[role=status]{flex-basis:100%;font-size:14px;color:var(--muted);overflow-wrap:anywhere}

/* The access screen is modal: background controls cannot take focus before login. */
dialog.pin-gate{margin:0;border:0;max-width:none;max-height:none;width:100%;height:100%;box-sizing:border-box;overflow:auto;color:var(--ink)}
dialog.pin-gate:not([open]){display:none}dialog.pin-gate[open]{display:flex}.pin-gate .pin-box{box-sizing:border-box;flex-shrink:0}.pin-gate input,.pin-gate button{min-height:48px}.pin-gate .pin-msg{min-height:24px;line-height:1.5;letter-spacing:normal}

.history-shell{padding:0;width:min(860px,calc(100% - 24px));max-width:860px;max-height:calc(100dvh - 24px);overflow:hidden}.history-shell[open]{display:flex;flex-direction:column}.history-shell .history-dialog{padding:20px;max-width:none;max-height:none;min-height:0;overflow:auto;overscroll-behavior:contain;width:100%;box-sizing:border-box}.history-shell .history-heading{position:sticky;top:-20px;z-index:2;margin:-20px -20px 0;padding:20px 20px 12px;background:#fffef8;border-bottom:1px solid var(--line);align-items:center}.history-heading h2{font-size:23px;line-height:1.3;margin:0;overflow-wrap:anywhere}.history-shell button,.history-shell .btn{min-height:44px}.history-shell .history-entry-title{width:100%}.history-shell .history-remove{font-size:14px;text-align:left}.history-shell .history-login input{flex:1;min-width:130px;font-size:18px}.history-shell .history-filters>input{width:100%}.history-shell .history-image{flex-basis:100%;width:100%;height:auto}.history-shell .history-attachment{min-width:0}.history-shell .history-heading>.btn{flex-shrink:0}.history-shell .history-heading>.btn:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
@media(max-width:560px){.history-shell .history-dialog{padding:16px}.history-shell .history-heading{top:-16px;margin:-16px -16px 0;padding:16px 16px 12px}.history-heading h2{font-size:21px}.history-shell .history-actions>.btn{flex:1 1 100%}}
/* A complete learning diagram stays reachable when the phone chat is short. */
.drawing-open{display:block;width:100%;padding:0;margin-top:10px;border:1px solid #d7dfcf;border-radius:14px;background:#fffef8;color:#36523d;cursor:zoom-in;text-align:center;font:inherit;overflow:hidden}.drawing-open .drawing{display:block;max-width:100%;height:auto;margin:0 auto}.drawing-open>span{display:block;min-height:44px;align-content:center;padding:7px 12px;font-size:14px;font-weight:700}.drawing-open:focus-visible{outline:3px solid var(--accent);outline-offset:3px}.diagram-dialog{width:min(680px,calc(100% - 24px))}.diagram-dialog .drawing-detail{display:block;width:100%;height:auto;max-height:calc(100dvh - 160px);object-fit:contain;background:#fffef8}.diagram-dialog .dialog-close{min-height:44px}.diagram-dialog .comfort-dialog-head{position:sticky;top:0;background:#fffef8;z-index:1}

/* Personal learning observations and conversation controls. */
.study-memory-row{display:grid;gap:8px;padding:14px 0;border-bottom:1px solid #dce3d8;overflow-wrap:anywhere}.study-memory-row p{margin:0}.study-memory-row button{justify-self:start;min-height:44px;max-width:100%;white-space:normal}#conversationSettings>label{display:flex;align-items:center;gap:10px;min-height:44px}#conversationSettings input[type=checkbox]{flex-shrink:0}#conversationTiming p{overflow-wrap:anywhere}#bargeStatus{display:block;max-width:100%;overflow-wrap:anywhere}
