/* Touch layout overrides only. Desktop uses the existing layout. */
.mobile-jump,.mobile-install-status{display:none}
@media(max-width:900px){
 html,body{max-width:100%;overflow-x:clip}
 .app-shell,.main,.page,.panel,.studio-grid,.bottom-grid,.library-grid{min-width:0;max-width:100%}
 .rail{position:relative!important;top:auto!important;height:auto!important;min-height:0!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px!important;padding:8px!important}
 .rail .brand{grid-column:1/-1;min-width:0!important;margin:0!important;justify-content:center;padding:5px!important}
 .rail .brand-text{display:block!important}.rail .rail-bottom,.rail .rail-label,.rail .rail-divider,.rail .source-tile{display:none!important}
 .rail .nav-item{min-height:48px!important;white-space:normal!important;line-height:1.25;text-align:center;font-size:11px!important;padding:5px!important;display:flex;flex-direction:column;gap:3px;justify-content:center}
 .rail .nav-icon{font-size:17px!important;margin:0!important}
 .topbar{height:auto!important;min-height:52px!important;flex-wrap:wrap!important;gap:6px;padding:8px 12px!important}.topbar .breadcrumb{display:none!important}.topbar-right{width:100%;min-width:0;flex-wrap:wrap;justify-content:space-between;gap:6px!important}.topbar-right .avatar{display:none!important}#engine-status{flex:1;min-width:0;overflow-wrap:anywhere;font-size:11px}
 .page{padding:12px 9px 25px!important}.page-heading{min-width:0;flex-wrap:wrap}.hero-content,.hero-copy{min-width:0}.compact-race-hero{min-height:0!important;padding:13px!important}.compact-race-hero .heading-actions{margin:0!important;width:100%;display:grid;grid-template-columns:2fr 1fr;gap:8px}.heading-actions button{min-height:46px;white-space:normal}
 .mobile-jump{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:9px 0 13px}.mobile-jump button{min-height:45px;white-space:normal;border:1px solid #c7d3ef;border-radius:10px;background:#fff;color:#4455a2;font-weight:750;padding:6px;font-size:12px}
 .mobile-install-status{display:block;font-size:12px;line-height:1.45;color:#636e91;margin:6px 0 10px;overflow-wrap:anywhere}
 .metric-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px}.metric-strip>div{min-width:0;padding:9px!important;overflow-wrap:anywhere}
 #page-simulation .studio-grid,#page-simulation .bottom-grid,#page-simulation .race-setup-grid,#page-simulation .live-details-grid,.library-grid,.advanced-layout,.research-layout{grid-template-columns:minmax(0,1fr)!important;gap:10px}
 .panel-head,.race-head,.race-view-actions,.stage-top,.spatial-toolbar,.spatial-toolbar>div,.live-details-head,.library-actions{flex-wrap:wrap!important;min-width:0}.race-view-actions{width:100%;margin-left:0!important;gap:5px!important}.race-view-actions button{min-height:40px;white-space:normal}.spatial-toolbar>div{width:100%;justify-content:space-between}.spatial-toolbar select{max-width:100%;min-width:0}
 #track-canvas{height:clamp(260px,52vh,460px)!important;min-height:0!important;width:100%!important;max-width:100%;touch-action:pan-y}.track-canvas-wrap{min-width:0;max-width:100%;overflow:hidden}.race-rank-strip{overflow-x:auto;max-width:100%;overscroll-behavior-x:contain}.playback{flex-wrap:wrap!important;gap:7px}.scrubber-wrap{min-width:100px;flex:1}.spatial-stage{margin:8px!important;padding:8px!important;max-width:100%}
 .roster-list{padding:6px!important}.roster-row{grid-template-columns:44px minmax(0,1fr) 48px 20px!important;gap:6px!important;min-height:64px!important}.roster-row .stat-bars{display:none!important}.roster-name,.roster-name strong,.roster-name small{min-width:0;overflow-wrap:anywhere;white-space:normal!important}.roster-row .style-chip{min-width:0;padding:5px 3px!important}.roster-edit{font-size:14px!important}
 .runner-drawer{width:100%!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-left:0!important}.drawer-head,.drawer-footer{flex-shrink:0;padding:10px 12px!important}.drawer-footer{padding-bottom:max(10px,env(safe-area-inset-bottom))!important}.drawer-body{min-height:0;overflow-y:auto!important;padding:10px 12px 16px!important;overscroll-behavior:contain}.drawer-body input:not([type=checkbox]):not([type=range]),.drawer-body select,#picker-query,#support-card-query,#skill-filter,#ocr-runner-dialog input:not([type=checkbox]),#ocr-runner-dialog select{font-size:16px!important;min-width:0}.drawer-footer button,.drawer-head button{min-height:44px}.selected-skill-mobile{display:grid!important}.runner-skill-workspace{display:none!important}
 #skill-picker .picker-panel,#skill-picker.support-mode .picker-panel{width:100%!important;height:100dvh!important;max-height:100dvh!important;max-width:100vw!important;border-radius:0!important;border:0!important;margin:0!important}.picker-head,.picker-footer,.picker-mode-tabs,.picker-filterbar{flex-shrink:0}.picker-head{padding:8px 10px!important}.picker-head h2{font-size:18px!important}.picker-mode-tabs{min-width:0}.picker-mode-tab{min-height:42px;white-space:normal}.picker-filterbar{padding:6px 9px!important}.picker-filter-row{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important}.picker-filter-row label{display:flex;flex-direction:column;align-items:stretch;gap:3px!important}.picker-filter-row select{width:100%;min-height:38px}.picker-note{font-size:10px!important;line-height:1.25}.picker-results,.support-browser,.support-card-detail{min-height:0;min-width:0;overflow-y:auto;overscroll-behavior:contain}.picker-footer{padding:7px 9px max(7px,env(safe-area-inset-bottom))!important}.picker-footer button{min-height:44px}.picker-skill-item{min-width:0;overflow-wrap:anywhere}.picker-skill-item button{min-height:40px}.support-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.support-filterline,.support-chipset{min-width:0;flex-wrap:wrap!important}
 #ocr-runner-dialog{box-sizing:border-box;width:calc(100vw - 12px)!important;max-width:100%;max-height:calc(100dvh - 16px)!important;padding:12px!important;margin:auto;overflow:auto!important}#ocr-runner-dialog img,#ocr-runner-dialog canvas{max-width:100%;height:auto}#ocr-runner-dialog button{min-height:42px}#ocr-runner-dialog input[type=file]{max-width:100%}
 #floating-diagnostics-link{position:static!important;margin:10px auto 16px;width:fit-content;max-width:calc(100% - 24px);text-align:center;z-index:auto!important}
 .library-grid .skill-scroll{max-height:55vh;min-height:180px;overflow:auto}.library-grid .skill-info{min-width:0;overflow-wrap:anywhere}.result-tools button{white-space:normal;min-height:44px}.results-content,.runner-skill-log,#nine-runner-skill-audit{max-width:100%;overflow-x:auto}.toast{max-width:calc(100vw - 24px)!important;overflow-wrap:anywhere}
}
@media(max-width:420px){.editor-stats-top .drawer-stats input{font-size:16px!important;padding:5px 1px!important}.compact-race-hero .hero-horseshoe{display:none!important}.metric-strip em{font-size:10px}.race-view-actions .run-state{flex-basis:100%}.picker-head .eyebrow{font-size:10px}.support-card-grid{gap:6px!important}}
