.audio-note{font-size:11px;color:var(--muted);text-align:right;margin:7px 0 12px}
.sidebar{padding:20px 16px;height:100dvh;overflow-y:auto}
.sidebar nav{margin-top:22px;gap:3px;flex-shrink:0}
.sidebar .nav-item{padding:10px 12px}
.sidebar .side-note{padding:10px;margin-top:20px}
.sidebar .profile{margin-top:auto;padding-top:14px;flex-shrink:0}
.idiom-stats{padding:10px 14px;background:var(--soft);border-radius:9px;font-size:13px}
.idiom-controls{display:flex;flex-wrap:wrap;gap:16px;margin:18px 0}
.idiom-controls label{display:grid;gap:6px;flex:1;min-width:200px;font-size:12px}
.idiom-controls input,.idiom-controls select{padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--white);width:100%;font:inherit}
.idiom-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:14px;margin:20px 0;align-items:start}
.idiom-grid h2{font-size:27px;margin:12px 0}.idiom-grid p{font-size:13px;margin:9px 0}
.idiom-grid summary{cursor:pointer;font-size:12px;margin-top:12px}
.idiom-title{margin-bottom:17px}
.idiom-tabs,.idiom-actions,.idiom-set-actions{display:flex;flex-wrap:wrap;gap:9px;margin:13px 0}
.idiom-tabs .button[aria-pressed="true"]{background:var(--green);color:white}
.idiom-summary{display:flex;justify-content:space-between;gap:10px;align-items:center;background:#eaf0dd;border-radius:10px;padding:13px 16px;font-size:12px}
.idiom-summary strong{font-size:15px}
.idiom-actions .button{min-height:42px}
.idiom-set-readiness{display:flex;flex-wrap:wrap;justify-content:space-between;gap:5px 14px;align-items:center;padding:10px 13px;background:#eaf0dd;border:1px solid #d7e2c2;border-radius:9px;font-size:12px}
.idiom-set-readiness strong{font-size:13px}
.idiom-set-actions [data-id-action="set-complete"]{margin-left:auto;background:var(--green);color:#fff}
.idiom-set-actions [data-id-action="set-complete"]:disabled{background:#e4e8df;color:#60705e;cursor:not-allowed}
.idiom-set-actions [data-id-action="set-uncomplete"]{margin-left:auto}
.idiom-deck-finish{display:flex;justify-content:center;margin:16px 0}
.idiom-deck-finish .button{min-height:44px}
.idiom-action-note{margin:4px 0 12px}
.idiom-tile{display:flex;flex-direction:column;min-height:175px}
.idiom-tile h2{font-size:25px;margin:12px 0 5px}
.idiom-tile>p{margin:0 0 14px}
.idiom-tile-bottom{display:flex;justify-content:space-between;align-items:end;gap:10px;margin-top:auto}
.idiom-focus{width:100%;max-width:min(900px,calc(100vw - 226px - 80px));min-width:0;margin:0 auto}
.idiom-focus>.progress-track{margin:14px 0}
.idiom-study-card{min-height:320px;background:linear-gradient(140deg,var(--white),#edf2e4);position:relative;overflow:hidden}
.idiom-study-card:before{content:'';position:absolute;right:-48px;top:-65px;width:210px;height:210px;border:1px solid #263f3520;border-radius:50%;pointer-events:none}
.idiom-study-card h2{max-width:700px;margin:20px 0;font-size:clamp(33px,6vw,56px)}
.idiom-study-card>.button{margin-top:28px}
.idiom-reveal{margin-top:20px;display:grid;gap:13px}
.idiom-reveal .meaning{font-size:23px;line-height:1.3}
.idiom-reveal .scenario{font-size:21px}
.idiom-deck-nav{margin:14px 0}
.idiom-swipe-note{text-align:center;margin:10px 0}
.idiom-quiz-card h2{margin:12px 0 18px}
.idiom-prompt{padding:14px 17px;background:var(--paper);border-radius:10px;margin-bottom:19px}
.idiom-prompt p{font-size:18px;line-height:1.5}
.idiom-prompt p+p{font-size:13px;color:var(--muted);margin-top:9px}
.idiom-quiz-card .options{margin-bottom:18px}
.idiom-quiz-card .option{min-height:58px;text-align:left}
.idiom-quiz-card .feedback p{margin:8px 0}
.idiom-result{max-width:740px;margin:auto;text-align:center;display:grid;justify-items:center;gap:15px}
.idiom-result h2{font-size:clamp(37px,6vw,55px)}
@media(pointer:coarse){.idiom-study-card,.idiom-quiz-card{touch-action:pan-y pinch-zoom}}
@media(max-width:800px){.idiom-focus{max-width:calc(100vw - 76px - 60px)}}
@media(max-width:550px){.idiom-summary{display:grid}.idiom-actions{display:grid;grid-template-columns:1fr 1fr}.idiom-actions .button{min-height:48px;padding:10px 8px;font-size:11px}.idiom-actions .button:first-child{grid-column:span 2}.idiom-controls{display:grid;grid-template-columns:1fr;gap:10px}.idiom-controls label{min-width:0}.idiom-set-actions [data-id-action="set-complete"],.idiom-set-actions [data-id-action="set-uncomplete"]{width:100%;margin-left:0}.idiom-tile{min-height:0}.idiom-focus .lesson-card{padding:23px 19px}.idiom-study-card{min-height:300px}.idiom-quiz-card .option{font-size:13px}.idiom-prompt p{font-size:16px}.idiom-deck-nav .button{min-width:100px}}
@media(max-width:550px){.idiom-focus{max-width:calc(100vw - 40px)}}
@media(min-width:551px) and (max-height:760px){.sidebar .side-note{display:none}.sidebar nav{margin-top:16px}.sidebar .nav-item{padding:8px 10px}}
@media(max-width:550px){.sidebar{height:calc(72px + env(safe-area-inset-bottom));overflow:visible}.sidebar nav{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));margin:0;gap:0}.sidebar .nav-item{min-width:0;padding:6px 1px;gap:5px}.sidebar .nav-item span{font-size:9px;white-space:nowrap}.sidebar .side-note{display:none}}
.quiz-hint{margin:16px 0;padding:12px 15px;background:var(--paper);border:1px solid var(--line);border-radius:9px;font-size:13px}
.quiz-hint summary{cursor:pointer;font-weight:600}
.quiz-hint p{margin:10px 0}
.path-marker{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 18px;background:#eaf0dd;padding:11px 14px;border-radius:9px;font-size:12px;margin:12px 0}
.path-marker span{color:var(--muted)}
.study-guide{font-size:12px;line-height:1.65;margin:10px 0}
.study-guide summary{cursor:pointer;font-weight:600}
.study-guide ol{padding-left:22px;max-width:1000px}
.study-guide li{margin:8px 0}
body:not([data-view=other]) .content{max-width:1800px;padding:22px 28px}
body[data-view=book] .module-list{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));align-items:stretch}
body[data-view=book] .module{min-width:0;padding:15px;gap:10px;align-items:center}
body[data-view=book] .module-copy{min-width:0;flex:1}
body[data-view=book] .module h3{overflow-wrap:anywhere}
body[data-view=book] .module .button{flex-shrink:0}
body[data-view=book] .book-banner{padding:16px 20px}
body[data-view=book] .curriculum-group{padding:15px 18px;margin:10px 0}
body[data-view=words] .word-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}
body[data-view=words] .word-card{padding:16px;min-width:0}
body[data-view=words] .word-card p{min-height:0}
body[data-view=practice] .practice-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr))}
body[data-view=lesson] .lesson-container{max-width:1200px}
body[data-view=quiz] .lesson-container{max-width:1000px}
.spelling-correction{margin-top:10px}
.book-sections{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,330px),1fr));gap:12px;align-items:start}
body[data-view=book] .book-sections>.curriculum-group{margin:0}
.book-sections>.curriculum-group[open]{grid-column:1/-1}
@media(min-width:1100px){
 body[data-view=lesson] .lesson-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 28px;padding:24px}
 body[data-view=lesson] .lesson-card>.row,body[data-view=lesson] .lesson-card>.audio-note{grid-column:1/-1}
 body[data-view=lesson] .lesson-card>h2{grid-column:1;margin:0}
 body[data-view=lesson] .lesson-card>.pronunciation{grid-column:1;margin:0}
 body[data-view=lesson] .lesson-card>.meaning{grid-column:1;margin:0}
 body[data-view=lesson] .teaching-example{grid-column:2;grid-row:3/6;margin:0}
 body[data-view=lesson] .memory-hook{margin:0}
 body[data-view=lesson] .optional-practice{margin:0}
 body[data-view=lesson] .lesson-top{margin:15px 0}
}
@media(max-width:550px){
 body:not([data-view=other]):not([data-view=coach]) .content{padding:18px 16px 100px}
 body[data-view=words] .word-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr))}
 .row{min-width:0}
}
body[data-view=home] .content,body[data-view=coach] .content{max-width:1800px;padding:20px 28px}
.home-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
.home-heading h1{font-size:32px;margin:6px 0 0}
.compact-home .stats{margin:16px 0;gap:1px}
.compact-home .stat{padding:13px 18px}
.compact-home .stat span{margin-bottom:5px}
.compact-home .stat strong{font-size:27px}
.home-columns{display:grid;grid-template-columns:minmax(240px,.8fr) minmax(0,1.7fr);gap:18px}
.home-next{padding:22px;min-height:0;gap:10px}
.home-next h2{font-size:28px;margin:0;max-width:none}
.home-next p{max-width:none}
.home-next .button{margin-top:0}
.home-evidence{width:100%;font-size:11px;color:var(--lime)}
.home-evidence .progress-track{margin-top:8px;background:#ffffff35}
.home-evidence .progress-track span{background:var(--lime)}
.home-practice .section-head{margin:0 0 10px}
.home-practice .section-head h2,.home-focus .section-head h2{font-size:23px}
.home-practice .practice-grid{gap:10px}
.home-practice .practice-card{padding:16px}
.home-practice .practice-icon{margin-bottom:12px}
.home-practice .practice-card p{margin:7px 0 12px}
.home-focus{margin-top:16px;padding:14px 18px}
.home-focus .section-head{margin:0 0 7px}
.home-focus-words{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.focus-word{text-align:left;background:var(--paper);border:1px solid var(--line);border-radius:9px;padding:10px 12px;color:var(--ink)}
.focus-word strong,.focus-word span{display:block;overflow-wrap:anywhere}
.focus-word span{font-size:11px;color:var(--muted);margin-top:4px;line-height:1.5}
body[data-view=home] .disclaimer{margin-top:14px;padding-top:10px}
body[data-view=home] .footer{margin-top:10px}
/* Chat owns one viewport. Only the message log is a scrolling region. */
body[data-view=coach]{overflow:hidden}
body[data-view=coach] .main{height:var(--chat-viewport,100dvh);min-height:0;display:flex;flex-direction:column;overflow:hidden}
body[data-view=coach] .topbar{height:56px;flex:none}
body[data-view=coach] .content{width:100%;margin:0 auto;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:14px 24px}
body[data-view=coach] .page-title{flex:none;margin:0 0 12px}
body[data-view=coach] .page-title h1{font-size:28px;margin:5px 0}
body[data-view=coach] .page-title p{font-size:12px;max-width:none}
body[data-view=coach] .coach-layout{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) 260px;align-items:stretch;gap:16px}
body[data-view=coach] .coach-panel{height:100%;min-height:0;padding:16px}
body[data-view=coach] .coach-messages{min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y}
body[data-view=coach] .coach-aside{min-height:0;display:flex;flex-direction:column;gap:12px}
body[data-view=coach] .coach-aside .card{padding:14px}
body[data-view=coach] .coach-aside .button{margin-top:7px;min-height:32px;padding:7px 9px;font-size:11px}
body[data-view=coach] .coach-aside p{font-size:11px;line-height:1.45;margin:0}
body[data-view=coach] #coach-form textarea{height:56px;min-height:42px;margin:6px 0}
body[data-view=coach] #coach-form .row>small{font-size:10px;max-width:65%;line-height:1.4}
@media(min-width:1101px) and (max-height:760px){
 body[data-view=coach] .coach-aside .card:nth-child(2){display:none}
 body[data-view=coach] .page-title p{display:none}
}
@media(max-width:1100px){
 .home-columns{grid-template-columns:1fr}
 .home-next{display:grid;grid-template-columns:1fr auto;align-items:center}
 .home-next .eyebrow,.home-next h2,.home-next p{grid-column:1}
 .home-next .button{grid-column:2;grid-row:1/4}
 .home-evidence{grid-column:1/-1}
 body[data-view=coach] .coach-layout{grid-template-columns:minmax(0,1fr)}
 body[data-view=coach] .coach-aside{display:none}
}
@media(max-width:550px){
 body[data-view=home] .content{padding:18px 16px 92px}
 .home-heading h1{font-size:27px}
 .home-heading .pill{font-size:10px}
 .compact-home .stats{grid-template-columns:repeat(2,1fr)}
 .home-next{display:flex;align-items:flex-start}
 .home-practice .practice-grid,.home-focus-words{grid-template-columns:1fr}
 .home-practice .practice-card{padding:12px}
 .home-practice .practice-icon{margin:0}
 body[data-view=coach] .main{height:calc(var(--chat-viewport,100dvh) - 72px - env(safe-area-inset-bottom))}
 body[data-view=coach] .topbar{height:44px;padding:0 16px}
 body[data-view=coach] .content{padding:8px 10px}
 body[data-view=coach] .page-title{margin-bottom:8px}
 body[data-view=coach] .page-title h1{font-size:22px;margin:0}
 body[data-view=coach] .page-title .eyebrow,body[data-view=coach] .page-title p{display:none}
 body[data-view=coach] .coach-panel{padding:10px}
 body[data-view=coach] #coach-form label::after{content:''}
 body[data-view=coach] #coach-form .button{padding:9px 12px;min-height:38px}
}
@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important;transition:none!important}}
@media(max-width:550px){
 body[data-view=coach].keyboard-open .main{height:var(--chat-viewport,100dvh)}
 body[data-view=coach].keyboard-open .sidebar,body[data-view=coach].keyboard-open .topbar,body[data-view=coach].keyboard-open .page-title{display:none}
 body[data-view=coach].keyboard-open #coach-form .row>small{display:none}
}
