/* SKY-034: shared study surfaces, preserving the map and intermediate screens. */
body.study-surface{background:#0b2d5b}
.study-surface .fixed-sky{background:#0b2d5b}
.study-surface .sky-backdrop,.study-surface .fixed-sky::after{visibility:hidden}
.study-surface .shell{width:100%;max-width:none;min-height:100dvh;background:#0b2d5b}
.study-surface .shell>header{display:flex;border-bottom:1px solid #557394;padding-bottom:18px;margin-bottom:24px}
body.study-surface:has(:is(#lesson,#notes,#calendar).screen.active) .shell>header{display:flex}
/* Owner review: reading and answering start with their own navigation/content. */
body.focus-surface .shell>header{display:none!important}
.study-surface main{max-width:1120px;margin-inline:auto}
.study-surface .panel,.study-surface .reading-panel{background:transparent;box-shadow:none;border:0;max-height:none}
.study-surface :is(#lessonbody,#licensebody,#statsbody,#profile .panel){max-height:none;overflow:visible}
.study-surface :is(p,h2,h3,button,summary,label){overflow-wrap:anywhere}
.study-surface details>summary:not(.trainer-dropdown>summary){display:flex;align-items:center;justify-content:flex-start;gap:8px;min-height:44px;cursor:pointer;list-style:none}
.study-surface details>summary:not(.trainer-dropdown>summary)::after{content:'⌄';position:static;float:none;margin:0;flex:none}
.study-surface details[open]>summary:not(.trainer-dropdown>summary)::after{content:'⌃'}
.study-surface summary::-webkit-details-marker{display:none}
#home .intro .route-label,#home .intro #continue-flight span{font:600 22px/1.35 'Playfair Display',Georgia,serif;text-transform:uppercase;letter-spacing:.02em}
#home :is(.intro h1,.intro .route-label,#continue-flight,.lessontext){text-shadow:0 2px 3px #00142ee6,0 5px 12px #00142eb8}
#home :is(.intro-plane,.route-link){filter:drop-shadow(0 3px 5px #00142eb3)}
#home .intro-plane{cursor:pointer;pointer-events:none}
#home .intro-plane-hitbox{grid-column:2;grid-row:2;align-self:center;justify-self:center;width:100%;max-width:320px;min-height:76px;padding:0;margin:0;background:none;border:0;box-shadow:none;border-radius:10px}
#home .intro-plane-hitbox .intro-plane{display:block;pointer-events:none}
#home .orb{box-shadow:0 4px 10px #00142e9e,inset 0 0 16px #7cc0ff25}
.law-reading>p,.law-case p,.law-explanation p,.reading-panel .theory p{font-size:var(--study-text-size,18px);line-height:1.65;text-align:justify;hyphens:auto;overflow-wrap:break-word;max-height:none}
body.study-surface #lessonbody :is(.law-reading>p,.law-case p,.law-explanation p,.theory p){font-size:var(--study-text-size,18px);line-height:1.65;text-align:justify;hyphens:auto;max-height:none}
.law-reading h2{font-size:calc(var(--study-text-size,18px)*1.33)}
.law-reading h3{font-size:var(--study-text-size,18px)}
.law-tabs .lesson-tab svg{display:none}
.study-pager,.law-pager{display:grid;grid-template-columns:minmax(90px,1fr) auto auto minmax(90px,1fr);align-items:center;gap:18px;margin:24px 0 8px}
.law-pager>.secondary{grid-column:1;grid-row:1}.law-pager>.text-size{grid-column:2;grid-row:1}.law-pager>.page-count{grid-column:3;grid-row:1}.law-pager>.primary{grid-column:4;grid-row:1}
.study-pager>.primary,.law-pager>.primary{justify-self:end}
.study-pager>.secondary,.law-pager>.secondary{justify-self:start}
.text-size{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;flex:none}
.text-size button{min-width:44px;width:44px;min-height:44px;margin:0;padding:4px;background:transparent;border:1px solid #557394;border-radius:10px;color:#e6f1ff;box-shadow:none}
.text-size output{min-width:24px;text-align:center;font:400 14px Inter,system-ui,sans-serif}
.page-count{font-size:14px;text-align:right;white-space:nowrap}.page-count small{display:block}
.text-action{min-height:44px;padding:8px 0;border:0;background:none;color:#7cc0ff;box-shadow:none;width:auto;cursor:pointer}
.finish-action{display:block;margin:6px auto 0;min-height:44px;text-align:center}
.law-complete,.trainer-result{text-align:center;padding:24px 0}
.result-actions{display:flex;justify-content:center;gap:16px;margin-top:24px}
.result-actions button{margin:0;flex:1;max-width:320px}
.design-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:24px 0}
.design-metrics>div{background:#123968;border:1px solid #557394;border-radius:16px;padding:20px 12px;text-align:center}
.design-metrics b{display:block;font-size:28px}.design-metrics span{display:block}
.exam-history-row{display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between;padding:14px 0;border-bottom:1px solid #557394}
.error-lesson{border:1px solid #557394;border-radius:16px;padding:18px;margin:16px 0;background:#123968}
.solo-action{text-align:right;margin:24px 0}.solo-action button{margin:0}
.trainer-settings{display:grid;grid-template-columns:1fr 1fr;gap:24px}
.trainer-mode{display:flex;gap:8px}.trainer-mode button{flex:1;text-align:center;min-height:44px}
.trainer-mode button::before,.trainer-mode button::after{display:none}
.trainer-mode .active{background:#7cc0ff;color:#0b2d5b}
.trainer-question,#licensebody .option,.trainer-explanation .explanation-text{font:400 var(--study-text-size,18px)/1.6 Inter,system-ui,sans-serif;white-space:normal;overflow:visible;text-overflow:clip;max-height:none}
body.study-surface #licensebody :is(.trainer-question,.option,.explanation-text){font:400 var(--study-text-size,18px)/1.6 Inter,system-ui,sans-serif}
#licensebody .option{text-align:left;align-items:flex-start;overflow-wrap:anywhere;height:auto;min-height:56px}
#licensebody .option>span:last-child{min-width:0;white-space:normal;overflow:visible;text-overflow:clip}
#licensebody .option.correct::after,#licensebody .option.wrong::after{display:none}
#licensebody .option[disabled]{opacity:1}
.timer-warning,#trainer-time-note{color:#fbbf24}#trainer-time-note:empty{display:none}
.profile-link{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:56px;text-align:left;border:1px solid #557394;border-radius:12px;padding:14px 16px;margin:12px 0;background:#123968;color:#e6f1ff;box-shadow:none}
.profile-link::after{content:'›';margin-left:12px}
#profile .panel{padding:0}#profile-mascot{display:none}
.profile-account-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}
.profile-account-actions button{margin:0}.profile-program{display:block;margin:18px 0}
button:focus-visible,a:focus-visible,summary:focus-visible,[role=button]:focus-visible{outline:3px solid #7cc0ff;outline-offset:4px}
/* Fields use their existing border for focus, never an additional blue ring. */
:is(input,select,textarea,[contenteditable="true"]):focus{outline:none;box-shadow:none;border-color:#e6f1ff}
.trainer-dropdown:focus-within{border-color:#e6f1ff}
.trainer-dropdown>summary:focus-visible{outline:none}
.trainer-dropdown-options label:has(input:focus-visible){background:#e6f1ff26;color:#e6f1ff}
@media(min-width:700px){.study-surface .shell{margin-left:170px;width:calc(100% - 170px)}}
@media(max-width:699px){
 .study-surface .shell{padding-bottom:calc(110px + var(--sky-safe-bottom));margin:0}
 .study-surface .shell>header{padding-bottom:14px;margin-bottom:22px}
 #home .intro .route-label,#home .intro #continue-flight span{font-size:18px}
 .study-pager,.law-pager{grid-template-columns:1fr 1fr;gap:14px}
 .study-pager>.text-size,.law-pager>.text-size{grid-column:1;grid-row:1;justify-self:start}
 .study-pager>.page-count,.law-pager>.page-count{grid-column:2;grid-row:1;justify-self:end}
 .study-pager>.secondary,.law-pager>.secondary{grid-column:1;grid-row:2;width:100%}
 .study-pager>.primary,.law-pager>.primary{grid-column:2;grid-row:2;width:100%}
 .result-actions,.profile-account-actions{flex-direction:column}.result-actions button{width:100%;max-width:none}
 .solo-action .primary,.trainer-setup>#trainer-start,.trainer-setup>#trainer-resume,#mobile-update{width:100%}
 .trainer-settings{grid-template-columns:1fr;gap:12px}
 .design-metrics{gap:8px}.design-metrics>div{padding:16px 6px}.design-metrics b{font-size:24px}
 .design-metrics span{font-size:12px}
}
@media(max-width:350px){#home .intro .route-label,#home .intro #continue-flight span{font-size:17px}}

/* D26: one outer frame; reading surfaces and landscape surfaces share geometry. */
:root{--study-padding:24px;--study-glass:linear-gradient(135deg,#264e7099,#173a5b91);--study-shadow:inset 0 1px #e7f7ff33,0 10px 28px #071c342e}
body .shell{max-width:none;width:100%;min-height:100dvh;background:transparent}
body .shell>header{display:flex!important;width:100%;border-bottom:1px solid #c8e6f366;margin-bottom:24px;padding-bottom:18px}
body .shell>main{width:100%;max-width:none;margin:0}
body.study-surface .shell{background:transparent}
.shell>main>.screen{max-width:none!important;top:0;margin-inline:0}
.screen{width:100%;min-width:0}
.screen:not(#home){padding:var(--study-padding);border:1px solid #c8e6f3a3;border-radius:18px;background:var(--study-glass);backdrop-filter:blur(18px) saturate(115%);box-shadow:var(--study-shadow)}
.screen.active>:is(.panel,.lesson-screen,#blockbody){width:100%;max-width:none;margin:0;padding:0;border:0;box-shadow:none;background:transparent!important;backdrop-filter:none!important;max-height:none;overflow:visible}
body.study-surface .fixed-sky{background:#0b2d5b}
body.study-surface:not(.focus-surface) .sky-backdrop,body.study-surface:not(.focus-surface) .fixed-sky::after{visibility:visible}
body.focus-surface .sky-backdrop,body.focus-surface .fixed-sky::after{visibility:hidden}
body.focus-surface .screen:not(#home).active{background:#0b2d5b;backdrop-filter:none;box-shadow:none;border-color:transparent}
body.focus-surface #lesson .reading-panel{padding:0;max-width:none;background:transparent!important;border:0;box-shadow:none;backdrop-filter:none}
.screen :is(input,select,textarea){max-width:100%;min-width:0}
.screen :is(.section-toolbar,.trainer-setup,.trainer-result,.law-complete){max-width:none}
body #calendar .panel{height:auto;max-height:none}
#home .intro{width:100%;max-width:none;background:var(--study-glass);backdrop-filter:blur(18px) saturate(115%);border:0;border-radius:18px;padding:var(--study-padding);box-shadow:var(--study-shadow)}
#lesson .lesson-tabs{max-width:none}
#home :is(.intro h1,.intro .route-label,#continue-flight,.lessontext){text-shadow:none}
#home .intro :is(.route-label,.continue-flight span,h1){text-shadow:none;filter:none}
#home :is(.intro-plane,.route-link){filter:none}
#home .path .map-step{display:grid;grid-template-columns:54px minmax(0,1fr);height:auto;min-height:124px;padding-block:14px}
#home .map-step>.orb{grid-column:1;grid-row:1;width:44px;min-width:44px;max-width:44px;height:44px;padding:0}
#home .lessontext{grid-column:1/-1;grid-row:1;width:100%;min-height:44px;background:var(--study-glass);backdrop-filter:blur(18px) saturate(115%);border:0;border-radius:999px;padding:10px 18px 10px 60px;margin:0;box-shadow:var(--study-shadow)}
#home .intro .route-label,#home .intro #continue-flight span{font-size:16px}
#home .intro h1{font-size:28px}
#home .intro-plane-hitbox{justify-self:end;max-width:320px;overflow:visible}
#home .intro-plane{height:auto;max-width:none;width:100%;object-fit:contain;mask-image:none;animation:aligned-aircraft-flight 3.6s ease-in-out infinite;transform:translateX(var(--plane-visible-shift,0%)) scaleX(-1)}
@keyframes aligned-aircraft-flight{0%,100%{transform:translate(var(--plane-visible-shift,0%),0) scaleX(-1)}50%{transform:translate(var(--plane-visible-shift,0%),-5px) scaleX(-1)}}
.study-pager{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:16px;align-items:center}
.study-pager>.secondary{grid-column:1;grid-row:1}.study-pager>.text-size{grid-column:2;grid-row:1}.study-pager>.primary{grid-column:3;grid-row:1}
.study-pager>.page-count{grid-column:1/-1;grid-row:2;text-align:center;justify-self:center;white-space:normal}
.study-pager .page-count small{display:inline;font-size:inherit}.study-pager .page-count small::before{content:' · '}
.study-pager button{margin:0;align-self:center}.finish-action{margin:0 auto}
@media(min-width:700px){body .shell{margin-left:170px;width:calc(100% - 170px)}}
@media(max-width:699px){:root{--study-padding:16px}body .shell{margin:0;width:100%}body .shell>header{display:grid!important;grid-template-columns:minmax(0,1fr) 44px}.screen:not(#home){border-radius:16px}#home .intro{border-radius:16px}#home .intro .route-label,#home .intro #continue-flight span{font-size:13px}#home .intro h1{font-size:23px}.study-pager{gap:12px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.study-pager>.secondary{grid-column:1;grid-row:1}.study-pager>.primary{grid-column:2;grid-row:1}.study-pager>.text-size{grid-column:1/-1;grid-row:2;justify-self:start}.study-pager>.page-count{grid-row:3}}
@media(max-width:350px){#home .intro .route-label,#home .intro #continue-flight span{font-size:12px}#home .intro h1{font-size:21px}}
@supports not(backdrop-filter:blur(1px)){.screen:not(#home),#home .intro,#home .lessontext{background:#173a5bed}}
@media(prefers-reduced-motion:reduce){#home .intro-plane{animation:none;transform:translateX(var(--plane-visible-shift,0%)) scaleX(-1)}}

/* Review can skip a question, retry a wrong answer or finish at any point. */
.study-pager.review-pager{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.study-pager.review-pager>.secondary{grid-column:1;grid-row:1}
.study-pager.review-pager>.primary{grid-column:2;grid-row:1}
.study-pager.review-pager>.text-size{grid-column:1;grid-row:2}
.study-pager.review-pager>.page-count{grid-column:2;grid-row:2;justify-self:end}

/* Page picker retains direct navigation without requiring every page to be opened. */
.law-pager{grid-template-columns:auto auto auto auto;justify-content:space-between;gap:12px}
.law-pager>.primary,.law-pager>.secondary{width:auto;min-height:44px;padding:8px 14px}
.law-pager>.law-page-menu{grid-column:3;grid-row:1;position:relative;margin:0;padding:0;border:0}
.law-page-menu>summary{display:flex;align-items:center;gap:8px;min-height:44px;cursor:pointer;list-style:none;color:var(--ice)}
.law-page-menu>summary::-webkit-details-marker{display:none}
.law-page-menu svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6}
.law-page-menu>.questionnav{position:absolute;z-index:12;right:0;bottom:100%;width:min(300px,calc(100vw - 64px));max-height:40vh;overflow:auto;padding:12px;margin:0 0 8px;background:#113765;border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 24px #001a3360}
.law-page-menu .questionnav button{min-height:44px}
.trainer-time-placeholder>p{box-sizing:border-box;min-height:44px;display:flex;align-items:center;margin:5px 0 0;padding:9px 13px}
.trainer-setup .mode-description{display:grid}
.trainer-setup .mode-description>span{grid-area:1/1}
.trainer-setup .mode-description>[aria-hidden=true]{visibility:hidden}
@media(max-width:699px){
 .law-pager{grid-template-columns:auto auto}
 .law-pager>.law-page-menu{grid-column:2;grid-row:1;justify-self:end}
 .law-pager>.primary,.law-pager>.secondary{width:auto}
 .study-pager.review-pager>.page-count{font-size:12px}
}
@media(max-height:760px){.trainer-time-placeholder>p{min-height:40px}}


/* Commercial launch: quiet containers and compact screens, with scroll when needed. */
body .shell>header,body.study-surface .shell>header{border-bottom:0;margin-bottom:12px;padding-bottom:0}
#home .intro,#home.school-demo .intro{background:none;backdrop-filter:none;box-shadow:none;border:0}
.screen:is(#block,#notes){background:none;backdrop-filter:none;box-shadow:none;border:0}
#home .lessontext{width:fit-content;max-width:100%;justify-self:start}
#statsbody>h2{margin:0 0 12px;font-size:28px}
#statsbody .course-summary{padding:0;margin:0 0 12px}
#statsbody .course-summary h3{margin:0 0 6px}
#statsbody .course-summary p{margin:6px 0}
#statsbody .solo-action{margin:12px 0}
#statsbody .solo-action button{margin:0;min-height:44px}
#statsbody>h3{font-size:19px;margin:14px 0 4px}
#statsbody>.muted{margin:4px 0;font-size:13px}
#statsbody .design-metrics{margin:10px 0;gap:8px}
#statsbody .design-metrics>div{padding:12px 6px}
#statsbody .design-metrics b{font-size:24px}
#statsbody details{margin:8px 0}
.school-demo-callout{position:relative;z-index:1;width:fit-content;max-width:100%;box-sizing:border-box;margin:0 auto;padding:24px 38px;border:1px solid #c8e6f355;border-radius:999px;background:var(--study-glass);backdrop-filter:blur(18px) saturate(115%);box-shadow:var(--study-shadow)}
.school-demo-callout .school-demo-brand{max-width:100%}
.school-demo-callout .school-demo-brand img{max-width:min(230px,100%)}
.native-image-viewer .image-toolbar{padding-top:calc(27px + var(--native-safe-top,0px))}
/* Calendar shares the application header. */
body #calendar .panel{height:auto;min-height:0;max-height:none}
#calendarbody{height:auto}
#calendarbody .study-calendar{flex:none;grid-template-rows:32px repeat(var(--calendar-weeks,6),minmax(44px,auto))}
#calendarbody .study-day{font-size:clamp(15px,3.9vw,19px);min-height:36px}
#calendarbody .study-day b{font-size:clamp(18px,4.8vw,24px)}
#calendarbody .study-day b svg{width:clamp(18px,4.8vw,24px);height:clamp(18px,4.8vw,24px)}
@media(min-width:700px){body #calendar .panel{max-width:720px;margin:auto}}
@media(max-width:699px){#statsbody>h2{font-size:24px}#statsbody .design-metrics>div{padding:8px 4px}.school-demo-callout{padding:20px 24px}}

/* Page numbers expand in the document below navigation, like exam questions. */
.law-pager>.law-page-toggle{grid-column:3;grid-row:1;display:flex;align-items:center;gap:8px;background:transparent;border:0;color:var(--ice);padding:0;min-height:44px}.law-page-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6}.law-pager>.law-page-grid{grid-column:1/-1;grid-row:3;position:static;width:100%;max-height:none;box-shadow:none;margin:8px 0 0;padding:0;background:transparent;border:0}.law-page-grid[hidden]{display:none}.law-page-grid button{min-height:44px}@media(max-width:699px){.law-pager>.law-page-toggle{grid-column:2;justify-self:end}}

/* Match the time control geometry in both modes, including short viewports. */
.trainer-time-placeholder .trainer-dropdown{border-color:transparent;background:transparent}
.trainer-time-placeholder .trainer-dropdown>summary::after{visibility:hidden}

/* Owner rule: every button has 5 px of external space on each side. */
button,input[type="button"],input[type="submit"],[role="button"]{margin:5px!important;max-width:calc(100% - 10px);box-sizing:border-box}

/* Reserve button margins in fixed tracks; inset and centered actions keep their anchors. */
body .shell>header{grid-template-columns:minmax(0,1fr) 54px}
body .shell>header #profile-avatar{width:44px;min-width:44px;max-width:44px;height:44px}
#calendarbody .calendar-controls{grid-template-columns:52px minmax(0,1fr) 52px}
#calendarbody .calendar-controls button{width:42px;min-width:42px;max-width:42px}
.finish-action{position:relative;left:calc(50% - 5px);transform:translateX(-50%);width:max-content}

#home .lessontext :is(h3,span){overflow-wrap:anywhere}

@media(min-width:700px) and (max-width:1099px){.navwrap{width:88px}}
@media(min-width:1100px){.navwrap{width:150px}.nav{gap:10px;padding-inline:10px}}

/* Pager labels must not shrink below their text because of global 5px margins. */
.law-pager>#lawprev,.law-pager>#lawnext{width:max-content;min-width:max-content;max-width:none;white-space:nowrap;word-break:normal;overflow-wrap:normal}

/* Preserve authored line breaks, lists and paragraph spacing in lesson text. */
.law-reading>p{white-space:pre-wrap}

/* Keep mobile exam setup compact, including resume and error-review actions.
   Natural document scrolling remains available for small screens/large text. */
@media(max-width:699px){
 #license-exam:has(.trainer-setup){padding:12px}
 .trainer-setup{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px}
 .trainer-setup>*{grid-column:1/-1;min-width:0}
 .trainer-setup>p{margin:0;line-height:1.4}
 .trainer-setup h2{font-size:26px;margin:0}
 .trainer-setup .trainer-mode{margin:0;padding:2px}
 .trainer-setup .trainer-mode button{min-height:44px;padding:8px 6px}
 .trainer-setup .trainer-settings{gap:6px}
 .trainer-setup .trainer-setting{margin:0}
 .trainer-setup .trainer-dropdown>summary{min-height:44px}
 .trainer-setup>p:not(:first-of-type){order:1;font-size:13px}
 .trainer-setup>#trainer-start,.trainer-setup>#trainer-resume{order:2;min-height:44px;padding:8px 10px}
 .trainer-setup:has(#trainer-resume)>#trainer-start{grid-column:1}
 .trainer-setup>#trainer-resume{grid-column:2}
 .trainer-setup>#trainer-errors{order:3;min-height:44px;padding:8px 10px}
}
@media(min-width:360px) and (max-width:699px){
 .trainer-setup .trainer-settings{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
 .trainer-setup .trainer-setting>div:first-child{min-height:2.8em;line-height:1.4}
}


/* Approved time selector: shared label/edges; disabled training value has no arrow. */
.trainer-time-placeholder .trainer-dropdown{border:1px solid var(--line);background:#60758b33;opacity:.55}
.trainer-time-placeholder .trainer-dropdown>summary::after{visibility:hidden}
.trainer-time-placeholder .trainer-dropdown>summary{cursor:default;color:#c1c9d1}
.trainer-setup>h2,.trainer-setup>p,.trainer-setup>.mode-description,.trainer-setup>.trainer-mode,.trainer-setup>.trainer-settings{margin-left:5px;margin-right:5px;width:auto;max-width:none}
