/* Atlas adapts layout density to available space; numbers keep a readable floor. */
:root{--atlas-touch-target:2.75rem;--atlas-mobile-nav:4rem}
.atlas-mobile-nav{display:none}
@media(max-width:800px){
 dialog.options-lab{inset:0;width:100%;height:100dvh;max-height:100dvh;border-radius:0;border:0;--lab-chart-height:clamp(17rem,42svh,26rem);--lab-readable-text:clamp(.875rem,.8rem + .3vw,.9375rem)}
 .options-lab .olab-header{padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left));display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
 .options-lab .olab-identity{gap:0}.options-lab .olab-brand{display:none}
 .options-lab .olab-header h2{white-space:nowrap}.options-lab .olab-header .olab-identity p{max-width:100%;font-size:12px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .options-lab .olab-header-center{grid-column:1/-1;grid-row:2;justify-content:space-between;gap:8px}
 .options-lab .olab-header .olab-mode{display:none}
 .options-lab .olab-header-actions{grid-column:2;grid-row:1;gap:4px}
 .options-lab .olab-header-actions :is(#olab-open-shelf,#olab-theme,#options-close){font-size:0!important;min-width:44px;min-height:44px;padding:6px}
 .options-lab #olab-open-shelf:after{content:'Chain';font-size:13px}.options-lab #olab-theme:after{content:'◐';font-size:20px}.options-lab #options-close:after{content:'✕';font-size:18px}
 .options-lab .olab-body{padding-bottom:env(safe-area-inset-bottom);overscroll-behavior:contain}
 .options-lab .olab-analysis{padding:10px;gap:8px;min-width:0}
 .options-lab .olab-analysis-title{margin:0}.options-lab .olab-rulers{margin-bottom:0}
 .options-lab .olab-pan-hint{display:none}
 .options-lab .olab-ruler-heading{gap:6px;min-height:30px}
 .options-lab .olab-rail-wrap>button{flex-basis:32px}.options-lab .olab-rail button{min-height:44px}
 .options-lab .olab-metrics{margin-bottom:0}.options-lab .olab-metrics>div{padding:8px}
 .options-lab .olab-chart{overflow:hidden;min-width:0}.options-lab .olab-chart svg{min-width:0;width:100%;height:100%}
 dialog.options-lab #olab-chart svg text{font-size:var(--lab-phone-svg-text,32px)!important}
 .options-lab .olab-plot-heading{margin:0;gap:4px}.options-lab .olab-payoff{min-width:0}
 .options-lab .olab-result-controls{padding-right:0;gap:10px}.options-lab .olab-result-controls>div{flex-wrap:nowrap;max-width:100%}
 .options-lab .olab-result-controls button{min-height:44px;padding:8px 10px}
 .options-lab .olab-assumptions:not([open]){grid-row:7;justify-self:stretch}
 .options-lab .olab-position{margin-top:8px}.options-lab .olab-position>summary{min-height:44px;align-content:center}
 .options-lab .olab-leg{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px}
 .options-lab .olab-leg-contract{grid-column:1/-1}.options-lab .olab-leg :is(input,select,button){min-height:44px}
 .options-lab .olab-chain{height:auto;max-height:none;min-height:60svh;padding:12px 10px}
 .options-lab .olab-chain-scroll{max-height:65svh}.options-lab .olab-price-button{min-height:44px}
 .options-lab .olab-strategies-panel{position:fixed;inset:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom));width:auto;height:auto;max-height:none;transform:none;padding:12px;display:flex;flex-direction:column}
 .options-lab .olab-strategies-panel[hidden]{display:none}.options-lab .olab-strategy-menu{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-height:none;flex:1;min-height:0}
 .options-lab .olab-strategy-menu button{min-height:44px}.options-lab .olab-strategy-preview{grid-template-columns:1fr;gap:8px;max-height:45svh;overflow:auto}
 .options-lab .olab-preview-graph{max-width:24rem}.options-lab .olab-strategy-preview ul{columns:1}
}
@media(max-width:650px){
 body.atlas-workbench{padding-bottom:calc(var(--atlas-mobile-nav) + env(safe-area-inset-bottom))}
 body.atlas-workbench main,body.atlas-workbench.hidewatch main,body.atlas-workbench.hideai main{grid-column:2;min-width:0}
 .atlas-workbench #chart-grid.multi{height:auto!important;grid-template-columns:minmax(0,1fr);grid-template-rows:none;grid-auto-rows:clamp(25rem,68.75svh,40rem);gap:12px}
 .atlas-workbench #chart-grid.multi .chartcell{grid-column:1!important;grid-row:auto!important;min-width:0}
 .atlas-workbench .gridcellhead{height:auto;min-height:44px;gap:6px;padding:4px 8px}
 .atlas-workbench .gridcellhead input{font-size:14px;width:5rem;min-height:36px}.atlas-workbench .gridcellhead button{min-width:36px;min-height:36px;font-size:13px}
 .atlas-workbench .gridcellfoot{font-size:12px}.atlas-workbench .multi .studylist :is(button,span){font-size:12px}
 .atlas-workbench .tradingbar{min-height:52px;height:auto;padding-top:env(safe-area-inset-top)}
 .atlas-workbench .tradingbar>button,.atlas-workbench .tradingbar>.toolwrap>button{min-width:36px;min-height:44px}
 .atlas-workbench .tradingbar #theme-toggle{width:44px;min-width:44px;min-height:44px}
 .atlas-workbench .tradingbar #replay-toggle{display:none}
 .atlas-workbench .marketfeedcontrols{gap:8px}.atlas-workbench .marketfeedcontrols :is(select,button){min-height:40px;font-size:13px}
 .atlas-workbench .marketfeedcontrols label{font-size:13px}.atlas-workbench #quick-indicators{padding:10px}
 .atlas-workbench .quick-study-buttons{grid-template-rows:repeat(2,44px)}.atlas-workbench .quick-study-buttons button{font-size:13px}
 .atlas-mobile-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));position:fixed;z-index:45;bottom:0;left:0;right:0;padding:5px max(8px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));min-height:var(--atlas-mobile-nav);background:var(--atlas-tool-surface);border-top:1px solid var(--atlas-tool-edge)}
 .atlas-mobile-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:52px;border:0;font:500 12px 'IBM Plex Sans',sans-serif;color:var(--atlas-tool-copy);touch-action:manipulation}
 .atlas-mobile-nav svg{width:21px;height:21px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
 .atlas-mobile-nav button:hover,.atlas-mobile-nav button:focus-visible{color:var(--atlas-tool-heading);background:var(--atlas-tool-hover)}
 .atlas-workbench .indicatorproperties form{grid-template-columns:minmax(0,1fr)}
 .atlas-workbench .studypropertytabs{grid-column:1;grid-row:2;flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid var(--atlas-tool-edge)}
 .atlas-workbench .studypropertiesbody{grid-column:1;grid-row:3;max-height:55dvh}.atlas-workbench #study-settings-error{grid-column:1;grid-row:4}.atlas-workbench .studypropertiesfooter{grid-row:5;flex-wrap:wrap}
 .atlas-workbench .studyplotrow{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.atlas-workbench .studyplotrow>label:first-child{grid-column:1/-1}
 .atlas-workbench .strategyhead{flex-wrap:wrap;gap:10px}.atlas-workbench .strategyintro{flex-wrap:wrap;gap:8px}
 .atlas-workbench .topmenu{max-width:calc(100vw - 16px)}
 body.chart-maximized #chart-grid{bottom:calc(var(--atlas-mobile-nav) + env(safe-area-inset-bottom))}
}
@media(pointer:coarse){button,a,input,select,summary{touch-action:manipulation}input,select,textarea{font-size:max(1rem,1em)}}
@media(prefers-reduced-motion:reduce){.atlas-mobile-nav *{transition:none;scroll-behavior:auto}}

@media(max-width:800px){.options-lab #options-close .atlas-icon{display:none}.options-lab .olab-plot-heading{padding-bottom:8px}}

@media(min-width:651px) and (max-width:1000px){
 .atlas-workbench .tradingbar{flex-wrap:wrap;min-height:49px;height:auto;padding-block:4px}
 .atlas-workbench #chart-grid.multi{height:auto!important;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:clamp(23.75rem,52.5svh,36.25rem)}
 .atlas-workbench #chart-grid.multi .chartcell{grid-column:auto!important;grid-row:auto!important}
 .atlas-workbench #chart-grid.multi .chartcell:last-child:nth-child(odd){grid-column:1/-1!important}
}
@media(max-width:800px){.options-lab .olab-preview-copy{min-width:0}.options-lab .olab-strategy-preview p{white-space:normal;overflow-wrap:anywhere}.options-lab .olab-header #options-close svg{display:none}}
@media(max-width:650px){.atlas-workbench #workspace-menu{position:fixed;inset:56px 8px auto;width:auto;max-height:calc(100dvh - var(--atlas-mobile-nav) - env(safe-area-inset-bottom) - 72px);overflow-y:auto;overscroll-behavior:contain}.atlas-workbench #workspace-menu button{min-height:44px;font-size:14px}}
