/* Cockpit V0.42 — workstation hierarchy: chart + simulations + positions left; engines + opportunities + ticket right. */
html:has(#cockpit.is-active),body:has(#cockpit.is-active){height:100dvh;overflow:hidden}
aside:has(~main #cockpit.is-active){position:fixed;inset:0 auto 0 0;height:100dvh;width:76px;padding:22px 8px;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;z-index:5}
aside:has(~main #cockpit.is-active) .brand{font-size:0;letter-spacing:0}
aside:has(~main #cockpit.is-active) .brand .mark{font-size:25px;margin:0}
aside:has(~main #cockpit.is-active) .workspace,aside:has(~main #cockpit.is-active) .side-footer{display:none}
aside:has(~main #cockpit.is-active) nav{display:flex;flex-direction:column;width:100%;margin-top:35px}
aside:has(~main #cockpit.is-active) nav a{justify-content:center;padding:12px 3px;font-size:9px}
aside:has(~main #cockpit.is-active) nav a span{display:none}
main:has(#cockpit.is-active){position:relative;inset:auto;height:100dvh;max-width:none;margin:0 0 0 76px;padding:0 12px;display:flex;flex-direction:column;overflow:hidden}
main:has(#cockpit.is-active)>header{flex:0 0 48px;min-height:48px;padding:5px 4px;font-size:9px;letter-spacing:.8px;gap:12px}
main:has(#cockpit.is-active) .market-status{display:flex;align-items:center;gap:8px;min-width:0;font-size:9px;letter-spacing:0}
main:has(#cockpit.is-active) .market-status>*{flex:0 0 auto}
#cockpit.is-active{flex:1 1 auto;display:flex;flex-direction:column;gap:5px;width:100%;min-width:0;min-height:0;margin:0;padding:5px 0 7px;overflow:hidden}
#cockpit.is-active .cockpit-heading{display:grid;grid-template-columns:minmax(160px,1fr) minmax(170px,240px) minmax(170px,1fr);align-items:center;gap:10px;flex:0 0 48px;min-height:48px;padding:0 3px}
#cockpit.is-active .cockpit-heading .eyebrow{margin:0 0 2px;font-size:8px;letter-spacing:1px}
#cockpit.is-active .cockpit-heading h1{font-size:20px;line-height:1;letter-spacing:-.4px}
#cockpit.is-active .cockpit-instrument-picker{margin:0;font-size:9px;display:flex;align-items:center;gap:8px}
#cockpit.is-active .cockpit-instrument-picker select{margin:0;min-height:30px;padding:4px 8px;font-size:11px}
#cockpit.is-active .cockpit-focus{min-width:0;gap:2px}
#cockpit.is-active .cockpit-focus>span{font-size:8px;line-height:1.2}
#cockpit.is-active .cockpit-focus strong{font-size:17px;line-height:1.1}
#cockpit.is-active .cockpit-focus .signal-brief{max-width:100%;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#cockpit.is-active .cockpit-kpis{flex:0 0 43px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:0;border:0;background:transparent}
#cockpit.is-active .cockpit-kpis article{min-width:0;padding:3px 9px;border:1px solid var(--line);border-radius:4px;background:#10181e}
#cockpit.is-active .cockpit-kpis article>span{font-size:8px;letter-spacing:.8px}
#cockpit.is-active .cockpit-kpis strong{display:block;margin:0;font-size:15px;line-height:1.2}
#cockpit.is-active .cockpit-kpis p{display:none}
#cockpit.is-active .desk-main-grid{display:grid;grid-template-columns:minmax(0,1.02fr) minmax(0,.98fr);grid-template-rows:minmax(0,1fr);gap:7px;flex:1 1 auto;min-width:0;min-height:0}
#cockpit.is-active .desk-left-column,#cockpit.is-active .desk-right-column{display:grid;min-width:0;min-height:0;gap:6px;overflow:hidden}
#cockpit.is-active .desk-left-column{grid-template-rows:minmax(235px,1.1fr) minmax(130px,.9fr)}
#cockpit.is-active .desk-right-column{grid-template-rows:min-content min-content minmax(150px,1fr) min-content}
#cockpit.is-active .market-chart-panel{display:flex;flex-direction:column;min-width:0;min-height:0;max-height:50dvh;margin:0;padding:6px 8px 5px;overflow:hidden}
#cockpit.is-active .chart-title{margin:0;flex:0 0 auto}
#cockpit.is-active .chart-title h2{font-size:14px;line-height:1.1}
#cockpit.is-active .chart-title .eyebrow,#cockpit.is-active .chart-title .tag{font-size:8px;margin:0}
#cockpit.is-active .chart-subnav{flex:0 0 auto;gap:4px;margin:3px 0}
#cockpit.is-active .chart-subnav button{min-height:21px;padding:2px 7px;font-size:9px}
#cockpit.is-active .chart-subnav span,#cockpit.is-active .chart-legend{font-size:8px}
#cockpit.is-active .chart-canvas{flex:1 1 auto;min-height:65px;height:auto;aspect-ratio:auto}
#cockpit.is-active #market-chart{width:100%;height:100%;min-height:65px}
#cockpit.is-active .chart-legend{flex:0 0 auto;display:flex;gap:9px;margin:2px 0}
#cockpit.is-active .chart-signal{flex:0 0 auto;display:flex;justify-content:space-between;gap:10px;padding:3px 7px;font-size:8px;line-height:1.2}
#cockpit.is-active .strategy-models-wrap{flex:0 0 auto;height:auto;max-height:115px;min-width:0;min-height:0;margin:2px 0 0;overflow:auto;border-top:1px solid var(--line)}
#cockpit.is-active .strategy-models-head{display:flex;justify-content:space-between;gap:8px;padding:3px 4px;font-size:9px;line-height:1.2}
#cockpit.is-active .strategy-models-head small{font-size:8px}
#cockpit.is-active .strategy-models-scroll{overflow:auto}
#cockpit.is-active .strategy-models{width:100%;min-width:0;font-size:9px;line-height:1.1}
#cockpit.is-active .strategy-models thead th{font-size:8px}
#cockpit.is-active .strategy-models th,#cockpit.is-active .strategy-models td{padding:3px 4px;white-space:nowrap}
#cockpit.is-active .strategy-models .strategy-detail-row td,#cockpit.is-active .strategy-detail-cell{white-space:normal;padding:3px 5px;line-height:1.25}
#cockpit.is-active .strategy-detail-cell{display:flex;flex-wrap:wrap;align-items:center;gap:3px 9px;min-width:0;overflow-wrap:anywhere}
#cockpit.is-active .strategy-detail-fact{display:inline-block;max-width:100%;color:#9eb7c1;font:7px/1.25 ui-monospace,monospace;letter-spacing:.1px}
#cockpit.is-active .strategy-detail-fact:first-child{color:#8ce5dc}
#cockpit.is-active .model-copy{padding:2px 5px;font-size:8px}
#cockpit.is-active .cockpit-positions{display:grid;grid-template-rows:auto minmax(0,1fr);align-self:stretch;height:100%;max-height:none;min-width:0;min-height:0;margin:0;padding:5px 7px;overflow:hidden}
#cockpit.is-active .cockpit-positions .panel-head{margin:0 0 3px;gap:8px}
#cockpit.is-active .cockpit-positions h3{font-size:10px}
#cockpit.is-active .cockpit-positions .panel-head .tag{margin-left:auto;padding:2px 4px;font-size:7px}
#cockpit.is-active .cockpit-positions .filter-label{margin:0;font-size:8px;white-space:nowrap}
#cockpit.is-active .cockpit-positions .filter-label select{max-width:125px;padding:3px 5px;font-size:9px}
#cockpit.is-active .cockpit-position-columns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;min-height:0;margin:0;overflow:hidden}
#cockpit.is-active .cockpit-position-columns>article{display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0;overflow:hidden;border:1px solid var(--line);border-radius:4px;padding:3px 5px}
#cockpit.is-active .cockpit-position-columns h4{margin:0 0 3px;font-size:8px;letter-spacing:.6px}
#cockpit.is-active .cockpit-position-list{display:flex;flex-direction:column;gap:3px;min-width:0;min-height:0;overflow:auto}
#cockpit.is-active .cockpit-position-list>p{margin:0;font-size:9px;line-height:1.3}
#cockpit.is-active .cockpit-position-row{display:flex;justify-content:space-between;align-items:center;gap:5px;min-width:0;padding:3px 4px;border-bottom:1px solid var(--line);font-size:8px;line-height:1.25}
#cockpit.is-active .cockpit-position-row>div{min-width:0}
#cockpit.is-active .cockpit-position-row strong{font-size:8px;white-space:nowrap}
#cockpit.is-active .cockpit-position-row small{margin:0;font-size:7px;overflow-wrap:anywhere}
#cockpit.is-active .cockpit-position-row button{flex:0 0 auto;padding:3px 5px;font-size:8px}
#cockpit.is-active .engine-column{min-width:0;min-height:0;margin:0}
#cockpit.is-active .engine-network{display:none}
#cockpit.is-active .engine-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;min-height:0;padding:0}
#cockpit.is-active .engine-card{display:grid;grid-template-rows:auto auto;align-content:start;min-width:0;min-height:0;padding:4px 6px;border-radius:4px}
#cockpit.is-active .engine-top{display:flex;justify-content:space-between;gap:3px;font-size:8px;letter-spacing:.3px;line-height:1.2}
#cockpit.is-active .engine-indicator{padding:1px 3px;font-size:7px}
#cockpit.is-active .engine-card>strong{display:block;min-width:0;margin:2px 0 0;font-size:9px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#cockpit.is-active .engine-card>p,#cockpit.is-active .engine-card details,#cockpit.is-active .engine-viz{display:none}
#cockpit.is-active .cockpit-ai-panel{min-width:0;min-height:0;margin:0;padding:4px 7px;overflow:hidden}
#cockpit.is-active .cockpit-ai-panel .panel-head{margin:0 0 2px}
#cockpit.is-active .cockpit-ai-panel h3{font-size:9px}
#cockpit.is-active #cockpit-ai-status{padding:2px 4px;font-size:7px}
#cockpit.is-active #cockpit-ai-copy{display:flex;flex-direction:column;gap:2px;margin:0;font-size:9px;line-height:1.15}
#cockpit.is-active #cockpit-ai-copy strong{font-size:9px}
#cockpit.is-active #cockpit-ai-copy .ai-scenario-summary,#cockpit.is-active #cockpit-ai-copy .ai-scenario-condition{display:block;overflow:hidden;font-size:8px;line-height:1.15;text-overflow:ellipsis;white-space:nowrap}
#cockpit.is-active .cockpit-opportunities{display:grid;grid-template-rows:auto auto minmax(0,1fr);min-width:0;min-height:0;margin:0;padding:5px 7px;overflow:hidden}
#cockpit.is-active .cockpit-opportunities .panel-head{margin:0 0 3px}
#cockpit.is-active .cockpit-opportunities h3{font-size:10px}
#cockpit.is-active .opportunity-controls{display:flex;align-items:center;gap:7px}
#cockpit.is-active .opportunity-controls .filter-label{margin:0;font-size:8px;white-space:nowrap}
#cockpit.is-active .opportunity-controls select{max-width:105px;padding:3px 5px;font-size:9px}
#cockpit.is-active .opportunity-controls .tag{font-size:7px;padding:2px 4px}
#cockpit.is-active .auto-mode-control{display:flex;align-items:center;gap:3px;margin:0;color:#a7bac5;font-size:7px;white-space:nowrap}
#cockpit.is-active .auto-mode-control input{width:12px;height:12px;margin:0;accent-color:#b8f076}
#cockpit.is-active .auto-mode-control select{width:38px;max-width:38px;padding:2px;font-size:8px}
#cockpit.is-active #auto-mode-status{margin:0 0 3px;font-size:7px;line-height:1.1}
#cockpit.is-active .opportunity-table-scroll{min-height:0;overflow:auto}
#cockpit.is-active .opportunity-table{width:100%;min-width:0;font-size:8px;line-height:1.1}
#cockpit.is-active .opportunity-table th{position:sticky;top:0;z-index:1;padding:4px 3px;font-size:7px;white-space:nowrap}
#cockpit.is-active .opportunity-table td{padding:4px 3px;font-size:8px;white-space:nowrap}
#cockpit.is-active .opportunity-table td[colspan]{white-space:normal;padding:10px}
#cockpit.is-active .opportunity-table .model-copy{padding:3px 5px;font-size:8px}
#cockpit.is-active .dashboard-ticket{display:grid;grid-template-columns:minmax(65px,.6fr) minmax(140px,1.25fr) minmax(74px,.5fr) minmax(84px,.7fr) minmax(84px,.7fr);grid-template-rows:42px;align-items:center;gap:4px;flex:0 0 48px;height:48px;max-height:48px;width:100%;min-width:0;min-height:0;margin:0;padding:3px 5px;overflow:hidden}
#cockpit.is-active .dashboard-ticket .ticket-instrument{grid-column:1;grid-row:1}
#cockpit.is-active .dashboard-ticket .ticket-market{grid-column:2;grid-row:1}
#cockpit.is-active .dashboard-ticket #dashboard-lots{grid-column:3;grid-row:1;margin:0;min-height:30px;padding:3px 5px;font-size:9px}
#cockpit.is-active .dashboard-ticket .ticket-sell{grid-column:4;grid-row:1}
#cockpit.is-active .dashboard-ticket .ticket-buy{grid-column:5;grid-row:1}
#cockpit.is-active .dashboard-ticket .ticket-instrument>span,#cockpit.is-active .dashboard-ticket .ticket-market>span,#cockpit.is-active .dashboard-ticket .ticket-market>span strong,#cockpit.is-active .dashboard-ticket .ticket-market .ticket-mid{font-size:9px}
#cockpit.is-active .dashboard-ticket .ticket-instrument>strong{font-size:12px}
#cockpit.is-active .dashboard-ticket button{min-width:0;min-height:30px;padding:3px 5px;font-size:9px}
#cockpit.is-active .dashboard-ticket>small,#cockpit.is-active .ticket-controls>small,#cockpit.is-active .cockpit-action{display:none!important}
@media(max-width:1000px) and (min-width:761px){main:has(#cockpit.is-active){padding:0 7px}#cockpit.is-active .desk-main-grid{grid-template-columns:minmax(0,1fr) minmax(0,.95fr);gap:4px}#cockpit.is-active .desk-left-column,#cockpit.is-active .desk-right-column{gap:4px}#cockpit.is-active .engine-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#cockpit.is-active .engine-card{grid-template-columns:1fr;grid-template-rows:auto auto}#cockpit.is-active .engine-top{font-size:7px}#cockpit.is-active .engine-card>strong{font-size:8px}#cockpit.is-active .opportunity-table th,#cockpit.is-active .opportunity-table td{padding:3px 2px;font-size:7px}#cockpit.is-active .dashboard-ticket{grid-template-columns:45px minmax(100px,1fr) 65px 65px 65px}}
@media(max-width:760px){html:has(#cockpit.is-active),body:has(#cockpit.is-active){height:auto;min-height:100dvh;overflow:auto}aside:has(~main #cockpit.is-active){position:absolute;inset:0 0 auto;width:100%;height:54px;min-height:54px;padding:4px 10px;flex-direction:row;justify-content:space-between}aside:has(~main #cockpit.is-active) .brand{font-size:16px}aside:has(~main #cockpit.is-active) .workspace,aside:has(~main #cockpit.is-active) .side-footer{display:none}aside:has(~main #cockpit.is-active) nav{width:auto;display:flex;gap:3px;margin:0;overflow:auto}aside:has(~main #cockpit.is-active) nav a{padding:6px 7px;font-size:8px}aside:has(~main #cockpit.is-active) nav a span{display:inline;font-size:8px}main:has(#cockpit.is-active){height:auto;min-height:100dvh;margin:54px 0 0;padding:0 7px;overflow:visible}main:has(#cockpit.is-active)>header{min-height:48px;height:auto;flex-wrap:wrap}#cockpit.is-active{min-height:1000px;overflow:visible}#cockpit.is-active .cockpit-heading{grid-template-columns:minmax(0,1fr) minmax(0,1fr);flex-basis:82px;min-height:82px;gap:4px}#cockpit.is-active .cockpit-instrument-picker{grid-column:1/-1;grid-row:2}#cockpit.is-active .cockpit-focus{grid-column:2;grid-row:1}#cockpit.is-active .cockpit-kpis{flex-basis:40px}#cockpit.is-active .cockpit-kpis article{padding:3px}#cockpit.is-active .cockpit-kpis article>span{font-size:6px}#cockpit.is-active .cockpit-kpis strong{font-size:11px}#cockpit.is-active .desk-main-grid{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;flex:0 0 auto}#cockpit.is-active .desk-left-column{grid-template-rows:minmax(300px,45dvh) 260px}#cockpit.is-active .desk-right-column{grid-template-rows:auto auto minmax(250px,1fr) auto}#cockpit.is-active .market-chart-panel{max-height:50dvh}#cockpit.is-active .cockpit-position-columns{grid-template-columns:1fr;grid-template-rows:repeat(3,minmax(50px,1fr))}#cockpit.is-active .cockpit-positions{min-height:250px}#cockpit.is-active .engine-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#cockpit.is-active .engine-card{min-height:42px}#cockpit.is-active .dashboard-ticket{grid-template-columns:45px minmax(0,1fr) 65px;grid-template-rows:30px 30px;flex-basis:66px}#cockpit.is-active .dashboard-ticket .ticket-instrument{grid-column:1;grid-row:1/3}#cockpit.is-active .dashboard-ticket .ticket-market{grid-column:2/4;grid-row:1}#cockpit.is-active .dashboard-ticket #dashboard-lots{grid-column:1;grid-row:2;min-height:26px;font-size:8px}#cockpit.is-active .dashboard-ticket .ticket-sell{grid-column:2;grid-row:2}#cockpit.is-active .dashboard-ticket .ticket-buy{grid-column:3;grid-row:2}}

/* Visible strategy execution mode; Expert is enabled only for the authorized demo account. */
#cockpit.is-active .cockpit-heading{grid-template-columns:minmax(145px,1fr) minmax(170px,230px) minmax(175px,220px) minmax(190px,240px)}
.execution-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:3px;align-items:center;min-width:0}
.execution-mode-switch>span{grid-column:1/-1;font-size:8px;letter-spacing:.8px;color:var(--muted)}
.execution-mode-switch>small{grid-column:1/-1;min-width:0;color:var(--muted);font-size:7px;line-height:1.2;overflow-wrap:anywhere}
.execution-mode-switch>small[data-state="blocked"]{color:#e4b969}
.execution-mode-switch>small[data-state="ready"]{color:#72d7b8}
.execution-mode-switch button{min-width:0;min-height:27px;padding:4px 6px;font-size:8px;letter-spacing:.3px;border:1px solid var(--line);background:#111a22;color:var(--muted)}
.execution-mode-switch button[aria-pressed="true"]{border-color:var(--cyan);color:#d9ffff;background:#103039}
.execution-mode-switch button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:900px){#cockpit.is-active .cockpit-heading{grid-template-columns:minmax(120px,1fr) minmax(150px,1fr) minmax(160px,1fr);grid-template-rows:36px 30px;flex-basis:70px;min-height:70px}.execution-mode-switch{grid-column:1/3;grid-row:2;grid-template-columns:1fr 1fr 1fr}.execution-mode-switch>span{grid-column:auto}.execution-mode-switch button{min-height:25px;font-size:7px}.cockpit-focus{grid-column:3;grid-row:1/3}}
@media(max-width:900px){#cockpit.is-active .cockpit-heading{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:34px 28px;flex-basis:66px;min-height:66px;gap:2px;padding:0 2px}#cockpit.is-active .cockpit-heading>div:first-child{grid-column:1;grid-row:1}#cockpit.is-active .cockpit-instrument-picker{grid-column:2;grid-row:1;justify-content:flex-end;min-width:0}#cockpit.is-active .cockpit-instrument-picker select{min-width:0;max-width:100%}#cockpit.is-active .execution-mode-switch{grid-column:2;grid-row:2;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2px}#cockpit.is-active .execution-mode-switch>span{grid-column:1/-1;font-size:6px}#cockpit.is-active .execution-mode-switch button{min-height:21px;padding:2px;font-size:6px;letter-spacing:0}#cockpit.is-active .cockpit-focus{grid-column:1;grid-row:2;align-self:center;min-width:0}#cockpit.is-active .cockpit-focus>span{font-size:6px!important}#cockpit.is-active .cockpit-focus strong{font-size:12px!important}}
@media(max-width:480px){#cockpit.is-active .cockpit-heading{grid-template-rows:31px 27px;flex-basis:60px;min-height:60px}#cockpit.is-active .execution-mode-switch button{font-size:5px}#cockpit.is-active .cockpit-instrument-picker{font-size:5px!important;gap:1px!important}#cockpit.is-active .cockpit-instrument-picker select{font-size:7px!important;padding:2px!important}}
#cockpit.is-active .desk-right-column{grid-template-rows:min-content min-content min-content;align-content:start}
#cockpit.is-active .cockpit-opportunities{max-height:330px;grid-template-rows:auto minmax(0,1fr)}
#cockpit.is-active .opportunity-table-scroll{max-height:264px}
#cockpit.is-active .opportunity-table tbody tr{height:24px}
#cockpit.is-active .dashboard-ticket{grid-template-columns:minmax(0,.34fr) minmax(0,.66fr);grid-template-rows:1fr;align-items:stretch;gap:5px;flex:0 0 94px;height:94px;max-height:94px;padding:4px}
#cockpit.is-active .ticket-guidance{grid-column:1;grid-row:1;min-width:0;min-height:0;overflow:hidden;border:1px solid var(--line);border-radius:4px;background:#10181e}
#cockpit.is-active #cockpit-ai{height:100%;padding:4px 6px}
#cockpit.is-active #cockpit-ai .panel-head{align-items:center;gap:4px;margin:0 0 3px}
#cockpit.is-active #cockpit-ai .panel-head h3{font-size:8px;letter-spacing:.5px}
#cockpit.is-active #cockpit-ai-status{max-width:58%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:7px}
#cockpit.is-active #cockpit-ai-copy{display:flex;flex-direction:column;gap:2px;margin:0;font-size:8px;line-height:1.1}
#cockpit.is-active #cockpit-ai-copy strong{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#cockpit.is-active #cockpit-ai-copy .ai-scenario-summary,#cockpit.is-active #cockpit-ai-copy .ai-scenario-condition{display:none}
#cockpit.is-active #cockpit-ai-copy>span:last-child{overflow:hidden;font-size:7px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap}
#cockpit.is-active .ticket-controls{display:grid;grid-column:2;grid-row:1;grid-template-columns:minmax(48px,.55fr) minmax(78px,1fr) minmax(56px,.75fr) minmax(70px,1fr) minmax(70px,1fr);grid-template-rows:1fr;align-items:center;gap:4px;min-width:0;min-height:0}
#cockpit.is-active .ticket-controls .ticket-instrument{grid-column:1;grid-row:1}
#cockpit.is-active .ticket-controls .ticket-market{grid-column:2;grid-row:1}
#cockpit.is-active .ticket-controls #dashboard-lots{grid-column:3;grid-row:1;min-width:0}
#cockpit.is-active .ticket-controls .ticket-sell{grid-column:4;grid-row:1}
#cockpit.is-active .ticket-controls .ticket-buy{grid-column:5;grid-row:1}
#cockpit.is-active .ticket-controls .ticket-instrument>span,#cockpit.is-active .ticket-controls .ticket-market>span,#cockpit.is-active .ticket-controls .ticket-market>span strong,#cockpit.is-active .ticket-controls .ticket-market .ticket-mid{font-size:8px}
#cockpit.is-active .ticket-controls .ticket-instrument>strong{font-size:11px}
#cockpit.is-active .ticket-controls button{min-width:0;min-height:38px;padding:3px;font-size:8px;white-space:nowrap}
@media(max-width:1000px) and (min-width:761px){#cockpit.is-active .ticket-controls{grid-template-columns:minmax(43px,.5fr) minmax(68px,.9fr) minmax(48px,.65fr) minmax(62px,.9fr) minmax(62px,.9fr)}}
@media(max-width:760px){#cockpit.is-active .desk-right-column{grid-template-rows:min-content min-content min-content;align-content:start}#cockpit.is-active .cockpit-opportunities{max-height:330px}#cockpit.is-active .dashboard-ticket{grid-template-columns:minmax(0,.34fr) minmax(0,.66fr);grid-template-rows:1fr;flex-basis:94px;height:94px;max-height:94px}#cockpit.is-active .ticket-controls{grid-template-columns:minmax(40px,.5fr) minmax(64px,.9fr) minmax(45px,.6fr) minmax(56px,.8fr) minmax(56px,.8fr);gap:3px}}
@media(max-width:480px){#cockpit.is-active .dashboard-ticket{grid-template-columns:1fr;grid-template-rows:50px 64px;flex-basis:120px;height:120px;max-height:120px}#cockpit.is-active .ticket-guidance{grid-column:1;grid-row:1}#cockpit.is-active .ticket-controls{grid-column:1;grid-row:2;grid-template-columns:45px minmax(0,1fr) 58px 1fr 1fr;gap:2px}#cockpit.is-active .ticket-controls button{font-size:6px;padding:2px}}

#cockpit.is-active .dashboard-ticket{flex-basis:82px;height:82px;max-height:82px}
#cockpit.is-active .ticket-controls{grid-template-rows:38px 34px}
#cockpit.is-active #scalp-master{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:minmax(84px,.7fr) auto minmax(120px,1.3fr);grid-template-rows:18px 12px;align-items:center;gap:1px 5px;min-width:0;padding:2px 4px;border:1px solid var(--line);border-radius:4px;background:#0b151b}
#cockpit.is-active .scalp-master-toggle{grid-column:1;grid-row:1/3;display:flex;align-items:center;gap:4px;white-space:nowrap;font-size:8px;font-weight:700}
#cockpit.is-active .scalp-master-toggle input{width:13px;height:13px;margin:0;accent-color:#d9f084}
#cockpit.is-active #scalp-master-state{grid-column:2;grid-row:1;font-size:7px;padding:1px 3px}
#cockpit.is-active .scalp-master-keys{grid-column:3;grid-row:1;display:flex;gap:5px;align-items:center;justify-content:flex-end;font-size:7px;white-space:nowrap}
#cockpit.is-active .scalp-master-keys span{display:flex;gap:2px;align-items:center}
#cockpit.is-active .scalp-master-keys kbd{padding:1px 3px;font-size:7px;min-width:17px}
#cockpit.is-active #scalp-master-status{grid-column:2/4;grid-row:2;min-width:0;margin:0;overflow:hidden;font-size:7px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap;color:#a9c0c8}
@media(max-width:760px){#cockpit.is-active .dashboard-ticket{flex-basis:108px;height:108px;max-height:108px}#cockpit.is-active .ticket-controls{grid-template-rows:38px 34px}}
@media(max-width:480px){#cockpit.is-active .dashboard-ticket{grid-template-rows:50px 80px;flex-basis:138px;height:138px;max-height:138px}#cockpit.is-active .ticket-controls{grid-template-rows:38px 34px}#cockpit.is-active .scalp-master-toggle{font-size:7px}#cockpit.is-active .scalp-master-keys{gap:2px;font-size:6px}#cockpit.is-active .scalp-master-keys kbd{font-size:6px}}
#cockpit.is-active .scalp-marker{display:inline-block;margin-left:5px;padding:1px 4px;border:1px solid #d9f084;border-radius:3px;color:#d9f084;font:700 7px ui-monospace,monospace;vertical-align:middle}
#cockpit.is-active .dashboard-ticket #dashboard-order-status{grid-column:1/-1;grid-row:2;display:block!important;min-width:0;margin:0;padding:2px 4px;overflow:hidden;color:#b8d3dc;background:#0a1821;border-left:2px solid #58d6c0;font-size:8px;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:760px){#cockpit.is-active .dashboard-ticket #dashboard-order-status{grid-row:3}#cockpit.is-active .dashboard-ticket{grid-template-rows:30px 30px 12px;flex-basis:78px;height:78px;max-height:78px}}

#cockpit.is-active .strategy-marker{display:inline-block;margin-left:5px;padding:1px 4px;border:1px solid #68d7c1;border-radius:3px;color:#68d7c1;font:700 7px ui-monospace,monospace;vertical-align:middle}

/* Keep the opportunity list compact and reserve a real operator area below it. */
#cockpit.is-active .desk-right-column{grid-template-rows:min-content minmax(130px,1fr) minmax(25dvh,auto);align-content:stretch;overflow:hidden}
#cockpit.is-active .cockpit-opportunities{min-height:0;max-height:none;grid-template-rows:auto auto minmax(0,1fr)}
#cockpit.is-active .opportunity-table-scroll{min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain}
#cockpit.is-active .dashboard-ticket{flex:0 0 auto;height:auto;min-height:25dvh;max-height:none;grid-template-columns:minmax(0,.34fr) minmax(0,.66fr);grid-template-rows:minmax(0,1fr);align-items:stretch;padding:8px;overflow:visible}
#cockpit.is-active .ticket-guidance{min-height:0}
#cockpit.is-active .ticket-controls{grid-template-rows:minmax(40px,.7fr) minmax(64px,1fr);align-content:stretch;min-height:0}
#cockpit.is-active .ticket-controls button{min-height:42px;font-size:10px}
#cockpit.is-active .ticket-controls #dashboard-order-status{grid-row:3}
#cockpit.is-active .cockpit-position-columns{min-height:0}
#cockpit.is-active .cockpit-position-columns>article{min-height:0}
#cockpit.is-active .cockpit-position-list{overscroll-behavior:contain;scrollbar-gutter:stable}
#cockpit.is-active .cockpit-position-row{flex:0 0 auto;align-items:flex-start;min-height:44px;padding:5px 5px;font-size:9px}
#cockpit.is-active .cockpit-position-row>div.position-details{display:grid;gap:2px;min-width:0;overflow-wrap:anywhere}
#cockpit.is-active .cockpit-position-row strong{display:block;white-space:normal;font-size:9px;line-height:1.25}
#cockpit.is-active .cockpit-position-row small{display:block;font-size:8px;line-height:1.25;white-space:normal}
#cockpit.is-active .cockpit-position-row button{margin-top:2px;min-height:24px}
@media(max-width:760px){#cockpit.is-active .desk-right-column{grid-template-rows:auto minmax(220px,1fr) minmax(32dvh,auto);align-content:stretch;overflow:visible}#cockpit.is-active .cockpit-opportunities{max-height:none;min-height:220px}#cockpit.is-active .opportunity-table-scroll{max-height:32dvh}#cockpit.is-active .dashboard-ticket{min-height:32dvh;height:auto;max-height:none}#cockpit.is-active .ticket-controls{grid-template-rows:minmax(42px,.7fr) minmax(64px,1fr)}}

/* V0.48: give each broker position a readable, uncut row and its own scroll area. */
#cockpit.is-active .desk-left-column{grid-template-rows:minmax(0,1fr) minmax(150px,1fr)}
#cockpit.is-active .cockpit-positions{display:grid;grid-template-rows:auto minmax(0,1fr);height:100%;min-height:0;max-height:none;overflow:hidden}
#cockpit.is-active .cockpit-position-columns{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,2fr) minmax(0,1fr);min-height:0;overflow:hidden}
#cockpit.is-active .cockpit-position-columns>article:first-child{grid-column:1/-1;min-height:0}
#cockpit.is-active .cockpit-position-columns>article{min-width:0;min-height:0;overflow:hidden}
#cockpit.is-active #cockpit-open-positions{min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
#cockpit.is-active #cockpit-pending-orders,#cockpit.is-active #cockpit-closed-history{min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain}
#cockpit.is-active .cockpit-position-row{display:grid;grid-template-columns:minmax(0,1fr) 64px;gap:8px;min-width:0;min-height:52px;max-width:100%;align-items:center;overflow:visible}
#cockpit.is-active .cockpit-position-row .position-details{min-width:0;overflow:visible;overflow-wrap:anywhere}
#cockpit.is-active .cockpit-position-row strong,#cockpit.is-active .cockpit-position-row small{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
#cockpit.is-active .cockpit-position-row button{min-width:58px;min-height:30px;align-self:center}
#cockpit.is-active .cockpit-opportunities{min-height:0;max-height:none;grid-template-rows:auto auto minmax(0,1fr)}
#cockpit.is-active .opportunity-table-scroll{min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
#cockpit.is-active .dashboard-ticket{min-height:25dvh;height:auto;max-height:none;overflow:visible}
@media(max-width:760px){#cockpit.is-active .desk-left-column{grid-template-rows:minmax(300px,45dvh) auto}#cockpit.is-active .cockpit-positions{min-height:34dvh;height:auto;max-height:none}#cockpit.is-active .cockpit-position-columns{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(160px,2fr) repeat(2,minmax(105px,1fr));overflow:visible}#cockpit.is-active .cockpit-position-columns>article:first-child{grid-column:1}#cockpit.is-active .cockpit-position-row{grid-template-columns:minmax(0,1fr) 62px;min-height:50px}}

/* Short landscape panes (including the in-app browser) stay a dashboard instead of stacking a page-length layout. */
@media(max-width:760px) and (min-width:561px) and (min-height:430px) and (max-height:620px){
 html:has(#cockpit.is-active),body:has(#cockpit.is-active){height:100dvh;min-height:0;overflow:hidden}
 aside:has(~main #cockpit.is-active){position:fixed;inset:0 auto 0 0;width:48px;height:100dvh;min-height:0;padding:8px 3px;flex-direction:column;justify-content:flex-start}
 aside:has(~main #cockpit.is-active) .brand{font-size:0}
 aside:has(~main #cockpit.is-active) .brand .mark{font-size:20px}
 aside:has(~main #cockpit.is-active) nav{width:100%;display:flex;flex-direction:column;gap:2px;margin:28px 0 0;overflow:visible}
 aside:has(~main #cockpit.is-active) nav a{justify-content:center;padding:8px 1px;font-size:7px}
 aside:has(~main #cockpit.is-active) nav a span{display:none}
 main:has(#cockpit.is-active){height:100dvh;min-height:0;margin:0 0 0 48px;padding:0 6px;overflow:hidden}
 main:has(#cockpit.is-active)>header{flex:0 0 38px;height:38px;min-height:38px;top:0;padding:3px 2px}
 #cockpit.is-active{flex:1 1 0;min-height:0;height:auto;padding:2px 0 4px;gap:3px;overflow:hidden}
 #cockpit.is-active .cockpit-heading{flex:0 0 38px;height:38px;min-height:38px;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr) minmax(0,.9fr);padding:0}
 #cockpit.is-active .cockpit-kpis{flex:0 0 32px;height:32px;min-height:32px;margin:0}
 #cockpit.is-active .desk-main-grid{display:grid;flex:1 1 0;min-width:0;min-height:0;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:4px;overflow:hidden}
 #cockpit.is-active .desk-left-column{grid-template-rows:minmax(0,1fr) minmax(0,.78fr);gap:4px}
 #cockpit.is-active .market-chart-panel{max-height:50dvh;min-height:0;padding:4px 5px}
 #cockpit.is-active .strategy-models-wrap{max-height:76px}
 #cockpit.is-active .desk-right-column{grid-template-rows:min-content minmax(0,1fr) minmax(25dvh,auto);gap:4px;align-content:stretch;overflow:hidden}
 #cockpit.is-active .engine-network{display:none}
 #cockpit.is-active .engine-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(30px,1fr));min-height:64px;gap:3px}
 #cockpit.is-active .engine-card{min-height:0;padding:3px 4px}
 #cockpit.is-active .engine-card>p,#cockpit.is-active .engine-card details{display:none}
 #cockpit.is-active .cockpit-opportunities{min-height:0;max-height:none;overflow:hidden}
 #cockpit.is-active .opportunity-table-scroll{min-height:0;max-height:none;overflow:auto}
 #cockpit.is-active .dashboard-ticket{min-height:25dvh;height:auto;max-height:none;overflow:hidden;padding:4px}
 #cockpit.is-active .ticket-guidance{min-height:0}
 #cockpit.is-active .ticket-controls{grid-template-rows:minmax(32px,1fr) minmax(32px,1fr);gap:2px}
 #cockpit.is-active .cockpit-positions{min-height:0;height:100%;max-height:none;padding:3px}
 #cockpit.is-active .cockpit-position-columns{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,2fr) minmax(0,1fr);overflow:hidden;gap:3px}
 #cockpit.is-active .cockpit-position-columns>article:first-child{grid-column:1/-1}
 #cockpit.is-active #cockpit-open-positions,#cockpit.is-active #cockpit-pending-orders,#cockpit.is-active #cockpit-closed-history{min-height:0;max-height:none;overflow:auto}
 #cockpit.is-active .cockpit-position-row{grid-template-columns:minmax(0,1fr) 46px;gap:3px;min-height:40px;padding:3px;font-size:7px}
 #cockpit.is-active .cockpit-position-row strong{font-size:7px;line-height:1.1}
 #cockpit.is-active .cockpit-position-row small{font-size:6px;line-height:1.1}
 #cockpit.is-active .cockpit-position-row button{min-width:42px;min-height:22px;font-size:6px}
}


/* V0.49: keep the operator controls inside the narrow cockpit column. */
@media(max-width:760px) and (min-width:561px) and (min-height:430px) and (max-height:620px){
 #cockpit.is-active .ticket-controls{grid-template-columns:minmax(0,1fr) 48px minmax(0,1fr);grid-template-rows:26px 36px 24px 12px;gap:3px;overflow:hidden}
 #cockpit.is-active .ticket-controls .ticket-instrument{display:none}
 #cockpit.is-active .ticket-controls .ticket-market{grid-column:1/-1;grid-row:1;display:flex;justify-content:space-between;min-width:0}
 #cockpit.is-active .ticket-controls #dashboard-lots{grid-column:2;grid-row:2;width:100%;min-width:0;padding:1px;font-size:8px}
 #cockpit.is-active .ticket-controls .ticket-sell{grid-column:1;grid-row:2}
 #cockpit.is-active .ticket-controls .ticket-buy{grid-column:3;grid-row:2}
 #cockpit.is-active .ticket-controls button{min-height:34px;padding:2px;font-size:8px;white-space:normal;line-height:1.1}
 #cockpit.is-active #scalp-master{grid-column:1/-1;grid-row:3;grid-template-columns:minmax(0,1fr) auto minmax(0,1.25fr);grid-template-rows:20px 12px;gap:1px 3px;padding:1px 2px}
 #cockpit.is-active .scalp-master-toggle{grid-column:1;grid-row:1;font-size:7px}
 #cockpit.is-active #scalp-master-state{grid-column:2;grid-row:1}
 #cockpit.is-active .scalp-master-keys{grid-column:3;grid-row:1;gap:2px;font-size:6px}
 #cockpit.is-active .scalp-master-keys kbd{min-width:12px;padding:1px;font-size:6px}
 #cockpit.is-active #scalp-master-status{grid-column:1/-1;grid-row:2;font-size:6px}
 #cockpit.is-active .ticket-controls #dashboard-order-status{grid-column:1/-1;grid-row:4;font-size:6px;line-height:1.1}
}


/* V0.51: preserve scrollable position and opportunity rows in compact landscape. */
@media(max-width:760px) and (min-width:561px) and (min-height:430px) and (max-height:620px){
 #cockpit.is-active .cockpit-position-list{height:100%;max-height:none;min-height:0;overflow:auto;overscroll-behavior:contain}
 #cockpit.is-active .strategy-models-wrap,#cockpit.is-active .opportunity-table-scroll{min-height:0;overflow:auto;overscroll-behavior:contain}
}

/* Portrait phones: use document scrolling for the stacked workstation; keep each data list independently scrollable. */
@media(max-width:760px) and (orientation:portrait){
 html:has(#cockpit.is-active),body:has(#cockpit.is-active){height:auto;min-height:100dvh;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
 main:has(#cockpit.is-active){height:auto;min-height:100dvh;overflow:visible}
 #cockpit.is-active{height:auto;min-height:0;overflow:visible;flex:0 0 auto}
 #cockpit.is-active .desk-main-grid{height:auto;min-height:0;overflow:visible}
 #cockpit.is-active .desk-left-column,#cockpit.is-active .desk-right-column{height:auto;min-height:0;overflow:visible}
 #cockpit.is-active .cockpit-positions{height:auto;overflow:visible}
 #cockpit.is-active .cockpit-position-columns{height:auto;overflow:visible}
 #cockpit.is-active .cockpit-position-columns>article{min-height:160px}
 #cockpit.is-active .cockpit-position-list,#cockpit.is-active .opportunity-table-scroll{max-height:40dvh;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
}

.ai-model-control{display:flex;align-items:center;gap:5px;color:#7d9da5;font-size:8px;letter-spacing:.08em;white-space:nowrap}.ai-model-control select{max-width:142px;min-height:22px;padding:2px 5px;background:#0b171d;color:#d7e7e7;border:1px solid #24414a;border-radius:3px;font-size:9px}
#cockpit.is-active .opportunity-diagnostics{border-top:1px solid var(--line,#24404a);margin-top:.45rem;padding-top:.35rem;font-size:.72rem}
#cockpit.is-active .opportunity-diagnostics>summary{cursor:pointer;color:var(--muted,#91a8ae);letter-spacing:.08em}
#cockpit.is-active .opportunity-diagnostics-scroll{max-height:220px;overflow:auto;overscroll-behavior:contain}
#cockpit.is-active .opportunity-diagnostics-table{width:100%;border-collapse:collapse;font-size:.72rem}
#cockpit.is-active .opportunity-diagnostics-table th,#cockpit.is-active .opportunity-diagnostics-table td{padding:.3rem .45rem;border-bottom:1px solid var(--line,#24404a);text-align:left}

/* Global Engine model and explicit second-opinion controls. */
#cockpit.is-active .cockpit-heading{grid-template-columns:minmax(140px,1fr) minmax(150px,210px) minmax(180px,230px) minmax(175px,220px) minmax(150px,200px)}
#cockpit.is-active .cockpit-engine-model-control{display:flex;flex-wrap:wrap;align-content:center;gap:2px 6px;min-width:0;margin:0;font-size:8px}
#cockpit.is-active .cockpit-engine-model-control select{max-width:100%;width:100%;margin:0;min-height:23px}
#cockpit.is-active #engine-model-setting-status{flex-basis:100%;font-size:7px;line-height:1.1;white-space:normal}
#cockpit.is-active #cockpit-ai .panel-head{flex-wrap:wrap}
#cockpit.is-active #cockpit-ai .ai-model-control{min-width:0}
#cockpit.is-active #cockpit-ai .ai-model-control select{max-width:108px}
#cockpit.is-active #cockpit-additional-analysis{padding:3px 5px;font-size:7px;white-space:nowrap}
#cockpit.is-active .cockpit-ai-results{display:flex;flex-direction:column;gap:3px;max-height:62px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;font-size:8px;line-height:1.2}
#cockpit.is-active .cockpit-ai-results>strong{font-size:9px;line-height:1.15}
#cockpit.is-active .cockpit-ai-results .ai-scenario-meta{font-size:7px;color:#8da7b0}
#cockpit.is-active .cockpit-ai-results .ai-scenario-technical{font-size:7px;color:#b8e0d7}
#cockpit.is-active .cockpit-ai-results .ai-evaluation{padding:2px 4px;border:1px solid #406357;color:#9ce0bd}
#cockpit.is-active .cockpit-ai-results .ai-evaluation.is-conflict{border-color:#8e5b47;color:#f1b279}
#cockpit.is-active .cockpit-ai-results .ai-evaluation.is-aligned{border-color:#3c7c65;color:#8de4b4}
@media(max-width:900px){#cockpit.is-active .cockpit-heading{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:31px 28px 29px;flex-basis:92px;min-height:92px}#cockpit.is-active .cockpit-heading>div:first-child{grid-column:1;grid-row:1}#cockpit.is-active .cockpit-instrument-picker{grid-column:2;grid-row:1}#cockpit.is-active .cockpit-engine-model-control{grid-column:1/-1;grid-row:3;display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center}#cockpit.is-active #engine-model-setting-status{display:none}#cockpit.is-active .execution-mode-switch{grid-column:2;grid-row:2}#cockpit.is-active .cockpit-focus{grid-column:1;grid-row:2}#cockpit.is-active #cockpit-ai .ai-model-control{font-size:6px}#cockpit.is-active #cockpit-additional-analysis{font-size:6px}}
@media(max-width:480px){#cockpit.is-active .cockpit-heading{grid-template-rows:27px 25px 26px;flex-basis:82px;min-height:82px}#cockpit.is-active .cockpit-engine-model-control{font-size:6px}#cockpit.is-active .cockpit-engine-model-control select{min-height:20px;font-size:7px;padding:1px 3px}#cockpit.is-active #cockpit-ai .panel-head h3{font-size:7px}#cockpit.is-active .cockpit-ai-results{max-height:48px}}

/* Keep cockpit identity on the left and gather live controls into a compact right cluster. */
@media (min-width:1101px) {
  #cockpit.is-active { overflow: visible; }
  #cockpit.is-active .cockpit-heading {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(165px, 190px) max-content minmax(190px, 220px) minmax(190px, 220px) minmax(120px, 145px);
    align-items: center;
    gap: 10px;
    flex: 0 0 76px;
    min-height: 76px;
    padding: 4px 6px 8px;
    position: relative;
    z-index: 20;
    overflow: visible;
  }
  #cockpit.is-active .cockpit-heading > div:first-child { grid-column: 1; grid-row: 1; }
  #cockpit.is-active .cockpit-heading h1 { font-size: 24px; line-height: 1; letter-spacing: .4px; }
  #cockpit.is-active .cockpit-heading .eyebrow { margin: 0 0 5px; font-size: 8px; letter-spacing: 1.2px; }
  #cockpit.is-active .cockpit-instrument-picker {
    grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: stretch;
    justify-content: center; gap: 4px; min-width: 0; margin: 0; font-size: 8px; letter-spacing: .08em;
  }
  #cockpit.is-active .cockpit-instrument-picker select { width: 100%; max-width: 100%; min-width: 0; min-height: 27px; margin: 0; }
  #cockpit.is-active .instrument-universe { grid-column: 3; grid-row: 1; justify-self: end; align-self: center; position: relative; z-index: 45; }
  #cockpit.is-active .instrument-universe[open] { z-index: 60; }
  #cockpit.is-active .instrument-universe-panel { top: calc(100% + 8px); left: auto; right: 0; z-index: 70; }
  #cockpit.is-active .cockpit-engine-model-control {
    grid-column: 4; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr);
    align-content: center; gap: 4px; min-width: 0; margin: 0; white-space: normal;
  }
  #cockpit.is-active .cockpit-engine-model-control select { width: 100%; max-width: 100%; min-height: 27px; margin: 0; }
  #cockpit.is-active #engine-model-setting-status { margin: 0; font-size: 7px; line-height: 1.1; }
  #cockpit.is-active .execution-mode-switch { grid-column: 5; grid-row: 1; align-self: center; }
  #cockpit.is-active .execution-mode-switch > span { font-size: 8px; }
  #cockpit.is-active .execution-mode-switch button { min-height: 27px; font-size: 7px; }
  #cockpit.is-active .cockpit-focus { grid-column: 6; grid-row: 1; min-width: 0; gap: 3px; }
  #cockpit.is-active .cockpit-focus strong { font-size: 19px; }
  #cockpit.is-active .cockpit-focus .signal-brief { max-width: 100%; font-size: 8px; }
  #cockpit.is-active .cockpit-focus #cockpit-asof { font-size: 7px; }
  #cockpit.is-active:has(#cockpit-instrument:focus) { overflow: visible; position: relative; z-index: 40; }
  #cockpit.is-active #cockpit-instrument-picker { position: relative; z-index: 41; }
  #cockpit.is-active #cockpit-instrument-picker select:focus { position: relative; z-index: 42; }
  #cockpit.is-active:after { border-radius: inherit; }
}

@media (min-width:901px) and (max-width:1100px) {
  #cockpit.is-active .cockpit-heading {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(130px, .8fr);
    grid-template-rows: 34px 32px;
    gap: 5px 9px;
    flex: 0 0 76px;
    min-height: 76px;
    overflow: visible;
  }
  #cockpit.is-active .cockpit-heading > div:first-child { grid-column: 1; grid-row: 1; }
  #cockpit.is-active .cockpit-instrument-picker { grid-column: 2; grid-row: 1; min-width: 0; }
  #cockpit.is-active .instrument-universe { grid-column: 1; grid-row: 2; justify-self: start; align-self: center; position: relative; z-index: 45; }
  #cockpit.is-active .instrument-universe[open] { z-index: 60; }
  #cockpit.is-active .instrument-universe-panel { top: calc(100% + 8px); left: 0; right: auto; z-index: 70; }
  #cockpit.is-active .cockpit-engine-model-control { grid-column: 2 / 4; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
  #cockpit.is-active .execution-mode-switch { grid-column: 3 / 5; grid-row: 1; grid-template-columns: 1fr 1fr; }
  #cockpit.is-active .execution-mode-switch > span { grid-column: 1 / -1; }
  #cockpit.is-active .cockpit-focus { grid-column: 4; grid-row: 2; min-width: 0; }
  #cockpit.is-active:has(#cockpit-instrument:focus) { overflow: visible; position: relative; z-index: 40; }
  #cockpit.is-active #cockpit-instrument-picker { position: relative; z-index: 41; }
  #cockpit.is-active:after { border-radius: inherit; }
}

/* V0.53 mobile cockpit: readable stacked modules with deliberate page and table scrolling. */
@media (max-width:760px) and (orientation:portrait) {
  html:has(#cockpit.is-active),
  body:has(#cockpit.is-active) {
    width:100%; height:auto; min-height:100dvh; overflow-x:hidden; overflow-y:auto;
    -webkit-overflow-scrolling:touch; overscroll-behavior-y:contain;
  }
  aside:has(~main #cockpit.is-active) {
    position:absolute; inset:0 0 auto; z-index:10; width:100%; height:54px; min-height:54px;
    padding:5px 8px; display:flex; flex-direction:row; justify-content:space-between; align-items:center;
    overflow:hidden; border-right:0; border-bottom:1px solid var(--line);
  }
  aside:has(~main #cockpit.is-active) .brand {flex:0 0 auto; font-size:14px; letter-spacing:-.3px}
  aside:has(~main #cockpit.is-active) .brand .mark {font-size:20px; margin-right:3px}
  aside:has(~main #cockpit.is-active) nav {
    display:flex; flex:1 1 auto; width:auto; min-width:0; gap:2px; margin:0 0 0 8px;
    overflow-x:auto; overflow-y:hidden; scrollbar-width:thin; -webkit-overflow-scrolling:touch;
  }
  aside:has(~main #cockpit.is-active) nav a {
    flex:0 0 auto; min-height:38px; margin:0; padding:7px 8px; font-size:9px; white-space:nowrap;
  }
  aside:has(~main #cockpit.is-active) nav a span {display:inline; font-size:9px}
  main:has(#cockpit.is-active) {
    height:auto; min-height:100dvh; margin:54px 0 0; padding:0 8px 16px; overflow:visible;
  }
  main:has(#cockpit.is-active)>header {
    flex:0 0 auto; min-height:58px; padding:7px 2px; display:flex; flex-wrap:wrap;
    gap:5px; font-size:8px; line-height:1.25;
  }
  main:has(#cockpit.is-active)>header>span:first-child {display:none}
  main:has(#cockpit.is-active) .market-status {display:flex; flex:1 1 100%; min-width:0; flex-wrap:wrap; gap:5px}
  main:has(#cockpit.is-active) .market-status>* {flex:0 1 auto; min-width:0; max-width:100%}
  #cockpit.is-active {
    display:flex; flex:0 0 auto; height:auto; min-height:0; gap:8px; padding:4px 0 14px; overflow:visible;
  }
  #cockpit.is-active .cockpit-heading {
    display:grid; flex:0 0 auto; min-height:0; grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-rows:auto auto auto; gap:7px; padding:5px 2px;
  }
  #cockpit.is-active .cockpit-heading>div:first-child {grid-column:1; grid-row:1}
  #cockpit.is-active .cockpit-heading h1 {font-size:clamp(20px,6vw,28px)}
  #cockpit.is-active .cockpit-instrument-picker {grid-column:2; grid-row:1; display:flex; flex-direction:column; align-items:stretch; gap:2px; font-size:8px}
  #cockpit.is-active .cockpit-instrument-picker select {width:100%; min-height:38px; font-size:12px}
  #cockpit.is-active .cockpit-focus {grid-column:1; grid-row:2; min-width:0}
  #cockpit.is-active .execution-mode-switch {grid-column:2; grid-row:2; display:grid; grid-template-columns:1fr 1fr; gap:3px; min-width:0}
  #cockpit.is-active .execution-mode-switch>span {grid-column:1/-1; font-size:8px}
  #cockpit.is-active .execution-mode-switch button {min-height:34px; padding:5px 3px; font-size:8px}
  #cockpit.is-active .cockpit-engine-model-control {grid-column:1/-1; grid-row:3; display:grid; grid-template-columns:max-content minmax(0,1fr); gap:3px 8px; align-items:center; margin:0}
  #cockpit.is-active .cockpit-engine-model-control select {width:100%; min-height:36px; font-size:11px}
  #cockpit.is-active #engine-model-setting-status {display:block; grid-column:1/-1; font-size:8px; line-height:1.3}
  #cockpit.is-active .cockpit-kpis {flex:0 0 auto; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px}
  #cockpit.is-active .cockpit-kpis article {min-height:54px; padding:7px 8px}
  #cockpit.is-active .cockpit-kpis article>span {font-size:8px; line-height:1.25}
  #cockpit.is-active .cockpit-kpis strong {font-size:16px}
  #cockpit.is-active .desk-main-grid {display:grid; flex:0 0 auto; min-height:0; grid-template-columns:minmax(0,1fr); grid-template-rows:auto; gap:8px; overflow:visible}
  #cockpit.is-active .market-chart-panel {grid-column:1; grid-row:1}
  #cockpit.is-active .cockpit-positions {grid-column:1; grid-row:2}
  #cockpit.is-active .engine-column {grid-column:1; grid-row:3}
  #cockpit.is-active .cockpit-ai-panel {grid-column:1; grid-row:4}
  #cockpit.is-active .cockpit-opportunities {grid-column:1; grid-row:5}
  #cockpit.is-active .dashboard-ticket {grid-column:1; grid-row:6}
  #cockpit.is-active .market-chart-panel {display:flex; min-width:0; min-height:0; flex-direction:column; gap:5px; padding:8px}
  #cockpit.is-active .chart-title {gap:6px; align-items:center; flex-wrap:wrap; margin:0}
  #cockpit.is-active .chart-title h2 {font-size:16px}
  #cockpit.is-active .chart-subnav {display:flex; min-width:0; flex-wrap:wrap; gap:4px; margin:0}
  #cockpit.is-active .chart-subnav button {min-height:34px; padding:5px 10px}
  #cockpit.is-active .chart-subnav span {flex:1 1 100%; font-size:8px; white-space:normal}
  #cockpit.is-active .chart-canvas {flex:0 0 auto; width:100%; height:clamp(220px,43dvh,360px); min-height:220px; max-height:360px; overflow:hidden}
  #cockpit.is-active .chart-canvas svg {width:100%; height:100%; min-width:0}
  #cockpit.is-active .strategy-models-wrap {flex:0 0 auto; min-width:0; min-height:0; overflow:hidden}
  #cockpit.is-active .strategy-models-head {display:flex; gap:4px; flex-wrap:wrap; padding:5px; line-height:1.25}
  #cockpit.is-active .strategy-models-scroll {max-width:100%; overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch}
  #cockpit.is-active .strategy-models {min-width:660px; width:max-content; font-size:9px}
  #cockpit.is-active .strategy-models th,#cockpit.is-active .strategy-models td {padding:6px 7px; font-size:9px}
  #cockpit.is-active .chart-legend {display:flex; flex-wrap:wrap; gap:5px 10px; font-size:9px}
  #cockpit.is-active .engine-column {display:flex; flex-direction:column; flex:0 0 auto; min-width:0; min-height:0; gap:8px; overflow:visible}
  #cockpit.is-active .engine-grid {flex:0 0 auto; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto auto; gap:6px; min-height:0}
  #cockpit.is-active .engine-card {min-width:0; min-height:74px; padding:8px}
  #cockpit.is-active .engine-top {font-size:9px}
  #cockpit.is-active .engine-card>strong {font-size:12px}
  #cockpit.is-active .engine-card>p,#cockpit.is-active .engine-card details {display:block; font-size:9px; line-height:1.3}
  #cockpit.is-active .dashboard-ticket {display:grid; flex:0 0 auto; width:100%; height:auto; max-height:none; min-height:0; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:auto auto auto auto; gap:6px; padding:8px; overflow:visible}
  #cockpit.is-active .dashboard-ticket .ticket-instrument {grid-column:1; grid-row:1}
  #cockpit.is-active .dashboard-ticket .ticket-market {grid-column:2; grid-row:1; display:flex; flex-wrap:wrap; gap:4px; align-items:center}
  #cockpit.is-active .dashboard-ticket #dashboard-lots {grid-column:1/-1; grid-row:2; width:100%; min-height:40px; font-size:12px}
  #cockpit.is-active .dashboard-ticket .ticket-sell {grid-column:1; grid-row:3; min-height:48px; font-size:12px}
  #cockpit.is-active .dashboard-ticket .ticket-buy {grid-column:2; grid-row:3; min-height:48px; font-size:12px}
  #cockpit.is-active .dashboard-ticket>small {grid-column:1/-1; font-size:9px; line-height:1.35; overflow-wrap:anywhere}
  #cockpit.is-active .dashboard-ticket button {min-height:44px; padding:8px; font-size:11px}
  #cockpit.is-active .dashboard-ticket>small,#cockpit.is-active .ticket-controls>small {display:block!important; font-size:9px; line-height:1.35; overflow-wrap:anywhere}
  #cockpit.is-active #scalp-master {display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; gap:4px 8px; min-height:0; padding:8px}
  #cockpit.is-active #scalp-master .scalp-master-keys {grid-column:1/-1; font-size:9px; white-space:normal}
  #cockpit.is-active .cockpit-ai-panel,#cockpit.is-active .cockpit-opportunities,#cockpit.is-active .cockpit-positions {flex:0 0 auto; width:100%; min-width:0; min-height:0; max-height:none; overflow:visible; padding:9px}
  #cockpit.is-active .cockpit-ai-panel .panel-head,#cockpit.is-active .cockpit-opportunities .panel-head,#cockpit.is-active .cockpit-positions .panel-head {display:flex; flex-wrap:wrap; gap:6px; align-items:center}
  #cockpit.is-active .cockpit-ai-panel .panel-head h3,#cockpit.is-active .cockpit-opportunities .panel-head h3,#cockpit.is-active .cockpit-positions .panel-head h3 {font-size:11px}
  #cockpit.is-active .cockpit-ai-results {max-height:180px; font-size:10px; line-height:1.4; overflow:auto; touch-action:pan-y}
  #cockpit.is-active .opportunity-controls {display:flex; flex-wrap:wrap; gap:6px; width:100%}
  #cockpit.is-active .opportunity-controls>* {flex:1 1 135px; min-width:0}
  #cockpit.is-active .opportunity-table-scroll,#cockpit.is-active .opportunity-diagnostics-scroll {max-width:100%; max-height:290px; overflow:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; touch-action:pan-x pan-y}
  #cockpit.is-active .opportunity-table {min-width:760px; width:max-content}
  #cockpit.is-active .opportunity-table th,#cockpit.is-active .opportunity-table td {padding:7px 8px; font-size:9px; white-space:nowrap}
  #cockpit.is-active .cockpit-position-columns {display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto; gap:7px; min-height:0; overflow:visible}
  #cockpit.is-active .cockpit-position-columns>article {min-width:0; min-height:100px}
  #cockpit.is-active .cockpit-position-list {height:auto; max-height:220px; min-height:60px; overflow:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; touch-action:pan-y}
  #cockpit.is-active .cockpit-position-row {grid-template-columns:minmax(0,1fr) auto; min-width:0; min-height:58px; max-width:100%; gap:6px; padding:7px}
  #cockpit.is-active .cockpit-position-row button {min-height:38px; padding:6px 9px}
  #cockpit.is-active * {min-width:0}
  #cockpit.is-active .table-wrap {max-width:100%; overflow:auto; -webkit-overflow-scrolling:touch; touch-action:pan-x pan-y}
}

/* Runtime cockpit wrapper flattening: mobile order follows the actual arranged DOM. */
@media (max-width:760px) and (orientation:portrait) {
  #cockpit.is-active .desk-left-column,
  #cockpit.is-active .desk-right-column {display:contents}
  #cockpit.is-active .market-chart-panel {grid-column:1; grid-row:1; max-height:none; overflow:visible}
  #cockpit.is-active .cockpit-positions {grid-column:1; grid-row:2; height:auto; max-height:none; overflow:visible}
  #cockpit.is-active .engine-column {grid-column:1; grid-row:3}
  #cockpit.is-active .cockpit-opportunities {grid-column:1; grid-row:4}
  #cockpit.is-active .dashboard-ticket {grid-column:1; grid-row:5; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto; gap:8px; min-height:0}
  #cockpit.is-active .dashboard-ticket .ticket-guidance {grid-column:1; grid-row:1; min-width:0}
  #cockpit.is-active .dashboard-ticket .ticket-controls {display:grid; grid-column:1; grid-row:2; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:auto auto auto auto auto auto auto; gap:6px; min-width:0; min-height:0; overflow:visible}
  #cockpit.is-active .ticket-controls .ticket-instrument {grid-column:1; grid-row:1}
  #cockpit.is-active .ticket-controls .ticket-market {grid-column:2; grid-row:1}
  #cockpit.is-active .ticket-controls #dashboard-lots {grid-column:1/-1; grid-row:2}
  #cockpit.is-active .ticket-controls #dashboard-quote-state {grid-column:1/-1; grid-row:3}
  #cockpit.is-active .ticket-controls .ticket-sell {grid-column:1; grid-row:4}
  #cockpit.is-active .ticket-controls .ticket-buy {grid-column:2; grid-row:4}
  #cockpit.is-active .ticket-controls #dashboard-order-status {grid-column:1/-1; grid-row:5; min-height:30px; white-space:normal; overflow-wrap:anywhere}
  #cockpit.is-active .ticket-controls #scalp-master {grid-column:1/-1; grid-row:6}
  #cockpit.is-active .ticket-controls>small:not(#dashboard-quote-state) {grid-column:1/-1; grid-row:7}
}


/* V281 mobile cockpit: reflow the actual DOM as one readable, vertically scrollable surface. */
@media (max-width:760px) and (orientation:portrait) {
  html:has(#cockpit.is-active) { height:auto!important; min-height:100%; overflow-x:hidden!important; overflow-y:auto!important; }
  body:has(#cockpit.is-active) { height:auto!important; min-height:100%; overflow-x:hidden; overflow-y:visible; }
  body:has(#cockpit.is-active)>aside { position:sticky; inset:0 0 auto; z-index:20; width:100%; height:68px; min-height:68px; padding:5px 9px; flex-direction:column; align-items:stretch; justify-content:center; gap:4px; background:#071116; border-bottom:1px solid var(--line); }
  body:has(#cockpit.is-active)>aside .brand { font-size:14px; letter-spacing:0; white-space:nowrap; }
  body:has(#cockpit.is-active)>aside .brand .mark { margin-right:4px; font-size:19px; }
  body:has(#cockpit.is-active)>aside nav { display:flex; flex:1 1 auto; flex-direction:row!important; align-items:center; width:100%; min-width:0; margin:0; gap:3px; overflow-x:auto; scrollbar-width:thin; }
  body:has(#cockpit.is-active)>aside nav a { flex:0 0 auto; min-height:36px; padding:7px 8px; font-size:9px; }
  body:has(#cockpit.is-active)>aside nav a span { display:inline; font-size:10px; }
  main:has(#cockpit.is-active) { position:relative; inset:auto; height:auto; min-height:0; margin:0; padding:0 10px 20px; display:flex; flex-direction:column; overflow:visible; }
  main:has(#cockpit.is-active)>header { position:relative; inset:auto; flex:0 0 auto; min-height:50px; height:auto; padding:6px 0; display:flex; flex-wrap:wrap; gap:6px; overflow:visible; }
  main:has(#cockpit.is-active) .market-status { flex-wrap:wrap; gap:5px; font-size:9px; }
  main:has(#cockpit.is-active) .market-status .secondary { min-height:34px; padding:6px 8px; font-size:10px; }

  #cockpit.is-active { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto auto auto auto auto auto; align-content:start; gap:8px; width:100%; height:auto; min-height:0; margin:0; padding:6px 0 12px; overflow:visible; }
  #cockpit.is-active .cockpit-heading { grid-column:1; grid-row:1; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:auto auto auto auto; gap:7px 8px; flex:none; min-height:0; padding:8px; border:1px solid var(--line); border-radius:6px; background:#0d171d; }
  #cockpit.is-active .cockpit-heading>div:first-child { grid-column:1; grid-row:1; min-width:0; }
  #cockpit.is-active .cockpit-heading .eyebrow { margin:0 0 4px; font-size:9px; letter-spacing:.7px; line-height:1.3; }
  #cockpit.is-active .cockpit-heading h1 { font-size:20px; line-height:1.1; }
  #cockpit.is-active .cockpit-focus { grid-column:2; grid-row:1; display:flex; flex-direction:column; align-items:flex-end; justify-content:center; gap:3px; min-width:0; text-align:right; }
  #cockpit.is-active .cockpit-focus>span { font-size:9px!important; line-height:1.2; }
  #cockpit.is-active .cockpit-focus strong { font-size:16px!important; line-height:1.1; }
  #cockpit.is-active .cockpit-focus .signal-brief { max-width:100%; font-size:9px; white-space:normal; overflow-wrap:anywhere; }
  #cockpit.is-active .cockpit-instrument-picker { grid-column:1/-1; grid-row:2; display:grid; grid-template-columns:minmax(92px,.6fr) minmax(0,1fr); align-items:center; gap:8px; margin:0; font-size:10px!important; }
  #cockpit.is-active .cockpit-instrument-picker select { width:100%; max-width:none; min-width:0; min-height:40px; margin:0; padding:7px 9px; font-size:13px!important; }
  #cockpit.is-active .cockpit-engine-model-control { grid-column:1/-1; grid-row:3; display:grid; grid-template-columns:minmax(92px,.6fr) minmax(0,1fr); align-items:center; gap:8px; margin:0; font-size:10px; }
  #cockpit.is-active .cockpit-engine-model-control select { width:100%; min-width:0; min-height:38px; padding:6px 8px; font-size:12px; }
  #cockpit.is-active .cockpit-engine-model-control small { grid-column:1/-1; font-size:9px; }
  #cockpit.is-active .execution-mode-switch { grid-column:1/-1; grid-row:4; display:grid; grid-template-columns:1fr 1fr; gap:6px; min-width:0; }
  #cockpit.is-active .execution-mode-switch>span { grid-column:1/-1; font-size:9px; }
  #cockpit.is-active .execution-mode-switch button { min-height:40px; padding:7px 5px; font-size:10px; }
  #cockpit.is-active .cockpit-kpis { grid-column:1; grid-row:2; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; flex:none; min-height:0; margin:0; }
  #cockpit.is-active .cockpit-kpis article { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px; min-width:0; min-height:54px; padding:7px 9px; }
  #cockpit.is-active .cockpit-kpis article>span { font-size:9px; letter-spacing:.35px; }
  #cockpit.is-active .cockpit-kpis article strong { margin:0; font-size:15px; }
  #cockpit.is-active .cockpit-kpis article p { display:none; }

  /* Remove the desktop split wrapper so chart and engine become real grid items. */
  #cockpit.is-active .desk-main-grid,
  #cockpit.is-active .desk-left-column,
  #cockpit.is-active .desk-right-column,
  #cockpit.is-active .ticket-guidance { display:contents; }
  #cockpit.is-active .desk-left-column,
  #cockpit.is-active .desk-right-column,
  #cockpit.is-active .ticket-guidance,
  #cockpit.is-active .ticket-controls { display:contents; }
  #cockpit.is-active .market-chart-panel { grid-column:1; grid-row:3; display:flex; flex-direction:column; width:100%; min-width:0; min-height:0; max-height:none; margin:0; padding:8px; overflow:visible; }
  #cockpit.is-active .chart-title { gap:8px; }
  #cockpit.is-active .chart-title h2 { font-size:16px; }
  #cockpit.is-active .chart-title .eyebrow, #cockpit.is-active .chart-title .tag { font-size:9px; }
  #cockpit.is-active .chart-subnav { gap:5px; margin:6px 0; flex-wrap:wrap; }
  #cockpit.is-active .chart-subnav button { min-width:44px; min-height:36px; padding:6px 9px; font-size:12px; }
  #cockpit.is-active .chart-subnav span { flex:1 1 100%; font-size:9px; }
  #cockpit.is-active .chart-canvas { flex:0 0 auto; width:100%; height:clamp(205px,31dvh,290px); min-height:205px; aspect-ratio:auto; }
  #cockpit.is-active #market-chart { width:100%; height:100%; min-height:0; }
  #cockpit.is-active .chart-legend { flex-wrap:wrap; gap:7px 10px; margin:5px 0; font-size:9px; }
  #cockpit.is-active .chart-signal { flex-wrap:wrap; gap:5px 9px; padding:6px 8px; font-size:10px; }
  #cockpit.is-active .strategy-models-wrap { flex:0 0 auto; width:100%; max-height:none; margin:6px 0 0; overflow-x:auto; border-top:1px solid var(--line); }
  #cockpit.is-active .strategy-models-head { gap:6px; padding:7px 4px; font-size:10px; }
  #cockpit.is-active .strategy-models-head small { font-size:9px; }
  #cockpit.is-active .strategy-models-scroll { overflow-x:auto; }
  #cockpit.is-active .strategy-models { width:max-content; min-width:100%; font-size:10px; }
  #cockpit.is-active .strategy-models th, #cockpit.is-active .strategy-models td { padding:6px 7px; }
  #cockpit.is-active .strategy-models thead th { font-size:9px; }

  #cockpit.is-active .cockpit-positions { grid-column:1; grid-row:4; display:grid; grid-template-rows:auto minmax(0,1fr); width:100%; height:auto; max-height:none; min-height:0; margin:0; padding:9px; overflow:visible; }
  #cockpit.is-active .cockpit-positions .panel-head { flex-wrap:wrap; gap:7px; margin:0 0 7px; }
  #cockpit.is-active .cockpit-positions h3 { font-size:12px; }
  #cockpit.is-active .cockpit-positions .filter-label { font-size:10px; }
  #cockpit.is-active .cockpit-positions .filter-label select { max-width:170px; min-height:36px; padding:5px 7px; font-size:11px; }
  #cockpit.is-active .cockpit-position-columns { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto; gap:7px; min-height:0; margin:0; overflow:visible; }
  #cockpit.is-active .cockpit-position-columns>article { display:grid; grid-template-rows:auto minmax(0,1fr); min-width:0; min-height:0; max-height:175px; padding:7px; overflow:hidden; }
  #cockpit.is-active .cockpit-position-columns h4 { margin:0 0 5px; font-size:10px; }
  #cockpit.is-active .cockpit-position-list { display:flex; flex-direction:column; gap:4px; min-height:0; max-height:145px; overflow:auto; overscroll-behavior:contain; }
  #cockpit.is-active .cockpit-position-list>p { font-size:11px; }
  #cockpit.is-active .cockpit-position-row { align-items:flex-start; gap:7px; min-height:44px; padding:6px; font-size:10px; }
  #cockpit.is-active .cockpit-position-row strong { font-size:10px; white-space:normal; }
  #cockpit.is-active .cockpit-position-row small { font-size:9px; }
  #cockpit.is-active .cockpit-position-row button { min-height:34px; padding:6px 8px; font-size:10px; }

  #cockpit.is-active .engine-column { grid-column:1; grid-row:5; display:block; width:100%; min-width:0; min-height:0; margin:0; }
  #cockpit.is-active .engine-network { display:none; }
  #cockpit.is-active .engine-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; min-height:0; padding:0; }
  #cockpit.is-active .engine-card { display:grid; grid-template-rows:auto auto auto; align-content:start; gap:4px; min-width:0; min-height:92px; padding:8px; }
  #cockpit.is-active .engine-top { display:flex; justify-content:space-between; gap:5px; font-size:9px; line-height:1.25; }
  #cockpit.is-active .engine-indicator { padding:2px 4px; font-size:8px; }
  #cockpit.is-active .engine-card>strong { display:block; min-width:0; margin:0; font-size:12px; line-height:1.2; white-space:normal; overflow-wrap:anywhere; }
  #cockpit.is-active .engine-card>p { display:block; margin:0; font-size:10px; line-height:1.25; }
  #cockpit.is-active .engine-viz { display:flex; flex-wrap:wrap; gap:5px; min-width:0; font-size:9px; }
  #cockpit.is-active .engine-card details { display:none; }

  #cockpit.is-active .cockpit-opportunities { grid-column:1; grid-row:6; display:grid; grid-template-rows:auto auto minmax(0,1fr); width:100%; min-width:0; min-height:0; max-height:410px; margin:0; padding:9px; overflow:hidden; }
  #cockpit.is-active .cockpit-opportunities .panel-head { align-items:flex-start; flex-wrap:wrap; gap:7px; margin:0 0 6px; }
  #cockpit.is-active .cockpit-opportunities h3 { font-size:12px; }
  #cockpit.is-active .opportunity-controls { flex-wrap:wrap; gap:6px; }
  #cockpit.is-active .opportunity-controls .filter-label { font-size:10px; }
  #cockpit.is-active .opportunity-controls select { max-width:150px; min-height:36px; padding:5px 7px; font-size:11px; }
  #cockpit.is-active .auto-mode-control { gap:5px; font-size:10px; }
  #cockpit.is-active .auto-mode-control input { width:17px; height:17px; }
  #cockpit.is-active .auto-mode-control select { width:46px; min-height:34px; font-size:10px; }
  #cockpit.is-active #auto-mode-status { margin:0 0 5px; font-size:9px; line-height:1.25; }
  #cockpit.is-active .opportunity-table-scroll { width:100%; min-width:0; max-height:330px; overflow:auto; overscroll-behavior:contain; }
  #cockpit.is-active .opportunity-table { width:max-content; min-width:680px; font-size:10px; line-height:1.25; }
  #cockpit.is-active .opportunity-table th { position:sticky; top:0; z-index:1; padding:7px 6px; font-size:9px; }
  #cockpit.is-active .opportunity-table td { padding:7px 6px; font-size:10px; }

  #cockpit.is-active .dashboard-ticket { display:contents; }
  #cockpit.is-active .dashboard-ticket .ticket-controls { grid-column:1; grid-row:7; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto auto auto auto auto auto auto; align-items:stretch; gap:7px; width:100%; min-width:0; min-height:0; height:auto; max-height:none; margin:0; padding:10px; border:1px solid var(--line); border-radius:6px; background:#0d171d; overflow:visible; }
  #cockpit.is-active .ticket-controls .ticket-instrument { grid-column:1; grid-row:1; }
  #cockpit.is-active .ticket-controls .ticket-market { grid-column:2; grid-row:1; }
  #cockpit.is-active .ticket-controls .ticket-instrument>span, #cockpit.is-active .ticket-controls .ticket-market>span { font-size:10px; }
  #cockpit.is-active .ticket-controls .ticket-instrument>strong { font-size:14px; }
  #cockpit.is-active .ticket-controls .ticket-market>span strong, #cockpit.is-active .ticket-controls .ticket-market .ticket-mid { font-size:12px; }
  #cockpit.is-active .ticket-controls #dashboard-lots { grid-column:1/-1; grid-row:2; min-width:0; min-height:42px; margin:0; padding:7px 9px; font-size:13px; }
  #cockpit.is-active .ticket-controls #dashboard-quote-state { grid-column:1/-1; grid-row:3; display:block!important; margin:0; font-size:10px; }
  #cockpit.is-active .ticket-controls .ticket-sell { grid-column:1; grid-row:4; }
  #cockpit.is-active .ticket-controls .ticket-buy { grid-column:2; grid-row:4; }
  #cockpit.is-active .ticket-controls button { min-width:0; min-height:50px; padding:8px 6px; font-size:12px; white-space:normal; }
  #cockpit.is-active .ticket-controls #dashboard-order-status { grid-column:1/-1; grid-row:5; display:block!important; min-width:0; min-height:34px; margin:0; padding:6px 8px; overflow-wrap:anywhere; white-space:normal; font-size:10px; }
  #cockpit.is-active .dashboard-ticket .ticket-controls #dashboard-order-status { grid-row:5; }
  #cockpit.is-active .ticket-controls #scalp-master { grid-column:1/-1; grid-row:6; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto auto; gap:6px; min-width:0; min-height:0; margin:0; padding:8px; }
  #cockpit.is-active .scalp-master-toggle { grid-column:1; grid-row:1; gap:6px; font-size:11px; }
  #cockpit.is-active .scalp-master-toggle input { width:18px; height:18px; }
  #cockpit.is-active #scalp-master-state { grid-column:2; grid-row:1; font-size:9px; }
  #cockpit.is-active .scalp-master-keys { grid-column:1/-1; grid-row:2; flex-wrap:wrap; justify-content:flex-start; gap:8px; font-size:10px; white-space:normal; }
  #cockpit.is-active .scalp-master-keys kbd { min-width:24px; padding:2px 5px; font-size:9px; }
  #cockpit.is-active #scalp-master-status { grid-column:1/-1; grid-row:3; min-width:0; margin:0; overflow-wrap:anywhere; white-space:normal; font-size:10px; }
  #cockpit.is-active .ticket-controls>small:not(#dashboard-quote-state) { display:block!important; grid-column:1/-1; grid-row:7; margin:0; font-size:9px; line-height:1.3; }

  #cockpit.is-active .cockpit-ai-panel { grid-column:1; grid-row:8; width:100%; min-width:0; min-height:0; margin:0; padding:9px; overflow:visible; }
  #cockpit.is-active .cockpit-ai-panel .panel-head { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 7px; }
  #cockpit.is-active .cockpit-ai-panel h3 { font-size:11px; }
  #cockpit.is-active #cockpit-ai-status { max-width:100%; padding:4px 6px; font-size:9px; white-space:normal; }
  #cockpit.is-active .cockpit-ai-panel .ai-model-control { display:grid; grid-template-columns:minmax(100px,.6fr) minmax(0,1fr); align-items:center; gap:6px; width:100%; font-size:9px; }
  #cockpit.is-active .cockpit-ai-panel .ai-model-control select { min-width:0; min-height:38px; padding:5px 7px; font-size:11px; }
  #cockpit.is-active #cockpit-additional-analysis { min-height:38px; padding:6px 8px; font-size:10px; }
  #cockpit.is-active #cockpit-ai-copy { display:flex; flex-direction:column; gap:5px; margin:0; font-size:11px; line-height:1.35; }
  #cockpit.is-active #cockpit-ai-copy strong { font-size:12px; white-space:normal; }
  #cockpit.is-active #cockpit-ai-copy .ai-scenario-summary, #cockpit.is-active #cockpit-ai-copy .ai-scenario-condition { display:block; font-size:10px; line-height:1.3; white-space:normal; }
  #cockpit.is-active .cockpit-ai-panel>small { font-size:9px; line-height:1.3; }
  #cockpit.is-active .strategy-models-scroll, #cockpit.is-active .opportunity-table-scroll, #cockpit.is-active .cockpit-position-list { -webkit-overflow-scrolling:touch; }
}


/* V292: readable mobile flow, including short portrait screens and small landscape phones. */
@media (max-width:760px) {
  html:has(#cockpit.is-active), body:has(#cockpit.is-active) { width:100%; max-width:100%; overflow-x:hidden; }
  body:has(#cockpit.is-active)>aside { max-width:100vw; }
  main:has(#cockpit.is-active) { width:100%; max-width:100vw; min-width:0; box-sizing:border-box; overflow-x:hidden; }
  main:has(#cockpit.is-active)>header,
  main:has(#cockpit.is-active) .market-status { min-width:0; max-width:100%; }
  main:has(#cockpit.is-active) .market-status { flex:1 1 100%; }
  main:has(#cockpit.is-active) .market-status > * { max-width:100%; }
  #cockpit.is-active,
  #cockpit.is-active .desk-main-grid,
  #cockpit.is-active .desk-left-column,
  #cockpit.is-active .desk-right-column,
  #cockpit.is-active .ticket-controls { min-width:0; max-width:100%; }
  #cockpit.is-active .cockpit-heading > *,
  #cockpit.is-active .market-chart-panel,
  #cockpit.is-active .cockpit-positions,
  #cockpit.is-active .engine-column,
  #cockpit.is-active .cockpit-opportunities,
  #cockpit.is-active .cockpit-ai-panel,
  #cockpit.is-active .ticket-controls { box-sizing:border-box; }
  #cockpit.is-active .opportunity-table-scroll,
  #cockpit.is-active .strategy-models-scroll,
  #cockpit.is-active .cockpit-position-list { max-width:100%; overscroll-behavior-x:contain; }
  #cockpit.is-active .opportunity-table { min-width:680px; }
  #cockpit.is-active .ticket-controls button,
  #cockpit.is-active .ticket-controls select { min-width:0; }
  #cockpit.is-active .cockpit-position-row { overflow-wrap:anywhere; }
}

@media (max-width:760px) and (orientation:landscape) and (max-height:520px) {
  html:has(#cockpit.is-active), body:has(#cockpit.is-active) { height:auto; min-height:100%; overflow-x:hidden; overflow-y:auto; }
  body:has(#cockpit.is-active)>aside { position:sticky; inset:0 0 auto; z-index:20; width:100%; height:auto; min-height:54px; flex-direction:row; flex-wrap:wrap; }
  body:has(#cockpit.is-active)>aside nav { flex:1 1 100%; }
  main:has(#cockpit.is-active) { position:relative; inset:auto; height:auto; min-height:0; overflow:visible; }
  #cockpit.is-active { height:auto; min-height:0; overflow:visible; }
  #cockpit.is-active .desk-main-grid,
  #cockpit.is-active .desk-left-column,
  #cockpit.is-active .desk-right-column,
  #cockpit.is-active .ticket-guidance { display:contents; }
  #cockpit.is-active .desk-left-column,
  #cockpit.is-active .desk-right-column,
  #cockpit.is-active .ticket-guidance,
  #cockpit.is-active .ticket-controls { display:contents; }
  #cockpit.is-active .cockpit-heading,
  #cockpit.is-active .cockpit-kpis,
  #cockpit.is-active .market-chart-panel,
  #cockpit.is-active .cockpit-positions,
  #cockpit.is-active .engine-column,
  #cockpit.is-active .cockpit-opportunities,
  #cockpit.is-active .dashboard-ticket,
  #cockpit.is-active .cockpit-ai-panel { grid-column:1; grid-row:auto; }
}

/* V293: compact, scrollable phone cockpit; account data remains visible without page-wide overflow. */
@media (max-width:760px) and (orientation:portrait) {
  html:has(#cockpit.is-active), body:has(#cockpit.is-active) { width:100%; min-height:100dvh; height:auto; overflow-x:hidden; overflow-y:auto; }
  body:has(#cockpit.is-active)>aside { position:sticky; inset:0 0 auto; z-index:30; width:100%; max-width:100vw; height:auto; min-height:54px; padding:5px 8px; flex-direction:row; flex-wrap:wrap; align-items:center; gap:4px; }
  body:has(#cockpit.is-active)>aside .brand { display:flex; flex:0 0 auto; font-size:14px; }
  body:has(#cockpit.is-active)>aside .workspace, body:has(#cockpit.is-active)>aside .side-footer { display:none; }
  body:has(#cockpit.is-active)>aside nav { display:flex; flex:1 1 100%; width:100%; min-width:0; margin:0; gap:4px; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; }
  body:has(#cockpit.is-active)>aside nav a { flex:0 0 auto; min-height:34px; padding:7px 9px; font-size:10px; white-space:nowrap; }
  body:has(#cockpit.is-active)>aside nav a span { display:inline; font-size:10px; }
  main:has(#cockpit.is-active) { position:relative; width:100%; max-width:100vw; min-width:0; height:auto; min-height:100dvh; margin:0; padding:0 8px 20px; overflow-x:hidden; overflow-y:visible; box-sizing:border-box; }
  main:has(#cockpit.is-active)>header { position:relative; display:flex; flex-wrap:wrap; gap:4px 8px; min-width:0; min-height:52px; height:auto; padding:7px 2px; }
  main:has(#cockpit.is-active)>header>span:first-child { font-size:9px; }
  main:has(#cockpit.is-active)>header .market-status { display:grid; flex:1 1 100%; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; gap:5px; min-width:0; max-width:100%; overflow:visible; }
  main:has(#cockpit.is-active)>header .market-status>* { min-width:0; max-width:100%; font-size:8px; overflow-wrap:anywhere; }
  main:has(#cockpit.is-active)>header #ctrader-status { grid-column:1/-1; }
  main:has(#cockpit.is-active)>header #ctrader-account, main:has(#cockpit.is-active)>header #ctrader-select-account, main:has(#cockpit.is-active)>header #ctrader-connect, main:has(#cockpit.is-active)>header #ctrader-disconnect { width:100%; min-height:32px; padding:5px 4px; text-align:center; font-size:8px; }
  main:has(#cockpit.is-active)>header #desk-release { text-align:right; }
  #cockpit.is-active { display:grid; grid-template-columns:minmax(0,1fr); grid-auto-rows:auto; gap:8px; width:100%; min-width:0; min-height:0; height:auto; padding:4px 0 12px; overflow:visible; }
  #cockpit.is-active .cockpit-heading { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:auto auto auto; gap:6px; min-width:0; min-height:0; flex:none; padding:8px; }
  #cockpit.is-active .cockpit-heading>div:first-child { grid-column:1/-1; grid-row:1; min-width:0; }
  #cockpit.is-active .cockpit-instrument-picker { grid-column:1; grid-row:2; display:grid; gap:3px; min-width:0; font-size:9px!important; }
  #cockpit.is-active .cockpit-instrument-picker select { width:100%; min-width:0; min-height:38px; font-size:13px!important; }
  #cockpit.is-active .cockpit-engine-model-control { grid-column:2; grid-row:2; display:grid; gap:3px; min-width:0; font-size:9px!important; }
  #cockpit.is-active .cockpit-engine-model-control select { width:100%; min-width:0; min-height:38px; font-size:11px; }
  #cockpit.is-active .cockpit-engine-model-control small { display:none; }
  #cockpit.is-active .execution-mode-switch { grid-column:1; grid-row:3; grid-template-columns:1fr 1fr; gap:4px; min-width:0; }
  #cockpit.is-active .execution-mode-switch>span { grid-column:1/-1; font-size:8px; }
  #cockpit.is-active .execution-mode-switch button { min-height:38px; padding:6px 4px; font-size:9px; }
  #cockpit.is-active .cockpit-focus { grid-column:2; grid-row:3; display:grid; gap:2px; min-width:0; text-align:right; }
  #cockpit.is-active .cockpit-focus>span { font-size:8px!important; }
  #cockpit.is-active .cockpit-focus strong { font-size:17px!important; }
  #cockpit.is-active .cockpit-kpis { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; min-width:0; flex:none; }
  #cockpit.is-active .cockpit-kpis article { min-width:0; padding:8px; }
  #cockpit.is-active .cockpit-kpis article>span { font-size:8px; }
  #cockpit.is-active .cockpit-kpis strong { font-size:15px; }
  #cockpit.is-active .cockpit-kpis p { margin:3px 0 0; font-size:8px; }
  #cockpit.is-active .desk-main-grid { display:contents; }
  #cockpit.is-active .desk-left-column, #cockpit.is-active .desk-right-column, #cockpit.is-active .dashboard-ticket, #cockpit.is-active .ticket-guidance { display:contents; }
  #cockpit.is-active .market-chart-panel { grid-column:1; grid-row:auto; min-width:0; width:100%; max-height:none; padding:8px; }
  #cockpit.is-active .chart-title { gap:5px; }
  #cockpit.is-active .chart-title h2 { font-size:16px; }
  #cockpit.is-active .chart-title .tag { max-width:48%; white-space:normal; font-size:8px; }
  #cockpit.is-active .chart-subnav { flex-wrap:wrap; gap:5px; }
  #cockpit.is-active .chart-subnav button { min-width:42px; min-height:36px; }
  #cockpit.is-active .chart-subnav>span { flex:1 1 100%; font-size:8px; }
  #cockpit.is-active .chart-canvas { width:100%; min-width:0; height:clamp(250px,38svh,390px); min-height:250px; }
  #cockpit.is-active .strategy-models-wrap { min-width:0; }
  #cockpit.is-active .strategy-models-scroll, #cockpit.is-active .opportunity-table-scroll, #cockpit.is-active .cockpit-position-list { max-width:100%; overflow:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  #cockpit.is-active .strategy-models { min-width:660px; }
  #cockpit.is-active .cockpit-positions { grid-column:1; grid-row:auto; min-width:0; width:100%; min-height:0; max-height:none; }
  #cockpit.is-active .cockpit-position-columns { grid-template-columns:minmax(0,1fr); grid-template-rows:auto; gap:6px; min-width:0; overflow:visible; }
  #cockpit.is-active .cockpit-position-columns>article { min-width:0; min-height:100px; }
  #cockpit.is-active .cockpit-position-row { grid-template-columns:minmax(0,1fr) 64px; gap:6px; min-width:0; min-height:58px; }
  #cockpit.is-active .cockpit-position-row strong, #cockpit.is-active .cockpit-position-row small { white-space:normal; overflow-wrap:anywhere; }
  #cockpit.is-active .engine-column { grid-column:1; grid-row:auto; display:block; min-width:0; width:100%; }
  #cockpit.is-active .engine-network { display:none; }
  #cockpit.is-active .engine-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
  #cockpit.is-active .engine-card { min-width:0; min-height:0; padding:7px; }
  #cockpit.is-active .engine-top { gap:4px; font-size:8px; }
  #cockpit.is-active .engine-card>strong { font-size:10px; overflow-wrap:anywhere; }
  #cockpit.is-active .engine-card>p { font-size:8px; }
  #cockpit.is-active .engine-card details { font-size:8px; }
  #cockpit.is-active .cockpit-opportunities { grid-column:1; grid-row:auto; min-width:0; width:100%; min-height:0; max-height:none; }
  #cockpit.is-active .opportunity-table { min-width:680px; }
  #cockpit.is-active .dashboard-ticket .ticket-controls { grid-column:1; grid-row:auto; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto; gap:7px; width:100%; min-width:0; min-height:0; height:auto; max-height:none; margin:0; padding:9px; overflow:visible; }
  #cockpit.is-active .ticket-controls .ticket-instrument { grid-column:1; grid-row:1; }
  #cockpit.is-active .ticket-controls .ticket-market { grid-column:2; grid-row:1; }
  #cockpit.is-active .ticket-controls #dashboard-lots { grid-column:1/-1; grid-row:2; min-height:42px; font-size:13px; }
  #cockpit.is-active .ticket-controls .ticket-sell { grid-column:1; grid-row:3; }
  #cockpit.is-active .ticket-controls .ticket-buy { grid-column:2; grid-row:3; }
  #cockpit.is-active .ticket-controls button { min-width:0; min-height:48px; padding:7px 5px; font-size:11px; white-space:normal; }
  #cockpit.is-active .ticket-controls #dashboard-order-status { grid-column:1/-1; grid-row:4; min-width:0; min-height:32px; overflow-wrap:anywhere; white-space:normal; font-size:10px; }
  #cockpit.is-active .ticket-controls #scalp-master { grid-column:1/-1; grid-row:5; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; gap:6px; min-width:0; padding:8px; }
  #cockpit.is-active .scalp-master-toggle { font-size:11px; }
  #cockpit.is-active .scalp-master-keys { grid-column:1/-1; flex-wrap:wrap; justify-content:flex-start; font-size:10px; }
  #cockpit.is-active .cockpit-ai-panel { grid-column:1; grid-row:auto; min-width:0; width:100%; }
}

#cockpit.is-active #reconcile-unknown-status:empty{display:none}
#cockpit.is-active #reconcile-unknown-orders{padding:5px 7px;font-size:9px;white-space:nowrap}
@media(max-width:760px){#cockpit.is-active #reconcile-unknown-orders{min-height:32px;padding:4px 6px;font-size:8px}}

/* V289 mobile repair: target the actual cockpit DOM (Quick Trade has no ticket-controls wrapper). */
@media (max-width:760px) and (orientation:portrait) {
  html:has(#cockpit.is-active), body:has(#cockpit.is-active) { height:auto; min-height:100%; overflow-x:hidden; overflow-y:auto; }
  aside:has(~main #cockpit.is-active) { position:sticky; top:0; z-index:8; width:100%; height:auto; min-height:0; padding:6px 8px 4px; }
  aside:has(~main #cockpit.is-active) .brand { display:block; margin:0 auto 4px; font-size:13px; }
  aside:has(~main #cockpit.is-active) .brand .mark { font-size:18px; }
  aside:has(~main #cockpit.is-active) nav { flex-direction:row; justify-content:flex-start; gap:4px; margin:0; overflow-x:auto; }
  aside:has(~main #cockpit.is-active) nav a { flex:0 0 auto; justify-content:center; min-height:28px; padding:5px 8px; font-size:8px; }
  aside:has(~main #cockpit.is-active) nav a span { display:inline; }
  main:has(#cockpit.is-active) { height:auto; min-height:100dvh; margin:0; padding:0 8px; overflow-x:clip; overflow-y:visible!important; }
  main:has(#cockpit.is-active)>header { position:relative; top:auto; flex:0 0 auto; min-height:38px; padding:4px 2px; }
  main:has(#cockpit.is-active) .market-status { flex-wrap:wrap; justify-content:flex-end; }
  #cockpit.is-active { display:grid; grid-template-columns:minmax(0,1fr); grid-auto-flow:row; grid-auto-rows:auto; align-content:start; gap:6px; height:auto; min-height:0; overflow:visible; }
  #cockpit.is-active .cockpit-heading { display:grid; grid-row:1; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:auto auto auto; align-content:start; align-items:center; gap:6px; height:auto; min-height:0; flex:none; padding:6px; }
  #cockpit.is-active .cockpit-heading>div:first-child { grid-column:1; grid-row:1; min-width:0; }
  #cockpit.is-active .cockpit-heading .cockpit-focus { grid-column:2; grid-row:1; display:flex; flex-direction:column; align-items:flex-end; gap:2px; min-width:0; }
  #cockpit.is-active .cockpit-focus .signal-brief { display:block; max-width:100%; height:1.2em; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #cockpit.is-active .cockpit-heading .cockpit-instrument-picker { grid-column:1; grid-row:2; display:flex; flex-wrap:wrap; align-items:center; gap:4px; min-width:0; }
  #cockpit.is-active .cockpit-heading .cockpit-engine-model-control { grid-column:2; grid-row:2; min-width:0; }
  #cockpit.is-active .cockpit-heading .execution-mode-switch { grid-column:1/-1; grid-row:3; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:auto auto; gap:4px; min-width:0; }
  #cockpit.is-active .execution-mode-switch>span { grid-column:1/-1; }
  #cockpit.is-active .execution-mode-switch button { min-width:0; min-height:34px; }
  #cockpit.is-active .cockpit-kpis { grid-row:2; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:minmax(52px,auto); height:auto; min-height:0; }
  #cockpit.is-active .desk-main-grid { display:contents; }
  #cockpit.is-active .market-chart-panel { grid-column:1; grid-row:3; width:100%; height:50dvh; min-height:320px; max-height:50dvh; }
  #cockpit.is-active .strategy-models-scroll { min-height:0; overflow:auto; overscroll-behavior:contain; }
  #cockpit.is-active .engine-column { grid-column:1; grid-row:4; display:block; min-width:0; min-height:0; overflow:visible; }
  #cockpit.is-active .engine-network { display:none; }
  #cockpit.is-active .engine-grid { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto auto; min-height:0; gap:5px; }
  #cockpit.is-active .engine-card { min-width:0; min-height:62px; padding:6px; }
  #cockpit.is-active .engine-card>p,#cockpit.is-active .engine-card details { display:none; }
  #cockpit.is-active .dashboard-ticket .cockpit-ai-panel { grid-column:1; grid-row:2; width:100%; max-width:100%; min-width:0; }
  #cockpit.is-active .cockpit-opportunities { grid-column:1; grid-row:6; width:100%; max-height:none; min-height:180px; }
  #cockpit.is-active .opportunity-table-scroll { max-height:42dvh; overflow:auto; overscroll-behavior:contain; }
  #cockpit.is-active .cockpit-positions { grid-column:1; grid-row:7; width:100%; height:auto; max-height:none; min-height:300px; }
  #cockpit.is-active .dashboard-ticket { display:grid; grid-column:1; grid-row:8; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto; align-items:stretch; gap:7px; width:100%; height:auto; min-width:0; min-height:0; max-height:none; padding:10px; overflow:visible; }
  #cockpit.is-active .dashboard-ticket .ticket-controls { display:grid; grid-column:1; grid-row:1; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto auto auto auto auto auto auto; gap:7px; width:100%; min-width:0; min-height:0; height:auto; max-height:none; overflow:visible; }
  #cockpit.is-active .dashboard-ticket .ticket-instrument { grid-column:1; grid-row:1; min-width:0; }
  #cockpit.is-active .dashboard-ticket .ticket-market { grid-column:2; grid-row:1; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px; min-width:0; }
  #cockpit.is-active .dashboard-ticket #dashboard-lots { grid-column:1/-1; grid-row:2; width:100%; min-width:0; min-height:42px; font-size:13px; }
  #cockpit.is-active .dashboard-ticket #dashboard-quote-state { grid-column:1/-1; grid-row:3; display:block; min-width:0; margin:0; font-size:10px; }
  #cockpit.is-active .dashboard-ticket .ticket-sell { grid-column:1; grid-row:4; min-width:0; min-height:50px; font-size:12px; }
  #cockpit.is-active .dashboard-ticket .ticket-buy { grid-column:2; grid-row:4; min-width:0; min-height:50px; font-size:12px; }
  #cockpit.is-active .dashboard-ticket #dashboard-order-status { grid-column:1/-1; grid-row:5; min-width:0; min-height:32px; white-space:normal; overflow-wrap:anywhere; font-size:10px; }
  #cockpit.is-active .dashboard-ticket #scalp-master { grid-column:1/-1; grid-row:6; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; gap:6px; min-width:0; padding:8px; }
  #cockpit.is-active .dashboard-ticket #scalp-master .scalp-master-keys { grid-column:1/-1; flex-wrap:wrap; justify-content:flex-start; font-size:10px; }
  #cockpit.is-active .dashboard-ticket>small:last-child { grid-column:1/-1; grid-row:7; display:block; margin:0; font-size:9px; line-height:1.35; overflow-wrap:anywhere; }
  #cockpit.is-active .cockpit-position-columns { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(100px,auto) minmax(85px,auto) minmax(85px,auto); overflow:visible; }
}

/* V310 responsive repair: reflow controls and let short/narrow viewports grow without clipping. */
main:has(#cockpit.is-active) { container-type:inline-size; container-name:desk; }
main:has(#cockpit.is-active)>header { height:auto; min-height:38px; flex:0 0 auto; flex-wrap:wrap; align-items:center; gap:6px 12px; padding:5px 4px; }
main:has(#cockpit.is-active) .market-status { flex:1 1 640px; min-width:0; flex-wrap:wrap; justify-content:flex-end; gap:5px; }
main:has(#cockpit.is-active) .market-status>* { min-width:0; max-width:100%; }
#cockpit.is-active .cockpit-heading { display:grid; grid-template-columns:minmax(130px,1fr) minmax(140px,.8fr) minmax(180px,1.05fr) minmax(170px,.95fr) minmax(130px,.8fr); grid-template-rows:minmax(44px,auto); align-items:center; gap:clamp(5px,.7vw,12px); flex:0 0 auto; height:auto; min-height:52px; padding:5px 3px; }
#cockpit.is-active .cockpit-heading>* { min-width:0; max-width:100%; }
#cockpit.is-active .cockpit-heading>div:first-child { grid-column:1; grid-row:1; }
#cockpit.is-active .cockpit-heading .cockpit-instrument-picker { grid-column:2; grid-row:1; display:flex; flex-wrap:wrap; min-width:0; }
#cockpit.is-active .cockpit-heading .cockpit-instrument-picker select,#cockpit.is-active .cockpit-engine-model-control select { width:100%; min-width:0; max-width:100%; }
#cockpit.is-active .cockpit-heading .cockpit-engine-model-control { grid-column:3; grid-row:1; display:grid; grid-template-columns:minmax(0,1fr); min-width:0; margin:0; white-space:normal; }
#cockpit.is-active .cockpit-heading .execution-mode-switch { grid-column:4; grid-row:1; grid-template-columns:repeat(2,minmax(0,1fr)); min-width:0; }
#cockpit.is-active .cockpit-heading .execution-mode-switch>span { grid-column:1/-1; }
#cockpit.is-active .cockpit-heading .cockpit-focus { grid-column:5; grid-row:1; min-width:0; overflow:hidden; }
@container desk (max-width:1399px) {
  #cockpit.is-active .cockpit-heading { grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:auto auto; min-height:92px; gap:5px 10px; }
  #cockpit.is-active .cockpit-heading>div:first-child { grid-column:1; grid-row:1; }
  #cockpit.is-active .cockpit-heading .cockpit-instrument-picker { grid-column:2; grid-row:1; }
  #cockpit.is-active .cockpit-heading .cockpit-focus { grid-column:3; grid-row:1; align-items:flex-end; text-align:right; }
  #cockpit.is-active .cockpit-heading .cockpit-engine-model-control { grid-column:1/3; grid-row:2; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; gap:2px 8px; }
  #cockpit.is-active .cockpit-heading .execution-mode-switch { grid-column:3; grid-row:2; }
  #cockpit.is-active #engine-model-setting-status { grid-column:1/-1; }
}
@container desk (max-width:1000px) {
  #cockpit.is-active .cockpit-heading { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto auto auto; min-height:0; padding:8px; }
  #cockpit.is-active .cockpit-heading>div:first-child { grid-column:1; grid-row:1; }
  #cockpit.is-active .cockpit-heading .cockpit-focus { grid-column:2; grid-row:1; }
  #cockpit.is-active .cockpit-heading .cockpit-instrument-picker { grid-column:1; grid-row:2; }
  #cockpit.is-active .cockpit-heading .cockpit-engine-model-control { grid-column:2; grid-row:2; grid-template-columns:minmax(0,1fr); }
  #cockpit.is-active .cockpit-heading .execution-mode-switch { grid-column:1/-1; grid-row:3; }
}
@media (min-width:761px) and (max-width:1100px) {
  html:has(#cockpit.is-active),body:has(#cockpit.is-active) { height:auto; min-height:100dvh; overflow-x:hidden; overflow-y:auto; }
  main:has(#cockpit.is-active) { height:auto; min-height:100dvh; overflow:visible; }
  #cockpit.is-active { height:auto; min-height:0; overflow:visible; }
  #cockpit.is-active .cockpit-kpis { flex:0 0 auto; min-height:48px; }
  #cockpit.is-active .desk-main-grid { flex:0 0 auto; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto; align-items:start; overflow:visible; }
  #cockpit.is-active .market-chart-panel { min-height:300px; }
  #cockpit.is-active .engine-column { min-width:0; min-height:0; overflow:visible; }
  #cockpit.is-active .market-chart-panel { height:auto; min-height:300px; max-height:56vh; }
  #cockpit.is-active .cockpit-opportunities { max-height:44vh; min-height:110px; }
  #cockpit.is-active .opportunity-table-scroll { max-height:36vh; overflow:auto; overscroll-behavior:contain; }
}
@media (min-width:1101px) and (max-height:700px) {
  html:has(#cockpit.is-active),body:has(#cockpit.is-active) { height:auto; min-height:100dvh; overflow-x:hidden; overflow-y:auto; }
  main:has(#cockpit.is-active) { height:auto; min-height:100dvh; overflow:visible; }
  #cockpit.is-active { height:auto; min-height:0; overflow:visible; }
  #cockpit.is-active .cockpit-kpis { flex:0 0 auto; min-height:48px; }
  #cockpit.is-active .desk-main-grid { flex:0 0 auto; grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr); grid-template-rows:auto; align-items:start; overflow:visible; }
  #cockpit.is-active .engine-column { min-width:0; min-height:0; overflow:visible; }
  #cockpit.is-active .market-chart-panel { height:auto; min-height:300px; max-height:56vh; }
  #cockpit.is-active .cockpit-opportunities { max-height:44vh; min-height:110px; }
  #cockpit.is-active .opportunity-table-scroll { max-height:36vh; overflow:auto; overscroll-behavior:contain; }
}

.instrument-universe{position:relative;align-self:center;z-index:5;font:9px ui-monospace,monospace;letter-spacing:.7px;color:#9cb9c0}.instrument-universe summary{cursor:pointer;list-style:none;border:1px solid #35626b;border-radius:4px;padding:9px 10px;color:#83ddd4;white-space:nowrap}.instrument-universe summary::-webkit-details-marker{display:none}.instrument-universe[open] summary{border-color:#72dbd3}.instrument-universe-panel{position:absolute;top:calc(100% + 7px);right:0;width:min(360px,calc(100vw - 32px));max-height:min(70vh,540px);overflow:auto;padding:14px;border:1px solid #35626b;border-radius:7px;background:#0d1b22;box-shadow:0 16px 44px #000b;display:grid;gap:10px}.instrument-universe-panel>strong{color:#82ddd4;letter-spacing:1px}.instrument-universe-panel>small{color:#9ab0b8;line-height:1.5;letter-spacing:0}.instrument-universe-panel fieldset{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 8px;max-height:310px;overflow:auto;margin:0;padding:8px;border:1px solid #29434b}.instrument-universe-option{display:flex;align-items:center;gap:7px;min-width:0;padding:4px;color:#d6e6e7;letter-spacing:0}.instrument-universe-option input{accent-color:#72dbd3}.instrument-universe-panel button{justify-self:end}
@media(max-width:760px){#cockpit.is-active .cockpit-heading{grid-template-rows:auto auto auto auto}#cockpit.is-active .instrument-universe{grid-column:1/-1;grid-row:3;justify-self:start}#cockpit.is-active .cockpit-heading .execution-mode-switch{grid-column:1/-1;grid-row:4}.instrument-universe summary{padding:7px 9px}.instrument-universe-panel{left:0;right:auto}}

/* V311: identify the broker-net open P/L basis and its excluded exit fee. */
#cockpit.is-active .position-pnl-note{display:block;margin-top:2px;font-size:7px;font-weight:400;line-height:1.2;letter-spacing:0;color:var(--muted)}

/* V312: restore the original left identity and keep added controls together on the right. */
@media (min-width:1400px) {
  #cockpit.is-active { overflow:visible; }
  #cockpit.is-active .cockpit-heading {
    display:flex; align-items:center; gap:10px; flex:0 0 auto; height:auto; min-height:58px;
    padding:5px 4px; overflow:visible; position:relative; z-index:20;
  }
  #cockpit.is-active .cockpit-heading > div:first-child { flex:0 0 220px; min-width:0; margin-right:auto; }
  #cockpit.is-active .cockpit-heading h1 { font-size:24px; line-height:1; letter-spacing:.4px; }
  #cockpit.is-active .cockpit-heading .eyebrow { margin:0 0 5px; font-size:8px; letter-spacing:1.2px; }
  #cockpit.is-active .cockpit-instrument-picker { flex:0 1 180px; display:flex; flex-direction:column; justify-content:center; gap:4px; min-width:145px; margin:0; font-size:8px; letter-spacing:.08em; }
  #cockpit.is-active .cockpit-instrument-picker select { display:block; width:100%; min-width:0; max-width:none; min-height:29px; margin:0; pointer-events:auto; }
  #cockpit.is-active .instrument-universe { flex:0 0 auto; align-self:center; position:relative; z-index:45; }
  #cockpit.is-active .instrument-universe[open] { z-index:60; }
  #cockpit.is-active .instrument-universe-panel { top:calc(100% + 8px); left:auto; right:0; z-index:70; }
  #cockpit.is-active .cockpit-engine-model-control { flex:0 1 205px; display:grid; grid-template-columns:minmax(0,1fr); align-content:center; gap:4px; min-width:170px; margin:0; white-space:normal; }
  #cockpit.is-active .cockpit-engine-model-control select { width:100%; max-width:none; min-height:29px; margin:0; }
  #cockpit.is-active #engine-model-setting-status { margin:0; font-size:7px; line-height:1.1; }
  #cockpit.is-active .execution-mode-switch { flex:0 1 200px; align-self:center; min-width:180px; }
  #cockpit.is-active .execution-mode-switch > span { font-size:8px; }
  #cockpit.is-active .execution-mode-switch button { min-height:29px; font-size:7px; }
  #cockpit.is-active .cockpit-focus { flex:0 0 135px; min-width:0; gap:3px; }
  #cockpit.is-active .cockpit-focus strong { font-size:19px; }
  #cockpit.is-active .cockpit-focus .signal-brief { max-width:100%; font-size:8px; }
  #cockpit.is-active .cockpit-focus #cockpit-asof { font-size:7px; }
  #cockpit.is-active:has(#cockpit-instrument:focus) { overflow:visible; position:relative; z-index:40; }
  #cockpit.is-active #cockpit-instrument-picker { position:relative; z-index:41; }
  #cockpit.is-active #cockpit-instrument:focus { position:relative; z-index:42; }
}
@container desk (min-width:1001px) and (max-width:1399px) {
  #cockpit.is-active .cockpit-heading { display:grid; grid-template-columns:minmax(185px,1fr) minmax(155px,190px) max-content minmax(180px,210px) minmax(180px,205px) minmax(120px,140px); grid-template-rows:auto; min-height:64px; gap:7px; }
  #cockpit.is-active .cockpit-heading>div:first-child { grid-column:1; grid-row:1; }
  #cockpit.is-active .cockpit-instrument-picker { grid-column:2; grid-row:1; min-width:0; }
  #cockpit.is-active .instrument-universe { grid-column:3; grid-row:1; justify-self:start; position:relative; z-index:45; }
  #cockpit.is-active .cockpit-engine-model-control { grid-column:4; grid-row:1; min-width:0; }
  #cockpit.is-active .execution-mode-switch { grid-column:5; grid-row:1; min-width:0; }
  #cockpit.is-active .cockpit-focus { grid-column:6; grid-row:1; min-width:0; }
  #cockpit.is-active:has(#cockpit-instrument:focus) { overflow:visible; position:relative; z-index:40; }
  #cockpit.is-active #cockpit-instrument-picker { position:relative; z-index:41; }
  #cockpit.is-active #cockpit-instrument:focus { position:relative; z-index:42; }
}
@container desk (max-width:1000px) {
  #cockpit.is-active .cockpit-heading { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:auto auto; min-height:92px; gap:5px 10px; }
  #cockpit.is-active .cockpit-heading>div:first-child { grid-column:1; grid-row:1; }
  #cockpit.is-active .cockpit-instrument-picker { grid-column:2; grid-row:1; }
  #cockpit.is-active .cockpit-focus { grid-column:3; grid-row:1; align-items:flex-end; text-align:right; }
  #cockpit.is-active .instrument-universe { grid-column:1; grid-row:2; justify-self:start; }
  #cockpit.is-active .cockpit-engine-model-control { grid-column:2; grid-row:2; grid-template-columns:minmax(0,1fr); }
  #cockpit.is-active .execution-mode-switch { grid-column:3; grid-row:2; }
  #cockpit.is-active #engine-model-setting-status { display:none; }
}
@media (min-width:761px) and (max-width:1100px) {
  #cockpit.is-active .cockpit-heading { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:auto auto; min-height:92px; gap:5px 10px; }
  #cockpit.is-active .cockpit-heading>div:first-child { grid-column:1; grid-row:1; }
  #cockpit.is-active .cockpit-instrument-picker { grid-column:2; grid-row:1; min-width:0; }
  #cockpit.is-active .cockpit-focus { grid-column:3; grid-row:1; align-items:flex-end; }
  #cockpit.is-active .instrument-universe { grid-column:1; grid-row:2; justify-self:start; }
  #cockpit.is-active .cockpit-engine-model-control { grid-column:2; grid-row:2; min-width:0; }
  #cockpit.is-active .execution-mode-switch { grid-column:3; grid-row:2; min-width:0; }
}
@media (max-width:760px) {
  #cockpit.is-active .cockpit-instrument-picker { position:relative; z-index:41; }
  #cockpit.is-active .cockpit-instrument-picker select { position:relative; z-index:42; display:block; width:100%; min-height:34px; pointer-events:auto; }
  #cockpit.is-active .instrument-universe-panel { z-index:70; }
}

/* Account chooser modal: keeps the selected cTrader account connected until an option is chosen. */
.account-picker-dialog{width:min(92vw,440px);max-height:min(82dvh,680px);padding:20px;border:1px solid #326b70;border-radius:12px;background:#0c1a20;color:#e9f5f5;box-shadow:0 24px 80px #000b}
.account-picker-dialog::backdrop{background:#02090ddd;backdrop-filter:blur(3px)}
.account-picker-dialog h2{margin:0 0 6px;font-size:18px}
.account-picker-subtitle{margin:0 0 16px;color:#a8bdc2;font-size:12px;line-height:1.5}
.account-picker-status{margin:4px 0 12px;color:#9ee0d3;font-size:12px;line-height:1.5}
.account-picker-options{display:grid;gap:12px;max-height:58dvh;overflow:auto}
.account-picker-group{display:grid;gap:6px}
.account-picker-group h3{margin:0;color:#74d4c5;font-size:10px;letter-spacing:1px;text-transform:uppercase}
.account-picker-option{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;min-height:44px;padding:10px 12px;border:1px solid #29434c;border-radius:7px;background:#101f26;color:#e9f5f5;text-align:left;cursor:pointer}
.account-picker-option:hover,.account-picker-option:focus-visible{border-color:#75d8c8;background:#143039;outline:2px solid #75d8c855}
.account-picker-option small{color:#88d4c4;font-size:10px}
.account-picker-dialog>.secondary{margin-top:14px;width:100%;min-height:38px}
.account-picker-dialog-fallback{position:fixed;inset:50% auto auto 50%;z-index:2147483647;margin:0;transform:translate(-50%,-50%)}

/* V313: narrow landscape windows use the same complete, scrollable module flow as mobile portrait. */
@media (max-width:760px) and (orientation:landscape) {
  html:has(#cockpit.is-active), body:has(#cockpit.is-active) { height:auto; min-height:100dvh; overflow-x:hidden; overflow-y:auto; }
  aside:has(~main #cockpit.is-active) { position:fixed; inset:0 auto 0 0; width:48px; height:100dvh; min-height:0; padding:8px 3px; flex-direction:column; }
  main:has(#cockpit.is-active) { width:calc(100% - 48px); max-width:calc(100% - 48px); height:auto; min-height:100dvh; margin:0 0 0 48px; padding:0 8px 16px; overflow-x:clip; overflow-y:visible; }
  main:has(#cockpit.is-active)>header { position:relative; top:auto; height:auto; min-height:38px; flex:0 0 auto; flex-wrap:wrap; padding:4px 2px; }
  main:has(#cockpit.is-active) .market-status { flex-wrap:wrap; justify-content:flex-end; }
  #cockpit.is-active { display:flex; flex:0 0 auto; height:auto; min-height:0; overflow:visible; padding:4px 0 14px; gap:7px; }
  #cockpit.is-active .cockpit-heading { display:grid; flex:0 0 auto; height:auto; min-height:0; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:auto auto auto auto; gap:6px; padding:6px 2px; overflow:visible; }
  #cockpit.is-active .cockpit-heading>div:first-child { grid-column:1; grid-row:1; min-width:0; }
  #cockpit.is-active .cockpit-heading .cockpit-focus { grid-column:2; grid-row:1; min-width:0; align-items:flex-end; text-align:right; }
  #cockpit.is-active .cockpit-heading .cockpit-instrument-picker { grid-column:1; grid-row:2; display:flex; flex-wrap:wrap; align-items:center; min-width:0; }
  #cockpit.is-active .cockpit-instrument-picker select { width:100%; min-height:36px; }
  #cockpit.is-active .instrument-universe { grid-column:2; grid-row:2; justify-self:start; position:relative; z-index:45; }
  #cockpit.is-active .instrument-universe-panel { left:0; right:auto; z-index:70; }
  #cockpit.is-active .cockpit-heading .cockpit-engine-model-control { grid-column:1/-1; grid-row:3; display:grid; grid-template-columns:max-content minmax(0,1fr); min-width:0; }
  #cockpit.is-active .cockpit-heading .cockpit-engine-model-control select { width:100%; min-width:0; }
  #cockpit.is-active #engine-model-setting-status { grid-column:1/-1; }
  #cockpit.is-active .execution-mode-switch { grid-column:1/-1; grid-row:4; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); min-width:0; }
  #cockpit.is-active .execution-mode-switch>span { grid-column:1/-1; }
  #cockpit.is-active .cockpit-kpis { flex:0 0 auto; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
  #cockpit.is-active .cockpit-kpis article { min-height:52px; padding:7px 8px; }
  #cockpit.is-active .desk-main-grid { display:grid; flex:0 0 auto; min-width:0; min-height:0; grid-template-columns:minmax(0,1fr); grid-template-rows:auto; gap:8px; overflow:visible; }
  #cockpit.is-active .desk-left-column, #cockpit.is-active .desk-right-column { display:contents; }
  #cockpit.is-active .market-chart-panel { grid-column:1; grid-row:auto; width:100%; height:auto; min-height:0; max-height:none; padding:8px; }
  #cockpit.is-active .chart-canvas { flex:0 0 auto; width:100%; height:clamp(200px,45dvh,340px); min-height:200px; max-height:340px; }
  #cockpit.is-active #market-chart { width:100%; height:100%; min-height:0; }
  #cockpit.is-active .strategy-models-wrap { min-width:0; max-height:none; }
  #cockpit.is-active .strategy-models-scroll, #cockpit.is-active .opportunity-table-scroll { max-width:100%; overflow:auto; overscroll-behavior:contain; }
  #cockpit.is-active .cockpit-positions { grid-column:1; grid-row:auto; width:100%; height:auto; max-height:none; min-height:150px; overflow:visible; }
  #cockpit.is-active .cockpit-position-columns { grid-template-columns:minmax(0,1fr); grid-template-rows:repeat(3,minmax(75px,auto)); overflow:visible; }
  #cockpit.is-active .cockpit-position-list { max-height:180px; }
  #cockpit.is-active .engine-column { grid-column:1; grid-row:auto; display:block; min-width:0; min-height:0; overflow:visible; }
  #cockpit.is-active .engine-network { display:none; }
  #cockpit.is-active .engine-grid { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto auto; min-height:0; gap:6px; }
  #cockpit.is-active .engine-card { min-width:0; min-height:62px; padding:7px; }
  #cockpit.is-active .engine-card>p, #cockpit.is-active .engine-card details { display:none; }
  #cockpit.is-active .cockpit-opportunities { grid-column:1; grid-row:auto; width:100%; min-height:150px; max-height:48dvh; }
  #cockpit.is-active .dashboard-ticket { display:grid; grid-column:1; grid-row:auto; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto; width:100%; height:auto; min-height:0; max-height:none; overflow:visible; }
  #cockpit.is-active .ticket-guidance { display:contents; }
  #cockpit.is-active .dashboard-ticket .ticket-controls { display:grid; grid-column:1; grid-row:auto; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto auto auto auto auto; width:100%; height:auto; min-width:0; min-height:0; max-height:none; overflow:visible; }
  #cockpit.is-active .cockpit-ai-panel { grid-column:1; grid-row:auto; width:100%; min-height:54px; overflow:visible; }
  #cockpit.is-active .dashboard-ticket .ticket-instrument { grid-column:1; grid-row:auto; }
  #cockpit.is-active .dashboard-ticket .ticket-market { grid-column:2; grid-row:auto; }
  #cockpit.is-active .dashboard-ticket #dashboard-lots { grid-column:1/-1; grid-row:auto; width:100%; min-height:38px; }
  #cockpit.is-active .dashboard-ticket .ticket-sell { grid-column:1; grid-row:auto; min-height:48px; }
  #cockpit.is-active .dashboard-ticket .ticket-buy { grid-column:2; grid-row:auto; min-height:48px; }
  #cockpit.is-active .dashboard-ticket #dashboard-order-status, #cockpit.is-active .dashboard-ticket>small { grid-column:1/-1; grid-row:auto; white-space:normal; overflow-wrap:anywhere; }
  #cockpit.is-active .dashboard-ticket #scalp-master { grid-column:1/-1; grid-row:auto; }
}

/* IE-08 final desktop geometry overrides older overlapping container rules. */
@media (min-width:1101px) {
  #cockpit.is-active .cockpit-heading {
    display:grid; grid-template-columns:minmax(160px,1.1fr) minmax(135px,.9fr) max-content minmax(160px,1fr) minmax(160px,1fr) minmax(100px,.75fr);
    grid-template-rows:auto; align-items:center; gap:6px 8px; flex:0 0 auto; height:auto; min-height:62px; padding:4px; overflow:visible; position:relative; z-index:20;
  }
  #cockpit.is-active .cockpit-heading > div:first-child { grid-column:1; grid-row:1; flex:none; min-width:0; margin:0; }
  #cockpit.is-active .cockpit-instrument-picker { grid-column:2; grid-row:1; display:flex; flex:none; flex-direction:column; gap:4px; width:auto; min-width:0; margin:0; }
  #cockpit.is-active .cockpit-instrument-picker select { width:100%; min-width:0; }
  #cockpit.is-active .instrument-universe { grid-column:3; grid-row:1; justify-self:start; flex:none; }
  #cockpit.is-active .cockpit-heading .cockpit-engine-model-control { grid-column:4; grid-row:1; display:grid; flex:none; grid-template-columns:minmax(0,1fr); width:100%; min-width:0; margin:0; }
  #cockpit.is-active #engine-model-setting-status { display:block; overflow-wrap:anywhere; }
  #cockpit.is-active .cockpit-heading .execution-mode-switch { grid-column:5; grid-row:1; display:grid; flex:none; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; min-width:0; }
  #cockpit.is-active .cockpit-heading .execution-mode-switch > span { grid-column:1/-1; }
  #cockpit.is-active .cockpit-heading .execution-mode-switch button { min-width:0; padding:4px; }
  #cockpit.is-active .cockpit-heading .cockpit-focus { grid-column:6; grid-row:1; display:flex; flex:none; flex-direction:column; align-items:flex-end; width:auto; min-width:0; text-align:right; }
}
@media (min-width:1101px) and (min-height:701px) {
  #cockpit.is-active .desk-left-column { grid-template-rows:minmax(235px,1.35fr) minmax(130px,.65fr); }
}
@media (min-width:1101px) and (max-height:700px) {
  #cockpit.is-active .desk-left-column { grid-template-rows:auto auto; overflow:visible; }
  #cockpit.is-active .market-chart-panel { height:auto; min-height:0; max-height:none; overflow:visible; }
  #cockpit.is-active .chart-canvas { flex:0 0 auto; height:clamp(160px,40vh,260px); min-height:160px; max-height:260px; }
  #cockpit.is-active .cockpit-positions { height:auto; min-height:200px; }
}

/* V345 desktop composition: one measured grid owns the chart, engines, tables and operator row. */
@media (min-width:1000px) {
  #cockpit.is-active {
    display:grid;
    grid-template-columns:repeat(12,minmax(0,1fr));
    grid-template-rows:auto auto minmax(160px,1fr) minmax(70px,.35fr) minmax(125px,.6fr) minmax(180px,.75fr);
    gap:5px 7px;
    flex:1 1 0;
    height:auto;
    min-height:0;
    padding:4px 0 6px;
    overflow:hidden;
  }
  #cockpit.is-active .cockpit-heading { grid-column:1/-1; grid-row:1; min-width:0; }
  #cockpit.is-active .cockpit-kpis { grid-column:1/-1; grid-row:2; min-width:0; }
  #cockpit.is-active .desk-main-grid,
  #cockpit.is-active .desk-left-column,
  #cockpit.is-active .desk-right-column,
  #cockpit.is-active .ticket-guidance { display:contents; }
  #cockpit.is-active .market-chart-panel {
    grid-column:1/7; grid-row:3; width:100%; height:100%; max-height:50dvh; min-height:0;
  }
  #cockpit.is-active .engine-column {
    grid-column:7/13; grid-row:3; width:100%; height:100%; min-height:0; overflow:hidden;
  }
  #cockpit.is-active .engine-grid { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); min-height:0; }
  #cockpit.is-active .engine-card { min-width:0; min-height:0; }
  #cockpit.is-active .cockpit-positions {
    grid-column:1/7; grid-row:4/7; width:100%; height:100%; max-height:none; min-height:0; overflow:hidden;
  }
  #cockpit.is-active .cockpit-position-columns,
  #cockpit.is-active .cockpit-position-columns>article { min-height:0; }
  #cockpit.is-active .cockpit-position-list { max-height:none; min-height:0; overflow:auto; overscroll-behavior:contain; }
  #cockpit.is-active .cockpit-opportunities {
    grid-column:7/13; grid-row:4; width:100%; height:100%; max-height:none; min-height:0; overflow:hidden;
  }
  #cockpit.is-active .opportunity-table-scroll { min-height:0; max-height:none; overflow:auto; overscroll-behavior:contain; }
  #cockpit.is-active .cockpit-strategy-panel { grid-column:7/13; grid-row:5; }
  #cockpit.is-active .cockpit-ai-panel {
    grid-column:7/9; grid-row:6; width:100%; height:100%; max-height:none; min-width:0; min-height:0; overflow:hidden;
  }
  #cockpit.is-active .cockpit-ai-panel>* { min-width:0; max-width:100%; overflow-wrap:anywhere; }
  #cockpit.is-active .cockpit-ai-panel .panel-head { flex-wrap:wrap; }
  #cockpit.is-active .cockpit-ai-panel select { width:100%; max-width:100%; min-width:0; }
  #cockpit.is-active .dashboard-ticket {
    grid-column:9/13; grid-row:6; width:100%; height:100%; max-height:none; min-width:0; min-height:0;
    grid-template-columns:minmax(44px,.55fr) minmax(74px,1fr) minmax(52px,.65fr) minmax(62px,1fr) minmax(62px,1fr);
    grid-template-rows:minmax(38px,1fr) minmax(34px,.8fr);
    overflow:hidden;
  }
  #cockpit.is-active .dashboard-ticket .ticket-instrument,
  #cockpit.is-active .dashboard-ticket .ticket-market,
  #cockpit.is-active .dashboard-ticket #dashboard-lots,
  #cockpit.is-active .dashboard-ticket .ticket-sell,
  #cockpit.is-active .dashboard-ticket .ticket-buy { min-width:0; min-height:0; }
}


/* DSK03: compact, numeric SC/NM operator readout from the existing analysis contracts. */
@media (min-width:1000px) {
  #cockpit.is-active .cockpit-strategy-panel { display:grid; grid-template-rows:auto minmax(0,1fr); min-width:0; min-height:0; overflow:hidden; padding:5px 7px; border:1px solid var(--line); border-radius:5px; background:var(--panel,#0b1922); }
}
#cockpit.is-active .cockpit-strategy-head { display:flex; align-items:center; gap:8px; min-width:0; margin:0 0 4px; }
#cockpit.is-active .cockpit-strategy-head h3 { margin:0 auto 0 0; font-size:9px; letter-spacing:.8px; }
#cockpit.is-active .cockpit-strategy-head .tag,#cockpit.is-active .cockpit-strategy-head .muted { font-size:7px; }
#cockpit.is-active .cockpit-strategy-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; min-width:0; min-height:0; }
#cockpit.is-active .cockpit-strategy-card { display:grid; grid-template-rows:auto auto auto; align-content:start; gap:4px; min-width:0; min-height:0; padding:4px 6px; border:1px solid var(--line); border-radius:4px; background:rgba(8,20,28,.65); }
#cockpit.is-active .cockpit-strategy-card>header { display:flex; justify-content:space-between; align-items:center; gap:5px; min-width:0; }
#cockpit.is-active .cockpit-strategy-card>header strong { font-size:8px; letter-spacing:.5px; }
#cockpit.is-active .cockpit-strategy-card>header .tag { max-width:65%; overflow:hidden; text-overflow:ellipsis; font-size:7px; }
#cockpit.is-active .strategy-facts-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:2px 5px; min-width:0; }
#cockpit.is-active .strategy-fact { display:flex; gap:3px; min-width:0; overflow:hidden; font:8px/1.2 ui-monospace,monospace; color:#9eb7c1; white-space:nowrap; text-overflow:ellipsis; }
#cockpit.is-active .strategy-fact strong { overflow:hidden; color:#e1edf0; font-weight:600; text-overflow:ellipsis; }
#cockpit.is-active .strategy-fact small { flex:0 0 auto; color:#6d8793; font-size:7px; letter-spacing:.3px; }
#cockpit.is-active .strategy-freshness { display:block; min-width:0; overflow:hidden; color:#7f9aa5; font:6px/1.2 ui-monospace,monospace; text-overflow:ellipsis; white-space:nowrap; }
#cockpit.is-active .strategy-factor-row { display:flex; gap:4px; min-width:0; overflow:hidden; }
#cockpit.is-active .strategy-factor { padding:1px 4px; border-radius:3px; background:#102a31; color:#8ce5dc; font:7px/1.25 ui-monospace,monospace; white-space:nowrap; }
#cockpit.is-active .strategy-factor.risk { background:#30251c; color:#ffca75; }
#cockpit.is-active .strategy-card-ready { color:#78e6bd!important; }
#cockpit.is-active .strategy-card-block { color:#ff9a8a!important; }
@media(max-width:999px){#cockpit.is-active .cockpit-strategy-panel{display:grid;grid-template-rows:auto minmax(0,1fr);min-height:150px;padding:7px;overflow:hidden;border:1px solid var(--line);border-radius:5px;background:var(--panel,#0b1922)}}
@media(max-width:480px){#cockpit.is-active .cockpit-strategy-cards{grid-template-columns:minmax(0,1fr);overflow:auto}#cockpit.is-active .cockpit-strategy-card{min-height:96px}#cockpit.is-active .strategy-fact{font-size:8px}}

/* V349: engine cards should occupy their content height, not the chart's height. */
@media (min-width:1000px) {
  #cockpit.is-active .engine-column {
    display:block;
    align-self:start;
    height:auto;
    min-height:0;
    overflow:visible;
  }
  #cockpit.is-active .engine-grid {
    grid-template-rows:repeat(2,min-content);
    align-content:start;
    height:auto;
    min-height:0;
    gap:5px;
  }
  #cockpit.is-active .engine-card {
    grid-template-rows:auto auto auto auto;
    align-content:start;
    gap:2px;
    min-height:0;
    padding:5px 7px;
  }
  #cockpit.is-active .engine-card>strong {
    margin:1px 0 0;
  }
  #cockpit.is-active .engine-card>p {
    display:block;
    min-width:0;
    min-height:0;
    margin:0;
    overflow:hidden;
    color:#92aab3;
    font-size:7px;
    line-height:1.15;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  #cockpit.is-active .engine-card details { display:none; }
  #cockpit.is-active .engine-viz {
    display:flex;
    align-items:center;
    gap:5px;
    min-width:0;
    min-height:13px;
    margin:0;
    padding:0;
    overflow:hidden;
    border:0;
    background:transparent;
    font-size:7px;
  }
  #cockpit.is-active .engine-viz>span {
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  #cockpit.is-active .trend-viz { justify-content:flex-start; }
  #cockpit.is-active .trend-viz>i { flex:0 0 22px; height:2px; }
  #cockpit.is-active .momentum-viz .meter { flex:1 1 28px; min-width:24px; margin:0; }
  #cockpit.is-active .risk-viz {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-rows:auto auto;
    gap:2px 5px;
    align-items:center;
  }
  #cockpit.is-active .risk-viz>div { min-width:0; }
  #cockpit.is-active .risk-viz>div:first-child,
  #cockpit.is-active .risk-viz>div:last-child {
    display:flex;
    justify-content:space-between;
    gap:3px;
    overflow:hidden;
    white-space:nowrap;
  }
  #cockpit.is-active .risk-viz>div>span { overflow:hidden; text-overflow:ellipsis; }
  #cockpit.is-active .risk-viz>.meter { grid-column:1/-1; grid-row:2; min-width:0; margin:0; }
  #cockpit.is-active .risk-viz span,
  #cockpit.is-active .risk-viz b { font-size:6px; }
  #cockpit.is-active .exec-viz { justify-content:space-between; gap:4px; }
  #cockpit.is-active .exec-viz>span { font-size:6px; }
}

/* V349: distinguish AI guidance, operator controls, and SC/NM simulations. */
@media (min-width:1000px) {
  #cockpit.is-active .cockpit-ai-panel,
  #cockpit.is-active .dashboard-ticket {
    box-sizing:border-box;
    min-width:0;
    border-radius:5px;
  }
  #cockpit.is-active .cockpit-ai-panel {
    border:1px solid #31505a;
    border-left:3px solid #60d6c2;
    background:linear-gradient(135deg,#10232b,#0c171d);
  }
  #cockpit.is-active .dashboard-ticket {
    border:1px solid #31545a;
    border-left:3px solid #59c892;
    background:linear-gradient(135deg,#10231f,#0d191e);
  }
}

/* V349: distinguish AI guidance, operator controls, and SC/NM simulations. */
@media (min-width:1000px) {
  #cockpit.is-active .cockpit-ai-panel,
  #cockpit.is-active .dashboard-ticket {
    box-sizing:border-box;
    min-width:0;
    border-radius:5px;
  }
  #cockpit.is-active .cockpit-ai-panel {
    border:1px solid #31505a;
    border-left:3px solid #60d6c2;
    background:linear-gradient(135deg,#10232b,#0c171d);
  }
  #cockpit.is-active .dashboard-ticket {
    border:1px solid #31545a;
    border-left:3px solid #59c892;
    background:linear-gradient(135deg,#10231f,#0d191e);
  }
}

/* V349: distinguish AI guidance, operator controls, and SC/NM simulations. */
@media (min-width:1000px) {
  #cockpit.is-active .cockpit-ai-panel,
  #cockpit.is-active .dashboard-ticket {
    box-sizing:border-box;
    min-width:0;
    border-radius:5px;
  }
  #cockpit.is-active .cockpit-ai-panel {
    border:1px solid #31505a;
    border-left:3px solid #60d6c2;
    background:linear-gradient(135deg,#10232b,#0c171d);
  }
  #cockpit.is-active .dashboard-ticket {
    border:1px solid #31545a;
    border-left:3px solid #59c892;
    background:linear-gradient(135deg,#10231f,#0d191e);
  }
}

/* V350: keep AI guidance and operator controls in their intended 1/3–2/3 nested layout. */
@media (min-width:1000px) {
  #cockpit.is-active .dashboard-ticket {
    grid-column:7/13;
    grid-row:6;
    width:100%;
    height:100%;
    min-height:0;
    max-height:none;
    grid-template-columns:minmax(0,1fr) minmax(0,2fr);
    grid-template-rows:minmax(0,1fr);
    align-items:stretch;
    gap:8px;
    padding:6px;
    overflow:hidden;
  }
  #cockpit.is-active .ticket-guidance {
    display:grid;
    grid-column:1;
    grid-row:1;
    min-width:0;
    min-height:0;
    overflow:hidden;
    border:1px solid #31505a;
    border-left:3px solid #60d6c2;
    border-radius:5px;
    background:linear-gradient(135deg,#10232b,#0c171d);
  }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel {
    display:grid;
    grid-column:auto;
    grid-row:auto;
    grid-template-rows:auto auto minmax(0,1fr) auto auto;
    width:100%;
    height:100%;
    min-width:0;
    min-height:0;
    max-height:none;
    margin:0;
    padding:5px 7px;
    overflow:hidden;
    border:0;
    border-radius:0;
    background:transparent;
  }
  #cockpit.is-active .ticket-controls {
    grid-column:2;
    grid-row:1;
    width:100%;
    height:100%;
    grid-template-columns:minmax(48px,.55fr) minmax(78px,1fr) minmax(56px,.75fr) minmax(70px,1fr) minmax(70px,1fr);
    grid-template-rows:minmax(38px,.8fr) minmax(64px,1.2fr) 14px;
    align-content:stretch;
    gap:5px;
    min-width:0;
    min-height:0;
  }
  #cockpit.is-active .ticket-controls #dashboard-quote-state { display:none; }
  #cockpit.is-active .ticket-controls #dashboard-order-status { grid-column:1/-1; grid-row:3; }
  #cockpit.is-active .ticket-controls #scalp-master { grid-column:1/-1; grid-row:2; }
  #cockpit.is-active .ticket-controls .ticket-sell,
  #cockpit.is-active .ticket-controls .ticket-buy { min-height:36px; }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel .panel-head { min-width:0; }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel .panel-head h3 { font-size:8px; }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel .ai-model-control { min-width:0; max-width:100%; font-size:6px; }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel select,
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel button { max-width:100%; min-width:0; font-size:7px; }
}

/* V351: keep the one-shot AI scenario controls readable inside their guidance column. */
@media (min-width:1000px) {
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:3px;
  }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel .panel-head {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    align-content:start;
    justify-items:stretch;
    gap:3px;
    flex:0 0 auto;
  }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel .panel-head h3 {
    margin:0;
    overflow:hidden;
    font-size:7px;
    line-height:1.2;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel .panel-head .tag {
    justify-self:start;
    max-width:100%;
    font-size:6px;
  }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel .ai-model-control {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:2px;
    min-width:0;
    font-size:6px;
  }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel select {
    width:100%;
    height:22px;
    padding:2px 4px;
  }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel .panel-head button {
    min-height:24px;
    padding:3px 5px;
    white-space:normal;
  }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel #cockpit-ai-copy {
    display:block;
    flex:1 1 auto;
    min-width:0;
    min-height:18px;
    max-height:45px;
    margin:0;
    overflow:hidden;
    font-size:7px;
    line-height:1.2;
  }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel #cockpit-ai-copy>strong,
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel #ai-model-setting-status,
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel .ai-breaker-controls,
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel>small:last-child { display:none!important; }
  #cockpit.is-active .ticket-guidance .cockpit-ai-panel #cockpit-ai-copy>span:last-child {
    display:-webkit-box;
    overflow:hidden;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    white-space:normal;
  }
}

/* R03: independent right rail; preserve the pre-V358 chart and positions tracks. */
@media (min-width:1000px) {
  #cockpit.is-active {
    grid-template-rows:auto auto minmax(160px,1fr) minmax(70px,.35fr) minmax(125px,.6fr) minmax(180px,.75fr);
  }
  #cockpit.is-active .desk-right-column {
    display:grid;
    grid-column:7/13;
    grid-row:3/7;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:max-content minmax(0,1fr) minmax(110px,.6fr) minmax(130px,.75fr);
    gap:5px;
    min-width:0;
    min-height:0;
    overflow:hidden;
  }
  #cockpit.is-active .desk-right-column>.engine-column,
  #cockpit.is-active .desk-right-column>.cockpit-opportunities,
  #cockpit.is-active .desk-right-column>.cockpit-strategy-panel,
  #cockpit.is-active .desk-right-column>.dashboard-ticket {
    grid-column:1;
    grid-row:auto;
  }
  #cockpit.is-active .cockpit-opportunities {
    display:grid;
    grid-template-rows:auto auto minmax(0,1fr);
    min-height:0;
    max-height:none;
    height:100%;
  }
  #cockpit.is-active .opportunity-table-scroll {
    height:100%;
    min-height:0;
    max-height:none;
    overflow:auto;
    overscroll-behavior:contain;
  }
}

/* V361: enlarge the chart, keep open positions compact, and make candle history navigable. */
#cockpit.is-active .desk-left-column { grid-template-rows:minmax(0,1.6fr) minmax(100px,.4fr); }
#cockpit.is-active .market-chart-panel { max-height:none; }
#cockpit.is-active #market-chart { cursor:grab; touch-action:pan-y; user-select:none; }
#cockpit.is-active #market-chart.is-panning { cursor:grabbing; }
#cockpit.is-active .chart-subnav .chart-gesture-hint { margin-left:auto; white-space:nowrap; color:#86a9b0; font-size:8px; }
#cockpit.is-active .chart-view-reset { flex:0 0 auto; min-height:21px; padding:2px 7px; border:1px solid #31545d; border-radius:3px; background:#101d23; color:#92c5c5; font-size:8px; }
#cockpit.is-active .chart-view-reset:hover { border-color:#77d9cf; color:#d7f7f1; }
@media (min-width:761px) and (max-width:1100px) {
  #cockpit.is-active .desk-left-column { grid-template-rows:minmax(340px,1.55fr) minmax(120px,.45fr); }
  #cockpit.is-active .market-chart-panel { max-height:none; }
}
@media (max-width:760px) {
  #cockpit.is-active .desk-left-column { grid-template-rows:minmax(360px,54dvh) minmax(210px,auto); }
  #cockpit.is-active .market-chart-panel { max-height:none; }
  #cockpit.is-active .chart-subnav { flex-wrap:wrap; }
  #cockpit.is-active .chart-subnav .chart-gesture-hint { order:2; flex:1 1 160px; margin-left:0; }
  #cockpit.is-active .chart-view-reset { order:3; }
}

@media(min-width:1000px){#cockpit.is-active .cockpit-opportunities{grid-template-rows:auto auto minmax(0,1fr) auto auto}}

/* V433: remove legacy cockpit histories and retain broker position history. */
#cockpit.is-active .cockpit-lane-activity{display:grid;grid-template-rows:auto auto auto auto auto;align-content:start;gap:4px;min-width:0;min-height:0;overflow:hidden;padding:5px 7px;border:1px solid var(--line);border-radius:5px;background:var(--panel,#0b1922)}
#cockpit.is-active .cockpit-lane-activity-head{display:flex;align-items:center;gap:7px;min-width:0}
#cockpit.is-active .cockpit-lane-activity-head h3{margin:0 auto 0 0;font-size:9px;letter-spacing:.7px}
#cockpit.is-active .cockpit-lane-activity-head .tag{max-width:58%;overflow:hidden;text-overflow:ellipsis;font-size:7px}
#cockpit.is-active .cockpit-lane-activity-group{display:grid;grid-template-columns:95px minmax(0,1fr);align-items:start;gap:4px;min-width:0}
#cockpit.is-active .cockpit-lane-activity-group>strong{padding:2px 0;color:#819ba5;font:7px/1.25 ui-monospace,monospace;letter-spacing:.35px}
#cockpit.is-active .cockpit-lane-activity-pills{display:flex;flex-wrap:wrap;gap:3px;min-width:0;max-height:30px;overflow:auto;overscroll-behavior:contain}
#cockpit.is-active .cockpit-lane-activity-pills .strategy-factor{max-width:100%;font-size:7px;text-overflow:ellipsis}
#cockpit.is-active .cockpit-lane-activity-group details{min-width:0}
#cockpit.is-active .cockpit-lane-activity-group details>summary{cursor:pointer;color:#c0d2d8;font:9px/1.35 ui-monospace,monospace;overflow-wrap:anywhere}
#cockpit.is-active .cockpit-lane-activity-group details[open] .cockpit-lane-activity-pills{max-height:210px;overflow:auto;overscroll-behavior:contain;padding-top:5px}
#cockpit.is-active #cockpit-lane-runtime .strategy-factor,#cockpit.is-active #cockpit-lane-refusal-history .strategy-factor{max-width:100%;font:9px/1.4 ui-monospace,monospace;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
#cockpit.is-active .cockpit-lane-activity:has(details[open]){max-height:min(68vh,520px);overflow-y:auto;overscroll-behavior:contain;z-index:12}
#cockpit.is-active #cockpit-lane-refusal-history{max-height:34px}
#cockpit.is-active #cockpit-lane-stage-strip{display:flex;gap:3px;min-width:0;max-height:16px;overflow:auto;overscroll-behavior:contain}
#cockpit.is-active #cockpit-lane-stage-strip .strategy-factor{font-size:6px}
@media(min-width:1000px){#cockpit.is-active .desk-right-column{grid-template-rows:minmax(82px,.48fr) max-content minmax(0,1fr) minmax(96px,.56fr) minmax(120px,.7fr)}}
@media(max-width:999px){#cockpit.is-active .cockpit-lane-activity{min-height:132px;max-height:190px}#cockpit.is-active .desk-right-column{grid-template-rows:auto auto minmax(220px,1fr) auto auto;align-content:start;overflow:visible}}
@media(max-width:760px){#cockpit.is-active .cockpit-lane-activity{min-height:146px;max-height:210px}#cockpit.is-active .cockpit-lane-activity-group{grid-template-columns:82px minmax(0,1fr)}}
@media(max-width:760px) and (orientation:portrait){#cockpit.is-active .cockpit-lane-activity{grid-column:1;grid-row:3}#cockpit.is-active .engine-column{grid-row:4}#cockpit.is-active .cockpit-opportunities{grid-row:5}#cockpit.is-active .dashboard-ticket{grid-row:6}}
@media(max-width:760px) and (orientation:landscape) and (max-height:520px){#cockpit.is-active .cockpit-lane-activity{grid-column:1;grid-row:auto}}
#cockpit.is-active .cockpit-lane-log-summary{display:flex;align-items:center;gap:8px;flex-wrap:wrap;cursor:pointer;list-style:none}
#cockpit.is-active .cockpit-lane-log-summary::-webkit-details-marker{display:none}
#cockpit.is-active .cockpit-lane-log-summary>strong{font:9px/1.3 ui-monospace,monospace;letter-spacing:.5px}
#cockpit.is-active .cockpit-lane-log-summary .muted{font:8px/1.35 ui-monospace,monospace;min-width:0;overflow-wrap:anywhere}
#cockpit.is-active .cockpit-lane-log-content{display:grid;gap:8px;padding-top:8px}
#cockpit.is-active .cockpit-lane-history-filters{display:grid;grid-template-columns:repeat(5,minmax(80px,1fr));gap:5px}
#cockpit.is-active .cockpit-lane-history-filters label{display:grid;gap:3px;color:#819ba5;font:7px/1.2 ui-monospace,monospace}
#cockpit.is-active .cockpit-lane-history-filters select{min-width:0;width:100%;padding:5px;background:#101a22;color:#d6e3e8;border:1px solid #344752;border-radius:4px;font:8px ui-monospace,monospace}
#cockpit.is-active #cockpit-lane-setup-history{max-height:210px;overflow:auto;overscroll-behavior:contain}
#cockpit.is-active #cockpit-lane-setup-history .strategy-factor{max-width:100%;font:8px/1.4 ui-monospace,monospace;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
#cockpit.is-active .cockpit-lane-history-pager{display:flex;align-items:center;justify-content:center;gap:10px}
#cockpit.is-active .cockpit-lane-history-pager button{padding:5px 9px;font-size:8px}
@media(max-width:760px){#cockpit.is-active .cockpit-lane-history-filters{grid-template-columns:repeat(2,minmax(100px,1fr))}#cockpit.is-active .cockpit-lane-activity{min-height:100px;max-height:240px}}

/* V462: readable, full-width cockpit status/history below opportunities. */
#cockpit.is-active .desk-right-column>.cockpit-lane-activity{grid-column:1;grid-row:auto;display:block;min-width:0;min-height:0;max-height:none;overflow:visible;padding:12px 14px}
#cockpit.is-active .cockpit-lane-activity details{min-width:0}
#cockpit.is-active .cockpit-lane-log-summary{gap:10px;min-height:38px}
#cockpit.is-active .cockpit-lane-log-summary>strong{font-size:12px}
#cockpit.is-active .cockpit-lane-log-summary .muted,#cockpit.is-active .cockpit-lane-activity .tag{font-size:11px;line-height:1.45}
#cockpit.is-active .cockpit-lane-log-content{max-height:min(68vh,680px);overflow-y:auto;overscroll-behavior:contain;padding:12px 4px 4px 0}
#cockpit.is-active .cockpit-lane-activity-group{grid-template-columns:minmax(110px,160px) minmax(0,1fr);gap:8px;padding:4px 0}
#cockpit.is-active .cockpit-lane-activity-group>strong{font:10px/1.45 ui-monospace,monospace}
#cockpit.is-active .cockpit-lane-activity-pills,#cockpit.is-active .cockpit-lane-activity-group details[open] .cockpit-lane-activity-pills,#cockpit.is-active #cockpit-lane-stage-strip,#cockpit.is-active #cockpit-lane-refusal-history,#cockpit.is-active #cockpit-lane-setup-history{max-height:none;overflow:visible;overscroll-behavior:auto}
#cockpit.is-active .cockpit-lane-activity-group .strategy-factor,#cockpit.is-active #cockpit-lane-setup-history .strategy-factor{font:10px/1.5 ui-monospace,monospace;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
#cockpit.is-active .cockpit-lane-activity-group details>summary{font:11px/1.5 ui-monospace,monospace}
#cockpit.is-active .cockpit-lane-history-filters label{font:10px/1.35 ui-monospace,monospace}
#cockpit.is-active .cockpit-lane-history-filters select{font:11px ui-monospace,monospace;min-height:32px}
#cockpit.is-active .cockpit-lane-history-pager button{font-size:11px;min-height:32px}
@media(min-width:1000px){#cockpit.is-active .desk-right-column{grid-template-rows:max-content minmax(180px,1fr) max-content max-content max-content max-content;overflow:visible}#cockpit.is-active .desk-right-column>.cockpit-lane-activity{align-self:start}}
@media(max-width:999px){#cockpit.is-active .desk-right-column{grid-template-rows:auto minmax(220px,1fr) auto auto auto auto;overflow:visible}#cockpit.is-active .cockpit-lane-activity{min-height:0;max-height:none}}
@media(max-width:760px){#cockpit.is-active .cockpit-lane-activity-group{grid-template-columns:minmax(82px,110px) minmax(0,1fr)}#cockpit.is-active .cockpit-lane-log-content{max-height:68dvh}}
@media(max-width:760px) and (orientation:portrait){#cockpit.is-active .engine-column{grid-row:3}#cockpit.is-active .cockpit-opportunities{grid-row:4}#cockpit.is-active .cockpit-lane-activity{grid-column:1;grid-row:5}#cockpit.is-active #central-market-events-panel{grid-column:1;grid-row:6}#cockpit.is-active .cockpit-strategy-panel{grid-column:1;grid-row:7}#cockpit.is-active .dashboard-ticket{grid-column:1;grid-row:8}}
