/* Funding Lab / Workbench. Presentation only; native controls and routes retained. */
@font-face{font-family:Manrope;src:url('/bots/assets/fonts/manrope.ttf') format('truetype');font-weight:200 800;font-style:normal;font-display:swap}
@font-face{font-family:'JetBrains Mono';src:url('/bots/assets/fonts/jetbrains-mono.ttf') format('truetype');font-weight:100 800;font-style:normal;font-display:swap}
:root{color-scheme:dark;--bg:#0e1015;--panel:#15181f;--surface:#1b1f28;--hover:#222733;--line:#303644;--line-soft:#252a35;--text:#e8ebf2;--muted:#a0a9bb;--accent:#b4a5ff;--cyan:#6edbb6;--green:#6edbb6;--red:#f58f9d;--amber:#edc082;--orange:#edc082;--radius:8px;--radius-control:6px;--font-ui:Manrope,'Segoe UI',sans-serif;--font-data:'JetBrains Mono',Consolas,monospace;--shadow:none;--motion:140ms ease}
*{box-sizing:border-box;scrollbar-width:thin;scrollbar-color:#404858 transparent}
html{background:var(--bg);scroll-padding-top:16px}
body{margin:0;background:var(--bg);color:var(--text);font:400 14px/1.55 var(--font-ui);font-variant-numeric:tabular-nums}
body :is(button,input,select,textarea){font-family:var(--font-ui);font-variant-numeric:tabular-nums}
body :is(h1,h2,h3){color:var(--text);font-family:var(--font-ui);font-weight:700}
body h1{font-size:26px;line-height:1.3;letter-spacing:-.8px;margin:0 0 6px}
body h2{font-size:17px;line-height:1.4;letter-spacing:-.25px}
body h3{font-size:14px;line-height:1.5;letter-spacing:0}
body :is(p,label,.foot,.footnote,.note,.blockhelp,.fieldhelp,.subnote){color:var(--muted)}
body :is(p,.foot,.footnote,.note,.blockhelp,.fieldhelp){line-height:1.6}
body a{color:var(--accent);text-decoration:none;text-underline-offset:4px}
body a:hover{text-decoration:underline}
body :is(button,.button){min-height:36px;padding:8px 13px;border:1px solid #8170dc;border-radius:6px;background:#7461ce;color:#fff;font-size:13px;font-weight:650;line-height:1.4;box-shadow:none;cursor:pointer;transition:background-color 140ms,border-color 140ms,color 140ms}
body :is(button,.button):hover:not(:disabled){background:#8572df;border-color:#a295ee;color:#fff;filter:none;text-decoration:none}
body :is(button,.button):active:not(:disabled){background:#6856bf}
body :is(button.secondary,.secondary,.navToggleLabel){background:var(--surface);border:1px solid var(--line);color:var(--text);box-shadow:none}
body :is(button.secondary,.secondary):hover:not(:disabled){background:var(--hover);border-color:#50596c}
body :is(button,input,select):disabled{opacity:.48;cursor:not-allowed;filter:none}
body :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]){min-height:36px;max-width:100%;padding:8px 11px;border:1px solid #3a4253;border-radius:6px;background-color:#12151c;color:var(--text);font-size:14px;font-weight:500;line-height:1.4;box-shadow:none;transition:border-color 140ms,background-color 140ms}
body select{appearance:none;padding-right:34px!important;background-image:linear-gradient(45deg,transparent 50%,#a0a9bb 50%),linear-gradient(135deg,#a0a9bb 50%,transparent 50%);background-size:4px 4px;background-position:calc(100% - 16px) 50%,calc(100% - 12px) 50%;background-repeat:no-repeat;cursor:pointer}
body :is(input,select,textarea):hover:not(:disabled){border-color:#626d83;background-color:#191d26}
body input::placeholder,body textarea::placeholder{color:#818ba0;opacity:1}
body select option{background:var(--surface);color:var(--text);font:inherit}
body :is(input[type=checkbox],input[type=radio]){accent-color:#a18aef;width:16px;height:16px;min-height:0;flex:0 0 auto}
body :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
body :is(input,select,textarea):focus{box-shadow:none}
body label{font-size:12px;line-height:1.5;font-weight:500}
body label:focus-within{color:var(--text)}
/* Enhanced native picker; unsupported browsers retain their platform menu. */
@supports (appearance:base-select){
 body select,body select::picker(select){appearance:base-select}
 body select,body.radar-lab select,body.bots-lab select{appearance:base-select;display:inline-flex;background-image:none;padding-right:11px!important;align-items:center;justify-content:space-between;gap:14px}
 body select::picker-icon{color:var(--muted);transition:rotate 140ms}
 body select:open::picker-icon{rotate:180deg}
 body select::picker(select){background:#1b1f28;color:var(--text);border:1px solid #465067;border-radius:8px;padding:5px;max-height:min(340px,60dvh);min-width:anchor-size(width);box-shadow:0 12px 32px #0006;overflow-y:auto;animation:picker-in 110ms ease-out}
 body select option,body:is(.radar-lab,.bots-lab) select option{min-height:36px;padding:8px 10px;border-radius:4px;gap:12px;background:transparent;font:500 13px/1.5 var(--font-ui)}
 body select option:hover,body select option:focus,body:is(.radar-lab,.bots-lab) select option:is(:hover,:focus){background:#2c3140;color:#fff}
 body select option:checked,body:is(.radar-lab,.bots-lab) select option:checked{background:#302a48;color:#d5cbff}
 body select option::checkmark{color:#b4a5ff;order:2;margin-left:auto}
}
@keyframes picker-in{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
@keyframes dialog-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
/* A single, quiet application shell. */
.appSidebar{width:204px;padding:20px 12px;gap:26px;background:#11141a;border-right:1px solid var(--line-soft);box-shadow:none}
.appSidebar .brand{padding:0 9px;gap:10px;font-size:27px;font-weight:750;color:#c3b4ff;white-space:nowrap}
.appSidebar .brand span{font-size:12px;letter-spacing:.25px;color:var(--text)}
.appSidebar .navGroup{padding:8px 10px;color:#7e899e;font-size:10px;letter-spacing:1px;font-weight:650}
.appSidebar nav{gap:4px}
.appSidebar nav :is(a,button){display:flex;align-items:center;min-height:38px;padding:9px 10px;border:1px solid transparent;border-radius:5px;background:transparent;color:#b4bdce;font-size:12px;font-weight:500;line-height:1.45;box-shadow:none;white-space:normal;text-align:left}
.appSidebar nav :is(a,button):hover{background:#1c212c;color:#fff;border-color:transparent;text-decoration:none}
.appSidebar nav .navCurrent{background:#282338;border-color:#39304e;color:#d9d0ff;box-shadow:inset 2px 0 #aa95f4}
.sidebarNote{border-color:var(--line-soft);color:#7e899e;font-size:11px}
.appTopbar{margin-left:204px;min-height:48px;padding:10px 24px;background:#11141a;border-bottom:1px solid var(--line-soft);font-size:12px;color:var(--muted);gap:14px}
.appTopbar>span{font-size:12px;letter-spacing:0}
.appTopbar .local{border:0;background:transparent;padding:0;color:#9ca8bd;font-size:11px;min-height:0}
body:has(.appSidebar)>main{margin-left:204px;padding:22px 24px;max-width:none}
body:not(:has(.appSidebar))>main{max-width:1800px;padding:24px;margin:auto}
body>header:not(.appTopbar){height:auto;min-height:52px;padding:12px 24px;background:#11141a;border-color:var(--line-soft)}
.intro,.workspaceHeading{gap:16px;margin-bottom:20px;align-items:center;padding:0;border:0}
.intro p{font-size:13px;max-width:78ch;margin:6px 0 0}
.eyebrow,.intro .eyebrow{font-size:10px;letter-spacing:.9px;font-weight:600;color:#8792a7;margin:0 0 8px}
.top-actions{gap:8px}
.top-actions button{min-height:36px;font-size:12px;padding:8px 12px}
.top-actions #connection{font-size:11px;color:var(--muted)}
.summary{background:transparent;border:0;border-bottom:1px solid var(--line-soft);border-radius:0;padding:0 0 12px;margin-bottom:16px;gap:10px 24px;font-size:12px;color:var(--muted)}
body:has(#add:enabled:not([hidden])) #accountStatus{border:0;border-left:2px solid #4d4669;border-radius:0;background:#191b27;padding:8px 12px;font-size:11px;color:var(--muted)}
/* Research workspace: keep the rows, not the wrappers, in the foreground. */
.comparisonWorkspace,.board,.panel,.detail,.method{border:1px solid var(--line);border-radius:8px;background:var(--panel);box-shadow:none}
.comparisonWorkspace .controls,.controls,.history-filters{border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;padding:16px;gap:14px;box-shadow:none;margin:0;align-items:end}
.comparisonWorkspace .controls label,.radar-lab .controls label{min-width:170px;font-size:12px;gap:6px;flex:0 1 auto}
.radar-lab .controls input{width:210px}
.radar-lab .controls label:has(#cap){min-width:210px}
.comparisonWorkspace .controls :is(input,select){min-height:36px;margin:0;font-size:14px}
.modelContext{padding:10px 16px;gap:12px;background:#12151b;border-color:var(--line-soft);font-size:11px}
.modelContext .fixed{font-size:11px;line-height:1.6;gap:8px}
.modelContext .contextTitle{color:#b7c0d0;font-size:11px}
.modelContext .modelBasis{font-size:11px;color:#8792a7}
.comparisonWorkspace .boardhead,.boardhead,.panelhead{padding:16px;background:transparent;gap:16px}
.boardhead p,.panelhead p{font-size:12px;margin-top:5px;max-width:85ch}
.boardhead>span,#loaded{background:transparent;border:0;padding:0;color:var(--muted);font-size:11px}
.comparisonWorkspace .boardhead h2{font-size:15px}
.liquidityNote{display:grid;grid-template-columns:1fr auto;gap:3px 24px;padding:12px 14px;margin:0 0 20px;border:0;border-left:2px solid #927752;border-radius:0;background:#1c1b1a;font-size:12px;line-height:1.55}
.liquidityNote strong{color:var(--amber);font-size:12px;font-weight:600}
.liquidityNote p{margin:0;max-width:95ch;font-size:12px}
.liquidityNote>a{grid-column:2;grid-row:1/3;align-self:center;max-width:230px;font-size:12px}
body #refresh{background:var(--surface);border-color:var(--line);color:var(--text);box-shadow:none}
body #refresh:hover:not(:disabled){background:var(--hover);border-color:#515d72}
body :is(.controls,.filters,.trade-controls,.totalFilters,.history-filters){gap:12px}
.trade-controls input{min-width:200px}
.detailNav{background:#12151b;border-color:var(--line-soft);gap:18px}
.detailNav a{border:0;border-bottom:1px solid transparent;border-radius:0;background:transparent;padding:8px 0;color:var(--muted)}
.detailNav a:hover{color:var(--accent);border-color:var(--accent);background:transparent}
body :is(details,.method,.import){border-color:var(--line)}
body summary{color:var(--text);font-size:13px;padding:14px 16px;cursor:pointer;transition:background-color 140ms}
body summary:hover{background:#1d222d}
body details[open]>summary{box-shadow:inset 2px 0 var(--accent);background:#1b1e29;color:#cec2ff}
body summary::marker{color:#8d82bd}
/* Stable table geometry and consistent numeric alignment. */
body table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}
body th,.history-table th,.venueMatrix thead th{font:600 11px/1.45 var(--font-ui);letter-spacing:.1px;color:#a7b1c3;background:#191d26;padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:top;white-space:normal}
body th :is(span,small){font-size:10px;font-weight:400;line-height:1.4;color:#7f8ba1;margin-top:4px;display:block}
body td,.history-table td,.venueMatrix tbody td{font:500 13px/1.5 var(--font-ui);padding:13px 14px;border-bottom:1px solid var(--line-soft);background:transparent;vertical-align:middle}
body td small,.history-table small{font:400 11px/1.5 var(--font-ui);color:var(--muted);margin-top:4px}
body tbody tr:hover{background:#1b202b}
body tbody tr.selected,.venueMatrix tbody tr.selected,.selectedScenario{background:#26233a}
.venueMatrix{table-layout:fixed;min-width:1000px}
.venueMatrix .colVenue{width:19%}.venueMatrix .colStrategy{width:21%}
.venueMatrix .colResult{width:13%}.venueMatrix .colRisk{width:10.5%}
.venueMatrix th:nth-child(n+3){text-align:right}
.venueMatrix th:last-child{width:50px}
.venueMatrix tbody tr:has(>td:nth-child(7))>td:nth-child(3){font-size:16px;letter-spacing:-.3px;font-weight:650;white-space:nowrap}
.venueMatrix .exchange-name{font:700 14px var(--font-ui);padding:0;min-height:24px;border:0;border-radius:0;background:transparent;color:var(--text)}
.venueMatrix .exchange-name:hover{color:var(--accent);background:transparent;border:0}
.venueMatrix td .expand{min-width:30px;padding:4px;min-height:30px}
body.radar-lab td button:not(.exchange-name){min-height:30px;padding:6px 8px;font-size:11px;border:1px solid var(--line);background:var(--surface);color:var(--text)}
.history-table{table-layout:fixed;min-width:850px}
.history-table th:first-child{width:26%}.history-table th:nth-child(2){width:19%}.history-table th:last-child{width:110px}
.history-table td:nth-child(5),.history-table th:nth-child(5){text-align:right}
.history-table .money{font:500 13px var(--font-data)}
.history-table td:first-child{white-space:normal;overflow-wrap:anywhere}
.trade-table{min-width:850px;table-layout:fixed}
.trade-table :is(th,td):nth-child(5){text-align:right}
.history-table-wrap,.tablewrap,.scroll{border-color:var(--line);border-radius:6px;scrollbar-gutter:stable;overscroll-behavior-x:contain}
.history-table-wrap{background:var(--panel)}
body .note,body .footnote{padding:14px 16px;font-size:11px}
body :is(.positive,.cyan){color:var(--green)}body .negative{color:var(--red)}body .orange{color:var(--amber)}
.totalValue{background:#173029}.barrierStart td{border-top:1px solid #515c70}
/* Independent bots retain their own controls and logs, with fewer nested boxes. */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,328px),1fr));gap:14px;align-items:start}
.bot{border:1px solid var(--line);border-top:2px solid #485269;border-radius:8px;background:var(--panel);box-shadow:none;overflow:hidden}
.bothead{padding:14px 14px 10px;background:transparent;gap:10px}
.botidentity{gap:10px}.exchange-logo{width:32px;height:32px;flex-basis:32px;border-radius:7px;border-color:#454e60}
.bothead .exchange-name{font-size:10px;font-weight:700;letter-spacing:1.2px;color:#aeb9cd;margin-bottom:3px}
.bothead h2{font-size:17px;line-height:1.35;font-weight:700;color:var(--text);letter-spacing:-.25px}
.bothead .badge{max-width:100px;font-size:10px;line-height:1.5;padding:3px 7px;min-height:0;border-radius:5px}
.badge{background:#222733;border:1px solid #3d4658;color:#aeb9cd}
.botcontext{padding:0 14px 8px;background:transparent;gap:10px;font-size:12px;color:#9eabc0}
.bot-symbol{border:0;border-radius:4px;padding:2px 6px;background:#252a37;color:#e9e8f5;font:600 12px var(--font-data);box-shadow:none}
.bot-account{padding:0 14px 12px;margin:0 0 12px;background:transparent;border-bottom:1px solid var(--line-soft);font-size:11px;color:#8591a7}
.bot-account span{color:#b3bdd0}
.botmetrics{gap:0;padding:0 8px 8px;grid-template-columns:1fr 1fr}
.botmetrics .metric{border:0;border-radius:0;box-shadow:none;background:transparent;min-height:58px;padding:5px 8px 9px}
.botmetrics .metric:nth-child(even){border-left:1px solid var(--line-soft)}
.botmetrics .metric label{font:500 10px/1.5 var(--font-ui);letter-spacing:.3px;margin-bottom:4px;color:#8f9cb3}
.botmetrics .metric b{font:600 17px/1.4 var(--font-ui);letter-spacing:-.3px;color:var(--text);overflow-wrap:anywhere}
.botmetrics .metric b small{font-size:11px;font-weight:500;letter-spacing:0;color:var(--muted)}
.botmetrics .metric-tp b{color:var(--green)}.botmetrics .metric-risk b{color:var(--red)}.botmetrics .metric-entry b{color:#c6baff}
.bot-timing{padding:0 14px 12px;gap:4px 12px;font-size:11px;color:#b5bfd1}
.bot-timing>span{border:0;border-radius:0;background:transparent;padding:0}.bot-timing i{color:#7f8ba1}
.bot-progress{margin:0 14px 12px;padding:10px;background:#1a1f29;border:1px solid #333b4b;border-radius:6px;min-height:38px}
.progress-title{font-size:11px;line-height:1.5;color:#afbbce}.stage-dot{width:6px;height:6px}
.countdown{font-size:11px;gap:6px;margin-top:8px}.countdown b{font:500 14px var(--font-data);color:var(--text);min-width:94px;text-align:right}
.botmode{padding:8px 14px;background:#13161d;border-color:var(--line-soft);font-size:11px;min-height:34px;color:#96a3b9}
.botmode.real{color:var(--amber)}
.botactions{padding:12px 14px 10px;gap:6px}
.botactions button{min-height:32px;padding:7px 9px;border-radius:5px;font-size:11px}
.botactions [data-action=settings]{border-color:#3b4355;color:var(--text)}
.botactions [data-action=start]{flex:1;min-width:80px}
.botmsg{font-size:11px;line-height:1.5;padding:0 14px 10px;min-height:27px}
.loghead{padding:8px 14px;background:#13161d;border-color:var(--line-soft);font-size:10px;color:#8491a8}
.loghead a{font-size:11px;color:#b4a5ff}
.log{height:126px;padding:10px 14px;font:400 11px/1.65 var(--font-data);background:#101319;color:#aab7cd;scrollbar-gutter:stable}
.bot[data-stage=waiting],.bot[data-stage=entering]{border-color:#635887;box-shadow:inset 0 1px #9b88dd}
.bot[data-stage=waiting] .bot-progress,.bot[data-stage=entering] .bot-progress{background:#262237;border-color:#514467}
.bot[data-stage=position]{border-color:#3d7966;box-shadow:inset 0 1px #66c6a3}
.bot[data-stage=position] .bot-progress{background:#173029;border-color:#315e50}
.bot[data-stage=closing] .bot-progress,.bot[data-stage=verifying] .bot-progress{background:#30281c;border-color:#6e5939}
.bot[data-stage=completed] .bot-progress{background:#1b2925;border-color:#344e44}
.bot[data-stage=attention]{border-color:#9e5361;box-shadow:none}
/* Dialogs stay native: focus trapping, Escape and form behavior are unchanged. */
body dialog{color:var(--text);background:#171b23;border:1px solid #414b5f;border-radius:10px;box-shadow:0 24px 80px #0008;padding:24px;max-height:calc(100dvh - 40px);max-width:calc(100vw - 32px);animation:dialog-in 150ms ease-out;scrollbar-gutter:stable}
body dialog::backdrop{background:#06080dc9}
.dialoghead{gap:18px;border-bottom:1px solid var(--line);padding-bottom:16px;margin-bottom:18px}
.dialoghead h2,#tradeDetail h2{font-size:21px;margin:0;line-height:1.4;overflow-wrap:anywhere}
.dialoghead .eyebrow{font-size:10px;margin-bottom:6px}
.dialoghead button{flex-shrink:0}
.settingsblock{border:0;border-top:1px solid var(--line);border-radius:0;background:transparent;padding:18px 0;margin-top:10px}
.settingsblock h3{font-size:14px;margin:0 0 12px}
.settingsblock .blockhelp{font-size:12px}
.strategyHelp{padding:0;margin:12px 0;border-top:0;border-bottom:1px solid var(--line)}
.strategyHelp>summary{padding:10px 0;font-size:12px;color:var(--muted)}
.strategyHelp[open]>summary{box-shadow:none;background:transparent;color:var(--accent)}
.strategyHelp .modelNote{margin:0 0 12px}
.settingslayout{gap:24px}
.settingsblock.timingblock{padding:16px;background:#1d2030;border:1px solid #41415e;border-radius:7px}
.fields{gap:16px}.fields label{font-size:12px}
.fields :is(input,select){margin-top:6px}
.fieldhelp,.settingsblock .fieldhelp{font-size:11px;line-height:1.5;margin-top:5px}
.dialogfoot{position:sticky;bottom:-24px;margin:20px -24px -24px;padding:16px 24px;background:#171b23;border-top:1px solid var(--line);gap:14px;z-index:2}
.dialogfoot span{font-size:12px}
.modelNote{border:0;border-left:2px solid #68598d;border-radius:0;background:#202033;padding:10px 12px;font-size:12px;color:#b2b8cd}
.notice{padding:12px 14px;border:1px solid #665236;background:#282219;border-radius:6px;font-size:12px;color:var(--amber)}
#credentials p,.import p{font-size:12px}
.settingsblock :is([data-field=funding_tp_pct],[data-field=take_profit_pct]) input{background:#15251f;border-color:#396250;color:#a4e7cf}
.settingsblock :is([data-field=funding_risk_pct],[data-field=stop_loss_pct]) input{background:#2a1e25;border-color:#714652;color:#f5bec6}
.login{max-width:480px;margin:32px auto;padding:28px;border:1px solid var(--line);border-radius:10px;background:var(--panel);box-shadow:0 12px 32px #0002}
.login h2{font-size:21px}.login p{font-size:13px}.login form{display:grid;gap:16px}.login button{min-height:40px}
.login details{margin-top:24px;border-top:1px solid var(--line)}.login summary{padding:16px 0;color:var(--accent)}
.empty{padding:40px 24px;border:1px dashed #3a4355;border-radius:8px;background:transparent;text-align:center}
.empty h2{font-size:20px}.empty p{font-size:13px}
/* History, chart inspector and accounts share the same surfaces. */
.history-filters{padding:14px 0;border-bottom:1px solid var(--line);gap:14px}
.history-filters label{font-size:12px;min-width:170px}.history-filters :is(input,select){margin-top:0}
.history-count{margin:16px 0;font-size:12px}
.history-pages{font-size:12px;gap:16px}.history-pages button{min-height:34px;font-size:12px}
.history-mode{font-size:10px;background:#25243b;border:1px solid #4c4564;color:#c7b9ed;border-radius:4px;padding:3px 7px}
.history-mode.live{color:#e6bb85;background:#2c251c;border-color:#685438}
.trade-stat{border:0;border-left:1px solid var(--line);border-radius:0;background:transparent;padding:8px 16px}.trade-stat:first-child{border-left:0}
.trade-stat span{font-size:11px}.trade-stat b{font-size:18px}
.trade-chart{background:#10141b;border-color:var(--line);border-radius:6px}
.chart-readout,.chartReadout{background:#12161f;border-color:var(--line);color:#b9c9dd;font:11px/1.6 var(--font-data);padding:10px 12px;min-height:40px}
.candle-controls{gap:10px 12px;padding:12px 0}.candle-controls label{font-size:11px}.candle-controls select{font-size:12px;min-height:34px}
.trade-logs{background:#101319;color:#abb8cd;border:1px solid var(--line);border-radius:6px}
.account-page .account-box{padding:24px 0;border:0;border-top:1px solid var(--line);border-radius:0;background:transparent;margin:24px 0}
.account-box dd{color:var(--text)}.account-box form{gap:18px}.account-box p{font-size:13px}
.account-toolbar{gap:12px;padding:12px 0 16px;border-bottom:1px solid var(--line)}
.user-grid{gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr))}
.user-card{background:var(--panel);border:1px solid var(--line);border-radius:7px;padding:20px;margin:0}
.user-card[data-state=pending]{border-top:2px solid #aa874e;border-left-color:var(--line);border-right-color:var(--line);border-bottom-color:var(--line)}
.user-card[data-state=blocked]{border-top:2px solid #a06070;border-left-color:var(--line);border-right-color:var(--line);border-bottom-color:var(--line)}
.user-card header{height:auto;gap:12px;min-height:36px}.user-card header h2{font-size:16px;overflow-wrap:anywhere}.user-status{font-size:11px;color:#b6abc9}
.user-actions button{padding:7px 10px;font-size:11px;min-height:32px}.user-card form{gap:14px}
.user-actions button[data-days]{background:var(--surface);border-color:var(--line);color:#b9c3d5}
.user-actions button[data-days]:hover{background:var(--hover);border-color:#59637a;color:#fff}
.audit-list{font:12px/1.8 var(--font-ui);color:var(--muted);scrollbar-gutter:stable}
body :is(.stats article,.riskCards article,.outcomeCards article,.metricCards article){border-color:var(--line);border-radius:6px;background:var(--panel);box-shadow:none}
body .stats b{font:600 27px var(--font-ui);letter-spacing:-.5px}
body footer{font-size:11px;color:#7e8aa0;margin-top:24px;overflow-wrap:anywhere}
@media(min-width:1600px){body:has(.appSidebar)>main{padding:26px 32px}.cards{gap:16px}}
@media(max-width:1100px){.intro{align-items:flex-start}.top-actions{justify-content:flex-start;max-width:none}.liquidityNote{grid-template-columns:1fr}.liquidityNote>a{grid-column:auto;grid-row:auto;max-width:none}.modelBasis{width:100%;margin-left:0}}
@media(max-width:760px){
 .appSidebar{position:relative;inset:auto;width:auto;padding:12px 16px;gap:12px;border-right:0;overflow:visible}
 .appSidebar .brand{padding:0}.appSidebar nav :is(a,button){min-height:40px;font-size:13px}
 .appSidebar:has(.navToggle) nav{display:none}.appSidebar:has(.navToggle:checked) nav{display:flex}
 .appSidebar:not(:has(.navToggle)){display:flex;flex-direction:column}.appSidebar:not(:has(.navToggle)) nav{display:flex;flex-direction:row;flex-wrap:wrap;gap:5px}
 .appTopbar{margin:0;padding:10px 16px;min-height:42px;gap:10px}.appTopbar>span{font-size:11px}
 body:has(.appSidebar)>main,body:not(:has(.appSidebar))>main{margin:0;padding:20px 16px;max-width:100%}
 body h1{font-size:23px}.intro{gap:14px;margin-bottom:18px}.intro p{font-size:13px}.eyebrow{font-size:10px}
 .top-actions{gap:8px;width:100%}.top-actions button{min-height:40px}.summary{font-size:11px;gap:6px 14px}
 body :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]){min-height:42px;font-size:16px}
 body :is(button,.button){min-height:40px}
 .controls,.comparisonWorkspace .controls{padding:14px;gap:12px}
 .radar-lab .controls label,.comparisonWorkspace .controls label{min-width:0;width:100%;flex:1 1 180px}
 .radar-lab .controls :is(input,select){width:100%}
 .modelContext{padding:12px 14px;gap:6px}.modelContext .contextTitle{width:100%}
 .boardhead,.comparisonWorkspace .boardhead,.panelhead{padding:14px;flex-direction:column;align-items:flex-start;gap:8px}
 .liquidityNote{padding:10px 12px;font-size:11px}.liquidityNote p{font-size:11px}.liquidityNote>a{font-size:12px}
 .cards{grid-template-columns:1fr;gap:14px}.bothead h2{font-size:18px}.botactions button{min-height:38px;font-size:12px}.log{height:140px}
 .history-filters{padding:0 0 14px;gap:12px}.history-filters label{min-width:0;flex:1 1 150px}.history-filters label:has(input){flex-basis:100%}
 body dialog,#tradeDetail{padding:18px;width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);border-radius:8px}
 .dialoghead{gap:12px}.dialoghead h2{font-size:18px}.dialoghead button{padding:7px 10px;font-size:12px}
 .dialogfoot{bottom:-18px;margin:18px -18px -18px;padding:12px 18px;flex-wrap:wrap}
 .fields,.settingslayout .fields{gap:14px;grid-template-columns:1fr}.settingslayout{display:block}.settingsblock.timingblock{padding:12px}.settingsblock{margin-top:8px}
 .login{padding:22px;margin:16px auto}.login h2{font-size:20px}
 .user-grid{grid-template-columns:1fr}.user-card{padding:16px}.user-actions{gap:6px}.user-actions button{min-height:38px}
 .account-box dl{grid-template-columns:minmax(110px,1fr) 1fr;gap:12px;font-size:13px}.account-box dd{overflow-wrap:anywhere}
 .account-toolbar label{min-width:0;flex:1 1 100%}.account-toolbar button{flex:1}
 .trade-stats{grid-template-columns:1fr 1fr}.trade-stat{padding:8px 10px}.trade-stat b{font-size:16px}.history-pages{justify-content:space-between;gap:8px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(forced-colors:active){body select{appearance:auto;background-image:none}body :is(button,input,select){border:1px solid ButtonText}.bot,.panel,.user-card{border:1px solid CanvasText}}

/* History actions keep their own space, including at browser zoom / narrow widths. */
.history-runs{min-width:920px;white-space:normal}
.history-runs th:first-child{width:20%}
.history-runs th:nth-child(2){width:16%}
.history-runs th:nth-child(3){width:13%}
.history-runs th:nth-child(4){width:18%}
.history-runs th:last-child{width:144px}
.history-runs td{overflow-wrap:anywhere}
.history-runs td:last-child,.history-runs th:last-child{position:sticky;right:0;z-index:1;background:var(--panel);text-align:right;box-shadow:-1px 0 var(--line-soft);padding:12px}
.history-runs th:last-child{background:#191d26}
.history-runs td:last-child button{width:100%;min-width:0;white-space:nowrap;padding:8px 10px;font-size:12px}
.history-runs .history-mode{max-width:100%;white-space:normal}
.history-page main>.history-table-wrap{max-width:100%;min-width:0}

/* Funding Lab identity: geometric F, quiet wordmark and compact favicon. */
.appSidebar .brand{padding:0 3px;display:inline-flex;align-items:center;min-height:42px;max-width:100%}
.appSidebar .brand .brandLogo{display:block;width:168px;height:auto;max-width:100%;flex:none;transition:opacity 140ms ease}
.appSidebar .brand:hover .brandLogo{opacity:.82}
.loginBrand{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.loginBrand img{flex:none;display:block}
.loginBrand h2{margin:0;font-size:20px}
@media(max-width:760px){.appSidebar .brand .brandLogo{width:158px}.loginBrand h2{font-size:19px}}
@media(prefers-reduced-motion:reduce){.appSidebar .brand .brandLogo{transition:none}}

/* Compact API account manager; account operations and secret handling unchanged. */
#apiManager{width:min(720px,calc(100vw - 28px));padding:22px;max-height:90dvh}
#apiManager .dialoghead{margin-bottom:10px;padding-bottom:14px}
#apiManagerTitle{display:flex;align-items:center;gap:10px}
.apiCount{font:600 12px var(--font-ui);color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:3px 7px}
#apiManager .apiIntro{font-size:12px;margin:0 0 16px}
#apiAccountList{border:1px solid var(--line);border-radius:7px;overflow:hidden}
.apiAccountRow{padding:14px 16px;background:var(--panel)}
.apiAccountRow+.apiAccountRow{border-top:1px solid var(--line-soft)}
.apiAccountIdentity{display:flex;align-items:center;gap:10px;min-width:0}
.apiAccountIdentity img{border-radius:6px;flex:none;border:1px solid var(--line)}
.apiAccountName{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.apiExchange{font-size:10px;letter-spacing:.7px;color:var(--muted);font-weight:650}
.apiAccountName strong{font-size:14px;line-height:1.45;overflow-wrap:anywhere}
.apiDefaultBadge{font-size:10px;color:#c7baff;background:#262138;border:1px solid #45395f;padding:3px 7px;border-radius:4px;flex:none}
.apiAccountActions{display:flex;align-items:flex-start;flex-wrap:wrap;gap:8px;margin-top:10px;padding-left:40px}
#apiManager .apiAccountActions button,#apiManager .apiRename>summary{font-size:11px;min-height:30px;padding:5px 9px;line-height:18px;border-radius:5px}
#apiManager .apiRename{padding:0;margin:0;border:0;background:transparent;flex:1;min-width:135px}
#apiManager .apiRename>summary{display:inline-block;list-style:none;color:var(--muted);border:1px solid transparent;cursor:pointer}
#apiManager .apiRename>summary:hover{color:var(--text);background:var(--surface);border-color:var(--line)}
#apiManager .apiRename[open]{flex-basis:100%;order:3}
#apiManager .apiRename[open]>summary{color:var(--accent)}
.apiRenameForm{display:flex;gap:8px;align-items:end;margin-top:8px}
.apiRenameForm label{flex:1;min-width:0;font-size:11px}
#apiManager .apiRenameForm input{margin-top:5px;width:100%}
#apiManager .apiAccountActions .apiDelete{color:#d4a0a7;background:transparent;border-color:transparent}
#apiManager .apiAccountActions .apiDelete:hover{background:#352229;border-color:#65404b;color:var(--red)}
#apiManager .apiAccountActions button:disabled{background:transparent;border-color:transparent;color:var(--muted);opacity:.7}
#apiManager .apiAddPanel{margin:14px 0 0;padding:0;border:1px solid #51446d;border-radius:7px;background:#1c1926}
#apiManager .apiAddPanel>summary{padding:13px 16px;cursor:pointer;font-size:13px;font-weight:650;color:#c4b6ff;list-style:none}
#apiManager .apiAddPanel[open]>summary{border-bottom:1px solid var(--line-soft)}
#apiAccountForm{padding:16px;background:var(--panel);border-radius:0 0 7px 7px}
#apiAccountForm .fields{gap:12px 14px;grid-template-columns:repeat(2,minmax(0,1fr))}
#apiAccountForm label{font-size:12px}
#apiAccountForm button{margin-top:16px}
#apiManagerMessage:empty{display:none}
#apiManagerMessage{font-size:12px;margin:12px 0}
#apiManager .apiUsageNote{margin:16px 0 0;padding:0;border:0;background:transparent}
#apiManager .apiUsageNote summary{font-size:11px;color:var(--muted)}
#apiManager .apiUsageNote p{font-size:12px;margin:8px 0 0}
.apiEmpty{padding:24px 18px;text-align:center}.apiEmpty strong{font-size:14px}.apiEmpty p{font-size:12px;margin:6px 0 0}
@media(max-width:560px){#apiManager{padding:16px;max-height:94dvh}.apiAccountRow{padding:12px}.apiAccountActions{padding-left:0;gap:6px}.apiDefaultBadge{font-size:9px}#apiAccountForm .fields{grid-template-columns:1fr}#apiManager .apiAccountActions button,#apiManager .apiRename>summary{min-height:36px;line-height:24px}.apiRenameForm{flex-wrap:wrap}.apiRenameForm label{flex-basis:100%}}

#apiManager .apiAddPanel{margin:0 0 14px}
.apiAccountRow{padding:10px 14px}
.apiAccountActions{margin-top:6px}
@media(max-width:560px){#apiManager .apiRename{min-width:115px}.apiAccountActions{gap:4px}.apiAccountRow{padding:10px}}

/* Onest: a dedicated, readable voice for supporting information. */
@font-face{font-family:Onest;src:url('/bots/assets/fonts/onest.ttf') format('truetype');font-weight:100 900;font-style:normal;font-display:swap}
:root{--font-support:Onest,Manrope,'Segoe UI',sans-serif}
.bots-lab :is(.intro p,.foot,.footnote,.blockhelp,.fieldhelp,.modelNote,.sidebarNote,.apiIntro,.apiUsageNote,.history-count,.chart-legend,#tradeSubtitle,#tradeCoverage,.account-box p){font-family:var(--font-support);font-weight:450;letter-spacing:.01em}
.bots-lab :is(.blockhelp,.fieldhelp,.settingsblock .fieldhelp,.modelNote,.foot,.footnote){font-size:12px;line-height:1.65;color:#aab4c8}
.bots-lab :is(label,.apiExchange,.apiDefaultBadge,.apiCount,.bot-account,.bot-timing,.botmode,.progress-title,.botmsg,.countdown,.summary,#accountStatus,#connection,.loghead,.history-table small){font-family:var(--font-support)}
.bots-lab .fields label,.bots-lab #apiAccountForm label,.bots-lab .history-filters label{font-weight:550;letter-spacing:.015em;color:#b7bfd0}
.bots-lab .botmetrics .metric label{font-family:var(--font-support);font-size:11px;font-weight:550;line-height:1.5;letter-spacing:.035em;color:#a3aec3}
.bots-lab .bot-account{font-size:12px;color:#a1acc2}
.bots-lab .bot-timing,.bots-lab .progress-title,.bots-lab .botmsg{font-size:12px;line-height:1.55}
.bots-lab .eyebrow,.bots-lab .appSidebar .navGroup,.bots-lab .bothead .exchange-name,.bots-lab .apiExchange{font-family:var(--font-support);font-size:11px;font-weight:600;letter-spacing:.09em}
.bots-lab .history-table th{font-family:var(--font-support);font-size:12px;font-weight:550;letter-spacing:.015em}
.bots-lab .history-table small{font-size:12px;font-weight:450;line-height:1.55}
.bots-lab .sidebarNote,.bots-lab .loghead{font-size:11px;line-height:1.6;letter-spacing:.025em}
.bots-lab #apiManager .apiIntro,.bots-lab #apiManager .apiUsageNote p{font-family:var(--font-support);font-size:12px;line-height:1.65}
.bots-lab #apiManager .apiUsageNote summary,.bots-lab .strategyHelp>summary{font-family:var(--font-support);font-size:12px;font-weight:500}
.bots-lab .apiDefaultBadge{font-size:11px;letter-spacing:.015em}

.bots-lab .appSidebar .navGroup{font-size:10px;letter-spacing:.055em}

/* Trading direction: explicit icon + label, independent of PNL. */
.bots-lab .direction-long { color: #6edbb6; }
.bots-lab .direction-short { color: #f58f9d; }
.bots-lab .direction-badge { display:inline-flex; align-items:center; gap:5px; flex:none; width:max-content; padding:3px 7px; border:1px solid; border-radius:5px; font-size:11px; font-weight:700; line-height:1.35; letter-spacing:.025em; white-space:nowrap; }
.bots-lab .direction-badge.direction-long { background:#6edbb610; border-color:#6edbb632; }
.bots-lab .direction-badge.direction-short { background:#f58f9d10; border-color:#f58f9d32; }
.bots-lab .direction-badge [aria-hidden] { font-size:15px; line-height:1; }
.bots-lab select.direction-long { border-color:#6edbb660; }
.bots-lab select.direction-short { border-color:#f58f9d60; }
.bots-lab .botcontext .bot-leverage { color:var(--muted,#a0a9bb); font-variant-numeric:tabular-nums; }

/* Structured logs: distinguish send, acknowledgement and exchange execution. */
.bots-lab .log {height:172px;font-size:11px;line-height:1.65;padding:8px 10px}
.bots-lab .log-row {display:block;padding:5px 7px;border-left:2px solid transparent;border-bottom:1px solid #ffffff05;white-space:pre-wrap;overflow-wrap:anywhere;color:#aab7cd}
.bots-lab .log-time {color:#77849a;font-size:10px;font-variant-numeric:tabular-nums}
.bots-lab .log-tag {font-family:var(--font-support);font-size:10px;font-weight:650;letter-spacing:.03em;color:#c5cee0}
.bots-lab .log-fill {border-left-color:#6edbb6;background:#6edbb60c;color:#d6efe8}
.bots-lab .log-fill .log-tag,.bots-lab .log-closed .log-tag {color:#6edbb6}
.bots-lab .log-result {border-left-color:#b4a5ff;background:#b4a5ff0c;color:#e8ebf2}
.bots-lab .log-latency .log-tag,.bots-lab .log-tp .log-tag {color:#b4a5ff}
.bots-lab .log-error {border-left-color:#f58f9d;background:#f58f9d0c}
.bots-lab .log-error .log-tag {color:#f58f9d}
.bots-lab .log-warning .log-tag,.bots-lab .log-exit .log-tag {color:#edc082}
.bots-lab .log-value {font-weight:650;color:#e8ebf2}
.bots-lab .log-value.pnl-positive {color:#6edbb6}
.bots-lab .log-value.pnl-negative {color:#f58f9d}
.bots-lab .log-result .log-value[class*="pnl-"] {font-size:13px}

/* Completion status is independent of live/test and of PNL. */
.bots-lab .history-filters{flex-wrap:wrap;align-items:end}
.bots-lab .history-outcome{font-family:var(--font-support);font-size:12px;font-weight:600;line-height:1.5;display:inline-block}
.bots-lab .outcome-success{color:#6edbb6}
.bots-lab :is(.outcome-recovered,.outcome-completed_issues,.outcome-needs_review){color:#edc082}
.bots-lab .outcome-in_progress{color:#b4a5ff}
.bots-lab .history-runs td:nth-child(4) small{font-size:11px;line-height:1.5;margin-top:5px}

/* Exchange and asset identity, backed by bundled local images. */
.bots-lab .history-identity{display:inline-flex;align-items:center;gap:9px;max-width:100%;vertical-align:middle}
.bots-lab .coin-icon{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;border-radius:50%;background:#222733;overflow:hidden;border:1px solid #ffffff16}
.bots-lab .coin-icon img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#171b23}
.bots-lab .coin-icon img[hidden]{display:none}
.bots-lab .coin-fallback{color:#b4a5ff;font:650 10px var(--font-support);letter-spacing:.02em}
.bots-lab .coin-icon.has-image .coin-fallback{visibility:hidden}
.bots-lab .history-identity-text{min-width:0;display:flex;flex-direction:column;gap:5px}
.bots-lab .history-identity-text>b{font-size:12px;overflow-wrap:anywhere}
.bots-lab .history-venue{display:flex;align-items:center;gap:5px;color:#a0a9bb;font:500 10px var(--font-support);letter-spacing:.03em}
.bots-lab .history-venue img{width:16px;height:16px;object-fit:contain;border-radius:4px;background:#222733}
.bots-lab .identity-detail .coin-icon{width:40px;height:40px}
.bots-lab .identity-detail .history-identity-text>b{font-size:19px}

.bots-lab .bot-asset{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%}
.bots-lab .bot-asset .coin-icon{width:24px;height:24px}
.bots-lab .bot-asset .coin-fallback{font-size:9px}
.bots-lab .bot-asset .bot-symbol{min-width:0;overflow-wrap:anywhere}

.bots-lab .history-pnl{margin:20px 0;padding:18px 0;border-bottom:1px solid #303644}
.bots-lab .history-pnl-heading{display:flex;gap:14px;align-items:baseline;flex-wrap:wrap;margin-bottom:14px}
.bots-lab .history-pnl-heading h2{font-size:16px;margin:0}
.bots-lab .history-pnl-heading p{font-size:12px;color:#a0a9bb;margin:0}
.bots-lab .pnl-periods{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.bots-lab .pnl-period{display:flex;flex-direction:column;gap:7px;min-width:0;border-left:2px solid #7461ce;padding-left:12px}
.bots-lab .pnl-period>span{font:550 12px var(--font-support);color:#a0a9bb}
.bots-lab .pnl-period>strong{font:600 21px var(--font-data);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.bots-lab .pnl-period>small{font:450 11px/1.6 var(--font-support);color:#a0a9bb}
@media(max-width:1050px){.bots-lab .pnl-periods{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.bots-lab .pnl-period>strong{font-size:17px}}

.bots-lab .history-recheck{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:12px 0}.bots-lab .history-recheck label{display:grid;gap:6px;font-size:12px}.bots-lab .history-recheck select{min-width:120px}.bots-lab #recheckMessage{min-height:20px}
