/* Historical backtest workspace: existing dark terminal palette and layout. */
body.backtest-page .metrics,body.backtest-page .feed-banner{display:none}
#tab-backtest{min-width:0}
#tab-backtest .panel{min-height:0}
.bt-top-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(290px,.8fr);gap:16px;align-items:start}
.bt-config{overflow:visible}
.bt-history,.bt-chart-panel,.bt-trades-panel{overflow:hidden}
.bt-form{padding:0 21px 22px}
.bt-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px 12px}
.bt-fields label{display:flex;flex-direction:column;gap:7px;min-width:0;color:#a8bad0;font-size:11px;font-weight:650}
.bt-symbol-field{display:flex;flex-direction:column;gap:7px;min-width:0;position:relative;z-index:5}
.bt-symbol-field>label{display:block;color:#a8bad0;font-size:11px;font-weight:650}
.bt-catalog-count{float:right;color:#8faecc;font-size:10px;font-weight:500}
.bt-catalog-count.stale{color:#e9a26f}
.bt-symbol-combo{position:relative;min-width:0}
.bt-symbol-combo #btSymbolSearch{padding-right:32px}
.bt-symbol-chevron{position:absolute;right:10px;top:0;bottom:0;width:16px;display:flex;align-items:center;justify-content:center;color:#dbe9fb;pointer-events:none}
.bt-symbol-chevron svg{display:block;width:9px;height:6px;overflow:visible}
.bt-symbol-chevron path{fill:none;stroke:currentColor;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}
.bt-symbol-options{position:absolute;top:calc(100% + 5px);left:0;right:0;z-index:15;max-height:236px;overflow-y:auto;overscroll-behavior:contain;background:#14243a;border:1px solid #49648a;border-radius:9px;box-shadow:0 18px 36px #030915c9;padding:5px;scrollbar-color:#48658d #14243a}
.bt-symbol-option{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:9px 10px;border:0;border-radius:6px;background:transparent;color:#e6effb;text-align:left;font-size:12px}
.bt-symbol-option small{color:#91a9c6;font-size:11px}
.bt-symbol-option:hover,.bt-symbol-option.active{background:#29466b;color:#fff}
.bt-symbol-empty{padding:13px 9px;color:#91a9c6;font-size:11px}
.bt-fields input,.bt-fields select{width:100%;height:40px;padding:8px 11px;background:#0d1a2c;border:1px solid #30445d;border-radius:8px;color:#e7effb;font-size:12px;font-variant-numeric:tabular-nums}
.bt-fields input:hover,.bt-fields select:hover{border-color:#527198}
.bt-fields select option{background:#102033}
.bt-rule-note{margin:17px 0 15px;font-size:11px;line-height:1.8;color:#849bb6}
.bt-submit{min-width:158px;min-height:39px}
.bt-run-list{max-height:535px;overflow-y:auto;padding:0 13px 14px}
.bt-run{width:100%;display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left;border:1px solid #2a3b53;border-radius:9px;background:#14243a;padding:12px;margin-bottom:9px;color:#e6effd}
.bt-run:hover,.bt-run.selected{border-color:#5579b0;background:#1b3150}
.bt-run strong,.bt-run em,.bt-run b,.bt-run-state{display:block}
.bt-run strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bt-run strong small{font-weight:500;color:#93a8c0}
.bt-run em{font-size:10px;font-style:normal;color:#849ab6;margin-top:6px;white-space:nowrap}
.bt-run b{text-align:right;font-size:12px;white-space:nowrap}
.bt-run-state{text-align:right;font-size:10px;color:#8fa5bf;margin-top:6px}
.bt-empty{padding:28px 10px;text-align:center;color:#879cb5;font-size:12px}
.bt-status{margin-top:16px;padding:16px 21px}
.bt-status-row{display:flex;justify-content:space-between;gap:14px;align-items:center}
.bt-status-row b,.bt-status-row span{display:block}
.bt-status-row b{color:#e8f0fc;font-size:13px}
.bt-status-row span{color:#96abc4;font-size:11px;margin-top:5px}
.bt-status-row strong{color:#9fbdff;font-size:16px}
.bt-progress{height:6px;background:#0b1728;border-radius:20px;overflow:hidden;margin-top:14px}
.bt-progress>div{height:100%;width:0;background:#6790f4;border-radius:20px;transition:width .3s ease}
.bt-status.bt-error{border-color:#7e4553}.bt-status.bt-error .bt-status-row strong{color:#ff9aa8}.bt-status.bt-error .bt-progress>div{background:#b4515e}
.bt-results{margin-top:23px}
.bt-result-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.bt-result-head h2{font-size:20px;margin:6px 0 5px;color:#edf4ff}
.bt-result-head p{margin:0;color:#8ea4bf;font-size:11px}
.bt-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;margin-bottom:16px}
.bt-metric{padding:17px 19px;display:flex;flex-direction:column;gap:10px}
.bt-metric>span{color:#9fb2cb;font-size:11px}
.bt-metric strong{font-size:clamp(18px,1.5vw,23px);letter-spacing:-.3px;color:#f0f5ff;font-variant-numeric:tabular-nums;white-space:nowrap}
.bt-metric strong.positive{color:var(--buy)}.bt-metric strong.negative{color:var(--sell)}
.bt-chart-panel{margin-bottom:16px}
.bt-chart{height:350px;margin:0 10px}
.bt-chart-note{padding:0 21px 19px;margin:0;color:#8ca2bc;font-size:11px;line-height:1.7}
.bt-trades-panel .table-scroll{overflow-x:auto}
.bt-trades-panel table{min-width:920px}
.bt-trades-panel td,.bt-trades-panel th{white-space:nowrap}
@media(max-width:1450px){.bt-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:1080px){.bt-top-grid{grid-template-columns:1fr}.bt-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.bt-run-list{max-height:250px}.bt-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:690px){.bt-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.bt-form{padding:0 15px 18px}.bt-metrics{gap:9px}.bt-metric{padding:14px}.bt-metric strong{font-size:17px;white-space:normal}.bt-chart{height:310px;margin:0}.bt-result-head{align-items:flex-start;flex-direction:column}}
@media(max-width:420px){.bt-fields{grid-template-columns:1fr}}
