/* Final layout layer. One viewport and one shared quiz grid in all study modes. */
html:has(#screen-shell){height:100%;overflow:hidden}
body#learning-app:has(#screen-shell){height:var(--viewport-height,100dvh);min-height:0;overflow:hidden;background:#102a65;color:#17305c}
#screen-shell,#screen-scroll{height:100%;min-height:0;overflow:hidden}
#screen-scroll{display:flex;flex-direction:column}
body#learning-app .header{display:flex;height:44px;min-height:44px;padding:4px 16px;background:#102a65;color:#fff;border:0}
body#learning-app .header .brand{font-size:22px;color:#fff;gap:8px}
body#learning-app .header .brandmark{width:32px;height:32px}
body#learning-app .header .brand-sub{font-size:11px;color:#dce8ff}
body#learning-app .header .country{font-size:12px;color:#dce8ff}
body#learning-app #restart-home{min-height:30px;padding:3px 9px;font-size:13px}
body#learning-app #play-tools{position:static;flex:none;min-height:42px;padding:3px 16px;gap:6px;justify-content:flex-start;border-bottom:1px solid #385789}
body#learning-app #play-tools button,body#learning-app #play-tools select{min-height:32px;height:32px;font-size:13px;padding:3px 8px}
body#learning-app #play-tools #account-open{margin-inline-start:auto;max-width:190px;overflow:hidden;text-overflow:ellipsis}
body#learning-app #play-tools #sound{width:34px;min-width:34px;font-size:19px}
body#learning-app #play-tools .language-label{padding:0 3px}
body#learning-app #play-tools select{max-width:96px}
body#learning-app #play-tools .purchase-cta{display:flex;gap:6px;align-items:center}
body#learning-app main{flex:1;min-height:0;display:flex;flex-direction:column;width:100%;max-width:1440px;margin:0 auto;padding:8px 12px 0}
body#learning-app .workspace,body#learning-app:not(.paid-access) .workspace{flex:1;min-height:0;display:grid;grid-template-columns:184px minmax(0,1fr);gap:12px;width:100%;max-width:none;margin:0;align-items:stretch}
body#learning-app .sidebar,body#learning-app.focus-mode .sidebar,body#learning-app.journey-mode .sidebar,body#learning-app:not(.paid-access) .sidebar{display:block;min-height:0;padding:0}
body#learning-app .sidebar>:not(#modes):not(#play-tools){display:none}
body#learning-app #modes{display:grid;grid-template-columns:1fr;gap:8px;overflow:visible;padding:0}
body#learning-app #modes .mode{position:relative;min-height:48px;height:auto;width:100%;margin:0;padding:9px 8px;gap:7px;border-radius:12px;box-shadow:0 3px 0 #061c46;background:#e8f0ff;border:2px solid #adc8f1}
body#learning-app #modes .mode.active{background:#fff2b5;border-color:#ffda63}
body#learning-app #modes .mode strong{font-size:14px;line-height:1.2}
body#learning-app #modes .mode small{display:none}
body#learning-app #modes .mode-icon{display:grid;width:26px;flex:0 0 26px;height:26px;font-size:20px}
.access-marker{display:block;visibility:hidden;margin-inline-start:auto;font-weight:900;color:#315381;font-size:19px}
.requires-purchase .access-marker{visibility:visible}
body#learning-app .lesson,body#learning-app.journey-mode:not(.focus-mode) .lesson,body#learning-app.focus-mode .lesson{display:flex;flex-direction:column;min-width:0;min-height:0;height:100%;border:1px solid #456497;border-radius:16px;background:#102a65;box-shadow:none;overflow:hidden}
body#learning-app .lesson-top{position:static;flex:none;display:flex;align-items:center;flex-wrap:nowrap;min-height:36px;height:36px;padding:3px 12px;gap:6px;background:#071d48;color:#fff}
body#learning-app .lesson-top #lesson-label{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body#learning-app .lesson-top #count{font-size:13px;padding:2px 6px;white-space:nowrap}
body#learning-app .lesson-top #restart-session{width:30px;min-width:30px;min-height:28px;height:28px;margin-inline-start:auto;padding:0;font-size:21px}
body#learning-app .lesson-top #exit-session{min-height:28px;height:28px;padding:2px 8px;font-size:13px;white-space:nowrap;margin:0}
body#learning-app #focus-session{display:none}
body#learning-app .lesson-progress{flex:none;width:100%;max-width:none;height:4px;margin:0;background:#25467f}
body#learning-app .lesson-progress>div{background:#ffd957}
body#learning-app #exercise{position:relative;flex:1;min-height:0;width:100%;max-width:none;margin:0;padding:0;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center}
body#learning-app:not(.quiz-screen) :is(.lesson-top,.lesson-progress){display:none}
.screen-content{flex:none;max-width:none;transform-origin:top center}
body#learning-app footer,body#learning-app.focus-mode footer,body#learning-app.journey-mode:not(.focus-mode) footer,html[dir=ltr] body#learning-app footer{display:flex!important;flex:none;min-height:24px;margin:0;padding:2px 8px;color:#e1ecff;font-size:12px;justify-content:center;gap:12px}
body#learning-app footer>span,body#learning-app footer>#about-button{display:none}
body#learning-app footer a{color:#e1ecff;font-size:12px}
body#learning-app #notice{flex:none;margin:0;padding:4px 10px;font-size:12px;line-height:1.2}
/* Fixed tracks reserve room for the exam toolbar, title, media/answers, and actions. */
body#learning-app.quiz-screen #exercise{display:grid;grid-template-rows:30px minmax(60px,23%) minmax(0,1fr) 82px;align-items:stretch;justify-content:normal}
body#learning-app.quiz-screen .game-progress,body#learning-app.quiz-screen .exam-toolbar{grid-row:1;grid-column:1;min-height:0;margin:0;padding:2px 12px;display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:6px;background:#102a65;color:#e0eaff;border:0}
body#learning-app.quiz-screen .game-progress>span{display:none}
body#learning-app.quiz-screen .route-dots{display:flex;margin:0;gap:5px}
body#learning-app.quiz-screen .route-dots>span{width:19px;height:19px;font-size:11px}
body#learning-app.quiz-screen .exam-toolbar button{min-height:25px;height:25px;padding:1px 6px;font-size:12px}
body#learning-app.quiz-screen .exam-toolbar strong{font-size:20px;margin-inline-start:5px;color:#fff}
body#learning-app.quiz-screen .exam-toolbar strong.urgent{color:#ffdc70}
body#learning-app.quiz-screen .question-head{grid-row:2;grid-column:1;min-height:0;margin:0;padding:6px 14px;overflow:visible;display:flex;flex-direction:column;justify-content:center;font-size:23px}
body#learning-app.quiz-screen .question-head h2{font-size:inherit;line-height:1.25;letter-spacing:0;margin:0;color:#fff}
body#learning-app.quiz-screen .question-head p{font-size:.72em;line-height:1.15;margin:3px 0;color:#dce8ff}
body#learning-app.quiz-screen .question-head .tag{display:none}
body#learning-app.quiz-screen .question-body{grid-row:3;grid-column:1;display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr);grid-template-rows:minmax(0,1fr);gap:12px;min-height:0;margin:0;padding:4px 14px 8px;align-items:stretch;max-width:none}
.question-media{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:0;overflow:hidden}
body#learning-app.quiz-screen .question-media>*{flex:1;min-width:0;min-height:0;max-height:100%;margin:0;padding:4px;border-radius:12px}
body#learning-app.quiz-screen .question-media :is(img,svg){display:block;width:100%;height:100%;max-height:100%;min-height:0;object-fit:contain}
body#learning-app.quiz-screen .question-media :is(figure,.diagram){height:100%;display:flex;align-items:center;justify-content:center}
body#learning-app.quiz-screen .question-media :is(figcaption,.diagram-caption,.diagram-bottom){display:none}
body#learning-app.quiz-screen .question-body .answers{display:grid;grid-template-columns:1fr;grid-template-rows:repeat(4,minmax(0,1fr));gap:8px;min-height:0;height:100%;margin:0}
body#learning-app.quiz-screen .answers-label{display:none}
body#learning-app.quiz-screen .answer{font-size:18px;line-height:1.2;display:flex;align-items:center;gap:8px;height:100%;min-height:0;margin:0;padding:6px 9px;border:2px solid #6696e5;border-bottom-width:4px;border-radius:12px;color:#17305c;background:#fff;box-shadow:none;transform:none!important;transition:background .12s,border-color .12s;overflow-wrap:anywhere}
body#learning-app.quiz-screen .answer>span:last-child{min-width:0}
body#learning-app.quiz-screen .answer .letter{display:grid;place-items:center;flex:0 0 26px;width:26px;height:26px;font-size:14px;background:#2169e9;color:#fff;border:0}
body#learning-app.quiz-screen .answer.correct{background:#def6cc;border-color:#72b844;color:#204c1d}
body#learning-app.quiz-screen .answer.wrong{background:#ffe4de;border-color:#ed735c;color:#79281d}
body#learning-app.quiz-screen .answer.selected{background:#d7e7ff;border-color:#ffda63;color:#17305c}
body#learning-app.quiz-screen .answer:disabled{opacity:1}
body#learning-app.quiz-screen :is(.practice-controls,.exam-controls){position:static;grid-row:4;grid-column:1;display:grid;grid-template-columns:1fr 1fr 1fr;grid-template-rows:24px 40px;align-content:center;gap:3px 8px;width:100%;max-width:none;height:82px;min-height:0;margin:0;padding:5px 14px;transform:none;background:#071d48;border:0;border-radius:0;box-shadow:none}
body#learning-app.quiz-screen .navigation-feedback{grid-column:1/-1;grid-row:1;min-height:0;line-height:1.15;font-size:15px;text-align:center;color:#fff;display:flex;align-items:center;justify-content:center}
body#learning-app.quiz-screen .navigation-feedback.good{color:#c7f69b}
body#learning-app.quiz-screen :is(.practice-controls,.exam-controls) button{width:100%;min-width:0;min-height:0;height:40px;grid-row:2;font-size:15px;line-height:1.15;padding:3px 6px;border-radius:10px}
body#learning-app.quiz-screen :is(.practice-controls,.exam-controls) .primary{background:#ed423c;border:2px solid #ad2529;border-bottom-width:4px;color:#fff}
body#learning-app.quiz-screen :is(.practice-controls,.exam-controls) .secondary{background:#edf3ff;color:#17305c;border:2px solid #b3c8e6;border-bottom-width:4px}
body#learning-app .rotate-hint{display:none!important}
body#learning-app .journey-welcome,body#learning-app .journey-welcome.compact,body#learning-app .result,body#learning-app .exam-intro{max-width:740px;margin:0 auto;padding:16px 22px;border-radius:16px;box-shadow:none;background:#fff;color:#17305c}
body#learning-app .journey-welcome .journey-art{display:none}
body#learning-app .journey-welcome h1,body#learning-app .result h2{font-size:26px;line-height:1.2;margin:6px 0 10px}
body#learning-app .journey-welcome h2{font-size:19px;margin:8px 0}
body#learning-app .journey-welcome p,body#learning-app .result p{font-size:16px;line-height:1.35;margin:8px auto}
body#learning-app .journey-welcome small{margin:6px 0;font-size:13px}
body#learning-app .journey-welcome .journey-cta{min-height:42px;font-size:18px;margin:10px auto}
body#learning-app .date-choices,body#learning-app .experience-choices{margin:8px 0;gap:8px}
body#learning-app .date-choices button,body#learning-app .experience-choices button{min-height:44px;font-size:16px;padding:6px}
body#learning-app .game-badge,body#learning-app .result-emblem{width:48px;height:48px;font-size:25px;margin:4px auto}
body#learning-app .promo-video{max-width:260px;margin:8px auto 0;padding:4px;gap:3px}
body#learning-app .promo-video video{max-height:120px}
body#learning-app .promo-video-download{font-size:12px}
body#learning-app .daily-entry{margin:8px auto}
body#learning-app .daily-entry p{margin:4px 0}
body#learning-app .result-stats{margin:8px 0;gap:20px}
body#learning-app .result-stats strong{font-size:26px}
body#learning-app .topic-results{grid-template-columns:1fr 1fr;gap:6px;margin:8px auto}
body#learning-app .topic-results>div{padding:6px;font-size:13px;gap:4px}
#question-explanation{width:min(620px,94vw);max-height:90dvh;color:#17305c;padding:20px}
#explanation-content{font-size:18px;line-height:1.5}
#explanation-content :is(img,svg){max-height:40dvh;max-width:100%;object-fit:contain}
#explanation-close{width:100%;margin-top:8px}
/* Feature offers own purchase/login. Language and roast settings sit in the header. */
body#learning-app :is(#account-open,#purchase-open,#restart-home,#restart-session,#reset,#sound){display:none!important}
body#learning-app .header{height:auto;flex:none;flex-wrap:wrap;gap:4px 12px}
body#learning-app .header-end{min-width:0;max-width:100%;margin-inline-start:auto;gap:6px}
body#learning-app .header .country{display:none}
body#learning-app .header #play-tools{display:flex;flex-wrap:wrap;position:static;min-height:0;height:auto;max-width:100%;padding:0;margin:0;gap:5px;border:0;background:transparent;justify-content:flex-end}
body#learning-app .header #play-tools button,body#learning-app .header #play-tools select{font-size:14px;height:32px;min-height:32px}
body#learning-app .header #play-tools .language-label>span{display:none}
body#learning-app .lesson-top #exit-session{margin-inline-start:auto}
body#learning-app .game-badge.diagnosis-score{display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;gap:2px;width:84px;height:84px;padding:4px;margin:10px auto 16px;border-radius:50%;transform:none;white-space:nowrap;line-height:1;box-sizing:border-box}
body#learning-app .diagnosis-score strong{font-size:28px;line-height:1}
body#learning-app .diagnosis-score span{font-size:18px;line-height:1}
/* Phones use one vertical flow, including when the device is turned. */
@media(max-width:700px), (pointer:coarse) and (max-width:1000px){
 body#learning-app .header{min-height:44px;padding:4px 8px}
 body#learning-app .header .brand-sub{display:none}
 body#learning-app main{padding:4px 4px 0}
 body#learning-app .workspace,body#learning-app:not(.paid-access) .workspace{display:flex;flex-direction:column;gap:6px}
 body#learning-app .sidebar{flex:none}
 body#learning-app #modes{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 body#learning-app #modes .mode{min-height:36px;padding:5px 3px;gap:2px;justify-content:center;border-radius:8px}
 body#learning-app #modes .mode strong{font-size:14px}
 body#learning-app #modes .mode-icon{display:none}
 body#learning-app #modes .access-marker{font-size:12px;margin-inline-start:0}
 body#learning-app .lesson,body#learning-app.journey-mode:not(.focus-mode) .lesson,body#learning-app.focus-mode .lesson{flex:1;height:100%;min-height:0;border:0;border-radius:10px;background:#fff;overflow:hidden}
 body#learning-app .lesson-top{border-radius:10px 10px 0 0;min-height:36px;height:auto;padding:4px 8px;flex-wrap:wrap}
 body#learning-app #exercise{align-items:stretch;justify-content:center;padding:0}
 body#learning-app.quiz-screen #exercise{display:grid;grid-template-rows:auto var(--mobile-question-height,72px) minmax(0,1fr) 86px;align-items:stretch;justify-content:normal}
 body#learning-app .screen-content{width:100%;max-width:100%}
 body#learning-app.quiz-screen .question-head{min-height:0;padding:10px 8px;font-size:24px;background:#102a65}
 body#learning-app.quiz-screen .question-head h2{font-size:inherit;line-height:1.35}
 body#learning-app.quiz-screen .question-head p{font-size:16px;line-height:1.4}
 body#learning-app.quiz-screen .question-body{display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,.85fr) minmax(0,1.15fr);gap:6px;padding:4px 6px 6px}
 body#learning-app.quiz-screen .question-body:has(.question-media:empty){grid-template-rows:minmax(0,1fr)}
 body#learning-app.quiz-screen .question-media{width:100%;gap:6px;overflow:hidden;background:#fff}
 body#learning-app.quiz-screen .question-media:empty{display:none}
 body#learning-app.quiz-screen .question-media>*{flex:1;min-width:0;height:100%;min-height:0;max-height:100%;padding:0;margin:0;border:0;border-radius:0;box-shadow:none}
 body#learning-app.quiz-screen .question-media :is(img,svg){width:100%;height:100%;max-width:100%;max-height:none;object-fit:contain}
 body#learning-app.quiz-screen .question-body .answers{gap:5px;height:100%}
 body#learning-app.quiz-screen .answer{min-height:0;font-size:19px;line-height:1.25;padding:4px 7px;gap:6px;border-radius:10px;overflow-wrap:break-word}
 body#learning-app.quiz-screen .answer .letter{width:26px;height:26px;flex-basis:26px;font-size:15px}
 body#learning-app.quiz-screen :is(.practice-controls,.exam-controls){height:86px;grid-template-rows:24px 44px;gap:4px;padding:5px 6px;border-radius:0 0 10px 10px}
 body#learning-app.quiz-screen .navigation-feedback{font-size:16px;line-height:1.2;padding:0 2px}
 body#learning-app.quiz-screen :is(.practice-controls,.exam-controls) button{height:44px;font-size:15px;padding:5px 3px;line-height:1.2}
 body#learning-app.quiz-screen :is(.game-progress,.exam-toolbar){height:32px;padding:2px 6px;flex-wrap:nowrap}
 body#learning-app.quiz-screen .exam-toolbar button{height:28px;font-size:13px}
 body#learning-app .journey-welcome,body#learning-app .journey-welcome.compact,body#learning-app .result,body#learning-app .exam-intro{width:100%;max-width:none;padding:16px 12px;border-radius:10px}
 body#learning-app .journey-welcome h1,body#learning-app .result h2{font-size:28px;line-height:1.3}
 body#learning-app .journey-welcome p,body#learning-app .result p,body#learning-app .exam-intro p{font-size:18px;line-height:1.5}
 body#learning-app .promo-video{width:100%;max-width:440px;padding:4px;margin:12px auto 0}
 body#learning-app .promo-video video{width:100%;max-height:260px}
 body#learning-app .promo-video-download{font-size:16px}
 body#learning-app footer a{font-size:14px}
 body#learning-app footer,body#learning-app.focus-mode footer{min-height:32px;padding:6px 4px}
}
