/* Stable app frame: one content scroller, controls stay within the screen. */
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none;scroll-behavior:auto}
body{min-width:0}
.app-shell{position:fixed;inset:0;width:100%;height:100vh;height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;background:var(--bg)}
.app-scroll{min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;overflow-anchor:none;scroll-behavior:auto;scrollbar-gutter:stable;outline:none;-webkit-overflow-scrolling:touch}
.app-shell>.site-header{width:100%;height:78px;flex-shrink:0;padding-top:env(safe-area-inset-top,0px);background:var(--bg);z-index:10}
.demo-badge{display:inline-flex;font-size:11px;color:var(--green);background:#e9efdf;border:1px solid #d6e0ca;padding:4px 10px;border-radius:20px;white-space:nowrap}
main{width:100%;min-width:0}
.mobile-nav{display:none}
.lesson-menu summary{display:none}
.lesson-menu[open]>ol{display:block}
.lesson-menu{min-width:0}
#view-answer{font-size:13px}
#connection-status{min-height:48px;margin-bottom:0;display:flex;align-items:center;justify-content:center}
#photo-preview img{width:100%;height:260px;object-fit:contain;background:#f0f3eb}
#image-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.image-toolbar{gap:14px}
.image-toolbar .text-btn{flex-shrink:0}
.command{min-width:0;max-width:100%}
.command pre{overflow-x:auto;overscroll-behavior-x:contain;max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}
:where(button,a,input,select,textarea):focus-visible{outline:2px solid #567d2f;outline-offset:3px}
.cursor{animation:none}
.hero-visual .terminal{transform:none}
.entry-card,.btn,.photo-button{transition:background .15s,color .15s,border-color .15s;transform:none!important}
@media(min-width:768px){.app-scroll{scrollbar-gutter:stable both-edges}.site-header nav{margin-left:auto}.hero{padding-top:52px;padding-bottom:52px}.camera-heading{padding-top:34px}.camera-column{max-width:800px}.camera-panel{padding:28px 36px}.photo-button{min-height:210px}.lesson-sidebar{top:16px}.app-scroll footer{padding-bottom:36px}}
@media(max-width:767px){
 .app-shell{grid-template-rows:auto minmax(0,1fr) auto}
 .app-shell>.site-header{height:calc(60px + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) max(18px,env(safe-area-inset-right,0px)) 0 max(18px,env(safe-area-inset-left,0px));gap:12px}
 .site-header nav{display:none}.site-header .demo-badge{display:inline-flex}.brand-mark{width:32px;height:32px;font-size:16px}.site-header .brand{font-size:17px}.site-header .brand-en{font-size:8px}
 .app-scroll{scrollbar-gutter:auto;touch-action:pan-y pinch-zoom}
 main{padding:0 max(16px,env(safe-area-inset-right,0px)) 0 max(16px,env(safe-area-inset-left,0px))}
 .mobile-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;min-height:calc(65px + env(safe-area-inset-bottom,0px));padding:7px max(10px,env(safe-area-inset-right,0px)) calc(7px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));border-top:1px solid var(--line);background:#fafbf7;z-index:20}
 .mobile-nav a{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;min-height:50px;color:#748077;text-decoration:none;border-radius:12px;font-size:11px;font-weight:550;line-height:1.3;touch-action:manipulation}
 .mobile-nav a svg{width:22px;height:22px;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
 .mobile-nav a.active{color:#244d3d;background:#e9efdf}
 .page-heading{padding:22px 0 18px}.page-heading h1{font-size:29px;line-height:1.35;margin-bottom:10px}.page-heading .eyebrow{font-size:10px;margin-bottom:9px}.page-heading>p:last-child{font-size:13px;line-height:1.7}
 .camera-heading h1{font-size:29px}.camera-heading{padding-top:22px}.camera-heading>p:last-child{font-size:12px}
 .camera-column{margin-bottom:24px;gap:16px}.camera-panel{padding:18px;border-radius:18px}.upload-disclosure{font-size:11px;line-height:1.7;margin:0 0 14px;min-height:56px}.photo-button{min-height:184px;gap:10px;border-radius:16px}.photo-button strong{font-size:25px}.photo-button svg{width:44px;height:44px}.photo-button span{font-size:12px}
 .screenshot-button{min-height:44px;margin:14px 0 4px;padding:8px 16px}.camera-panel .mini-note{font-size:11px;line-height:1.65}#connection-status{min-height:44px;margin-top:8px}.camera-controls{gap:10px}.camera-controls:empty{display:none}
 #photo-preview img{height:200px}.image-toolbar{font-size:11px}.image-toolbar .text-btn{min-height:44px;font-size:11px}
 .camera-column .empty-result{padding:24px 20px}.camera-column .empty-result .result-orbit{display:none}.camera-column .empty-result h2{font-size:22px;margin-top:0}
 .route-picker{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:16px}.route-picker label{width:100%;min-width:0}.route-picker .route-note{grid-column:1/-1;width:100%;font-size:11px;line-height:1.5}
 select,input,textarea{font-size:16px!important}select{max-width:100%;padding-right:22px;min-height:46px}.learn-layout{display:block}.lesson-sidebar{position:static;padding:0;margin-bottom:16px}.lesson-sidebar>.mini-note,.lesson-sidebar>.text-link,.lesson-sidebar>#reset-progress{display:none}
 .lesson-menu{background:#fff;border:1px solid var(--line);border-radius:12px;margin:12px 0 0;overflow:hidden}.lesson-menu summary{display:flex;align-items:center;gap:12px;padding:11px 14px;min-height:48px;font-size:12px;cursor:pointer;list-style:none}.lesson-menu summary::-webkit-details-marker{display:none}.lesson-menu summary>span:first-child{margin-left:auto;color:#69766e}.lesson-menu ol{max-height:230px;overflow-y:auto;overscroll-behavior:contain;display:block!important;margin:0!important;padding:0 8px 8px!important}.lesson-menu:not([open])>ol{display:none!important}.lesson-sidebar li{margin:0 0 4px;flex-shrink:1}.lesson-sidebar li button{max-width:none;min-height:44px;width:100%;font-size:12px;align-items:center;padding:10px;border-color:transparent;background:transparent}.lesson-sidebar .progress-track{margin:10px 0 0}
 .lesson-card{padding:21px 18px}.lesson-card h2{font-size:23px}.lesson-card p{font-size:14px}.lesson-controls{gap:10px}.lesson-controls button{min-height:44px}.command pre{font-size:12px;padding-right:0}.command .copy{min-height:32px}
 .toast{bottom:calc(82px + env(safe-area-inset-bottom,0px));max-width:calc(100vw - 32px);width:max-content;font-size:12px}
 footer{margin:20px 16px 0;padding:20px 0 24px;gap:10px}footer>.brand,footer>p{display:none}footer>div{width:100%;font-size:10px;gap:8px}.source-panel{padding:20px}.download-card{padding:20px}
 #home-view .hero{display:block;padding:27px 0 21px}#home-view .hero h1{font-size:36px;line-height:1.3;margin-bottom:14px}#home-view .hero .eyebrow{font-size:10px;margin-bottom:14px}#home-view .hero-desc{font-size:13px;line-height:1.8;margin-bottom:14px}#home-view .hero-visual,#home-view .hero-actions,#home-view>.section-heading,#home-view .journey-bar,#home-view .common-section{display:none}
 #home-view .hero-meta{font-size:9px;gap:8px;flex-wrap:wrap}#home-view .hero-meta i{display:none}#home-view .entry-grid{grid-template-columns:1fr;gap:12px;margin-bottom:24px}#home-view .entry-card{padding:18px 20px;border-radius:18px}#home-view .entry-card .card-top{margin-bottom:9px}#home-view .entry-card .entry-icon{font-size:21px}#home-view .entry-card h3{font-size:20px;margin:0 0 8px}#home-view .entry-card p{font-size:12px;line-height:1.75;margin:0}#home-view .entry-card .pill-row{display:none}#home-view .entry-card .card-foot{margin-top:12px;padding-top:11px;font-size:12px}
 .keyboard-open .mobile-nav{display:none}.keyboard-open .app-shell{grid-template-rows:auto minmax(0,1fr)}.keyboard-open .toast{bottom:16px}
 dialog{max-width:calc(100vw - 32px);max-height:calc(100dvh - 80px);overflow:auto}
}
@media(max-width:359px){.photo-button{min-height:184px}.camera-panel{padding:15px}.upload-disclosure{font-size:10px}#home-view .hero h1{font-size:32px}.site-header .demo-badge{font-size:10px}.route-picker{gap:9px;padding:12px}.route-picker label{font-size:11px}}
@media(max-height:480px) and (max-width:767px){.app-shell>.site-header{height:46px}.mobile-nav{min-height:52px;padding-top:3px;padding-bottom:3px}.mobile-nav a{min-height:44px;flex-direction:row;gap:6px}.mobile-nav a svg{width:18px;height:18px}.page-heading{padding-top:16px}}
@media(max-width:767px){#home-view .entry-card .card-foot{display:none}#home-view .entry-card .entry-icon{width:30px;height:30px;font-size:19px;border-radius:9px}#home-view .entry-card{padding:16px 20px}#home-view .hero{padding-top:23px;padding-bottom:18px}}

/* Command-first course: one column on phones, no download directory. */
@media(max-width:767px){.mobile-nav{grid-template-columns:repeat(3,minmax(0,1fr))}}
.course-notice{padding:16px;border-radius:12px;background:#fff5dc;color:#5b4c27;line-height:1.75;margin:18px 0;overflow-wrap:anywhere}
.copy-guide{padding-left:24px;line-height:1.9}.copy-guide li{padding:4px 0}
.expected-output{background:#eff5ee;border:1px solid #d7e5d3;border-radius:12px;padding:16px;margin:18px 0}.expected-output span{font-size:12px;color:#53674e}.expected-output pre{white-space:pre-wrap;overflow-wrap:anywhere;margin:10px 0 0;font-size:14px;color:#244528}
.compat-grid{display:grid;gap:8px;margin:18px 0}.compat-grid p{margin:0;padding:12px;background:#f5f5ef;border-radius:10px}
.route-choice{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0}.route-choice .btn{white-space:normal;text-align:left}
.model-setup{padding:18px;background:#f4f4ee;border-radius:14px}.model-setup label{display:block;margin-bottom:14px;font-size:14px}.model-setup input{display:block;width:100%;min-width:0;box-sizing:border-box;padding:12px;border:1px solid #d4d9ce;border-radius:8px;font-size:16px;margin-top:7px}.model-setup button{white-space:normal}.lesson-controls{flex-wrap:wrap}
