:root{color-scheme:dark;--bg:#0b1016;--surface:#111923;--line:#233140;--muted:#8193a6;--text:#d9e5ee;--green:#32c6a3;--red:#ee716f;--cyan:#43ccdf}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:13px 'Segoe UI',sans-serif}header{height:74px;display:flex;align-items:center;justify-content:space-between;padding:0 26px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:12px;letter-spacing:2px;font-size:16px}.brand b{color:var(--cyan);font-weight:500}.brand small{display:block;font-size:10px;color:var(--muted);letter-spacing:.7px;margin-top:5px}.mark{background:#12313e;color:var(--cyan);padding:8px 11px;border-radius:9px;font-size:22px}.connection{color:var(--muted);font-size:12px}.connection i{display:inline-block;width:6px;height:6px;background:var(--green);border-radius:50%;margin-right:8px}.toolbar{display:flex;align-items:center;gap:10px;padding:16px 26px;flex-wrap:wrap}label{display:flex;flex-direction:column;gap:5px;color:var(--muted);font-size:10px}button,input,select{font:inherit;color:var(--text);background:#16212e;border:1px solid #2c3d4f;border-radius:5px;padding:8px 11px}button{cursor:pointer;transition:background .15s}button:hover{background:#25394b}button:disabled{opacity:.4;cursor:default}button.primary{background:#239bae;border-color:#2caabc;color:#07141c;font-weight:600}.ghost{background:transparent;border-color:transparent;color:var(--muted)}.divider{width:1px;height:30px;background:var(--line);margin:0 7px}#clock{margin-left:auto;font:20px Consolas,monospace;color:var(--cyan);letter-spacing:.5px}.timeline{display:flex;gap:16px;align-items:center;padding:0 26px 15px;color:var(--muted);font-size:11px}.timeline input{padding:0;flex:1;accent-color:var(--cyan)}#status{max-width:330px;text-align:right}main{display:flex;gap:16px;padding:0 20px 20px;align-items:stretch;overflow-x:auto}.market-panel{flex:1;min-width:490px;max-width:1000px;background:var(--surface);border:1px solid var(--line);border-radius:8px;overflow:hidden}.panel-head{height:54px;display:flex;align-items:center;gap:10px;padding:0 14px;border-bottom:1px solid var(--line)}.panel-head select{font-weight:600;border:0;background:transparent;color:var(--cyan);padding-left:0;font-size:15px;max-width:150px}.panel-head .price{font:16px Consolas,monospace}.spread{font-size:10px;color:var(--muted)}.center{margin-left:auto}.column-labels{height:31px;display:grid;grid-template-columns:24% 46% 30%;color:var(--muted);font-size:10px;border-bottom:1px solid var(--line);align-items:center;text-align:center;letter-spacing:.4px}.ladder-wrap{height:clamp(330px,calc(100vh - 580px),850px);position:relative}.ladder,.chart{width:100%;height:100%;display:block}.book-state{position:absolute;left:12px;bottom:7px;color:var(--muted);background:#0b1016d9;padding:4px 7px;border-radius:4px;font-size:10px;pointer-events:none}.chart-head{height:33px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 14px;font-size:11px}.chart-head b{font-weight:500;color:var(--muted)}.ohlc{font:10px Consolas,monospace}.chart-wrap{height:230px}.panel-foot{display:flex;justify-content:space-between;padding:9px 14px;color:var(--muted);font-size:10px;border-top:1px solid var(--line)}footer{display:flex;justify-content:space-between;padding:0 24px 18px;color:var(--muted);font-size:10px}.bad{color:var(--red)!important}@media(max-width:800px){header{padding:0 14px}.toolbar{padding:12px}.timeline{padding:0 12px 12px;flex-wrap:wrap}.timeline input{min-width:180px}main{padding:0 8px 12px}.market-panel{min-width:450px}#clock{font-size:16px}footer{display:block}#hint{display:block;margin-top:8px}.connection{display:none}}
.bottom-controls{position:sticky;bottom:0;z-index:20;background:#0b1016f5;border-top:1px solid var(--line);box-shadow:0 -8px 24px #0004;backdrop-filter:blur(8px)}.bottom-controls .toolbar{padding-top:12px;padding-bottom:10px}.bottom-controls .timeline{padding-bottom:12px}main{padding-top:16px}.bottom-controls #add{border-color:#2b9dac;color:var(--cyan);background:#14323e}.bottom-controls #add:hover{background:#205060}
.panel-settings{width:min(440px,90vw);padding:24px;color:var(--text);background:var(--surface);border:1px solid #3b566e;border-radius:10px}.panel-settings::backdrop{background:#0009}.panel-settings h2{font-size:17px;margin:0 0 22px}.panel-settings label{font-size:13px}.panel-settings p{color:var(--muted);font-size:12px;line-height:1.6}.settings-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}.panel-head{gap:6px}.panel-head .settings{font-size:20px;padding:5px 7px}

#realtime.active{color:#32c6a3;border-color:#32c6a3;background:#173e35}

.column-labels{grid-template-columns:36% 34% 30%}.book-state{left:37%;max-width:32%}

.profile-tools{display:none}.profile-tools input{pointer-events:auto;min-width:0;width:100%;height:14px;padding:0;margin:0;border:0;background:transparent;accent-color:var(--cyan)}
.timeline #range{flex:0 0 300px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.timeline #seek{min-width:160px}.timeline #time{flex:0 0 155px;width:155px;min-width:0;padding:6px 8px;font:13px Consolas,monospace}.timeline #status{display:none}
@media(max-width:1000px){.timeline #range{flex-basis:220px}}
@media(max-width:800px){.timeline #seek{flex:1 1 100%;order:2}.timeline #time{order:3}.timeline #range{order:1;flex:1 1 100%}}

.iceberg-settings{margin:18px 0 0;padding:12px;border:1px solid var(--line);display:grid;gap:10px}.iceberg-settings legend{color:#efbc63}.iceberg-settings .iceberg-enable{display:flex;flex-direction:row;align-items:center;font-size:12px}.panel-settings{max-height:85vh;overflow-y:auto}.panel-settings form>.iceberg-enable{display:flex;flex-direction:row;justify-content:flex-start;gap:8px}
main#panels{display:grid;grid-template-columns:repeat(var(--panel-columns,2),minmax(490px,1fr));align-items:start;overflow-x:auto}.market-panel{width:100%;max-width:none;min-width:490px}.splitter{position:absolute;top:0;bottom:25px;width:9px;margin-left:-4px;z-index:3;cursor:col-resize}.splitter:hover,.splitter.dragging{background:#43ccdf66}.market-panel .column-labels{grid-template-columns:var(--profile-share,36%) var(--tape-share,34%) 1fr}.market-panel.profile-hidden .splitter-profile,.market-panel.profile-hidden .profile-tools{display:none}.market-panel.profile-hidden .column-labels{grid-template-columns:var(--tape-share,34%) 1fr}.market-panel.chart-hidden .chart-head,.market-panel.chart-hidden .chart-wrap{display:none}.panel-head .toggle-profile,.panel-head .toggle-chart{padding:4px 6px}.panel-head .active{color:var(--cyan)}.market-panel.profile-hidden .column-labels span:first-child{display:none}#global-settings{z-index:50}
main#panels{display:grid;grid-template-columns:repeat(var(--panel-columns,2),minmax(0,1fr));align-items:start;overflow-x:auto}.market-panel{width:100%;max-width:none;min-width:0}.market-panel .panel-head{gap:4px;padding:0 8px;min-width:0}.market-panel .panel-head select{min-width:0;max-width:110px}.market-panel .panel-head .center{white-space:nowrap;padding:4px}.market-panel .panel-head .price,.market-panel .panel-head .spread{white-space:nowrap}.splitter{position:absolute;top:0;bottom:25px;width:9px;margin-left:-4px;z-index:3;cursor:col-resize}.splitter:hover,.splitter.dragging{background:#43ccdf66}.market-panel .column-labels{grid-template-columns:var(--profile-share,36%) var(--tape-share,34%) 1fr}.market-panel.profile-hidden .splitter-profile,.market-panel.profile-hidden .profile-tools{display:none}.market-panel.profile-hidden .column-labels{grid-template-columns:var(--tape-share,34%) 1fr}.market-panel.chart-hidden .chart-head,.market-panel.chart-hidden .chart-wrap{display:none}.panel-head .toggle-profile,.panel-head .toggle-chart{padding:4px 6px}.panel-head .active{color:var(--cyan)}.market-panel.profile-hidden .column-labels span:first-child{display:none}#global-settings{z-index:50}
.profile-heading{display:flex;align-items:center;justify-content:center;gap:2px;min-width:0;white-space:nowrap;overflow:hidden}.profile-tf{flex:none;width:58px;padding:2px 0;font-size:10px;color:var(--cyan);background:transparent;border:0;cursor:pointer}.profile-range{min-width:0;overflow:hidden;text-overflow:ellipsis}
.chart-heading{display:flex;align-items:center;gap:3px;white-space:nowrap;color:var(--muted)}.chart-tf{width:68px;padding:2px 0;font-size:11px;color:var(--cyan);background:transparent;border:0;cursor:pointer}
html,body{height:100%;overflow:hidden}body{display:flex;flex-direction:column}header,footer,.bottom-controls{flex:none}footer{padding:5px 16px;min-height:24px}
main#panels{flex:1;min-height:0;min-width:0;display:grid;grid-template-columns:repeat(var(--layout-cols,2),minmax(0,1fr));grid-template-rows:repeat(var(--layout-rows,1),minmax(0,1fr));gap:8px;padding:8px;overflow:hidden;align-items:stretch}
.layout-slot{min-width:0;min-height:0;overflow:hidden;container-type:size}.layout-slot .market-panel{height:100%;min-width:0;min-height:0;display:flex;flex-direction:column}.layout-slot .panel-head,.layout-slot .column-labels,.layout-slot .chart-head,.layout-slot .panel-foot{flex:none}.layout-slot .ladder-wrap{flex:1;min-height:0;height:auto}.layout-slot .chart-wrap{flex:none;height:clamp(70px,22%,210px)}
.empty-slot{display:grid;place-items:center;background:#111923;border:1px dashed #335064;border-radius:8px}.slot-add{width:72px;height:72px;border:1px solid #3e8191;border-radius:18px;background:#16303b;color:var(--cyan);font-size:48px;line-height:1;padding:0}.slot-add:hover{background:#235366}
.layout-control{position:relative;align-self:end}.layout-menu[hidden]{display:none}.layout-menu{position:absolute;left:0;bottom:calc(100% + 8px);z-index:30;width:266px;max-width:92vw;background:#1c222a;border:1px solid #43505e;border-radius:9px;box-shadow:0 12px 32px #000b;padding:10px}.layout-preview-title{font-size:13px;font-weight:600;color:#dce8f0;min-height:30px;padding:2px 2px 8px}.layout-picker-grid{display:grid;grid-template-columns:repeat(6,32px);grid-template-rows:repeat(3,32px);gap:4px}.layout-picker-cell{width:32px;height:32px;padding:0;border:1px solid #667480;border-radius:2px;background:#18222c}.layout-picker-cell.preview{border-color:#46c7d9;background:#205b69}.layout-picker-cell.preview.invalid{border-color:#d2836f;background:#674034}.layout-picker-cell:focus-visible{outline:2px solid #fff;outline-offset:1px}.layout-picker-cell:hover{cursor:pointer}
.instrument-picker{width:min(430px,92vw);max-height:75dvh;background:#151f29;color:var(--text);border:1px solid #476175;border-radius:10px;padding:16px}.instrument-picker::backdrop{background:#000a}.picker-head{display:flex;align-items:center;justify-content:space-between}.picker-head h2{font-size:17px;margin:0 0 12px}.picker-close{padding:3px 9px;font-size:22px}.instrument-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;max-height:60dvh;overflow:auto}.instrument-options button{text-align:left}
#panels[data-layout-rows="3"] .chart-head,#panels[data-layout-rows="3"] .chart-wrap{display:none}#panels[data-layout-cols="5"] .panel-head .spread,#panels[data-layout-cols="5"] .panel-head .center,#panels[data-layout-cols="6"] .panel-head .spread,#panels[data-layout-cols="6"] .panel-head .center{display:none}
@container (max-width:360px){.panel-head .spread,.panel-head .center{display:none}.panel-head .price{font-size:12px}.panel-head .instrument{max-width:70px}.profile-range{display:none}.column-labels{font-size:9px}}
@container (max-height:340px){.market-panel .chart-head,.market-panel .chart-wrap,.market-panel .panel-foot{display:none}.market-panel .panel-head{height:38px}.market-panel .column-labels{height:25px}}
.book-heading{display:flex;align-items:center;justify-content:center;gap:2px;min-width:0;white-space:nowrap;overflow:hidden}
.book-scale{flex:none;width:54px;padding:2px 0;font-size:10px;color:var(--cyan);background:transparent;border:0;cursor:pointer}
.panel-head .panel-robots{display:flex;align-items:center;gap:5px;flex:1;min-width:0;height:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
.panel-head .center{margin-left:0}
.robot-indicator{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:calc(var(--robot-size) + 18px);height:50px;color:#e9f3f5}
.robot-bubble{display:flex;align-items:center;justify-content:center;width:var(--robot-size);height:var(--robot-size);border-radius:50%;border:2px solid;font:600 12px Consolas,monospace;white-space:nowrap}
.robot-buy{background:#176a58;border-color:#32c6a3}.robot-sell{background:#823c43;border-color:#ee716f}
.robot-missed .robot-bubble{opacity:.4}
.robot-bubble{position:relative;border:0}
.robot-buy{--robot-ring:#32c6a3}
.robot-sell{--robot-ring:#ee716f}
.robot-ring{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;transform:rotate(-90deg)}
.robot-ring circle{fill:none;stroke:var(--robot-ring);stroke-width:7;stroke-linecap:butt}
.robot-counter{position:absolute;right:var(--counter-right);min-width:14px;padding:0 2px;border-radius:7px;background:#11192399;color:#9ba7b4;font:600 10px Consolas,monospace;text-align:center}
.robot-period{bottom:var(--counter-inset)}
.robot-misses{top:var(--counter-inset)}
.ladder-wrap .boundary-toggle{position:absolute;z-index:6;display:grid;place-items:center;padding:0;border:1px solid #41647b;border-radius:2px;background:#162a39e8;color:var(--cyan);font:10px Consolas,monospace;box-shadow:0 2px 8px #0008}
.ladder-wrap .boundary-toggle:hover{background:#24506a;color:#fff}
.ladder-wrap .toggle-profile{width:8px;height:42px;left:var(--profile-share,36%);top:50%;transform:translate(-50%,-50%)}
.market-panel.profile-hidden .ladder-wrap .toggle-profile{left:0;transform:translateY(-50%)}
.ladder-wrap .toggle-chart{width:42px;height:8px;left:50%;bottom:-4px;transform:translateX(-50%)}

/* Shared controls and compact workspace chrome. */
:root{--bg:#0b1118;--surface:#101923;--line:#253240;--muted:#8799ad;--text:#dce6ef;--cyan:#56c5d5;--control:#17232f;--control-hover:#223443}
header{height:42px;padding:0 16px;background:#0e161f}
.brand{gap:8px;font-size:12px;letter-spacing:1.5px}
.mark{background:transparent;padding:0;font-size:21px;border-radius:0}
.connection{font-size:11px}
.connection i{width:5px;height:5px;margin-right:6px}
button,input,select{min-height:32px;padding:6px 10px;background:var(--control);border-color:#304151;border-radius:6px;font-size:12px;line-height:18px;outline:none}
button{transition:background .12s,border-color .12s,color .12s}
button:hover{background:var(--control-hover);border-color:#4b657b}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #56c5d580;outline-offset:2px}
button:disabled{opacity:.36}
button.primary{background:#286e7b;border-color:#388594;color:#f1fbff}
button.primary:hover{background:#348493}
.ghost{background:transparent;border-color:transparent;color:var(--muted)}
.ghost:hover{background:#21313e;border-color:transparent;color:var(--text)}
select option{background:#17232f;color:var(--text)}
main#panels{gap:6px;padding:6px}
.market-panel,.empty-slot{border-radius:7px}
.market-panel .panel-head{height:52px;padding:0 10px;gap:6px;background:#121d28}
.market-panel .panel-head .instrument{font-size:14px;max-width:128px;padding:3px 0;min-height:30px;border-radius:4px}
.market-panel .panel-head .price{font-size:15px;color:#e2ebf3}
.panel-head .spread{font-size:10px;color:#71869b}
.panel-head .ghost{width:28px;height:28px;min-height:28px;padding:0;display:grid;place-items:center;flex:none;font-size:20px}
.panel-head .remove{font-size:19px;color:#72869a}
.panel-head .remove:hover{color:#ee8c8a;background:#5b303344}
.market-panel .column-labels{height:30px;letter-spacing:0;font-size:11px;background:#0f1923;color:#8da0b3}
.profile-heading,.book-heading{gap:3px}
.profile-tf,.book-scale,.chart-tf{min-height:24px;height:24px;padding:2px 0;border-radius:4px;background:transparent;line-height:18px;font-size:11px}
.profile-tf:hover,.book-scale:hover,.chart-tf:hover{background:#233441}
.profile-range{font-size:10px;color:#71869b}
.chart-head{height:29px;padding:0 10px;background:#111c27}
.chart-heading{font-size:11px}
.ohlc{color:#91a5b9}
.panel-foot{height:22px;padding:3px 10px;align-items:center;font:10px Consolas,monospace;color:#70859a;background:#0e1822;gap:10px;white-space:nowrap;overflow:hidden}
.quality{overflow:hidden;text-overflow:ellipsis}
.book-state{max-width:80%;left:50%;bottom:12px;transform:translateX(-50%);padding:7px 10px;background:#101923ed;border:1px solid var(--line);font-size:11px}
.bottom-controls{background:#101923f5;box-shadow:0 -4px 16px #0003}
.bottom-controls .toolbar{gap:8px;padding:9px 14px 7px;flex-wrap:nowrap;min-height:50px}
.toolbar>label{flex-direction:row;align-items:center;gap:7px;font-size:11px;white-space:nowrap}
.toolbar .divider{height:22px;margin:0 3px}
.toolbar button{white-space:nowrap}
#global-settings-button{width:32px;padding:0;font-size:19px;flex:none}
#play{min-width:140px}
.bottom-controls #add{background:transparent;color:var(--cyan);border-color:#345563;margin-left:auto}
.bottom-controls #add:hover{background:#1a3440;border-color:#4b7c8d}
.bottom-controls .step-controls{display:inline-flex;align-items:center;gap:2px;flex:none}
.bottom-controls .step-button{min-width:34px;min-height:30px;padding:4px 6px;border-color:#30495b;background:#152533;color:#b9d3e0;font:11px Consolas,monospace}
.bottom-controls .step-button:hover:not(:disabled){background:#213d4e;color:#e2f5fa}
#clock{display:none}
#realtime{color:#a4b4c3}
#realtime.active{background:#19392f;color:#60d4ac;border-color:#347e62}
.bottom-controls .timeline{padding:0 14px 10px;gap:12px;flex-wrap:nowrap}
.timeline #range{flex:0 1 290px;font:11px Consolas,monospace;color:#8599ad}
.timeline #time{height:32px;flex:0 0 155px;padding:5px 8px;border-color:#3c596d;background:#142432;color:#d0edf1}
.timeline #seek{height:20px;min-height:20px;accent-color:#5dbbcb;border:0;background:transparent;cursor:pointer}
.timeline #status.bad{display:block;position:absolute;bottom:calc(100% + 8px);right:14px;background:#332127;border:1px solid #70414b;color:#f3b5b7!important;padding:8px 12px;border-radius:6px;max-width:430px;text-align:left;box-shadow:0 4px 18px #0005}
.layout-menu{width:244px;background:#15212c;border-color:#3a5064;border-radius:8px;padding:12px;box-shadow:0 10px 32px #0008}
.layout-picker-grid{grid-template-columns:repeat(6,32px);gap:4px}
.layout-preview-title{font-size:12px;color:#b9cbd8}
.layout-picker-cell{min-height:32px;background:#101b25;border-color:#43576a;border-radius:3px}
.layout-picker-cell.preview{background:#255562;border-color:#58b9ca}
.panel-settings,.instrument-picker{padding:22px;width:min(480px,92vw);border-color:#3b5064;border-radius:10px;background:#131e29;box-shadow:0 20px 70px #0009}
.panel-settings::backdrop,.instrument-picker::backdrop{background:#050a10a6;backdrop-filter:blur(3px)}
.panel-settings h2,.picker-head h2{font-size:16px;font-weight:600;margin:0 0 20px}
.panel-settings form>label,.iceberg-settings>label{display:grid;grid-template-columns:minmax(0,1fr) 110px;align-items:center;gap:16px;min-height:46px;font-size:12px;line-height:1.4;color:#b9c8d6;border-bottom:1px solid #263544}
.panel-settings input[type=number]{width:110px;text-align:right;font:13px Consolas,monospace;min-height:32px}
.panel-settings .lot-value-setting{display:grid;grid-template-columns:minmax(0,1fr) 110px auto;align-items:center;gap:10px;min-height:46px;border-bottom:1px solid #263544;color:#b9c8d6;font-size:12px}
.panel-settings .lot-value-setting button{padding:6px 9px;min-height:32px;color:var(--cyan);background:transparent;border-color:#3b566e}
.iceberg-settings{margin-top:20px;padding:10px 14px;border-radius:6px;border-color:#344657;gap:0}
.iceberg-settings legend{padding:0 6px;color:#a7bacb;font-size:12px}
.iceberg-settings .iceberg-enable{display:flex;flex-direction:row;justify-content:flex-start;gap:8px;color:#d1dde7}
input[type=checkbox]{min-height:16px;accent-color:var(--cyan)}
.settings-actions{margin-top:22px;gap:8px}
.settings-actions button{min-width:96px}
.settings-actions button:not(.primary){background:transparent}
.instrument-options{gap:8px}
.instrument-options button{min-height:38px;background:#192935;border-color:#30495b}
.picker-close{width:28px;height:28px;min-height:28px;padding:0;font-size:22px;background:transparent;border-color:transparent;color:var(--muted);align-self:flex-start}
.slot-add{width:54px;height:54px;min-height:54px;border-radius:12px;font-size:34px;background:#162b36;border-color:#355b6b;color:#65adbc}
.empty-slot{background:#0e1821;border-color:#2b4354}
.slot-add{display:grid;place-items:center}.slot-add .ui-icon{display:block;width:24px;height:24px;margin:0}
.ladder-wrap .boundary-toggle{min-height:0;font-size:0;line-height:0;border-color:#3c6075;background:#1a3444e8;color:#9ac5d9;box-shadow:0 1px 4px #0006}
.ladder-wrap .boundary-toggle::before{content:"";position:absolute;left:50%;top:50%;width:8px;height:4px;background:currentColor;clip-path:polygon(0 0,50% 65%,100% 0,100% 35%,50% 100%,0 35%);transform:translate(-50%,-50%) rotate(var(--arrow-angle,0deg));pointer-events:none}
.market-panel.chart-hidden .toggle-chart{--arrow-angle:180deg}
.ladder-wrap .toggle-profile{--arrow-angle:90deg}
.market-panel.profile-hidden .toggle-profile{--arrow-angle:-90deg}
.market-panel.profile-expanded .column-labels{grid-template-columns:var(--profile-share) 1fr}
.market-panel.profile-expanded .column-labels>span:nth-child(2),.market-panel.profile-expanded .splitter-profile,.market-panel.profile-expanded .splitter-tape{display:none}
header #global-settings-button{width:30px;height:30px;min-height:30px;margin-left:auto;padding:0;background:transparent;border-color:transparent;color:#9aaec0;font-size:20px}
header #global-settings-button:hover{background:#20313e;color:#dce6ef}
header .layout-control{align-self:center;margin-left:auto}
header .layout-control>button{height:30px;min-height:30px;padding:4px 10px;background:transparent;border-color:transparent;color:#9aaec0}
header .layout-control>button:hover{background:#20313e;color:#dce6ef}
header .layout-menu{left:auto;right:0;bottom:auto;top:calc(100% + 8px)}
header #global-settings-button{margin-left:0}
.layout-slot .chart-wrap{height:var(--chart-height,22%)}
.chart-head{position:relative}
.chart-splitter{position:absolute;left:0;right:0;top:-5px;height:10px;z-index:5;cursor:row-resize;touch-action:none}
.chart-splitter:hover,.chart-splitter.dragging{background:linear-gradient(transparent 4px,#56c5d588 4px,#56c5d588 6px,transparent 6px)}
.chart-wrap{position:relative;border-top:1px solid var(--line)}
.chart-crosshair{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.chart-info{position:absolute;top:7px;left:8px;z-index:2;max-width:calc(100% - 92px);padding:4px 6px;border:1px solid #385164;border-radius:3px;background:#0b1620e8;color:#dce6ef;font:10px/1.4 Consolas,monospace;white-space:normal;pointer-events:none}
.chart-info[hidden]{display:none}
.chart-toolbar{position:absolute;top:5px;left:7px;right:77px;z-index:7;display:flex;align-items:flex-start;gap:7px;opacity:0;pointer-events:none;transition:opacity .12s}
.chart-wrap:hover .chart-toolbar,.chart-toolbar:focus-within{opacity:1;pointer-events:auto}
.chart-wrap.chart-crosshair-active .chart-toolbar{opacity:1}
.chart-tf-button{flex:none;min-width:42px;min-height:22px;height:22px;padding:1px 5px;border:1px solid #3b5266;border-radius:2px;background:#111d29e8;color:#60aaff;font:12px Consolas,monospace}
.chart-tf-button:hover{background:#243a50}
.chart-tf-menu[hidden]{display:none}
.chart-tf-menu{position:absolute;top:24px;left:0;display:flex;gap:1px;padding:3px;border:1px solid #405469;background:#111923f5;box-shadow:0 5px 16px #0009;white-space:nowrap}
.chart-tf-menu button{min-width:27px;min-height:24px;padding:2px 4px;border:1px solid transparent;border-radius:0;background:transparent;color:#60aaff;font:12px Consolas,monospace}
.chart-tf-menu button:hover,.chart-tf-menu button.active{border-color:#aab5bf;background:#273846;color:#dce6ef}
.chart-info{position:static;display:flex;align-items:center;gap:12px;flex:1;max-width:none;min-width:0;padding:3px 0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#aebbc7;font-size:11px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:clip}
.chart-info-item{display:inline-flex;align-items:center;gap:4px;flex:none}
.market-panel .column-labels{position:relative;z-index:8}
.profile-heading{overflow:visible}
.profile-tf-control{position:relative;display:inline-flex;align-items:center;flex:none}
.timeframe-button{flex:none;min-width:42px;min-height:22px;height:22px;padding:1px 5px;border:1px solid #3b5266;border-radius:2px;background:#111d29e8;color:#60aaff;font:12px Consolas,monospace}
.timeframe-button:hover{background:#243a50}
.timeframe-menu[hidden]{display:none}
.timeframe-menu{position:absolute;top:calc(100% + 2px);left:0;z-index:12;display:flex;flex-direction:column;gap:0;min-width:62px;width:max-content;max-height:min(320px,60vh);overflow-y:auto;padding:3px;border:1px solid #405469;border-radius:3px;background:#111923f5;box-shadow:0 5px 16px #0009;white-space:nowrap}
.timeframe-menu button{display:block;width:100%;min-width:54px;min-height:25px;padding:3px 8px;border:1px solid transparent;border-radius:0;background:transparent;color:#60aaff;text-align:left;font:12px Consolas,monospace}
.timeframe-menu button:hover,.timeframe-menu button.active{border-color:#aab5bf;background:#273846;color:#dce6ef}
.chart-toolbar:has(.chart-tf-menu:not([hidden])){opacity:1;pointer-events:auto}
.chart-tf-menu.timeframe-menu{top:auto;bottom:calc(100% + 2px)}
.bottom-controls .connection{display:inline-flex;align-items:center;white-space:nowrap;gap:1px;padding:0 9px 0 2px;border-right:1px solid var(--line);font-size:11px}
.bottom-controls .connection i{flex:none}
.bottom-controls .connection{max-width:min(44vw,560px);gap:8px}
.bottom-controls .connection #range{display:inline-block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#91a6b8;font:11px Consolas,monospace}
.bottom-controls .timeline{gap:14px}
.bottom-controls .timeline #time{order:0;flex:0 0 155px}
.bottom-controls .timeline #seek{order:1;flex:1 1 auto;min-width:100px}
.bottom-controls .timeline #clock{order:2;flex:0 0 auto;margin-left:0;min-width:185px;text-align:right;font:26px Consolas,monospace;color:var(--cyan);letter-spacing:.5px}
@media(max-width:800px){.bottom-controls .connection{display:inline-flex;max-width:100%;flex:1 1 auto}.bottom-controls .timeline #time{order:0;flex:0 0 150px}.bottom-controls .timeline #seek{order:1;flex:1 1 auto;min-width:80px}.bottom-controls .timeline #clock{order:2;min-width:145px;font-size:20px}}
@media(max-width:1000px){.bottom-controls .toolbar{gap:5px;padding-left:10px;padding-right:10px}.toolbar button{padding-left:8px;padding-right:8px}.toolbar>label{gap:5px}.toolbar .divider{display:none}#play{min-width:128px}.bottom-controls .timeline{padding-left:10px;padding-right:10px}.timeline #range{flex-basis:245px}}
@media(max-width:800px){.bottom-controls .toolbar{flex-wrap:wrap}.toolbar>label{flex-direction:row}.timeline #range{order:0;flex:0 1 220px}.timeline #seek{order:0;flex:1;min-width:80px}.timeline #time{order:0;flex-basis:150px}.market-panel .panel-head{padding:0 6px;gap:4px}}
@media(max-width:800px){.bottom-controls .timeline #seek{order:1;flex:1 1 auto}.bottom-controls .timeline #time{order:0}.bottom-controls .timeline #clock{order:2}}
@container(max-width:360px){.market-panel .panel-head .instrument{max-width:80px;font-size:12px}.market-panel .panel-head .price{font-size:12px}.panel-head .ghost{width:24px;height:26px;min-height:26px}.profile-range{display:none}}

.robot-total{display:flex;align-items:center;flex:none;height:100%;padding-right:7px;margin-right:1px;border-right:1px solid #2a3947}
.robot-total .robot-bubble{flex-direction:column;line-height:1.05;border:1px solid var(--robot-ring,#738497)}
.robot-neutral{background:#263441;color:#a6b3bf}

.robot-total[hidden]{display:none}

.chart{touch-action:none;user-select:none;cursor:default}.chart.chart-panning{cursor:default}

.chart-latest{position:absolute;right:10px;bottom:10px;z-index:5;display:grid;place-items:center;width:28px;height:28px;padding:4px;border:1px solid #355162;border-radius:5px;background:#182c3ce8;color:var(--cyan);box-shadow:0 2px 6px #0004}.chart-latest:hover{background:#244356}.chart-latest[hidden]{display:none}.chart-latest svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

main#panels{grid-template-columns:minmax(0,1fr)}
.layout-row{display:grid;gap:8px;min-height:0;min-width:0}
.collapse-panel{flex:none;width:26px;height:28px;padding:0;font-size:20px;line-height:1}
.market-panel.panel-collapsed .panel-head{position:relative;padding:0 2px;justify-content:center;gap:0}
.market-panel.panel-collapsed .panel-head .instrument{font-size:10px;width:100%;max-width:none;appearance:none;pointer-events:none;padding:0 2px;align-self:flex-start;margin-top:5px;text-align:center}
.market-panel.panel-collapsed .collapse-panel{position:absolute;bottom:0;left:50%;transform:translateX(-50%);height:24px}
.market-panel.panel-collapsed .panel-robots,.market-panel.panel-collapsed .robot-total,.market-panel.panel-collapsed .settings,.market-panel.panel-collapsed .remove,.market-panel.panel-collapsed .column-labels,.market-panel.panel-collapsed .chart-wrap,.market-panel.panel-collapsed .panel-foot,.market-panel.panel-collapsed .splitter,.market-panel.panel-collapsed .boundary-toggle,.market-panel.panel-collapsed .profile-tools,.market-panel.panel-collapsed .book-state{display:none!important}

.ladder{touch-action:none;user-select:none}.profile-latest{right:auto;bottom:28px}.profile-hidden .profile-latest,.panel-collapsed .profile-latest{display:none}

.panel-head .panel-robots::-webkit-scrollbar{display:none}.panel-head .panel-robots{overscroll-behavior-x:contain}

.panel-head .collapse-panel{font-size:18px;font-weight:400}.panel-collapsed .panel-head .collapse-panel{font-size:15px}

.panel-head .ghost svg{display:block;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.panel-head .settings svg{width:16px;height:16px}.market-panel .panel-head .ghost{line-height:1;align-items:center;justify-items:center}

.chart-wrap>.chart-latest{bottom:26px;width:24px;height:24px;padding:3px}.chart-wrap>.chart-latest svg{width:16px;height:16px}

.chart-wrap>.chart-latest{min-height:24px}


.chart-wrap>.chart-latest{width:32px;height:34px;min-height:34px;padding:5px;border:0;border-radius:6px;background:#303234eF;color:#dedede;box-shadow:0 2px 6px #0005}.chart-wrap>.chart-latest:hover{background:#414345;color:#fff}.chart-wrap>.chart-latest svg{width:22px;height:22px;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.chart-settings-control{position:absolute;right:6px;top:5px;z-index:9}.chart-settings-button{width:25px;height:25px;padding:0;font-size:17px;opacity:0;transition:opacity .12s}.chart-wrap:hover .chart-settings-button,.chart-wrap:focus-within .chart-settings-button{opacity:1}.chart-options{position:absolute;right:0;top:30px;min-width:175px;padding:8px;background:#15212e;border:1px solid #304256;border-radius:6px;box-shadow:0 5px 20px #0007}.chart-options[hidden]{display:none}.chart-options label{display:flex;flex-direction:row;align-items:center;gap:8px;padding:6px 4px;color:#cbd8e3;font-size:12px;white-space:nowrap;cursor:pointer}.chart-options input{width:14px;height:14px;margin:0;accent-color:#43ccdf}.chart-options label:hover{background:#203244;border-radius:3px}

.chart-pane-dividers{position:absolute;inset:0;z-index:6;pointer-events:none}.chart-pane-divider{position:absolute;left:0;right:0;height:8px;pointer-events:auto;cursor:row-resize;touch-action:none;outline:none}.chart-pane-divider:hover,.chart-pane-divider.dragging,.chart-pane-divider:focus-visible{background:linear-gradient(transparent 3px,#56c5d5aa 3px,#56c5d5aa 5px,transparent 5px)}

.bottom-controls .step-button svg{display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;margin:auto}

.ladder-hover-row{position:absolute;top:0;left:0;right:0;height:17px;background:#c4d9f018;pointer-events:none;z-index:2}

/* Tabs left, centered title, book controls right. */
header:has(.analysis-tabs){position:relative}
header:has(.analysis-tabs) .brand{position:absolute;left:50%;transform:translateX(-50%);pointer-events:none;white-space:nowrap}
header .analysis-tabs{order:-1;margin:0;flex:none}
header:has(.analysis-tabs) .layout-control{margin-left:auto}
.analysis-active header .layout-control,.analysis-active header #global-settings-button{display:none}
@media(max-width:760px){header:has(.analysis-tabs) .brand{font-size:10px;letter-spacing:1px}header .analysis-tabs{gap:4px}header .analysis-tabs button{padding:4px 6px;font-size:11px}}
@media(max-width:540px){header:has(.analysis-tabs) .brand{display:none}}

/* Active execution model: keep aggressor color and add independent cyan identity. */
.robot-active-algo .robot-bubble{outline:2px solid #50cfff;outline-offset:3px}
.robot-active-algo .robot-period{color:#50cfff}

/* Keep book content out of the first frame until the saved workspace is activated. */
html.workspace-booting #panels,html.workspace-booting .bottom-controls,html.workspace-booting .timeline,html.workspace-booting header>.layout-control,html.workspace-booting #global-settings-button{visibility:hidden}

/* Playback: recording, history transport, and a separate live destination. */
.bottom-controls .toolbar{display:grid;grid-template-columns:minmax(180px,1fr) auto minmax(170px,1fr);gap:20px;padding:12px 16px;align-items:center}
.playback-date{display:grid;gap:4px;min-width:0}
.playback-date>label,.control-caption,.playback-time>span{font-size:10px;color:var(--muted);line-height:14px}
.playback-date-input{display:flex;align-items:center;gap:10px}
.playback-date #start{height:32px;min-width:140px}
.playback-date #range{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:10px Consolas,monospace;color:var(--muted)}
.connection-indicator{display:block;flex:none;width:9px;height:9px;border-radius:50%;background:#efa64c;box-shadow:0 0 0 4px #efa64c12;cursor:help}
.connection-indicator[data-mode="live"]{background:var(--green);box-shadow:0 0 0 4px #32c6a31a}
.connection-indicator:focus-visible{outline:2px solid var(--cyan);outline-offset:5px}
.playback-transport{display:grid;gap:7px;padding:0 20px;border-inline:1px solid var(--line);min-width:0}
.transport-actions{display:flex;align-items:center;gap:10px}
.bottom-controls .step-controls{gap:3px}
.bottom-controls .step-button{display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:6px;min-width:47px;height:34px;font:11px 'Segoe UI',sans-serif}
.bottom-controls .step-button svg{flex:none;margin:0;width:8px}
.bottom-controls #play{height:36px;min-width:140px}
.playback-speed{display:flex;flex-direction:row;align-items:center;gap:6px;font-size:10px;margin-left:4px}
.playback-speed>span{display:none}
.playback-speed select{width:65px;height:34px;padding:5px}
.playback-live{display:grid;justify-items:end;gap:6px}
.bottom-controls #realtime{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:38px;padding:8px 13px;background:#153d36;border:1px solid #368d73;color:#8ce3c2;font-weight:600;box-shadow:0 2px 8px #0002}
.bottom-controls #realtime:hover{background:#205346;border-color:#65d5ac;color:#b1f5d9}
.bottom-controls #realtime.active{background:#24664f;border-color:#61d3a6;color:#dcfff0;box-shadow:inset 0 0 0 1px #61d3a633}
.bottom-controls .timeline{border-top:1px solid #25324080;padding:8px 16px 10px;gap:16px}
.playback-time{flex:none;display:flex;flex-direction:row;align-items:center;gap:10px;white-space:nowrap}
.bottom-controls .timeline #time{width:155px;flex:none}
@media(max-width:1200px){.bottom-controls .toolbar{grid-template-columns:minmax(170px,1fr) auto;gap:10px 16px}.playback-transport{grid-row:2;grid-column:1/-1;border:0;border-top:1px solid var(--line);padding:8px 0 0}.transport-actions{justify-content:center}.playback-transport>.control-caption{text-align:center}.playback-live{grid-column:2;grid-row:1}.playback-date #range{max-width:420px}}
@media(max-width:650px){.bottom-controls .toolbar{padding:9px 10px}.transport-actions{flex-wrap:wrap;gap:6px}.bottom-controls .step-button{min-width:40px;padding:4px}.bottom-controls #play{min-width:112px;font-size:11px}.playback-speed{width:100%;justify-content:center;margin:0}.playback-speed>span{display:inline}.bottom-controls .timeline{padding:8px 10px}.playback-time>span{display:none}}
