#backtestingPage{display:grid;grid-template-columns:minmax(260px,330px) minmax(0,1fr);gap:16px;align-items:start;margin:4px 0 24px;color:var(--text)}
#backtestingPage[hidden]{display:none}
#backtestingPage .bt-panel{min-width:0;background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:clamp(16px,2vw,26px)}
#backtestingPage h2{margin:0 0 18px;font-size:18px;font-weight:650;letter-spacing:-.02em}
#backtestingPage label,#backtestingPage legend{font:600 13px/1.4 var(--sans);color:var(--muted)}
#backtestingPage .bt-fields{display:grid;gap:12px;margin-bottom:20px}
#backtestingPage .bt-fields label,#backtestingPage .bt-results header label{display:grid;gap:6px;min-width:0}
#backtestingPage select,#backtestingPage input[type=number]{box-sizing:border-box;min-width:0;width:100%;padding:9px 10px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--text);font:inherit;font-weight:500;text-overflow:ellipsis}
#backtestingPage fieldset{border:0;padding:0;margin:0;min-width:0}
#backtestingPage legend{margin-bottom:8px}
.bt-frame-list{display:flex;gap:6px;flex-wrap:wrap}
.bt-frame-list label{position:relative;cursor:pointer}
.bt-frame-list input{position:absolute;opacity:0;width:1px;height:1px}
.bt-frame-list span{display:block;border:1px solid var(--border);border-radius:6px;padding:6px 10px;background:var(--bg);color:var(--muted)}
.bt-frame-list input:checked+span{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
.bt-frame-list input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}
.bt-custom{display:grid;grid-template-columns:1fr auto;gap:4px 8px;align-items:end;margin:14px 0 20px}
.bt-custom label{grid-column:1/-1}
#btAdd{height:36px;background:var(--panel-2);border:1px solid var(--border);color:var(--text);border-radius:6px;padding:0 15px;cursor:pointer}
.bt-actions{display:grid;gap:8px;border-top:1px solid var(--border);padding-top:16px}
#btMessage,.bt-results p{font-size:13px;color:var(--muted);line-height:1.55;overflow-wrap:anywhere}
#btMessage:empty{display:none}
.bt-results header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}
#backtestingPage .bt-results header h2{margin:0}
#backtestingPage .bt-results .bt-fields{grid-template-columns:1fr 1fr}
#btOutput p{margin:8px 0}
#btOutput table{width:100%;margin:12px 0;border-collapse:collapse;font-variant-numeric:tabular-nums}
#btOutput th,#btOutput td{text-align:right;padding:10px 6px;border-bottom:1px solid var(--line);font-size:13px}
#btOutput th{color:var(--muted);font-weight:600}
#btOutput td:first-child,#btOutput th:first-child,#btOutput td:nth-child(2),#btOutput th:nth-child(2){text-align:left}
#btOutput td:nth-child(6){font-weight:700}
@media(max-width:1160px){#backtestingPage{grid-template-columns:1fr}#backtestingPage .bt-config .bt-fields{grid-template-columns:1fr 1fr}.bt-custom{max-width:230px}.bt-actions{display:flex;align-items:center}}
@media(max-width:640px){#backtestingPage .bt-fields,#backtestingPage .bt-config .bt-fields,#backtestingPage .bt-results .bt-fields{grid-template-columns:1fr}.bt-actions{display:grid}.bt-frame-list span{padding:9px 12px}#btOutput thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}#btOutput table,#btOutput tbody{display:block}#btOutput tr{display:grid;grid-template-columns:1fr 1fr;gap:7px 10px;border-top:1px solid var(--border);padding:10px 0}#btOutput tbody td{text-align:left;border:0;padding:0}#btOutput td::before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;font-weight:500}#backtestingPage select,#backtestingPage input[type=number]{font-size:16px}}
