/* One compact DOM for phones and tablets. Rotation only changes CSS placement,
   so the live canvas, playback, selected dial and notes stay mounted. */
@media screen and (max-width:1400px){
 .app-shell,.app-shell:has(>.sidebar-premium){grid-template-columns:minmax(0,1fr)}
 .sidebar.sidebar-premium{position:fixed;inset:0 auto 0 0;width:min(340px,calc(100vw - 44px));height:100dvh;z-index:90;transform:translateX(-105%);padding:22px 18px; padding-top:max(22px,env(safe-area-inset-top));padding-bottom:max(24px,env(safe-area-inset-bottom));overscroll-behavior:contain}
 .sidebar:not(.open){visibility:hidden;pointer-events:none}.sidebar.open{visibility:visible;transform:translateX(0)}
 .sidebar .sidebar-close{display:block;align-self:flex-end;min-width:44px;min-height:44px;border:1px solid #bac5a5;border-radius:9px;background:transparent;color:#fff9ed;cursor:pointer}
 .sidebar .side-masthead{padding-right:40px}.menu-backdrop{z-index:80}
 .mobile-menu{display:grid}.mobile-brand{display:flex}.topbar .breadcrumb{display:none}
 /* The document already reserves the sticky header through scroll-padding. */
 .content :is(.m499-session,#putter-workspace,#strategy-play503){scroll-margin-top:12px}
 .strategy-page #strategy-play503{scroll-margin-top:72px!important}
 .pwa497-network,.pwa497-update-toast{bottom:calc(var(--m390-nav-height,66px) + 10px)}
 .pwa497-network:not([hidden])~.pwa497-update-toast{bottom:calc(var(--m390-nav-height,66px) + 68px)}
}

@media screen and (min-width:761px) and (max-width:1400px) and (min-height:501px){
 :root{--m390-head-height:calc(72px + env(safe-area-inset-top));--m390-nav-height:calc(74px + env(safe-area-inset-bottom));--m497-gutter:28px}
 .main>.topbar{margin-bottom:22px;padding-inline:28px;gap:18px}
 .topbar .mobile-brand{max-width:220px}.topbar .mobile-brand .flightlab-wordmark strong{font-size:28px}
 .m390-nav{padding-inline:max(28px,env(safe-area-inset-left)) max(28px,env(safe-area-inset-right));gap:12px}
 .m390-nav a{flex-direction:row;gap:10px;font-size:13px;min-height:52px}.m390-nav svg{width:24px;height:24px}
 .content{max-width:1280px;margin-inline:auto}
 .content :is(.compact-title,.page-head,.independent-heading) h1{font-size:36px;line-height:1.2}
 .content .learn-stage-context .learn-stage-tabs a{font-size:14px}
 .content :is(button,summary){touch-action:manipulation}
 .m390-page-index{max-width:680px}.m390-stage{gap:16px}.m390-stage>span{font-size:13px}
 .m390-home{width:100%;max-width:1100px;padding:0 28px 36px;box-sizing:border-box}
 .m390-home-head{min-height:90px}.m390-hero{padding:36px}.m390-hero h1{font-size:40px;max-width:22ch}
 .m390-hero p{max-width:65ch;font-size:17px}.m390-quick>div,.m497-field>div{grid-template-columns:repeat(4,minmax(0,1fr))}
 .m390-home .learn-roadmap-visual{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .m390-explore,.notebook-layout{max-width:1100px;margin-inline:auto}
 .content textarea{scroll-margin-block:100px;min-height:180px}
 .content :is(.formation436-grid,.module436-grid){gap:22px}
 .m390-strategy-jumps,.mobile-workspace-jumps{top:var(--m390-head-height)}
 .m499-shortcut{width:auto;max-width:100%;padding-inline:20px;border:1px solid #d5dece;border-radius:10px;font-size:14px}
 .m499-session{--m499-preview:clamp(280px,38svh,460px);border-radius:18px}
 .m499-picker{gap:8px;padding:12px}.m499-picker button{min-height:48px;font-size:13px;padding:10px}
 .m499-control-panel{padding:18px 20px;max-height:310px}
 .content .m499-more>summary{padding:14px 18px;font-size:14px}
 .lab-premium .m499-pose{height:clamp(680px,calc(100svh - 190px),880px);grid-template-rows:auto auto minmax(280px,1fr) auto auto}
 .lab-premium .m499-pose .mobile-scene-heading{min-height:56px;padding:8px 14px;gap:8px}
 .lab-premium .m499-pose .mobile-scene-heading>strong{font-size:12px;letter-spacing:.04em}
 .lab-premium .m499-pose .mobile-scene-heading button{min-width:44px;min-height:44px}
 .lab-premium .m499-pose .lab-view-toolbar{padding:8px 14px;min-height:64px;box-sizing:border-box;display:block}
 .lab-premium .m499-pose .lab-view-toolbar .lie-hand-toggle{width:100%}
 .lab-premium .m499-pose .lab-view-toolbar .lie-hand-toggle button{font-size:13px;min-height:44px;flex:1}
 .lab-premium .m519-playback{padding:10px 16px;gap:20px}
 .lab-premium .m519-play-slot{grid-column:1;grid-row:1;justify-content:flex-start}
 .lab-premium .m519-timeline{grid-column:2;grid-row:1}
 .lab-premium .m519-play-slot .pose-transport-play{min-width:142px;font-size:14px}
 .lab-premium .m519-timeline label{font-size:12px}.lab-premium .m519-timeline input[type=range]{min-height:40px}
 .lab-premium .m499-pose .lab-field-picker button{font-size:13px;min-height:48px;padding:10px}
 .lab-premium .m499-pose .lab-group-dial{padding:16px}
 .lab-premium .m499-pose .lab-group-dial>label{font-size:15px}.lab-premium .m499-pose .lab-group-dial output{font-size:30px}
 .lab-premium .m499-pose .lab-group-dial input{min-height:44px;margin-block:8px}
 .lab-premium .m499-pose .lab-dial-caption{font-size:12px;line-height:1.6}
 .lab-premium .m499-pose .pose-stage-flight{left:12px;bottom:12px;min-height:44px;font-size:12px;padding:10px 16px;max-width:calc(100% - 128px)}
 .lab-premium .m499-pose .pose-stage-zoom{right:12px;bottom:12px}
 .lab-premium .mobile-scene-expanded .m499-pose{height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:620px;flex:none}
 .lab-premium .mobile-scene-expanded>.m499-more{flex:none}
 .m499-wedge .sg433-stage,.m499-club .club-orientation-panel{padding:16px!important}
 .m499-wedge .sg433-view button{font-size:14px}.m499-wedge .sg433-view button small{font-size:12px}
 .m499-wedge .sg433-slider>span{font-size:15px}.m499-wedge .sg433-slider small{font-size:13px}
 .m499-bounce .bc481-product{height:250px;min-height:250px}
 .m499-bounce .bc481-wedge{height:254px!important;width:224px!important;margin-left:-118px}
 .m499-bounce .bc481-photo-label{font-size:10px;max-width:120px}.m499-bounce .bc481-model strong{font-size:30px}
 .m499-bounce .bc481-model small,.m499-bounce .bc481-lean span{font-size:11px}
 .m499-bounce .bc458-readings{padding:14px 20px}.m499-bounce .bc458-readings small{font-size:12px}
 .pt452-workspace .pt497-focus-bar{min-height:54px;padding:6px 16px}
 .pt452-workspace .pt494-outcome{min-height:72px;padding:12px 20px;gap:16px}
 .pt452-workspace .pt494-outcome-copy strong{font-size:17px}.pt452-workspace .pt494-outcome-copy>span{font-size:12px}
 .pt452-workspace .pt494-outcome>small{position:static;font-size:10px}
 .pt420-page .pt452-workspace .pt420-stage,.pt420-page .pt452-workspace .pt420-stage:has(.pt452-panel:not([hidden])){height:clamp(620px,calc(100svh - 312px),840px);--m499-panel:240px}
 .pt452-workspace .pt452-panel>header{padding:7px 12px}.pt452-workspace .pt452-panel>header>span{font-size:14px}
 .pt452-workspace .pt452-panel-body{padding:12px 18px}
 .pt452-workspace .pt452-panel-body .pt420-control>span,.pt452-workspace #putter-panel-face .pt420-control>span{font-size:14px}
 .pt452-workspace .pt452-panel-body input[type=range]{min-height:44px}
 .pt507-switcher{padding:8px;gap:8px}.pt507-switcher>button,.pt507-more{font-size:13px;min-height:48px}
 .strategy-page .st-map-stage>.st-map,.strategy-page .st-map-play>.st-map{max-height:min(54svh,560px)}
 .strategy-page .st-visual{padding:22px}.strategy-page .st-map-note,.strategy-page .st-small{font-size:14px}
 .strategy-page .st-shot-adjustment{padding:18px 22px 6px}
 .content .sk-stage{height:clamp(480px,60svh,760px)}
 .content .physics-chapters{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* Anatomy cards are regular grid items on tablets, not phone bottom sheets.
   A max-height without scrolling let their text cover the sections below. */
@media screen and (min-width:761px) and (max-width:1400px){
 .content .sk-card{position:static;inset:auto;z-index:auto;max-height:none;overflow:visible}
 .content .sk-card.is-open{max-height:none}
 /* This column includes the viewer AND the full joint selector. It is taller
    than the screen, so pinning it made its lower controls unreachable. */
 .content .sk-visual{position:static}
 .content :is(.bs-card,.an-card){top:calc(var(--m390-head-height,60px) + 16px);bottom:auto;max-height:calc(100svh - var(--m390-head-height,60px) - var(--m390-nav-height,66px) - 32px);box-sizing:border-box;overscroll-behavior:contain;scroll-padding-block:16px}
 .content :is(.bs-card-head,.an-card-head) .an-icon{min-width:44px;min-height:44px}
}

/* Narrow iPads / Split View use the phone sheets. Keep them clear of both
   app bars, including safe areas, and scroll long explanations inside. */
@media screen and (max-width:760px){
 .content :is(.bs-card.is-selected,.an-card.is-selected,.sk-card){bottom:calc(var(--m390-nav-height,66px) + 8px);z-index:30;box-sizing:border-box}
 .content :is(.bs-card.is-selected,.an-card.is-selected):not(.is-collapsed),.content .sk-card.is-open{max-height:min(54svh,calc(100dvh - var(--m390-head-height,60px) - var(--m390-nav-height,66px) - 32px));overflow:auto;overscroll-behavior:contain}
 .sk-study{padding-bottom:72px}
}

/* An iPad on its side has room for an independent control rail. */
@media screen and (min-width:961px) and (max-width:1400px) and (min-height:501px) and (orientation:landscape){
 .lab-premium .m499-session.m499-pose{grid-template-columns:minmax(0,1fr) minmax(310px,34%);grid-template-rows:auto auto minmax(260px,1fr) auto;height:clamp(480px,calc(100svh - 190px),780px);align-items:stretch}
 .m499-pose .mobile-scene-heading{grid-column:1;grid-row:1}.m499-pose .lab-view-toolbar{grid-column:1;grid-row:2}
 .m499-pose .club-3d-viewport{grid-column:1;grid-row:3}.m499-pose .m519-playback{grid-column:1;grid-row:4}
 .lab-premium .m499-pose .mobile-scene-controls{grid-column:2;grid-row:1/5;min-height:0;overflow:auto;border-left:1px solid var(--scene-border);background:var(--scene-label);overscroll-behavior:contain}
 .m499-pose .m499-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .lab-premium .m499-pose .m499-control-panel{max-height:none}
 .lab-premium .m499-pose .lab-field-picker{display:grid;grid-template-columns:1fr}
 .lab-premium .mobile-scene-expanded .m499-session.m499-pose{height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:500px}
 .m499-session.m499-wedge,.m499-session.m499-bounce,.m499-session.m499-club{display:grid;grid-template-columns:minmax(0,1fr) minmax(310px,36%);align-items:center;--m499-preview:clamp(290px,48svh,500px)}
 .m499-wedge .sg433-adjust,.m499-bounce .bc458-controls,.m499-club .m499-club-controls{grid-column:2;grid-row:1;align-self:stretch;border-left:1px solid #d5dece}
 .m499-session:not(.m499-pose) .m499-control-panel{max-height:340px}
 .m499-bounce .bc481-product{height:300px;min-height:300px}.m499-bounce .bc481-wedge{height:300px!important;width:264px!important}
 .pt420-page .pt452-workspace .pt420-stage,.pt420-page .pt452-workspace .pt420-stage:has(.pt452-panel:not([hidden])){height:clamp(460px,calc(100svh - 310px),740px)}
 .pt452-workspace #putter-3d-canvas,.pt452-workspace .pt420-stage:has(.pt452-panel:not([hidden])) #putter-3d-canvas{width:calc(100% - 350px);height:100%;bottom:auto}
 .pt507-switcher{left:auto;right:14px;top:14px;bottom:auto;width:322px}
 .pt452-workspace .pt452-popovers,.pt452-workspace .pt420-stage:has(.pt452-panel:not([hidden])) .pt452-popovers{left:auto;right:14px;top:88px;bottom:14px;width:322px;height:auto;max-height:calc(100% - 102px)}
 .pt452-workspace .pt452-camera,.pt452-workspace .pt452-playback{right:364px}
 .pt452-workspace .pt434-face-badge{right:364px;bottom:89px}.pt452-workspace .pt429-distance-badge{bottom:91px}
 html[data-mobile-visor] .pt420-page .pt452-workspace .pt420-stage,html[data-mobile-visor] .pt420-page .pt452-workspace .pt420-stage:has(.pt452-panel:not([hidden])){height:calc(100dvh - 140px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:400px}
 .strategy-page .st-map-play{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,32%);align-items:center}
 .strategy-page .st-map-play>.st-map{width:100%;max-height:calc(100svh - 200px)}
 .strategy-page .st-shot-adjustment,.strategy-page .st-shot-own{height:100%;box-sizing:border-box;border-top:0;border-left:1px solid #c9d5c4}
 .strategy-page .st-shot-heading{display:block}.strategy-page .st-shot-distance{justify-content:flex-start;margin-top:10px;flex-wrap:wrap}
 .strategy-page .st-shot-fields{grid-template-columns:minmax(0,1fr);gap:20px}
 .strategy-page .st-shot-club,.strategy-page .st-shot-intensity{display:block}.strategy-page .st-shot-club>label{margin-bottom:8px}
 .strategy-page .st-intensity-presets{grid-template-columns:repeat(3,minmax(0,1fr))}
 .notebook-layout{display:grid;grid-template-columns:minmax(260px,.7fr) minmax(0,1.3fr);gap:28px}
}
