/* Shared phone/tablet presentation. Market, indicator and account code is unchanged. */
html{ -webkit-text-size-adjust:100%;text-size-adjust:100% }
[hidden]{display:none!important}
.h5-bar,.h5-panel-button{display:none}
.h5-panel{color:#edf2fa;background:#141922;border:1px solid #344152;border-radius:12px;padding:0;width:min(420px,96vw);max-width:96vw;max-height:90dvh;margin:auto;box-sizing:border-box}
.h5-panel::backdrop{background:rgba(0,0,0,.65)}
.h5-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid #344152;background:#141922;position:sticky;top:0;z-index:2}
.h5-panel-head h2{font-size:16px;margin:0}.h5-panel-head button{min-height:40px;padding:6px 14px;border:1px solid #45546a;background:#222d3e;border-radius:6px;color:#fff;font:inherit}
.h5-panel-body{max-height:calc(85dvh - 64px);overflow:auto;overscroll-behavior:contain;padding:8px}
.h5-panel-body>#saWatch,.h5-panel-body>.left-watch,.h5-panel-body>.mw-side,.h5-panel-body>.watch-col{position:static!important;inset:auto!important;width:100%!important;height:auto!important;max-height:none!important;min-height:120px;flex:auto!important;display:block!important}
.h5-panel-body .shared-row,.h5-panel-body .watch-row{min-height:48px}.h5-panel-body .shared-row button,.h5-panel-body .w-name b{font-size:14px!important}.h5-panel-body .shared-row button:last-child,.h5-panel-body .w-del{min-width:40px;min-height:40px}
.h5-panel-body .shared-head,.h5-panel-body .shared-row,.h5-panel-body .watch-head,.h5-panel-body .watch-row{grid-template-columns:minmax(0,1fr) 76px 40px!important}
.h5-panel-body .tool-row,.h5-panel-body .toolbar{display:flex!important;flex-wrap:wrap!important;padding:8px!important;gap:12px!important;height:auto!important}
.h5-panel-body .toggles{display:flex;flex-wrap:wrap;margin:0;gap:12px;width:100%}.h5-panel-body .toggles label{min-height:44px;white-space:nowrap;font-size:14px}
.h5-panel-body #scToggle{position:static;display:flex;min-height:44px;padding:8px;font-size:14px}.h5-panel-body .zoomctl{width:100%;justify-content:center}.h5-panel-body .zoomctl button{min-height:40px;min-width:40px}
@media(max-width:900px){
 *{box-sizing:border-box}html,body{width:100%;max-width:100%;min-width:0}body{height:100vh;height:100dvh;min-height:0!important;overflow:hidden;padding:0!important}
 button,a,input,select{-webkit-tap-highlight-color:transparent}input[type=text],input[type=number],input[type=email],input[type=password],select,textarea{font-size:16px!important;max-width:100%;min-width:0}button{touch-action:manipulation}button:focus-visible,a:focus-visible{outline:2px solid #72a8ff;outline-offset:-2px}
 .site-nav,.sa-nav{box-sizing:border-box;display:flex!important;align-items:center!important;flex:none;min-height:44px;height:44px!important;gap:18px!important;padding:0 max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left))!important;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:none}
 .site-nav a,.sa-nav a{display:flex;align-items:center;min-height:44px;font-size:13px;flex:none}.site-nav .brand-link,.sa-nav .brand-link{min-height:0;width:30px;height:30px;flex:none}.site-nav .brand-link img,.sa-nav .brand-link img{width:60px;height:60px;left:-16px;top:-8px}
 .site-main{width:100%;max-width:100%;margin:0;padding:26px 16px calc(24px + env(safe-area-inset-bottom));overflow-y:auto;flex:1;min-height:0}.site-main h1{font-size:24px;line-height:1.4}.site-main p{font-size:14px;line-height:1.7}.site-grid{grid-template-columns:1fr!important;gap:12px!important;margin-top:24px!important}.site-card{padding:20px!important;min-height:106px}.site-card strong{font-size:20px}.site-card span{font-size:14px}
 main{max-width:100%;min-width:0}.chart-page,.chart-col,.chart-body,.mw-grid,.mw-box{min-width:0!important}
 #viewChart{padding-left:0!important;gap:0!important;overflow-x:hidden!important}#viewChart:not([hidden]){display:flex!important}body[data-section=chanlun] #viewChart{flex-direction:column!important;overflow-y:auto}
 .chart-page{padding:0!important;width:100%;flex:1;min-height:0}.searchbox{width:auto;max-width:none;margin:6px 8px!important;gap:6px;flex:none!important}.searchbox #q{height:42px;flex:1;width:0;padding:0 10px}.searchbox #btnGo{height:42px;min-width:60px;padding:0 12px}
 .quote-row{flex-wrap:wrap;gap:4px 8px;padding:4px 10px!important;overflow:visible;flex:none;min-height:38px}.quote-row #stockName{font-size:16px;flex-shrink:1;max-width:45%;overflow:hidden;text-overflow:ellipsis}.quote-row #stockCode{font-size:12px}.quote-row #quote{font-size:14px;margin-left:auto}.quote-row .fqsel{height:32px;font-size:13px!important}.quote-row .star{width:36px;height:36px}
 .periods{max-width:100%;min-width:0;overflow-x:auto!important;overflow-y:hidden;flex-wrap:nowrap!important;gap:2px!important;padding:3px 6px!important;margin:0!important;flex:none;scrollbar-width:none}.periods button{min-height:38px;flex:none;font-size:13px!important;padding:5px 11px!important}
 .canvas-wrap{min-height:240px!important;flex:1;touch-action:none}.canvas-wrap canvas{max-width:100%}.hintbar{font-size:11px;line-height:1.5;white-space:normal!important;overflow-wrap:anywhere;padding:5px 8px!important}
 .tabbar{height:calc(48px + env(safe-area-inset-bottom))!important;min-height:48px;flex:none;padding-bottom:env(safe-area-inset-bottom)}.tabbar button span{font-size:12px!important}.tabbar button{min-height:44px}
 .h5-bar{display:flex;align-items:center;gap:6px;flex:none;padding:3px 8px;background:#111722;border-bottom:1px solid #29313c;min-height:38px;overflow-x:auto}.h5-bar[hidden]{display:none!important}.h5-panel-button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #3b4d66;background:#1b2739;color:#dce9ff;border-radius:5px;min-height:34px;padding:4px 12px;font:13px inherit;white-space:nowrap;flex:none}
 .mw-side.h5-moved{width:auto!important}#viewPair2:not([hidden]),#viewPair4:not([hidden]){padding:4px!important;gap:0!important;min-height:0;overflow:hidden!important}.mw-grid[data-n="2"],.mw-grid[data-n="4"]{display:grid!important;grid-template-columns:1fr!important;grid-auto-rows:minmax(300px,48dvh);grid-template-rows:none!important;overflow-y:auto!important;gap:6px!important;align-content:start;overscroll-behavior:contain}.mw-grid.max[data-n]{grid-template-rows:minmax(0,1fr)!important;grid-auto-rows:1fr;align-content:stretch;overflow:hidden!important}.mw-grid.max .mw-box:not([hidden]){height:100%;min-height:0}
 /* Chart iframes use all of their own viewport and retain their parent maximize button. */
 .sa-pane .h5-bar{display:none!important}.sa-pane .canvas-wrap{min-height:100px!important}.sa-pane .quote-row{padding-left:76px!important;min-height:34px}.sa-pane #quote{font-size:12px}.sa-pane .sa-pane-bar button{min-height:30px;padding:2px 6px}.sa-pane .chart-page{overflow:hidden}.sa-pane .quote-row #stockCode{display:none}
 body.h5-wave>header{height:auto;min-height:0;display:flex;flex-wrap:wrap;gap:0;padding:2px 0;flex:none}body.h5-wave>header .brand{display:none}body.h5-wave>header .searchbox{flex:1 1 calc(100% - 16px)!important}body.h5-wave>header .periods{width:100%;border:0;border-radius:0}
 body.h5-wave #tabs{min-height:40px;height:40px;overflow-x:auto;flex:none}body.h5-wave #tabs button{min-height:40px;white-space:nowrap;padding:5px 12px}
 body.h5-wave #viewChart{padding:4px;flex-direction:column!important;min-height:0}body.h5-wave #viewChart>.chart-col{width:100%;flex:1;min-height:0}body.h5-wave #viewChart>.chart-col>.toolbar{padding:5px 8px;min-height:40px;gap:5px 8px;flex-wrap:wrap}body.h5-wave #quote{font-size:13px}body.h5-wave #stockCode{padding:0;border:0}body.h5-wave #stockName{font-size:15px}body.h5-wave .wave-controls{margin:0!important}body.h5-wave .wave-controls select{font-size:13px!important;min-height:34px}body.h5-wave .toolbar>.zoomctl{flex:1;min-width:150px}body.h5-wave .toolbar>.toggles{margin:0}body.h5-wave .canvas-wrap{min-height:240px!important}
 body.h5-st .toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:4px!important;padding:4px!important;align-items:center}.h5-st .toolbar>.field{min-width:0;width:auto}.h5-st .toolbar #q{width:100%;height:36px;font-size:16px}.h5-st .toolbar #go{height:36px;padding:2px 12px}.h5-st .toolbar #btnStar{height:36px;min-width:36px}.h5-st .toolbar>.field:has(.seg){grid-column:1 / -1}.h5-st .toolbar .seg{display:flex;overflow-x:auto}.h5-st .toolbar .seg button{flex:1;min-height:34px;padding:3px 10px;font-size:13px}.h5-st .compact-actions{grid-column:1 / -1;display:flex;gap:4px;justify-content:flex-end}.h5-st .compact-actions button{min-height:32px;padding:3px 10px}.h5-st .chart-body{flex:1;min-height:0}.h5-st .chart-col{width:100%!important}.h5-st #chart{height:100%!important;min-height:180px!important}.h5-st .panel-h{min-height:22px;padding:0 6px}.h5-st .panel-h b{font-size:12px;overflow:hidden;text-overflow:ellipsis}.h5-st .wrap{min-height:0}.h5-st .st-drawer{max-width:100%;width:min(380px,100%);padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}.h5-st .st-drawer input{min-height:42px}.h5-st .st-drawer header button{min-height:40px}.h5-st .st-drawer-body{box-sizing:border-box}
 /* Simulation cards, controls, ledgers and forms remain scrollable within the page. */
 body[data-section=paper] main{overflow-x:hidden;overflow-y:auto;padding-bottom:16px}.pp-hero{margin:10px!important;padding:14px!important}.pp-equity{font-size:30px!important;overflow-wrap:anywhere}.pp-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px 8px!important}.pp-cell .k{font-size:12px!important}.pp-cell .v{font-size:15px!important;overflow-wrap:anywhere}.pp-dash-rows{grid-template-columns:1fr!important}.pp-dash-row{flex-wrap:wrap}.pp-dash-row .v{overflow-wrap:anywhere;min-width:0}.pp-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}.pp-stat{min-width:0}.pp-stat .k,.pp-pos-sub,.pp-hint,.pp-risk-note{font-size:12px!important}.pp-actions{flex-wrap:wrap;gap:8px}.pp-actions button,.pp-card button{min-height:40px}.pp-card{max-width:100%;min-width:0}.pp-line{flex-wrap:wrap;gap:5px}.pp-pos{gap:10px;flex-wrap:wrap}.pp-trade{overflow-wrap:anywhere}.pp-sub{white-space:normal}.subpage{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}.subpage .subhead{min-height:48px}.stack{padding:10px!important}.form-row{min-width:0}.form-row input,.form-row select{max-width:100%;min-width:0}.modal,.modal-card,.dialog{max-width:calc(100vw - 20px)!important}
 .h5-table-scroll{max-width:100%;overflow:auto;overscroll-behavior-x:contain}.h5-table-scroll table{min-width:600px}.paper-wrap{max-width:100%;padding:10px!important}.paper-head{flex-wrap:wrap;gap:8px}.paper-actions{flex-wrap:wrap;margin-left:0!important}.paper-actions button{min-height:42px}.paper-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}.paper-form{display:grid!important;grid-template-columns:1fr!important;gap:12px}.paper-form input{width:100%;min-height:42px}.paper-scroll{max-width:100%;overflow:auto}.paper-table{min-width:720px}.paper-head h2{font-size:20px}.paper-note{font-size:13px;overflow-wrap:anywhere}
}
@media(max-width:900px) and (orientation:landscape){
 .site-nav,.sa-nav{height:36px!important;min-height:36px}.site-nav a,.sa-nav a{min-height:36px}.h5-bar{min-height:32px;padding:0 8px}.h5-panel-button{min-height:30px}.searchbox{margin:3px 8px!important}.searchbox #q,.searchbox #btnGo{height:36px}.tabbar{height:40px!important;min-height:40px}.canvas-wrap{min-height:180px!important}.mw-grid[data-n="2"],.mw-grid[data-n="4"]{grid-template-columns:1fr 1fr!important;grid-auto-rows:minmax(260px,80dvh)}.mw-grid.max[data-n]{grid-template-columns:1fr!important}.h5-st .toolbar{display:flex;flex-wrap:nowrap}.h5-st .toolbar>.field:first-child{flex:1}.h5-st .toolbar #q{min-width:110px}.h5-st .toolbar>.field:has(.seg){max-width:42%}.h5-st .compact-actions{flex:none}.h5-st .compact-actions button{padding:3px 6px}.h5-st .panel-h{display:none}body.h5-wave>header{flex-direction:row;flex-wrap:nowrap}body.h5-wave>header .searchbox{flex:1!important;min-width:180px}body.h5-wave>header .periods{width:auto;flex:1!important}body.h5-wave #viewChart{overflow-y:auto!important}body[data-section=chanlun] .chart-page{min-height:460px}
}
.h5-bar>.compact-actions{display:flex;margin-left:auto;gap:4px}.h5-bar>.compact-actions button{min-height:34px;padding:3px 9px;font-size:13px}
@media(max-width:900px){.h5-st .toolbar>.field:first-child{grid-column:1;grid-row:1}.h5-st .toolbar #go{grid-column:2;grid-row:1}.h5-st .toolbar #btnStar{grid-column:3;grid-row:1}.h5-st .toolbar>.field:has(.seg){grid-column:1/-1;grid-row:2}.h5-st .toolbar>.compact-actions{display:none}.h5-st .toolbar .seg button{min-height:32px}.h5-st .toolbar #q,.h5-st .toolbar #go,.h5-st .toolbar #btnStar{height:34px}}
.h5-wave-controls{display:contents}.h5-panel-body>.h5-wave-controls{display:flex;flex-direction:column;gap:14px;padding:8px}.h5-panel-body .wave-controls{margin:0}.h5-panel-body .wave-controls select{min-height:40px}.h5-panel-body .wave-controls label{font-size:14px}
@media(max-width:900px){body.h5-wave #viewChart>.chart-col{flex-shrink:1!important}.h5-st .panel-h{display:none}.h5-st .site-nav{height:38px!important;min-height:38px}.h5-st .site-nav a{min-height:38px}.h5-st .h5-bar{min-height:36px;padding:0 6px}.h5-st .toolbar{padding:2px!important}.h5-st .toolbar #q,.h5-st .toolbar #go,.h5-st .toolbar #btnStar{height:32px}.h5-st .toolbar .seg button{min-height:30px}.h5-st .toolbar #q{padding:2px 8px}.h5-st .h5-bar>.compact-actions button,.h5-st .h5-panel-button{min-height:32px}.pp-trade-mid span,.pp-pos-sub{white-space:normal!important;overflow-wrap:anywhere}.pp-trade-r{max-width:38%}.pp-trade-r b{overflow-wrap:anywhere}.pp-chart{max-width:100%}}
@media(max-width:900px){.h5-pane .canvas-wrap{min-height:80px!important}.h5-pane .hintbar{font-size:10px!important;line-height:1.3;padding:2px 5px!important}.h5-pane .wave-controls{padding:0 4px!important;margin:0!important}.h5-pane .wave-controls select{font-size:12px!important;min-height:28px}.h5-pane .pbar{padding:2px 5px;gap:5px;min-height:30px}.h5-pane .pbar button{min-height:28px}.h5-pane #dataTime{display:none}.h5-panel-body .shared-row>button:first-child{min-height:40px}}
/* Audit: fit the entire indicator stack inside short landscape screens. */
@media(max-width:900px) and (orientation:landscape){
 body[data-section=chanlun] #viewChart .chart-page{min-height:0!important;overflow:hidden}
 body[data-section=chanlun] #viewChart .canvas-wrap{min-height:80px!important}
 body[data-section=chanlun] #viewChart .hintbar{display:none}
 body.h5-wave #viewChart .canvas-wrap{min-height:80px!important}
}
@media(max-width:900px){
 .site-nav,.sa-nav{padding-top:env(safe-area-inset-top)!important;height:calc(44px + env(safe-area-inset-top))!important;min-height:calc(44px + env(safe-area-inset-top))!important}
 .h5-panel-head button{min-width:64px;min-height:44px}
}
@media(min-width:650px) and (max-width:900px) and (orientation:landscape){
 html:not(.sa-pane) body[data-section=chanlun] #viewChart .chart-page{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr)}
 html:not(.sa-pane) body[data-section=chanlun] #viewChart .searchbox{grid-column:1;grid-row:1;padding:0!important;margin:4px 8px!important;min-width:0}
 html:not(.sa-pane) body[data-section=chanlun] #viewChart .quote-row{grid-column:2;grid-row:1;min-width:0;padding:4px!important;gap:4px}
 html:not(.sa-pane) body[data-section=chanlun] #viewChart #stockCode{display:none}
 html:not(.sa-pane) body[data-section=chanlun] #viewChart .periods{grid-column:1/-1;grid-row:2}
 html:not(.sa-pane) body[data-section=chanlun] #viewChart .canvas-wrap{grid-column:1/-1;grid-row:3}
}
@media(max-width:900px){
 body.h5-legacy:has(#viewPaper:not([hidden]))>header{display:none}
 body.h5-legacy>header .searchbox{width:100%;flex:1 1 100%!important}
}
