.history-tools{--ht-ink:var(--rw-ink,var(--ink,#253b30));--ht-muted:var(--rw-muted,var(--muted,#687765));--ht-line:var(--rw-line,var(--line,#d9dfd1));--ht-paper:var(--rw-paper,var(--panel,#fffdf7));color:var(--ht-ink);min-width:0;font-size:12px;line-height:1.65}
.history-tools [hidden]{display:none!important}.history-tools :is(button,input,select){font:inherit}.history-tools :is(input,select){min-height:36px;border:1px solid var(--ht-line);border-radius:5px;padding:7px 9px;background:var(--ht-paper);color:var(--ht-ink);width:100%;max-width:100%;box-sizing:border-box}.history-tools :is(button,input,select,summary):focus-visible{outline:2px solid var(--green,#557146);outline-offset:3px}
.ht-controls{padding:17px 18px;background:var(--surface-subtle,var(--rw-soft,#f5f5ec));border:1px solid var(--ht-line);border-radius:6px}.ht-control-heading{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;margin-bottom:13px}.ht-control-heading strong{font-size:14px}.ht-control-heading span,.ht-note,.ht-muted,.ht-status,.ht-table small{color:var(--ht-muted)}
.ht-fields,.ht-dates,.ht-custom{display:flex;flex-wrap:wrap;align-items:end;gap:12px}.ht-fields label,.ht-dates label,.ht-custom label{display:grid;gap:5px;font-size:12px;min-width:120px;flex:1}.ht-fields label:nth-child(3){flex:1.4}.ht-dates{margin-top:14px}.ht-dates label{flex:0 1 170px}.ht-custom{border:1px solid var(--ht-line);margin:14px 0 0;padding:10px 12px}.ht-custom legend{font-size:11px;color:var(--ht-muted);padding:0 5px}
.history-tools .ht-button{background:var(--ht-paper);color:var(--ht-ink);border:1px solid var(--ht-line);border-radius:5px;min-height:36px;padding:7px 12px;cursor:pointer;white-space:nowrap;font-weight:500}.history-tools .ht-button:hover{border-color:var(--green,#557146)}.history-tools .ht-primary{background:var(--green,#285c48);color:#fff;border-color:var(--green,#285c48)}.history-tools button:disabled{cursor:wait;opacity:.65}.ht-note{font-size:11px;line-height:1.8;margin:10px 0 0}.ht-status{font-size:11px;line-height:1.8;margin:12px 0;overflow-wrap:anywhere}.ht-error{color:var(--warning-ink,#a2442d)!important}
.ht-summary{margin:14px 0}.ht-summary-caption{font-size:12px;margin:0 0 10px}.ht-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:var(--ht-line);border:1px solid var(--ht-line);border-radius:5px;overflow:hidden}.ht-summary-grid>div{background:var(--ht-paper);padding:12px 14px;min-width:0}.ht-summary-grid span{font-size:11px;color:var(--ht-muted)}.ht-summary-grid strong{display:block;font-size:17px;line-height:1.6;font-variant-numeric:tabular-nums;margin-top:5px;overflow-wrap:anywhere}
.history-tools .ht-net{display:inline-block;padding:2px 6px;border-radius:3px;white-space:nowrap;font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}.history-tools .ht-profit{color:#ad241b;background:#fff0ec;border:1px solid #efc4bc}.history-tools .ht-loss{color:#171717;background:#f2f0e9;border:1px solid #c9c7bf;box-shadow:0 0 0 1px #ffffff18}.history-tools .ht-flat{color:#636965;background:#eef0eb;border:1px solid #d6d9d1}
.ht-table-wrap{overflow:auto;max-width:100%;border:1px solid var(--ht-line);border-radius:5px;scrollbar-width:thin}.history-tools .ht-table{border-collapse:collapse;width:100%;min-width:1100px;font-size:11px;text-align:left;background:var(--ht-paper);table-layout:auto}.history-tools .ht-table :is(th,td){padding:12px 11px;border-bottom:1px solid var(--ht-line);vertical-align:top;min-width:0;max-width:280px;color:var(--ht-ink);background:transparent}.history-tools .ht-table th{font-weight:500;color:var(--ht-muted);white-space:nowrap;background:var(--surface-subtle,var(--rw-soft,#f5f5ec))}.history-tools .ht-table td:first-child{min-width:175px}.history-tools .ht-table td:nth-child(4){min-width:205px}.ht-table small,.ht-detail small{display:block;font-size:10px;line-height:1.65;margin-top:4px}.history-tools .ht-table strong{font-size:11px}.ht-odds{font-variant-numeric:tabular-nums;white-space:nowrap}.ht-result{font-size:10px}.ht-table td:last-child .ht-button{font-size:11px;min-height:32px;padding:5px 10px}.ht-detail-row>td{padding:0!important}.history-tools .ht-detail{padding:20px;max-width:1000px;white-space:normal}.ht-detail h4{font-size:15px;margin:0 0 6px}.ht-detail h5{font-size:12px;margin:16px 0 8px}.ht-detail>p{font-size:11px;color:var(--ht-muted);margin:6px 0}.ht-facts{display:grid;grid-template-columns:minmax(90px,1fr) minmax(160px,2fr);gap:7px 18px;font-size:11px;max-width:650px;margin:14px 0}.ht-facts dt{color:var(--ht-muted)}.ht-facts dd{margin:0;overflow-wrap:anywhere}.ht-detail-columns{display:grid;grid-template-columns:1fr 1fr;gap:18px;border-block:1px solid var(--ht-line);padding:0 0 15px}.ht-plan{margin:10px 0;border:1px solid var(--ht-line);padding:10px 12px;border-radius:4px}.ht-plan summary{cursor:pointer;font-weight:500}.ht-plan-match{padding:10px 0;border-top:1px solid var(--ht-line)}.ht-plan-match p{margin:5px 0;font-size:11px}.ht-plan-match small{color:var(--ht-muted)}
.backtest-block:has(.history-tools){grid-column:1/-1}.rw-panel>#rw-history-tools{padding:0 20px 20px}.rw .history-tools .ht-note{font-size:11px}.rw .history-tools .ht-table th{font-size:11px}
.ht-custom-had{display:flex;flex:1;flex-wrap:wrap;gap:12px}.ht-quote-options{min-width:155px}.ht-quote-options summary{cursor:pointer}.history-tools.ht-no-plans .ht-table tr:not(.ht-detail-row)>:nth-child(5){display:none}.ht-fields label{flex:1 1 150px}.ht-fields label:nth-child(3){flex:1 1 150px}.history-tools .ht-net.ht-profit{color:#ad241b!important;background:#fff0ec!important}.history-tools .ht-net.ht-loss{color:#171717!important;background:#f2f0e9!important}.history-tools .ht-net.ht-flat{color:#636965!important;background:#eef0eb!important}
@media(max-width:700px){.ht-controls{padding:13px}.ht-fields{gap:10px}.ht-fields label{flex-basis:calc(50% - 10px);min-width:0}.ht-fields label:nth-child(3){flex-basis:100%}.ht-fields>.ht-button{width:100%}.ht-dates label{flex:1;min-width:0}.ht-dates>.ht-button{flex:1}.ht-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ht-summary-grid>div{padding:10px}.ht-summary-grid strong{font-size:15px}.ht-custom label{min-width:0}.ht-custom legend{max-width:100%}.ht-detail-columns{grid-template-columns:1fr}.ht-detail{padding:14px!important}.ht-facts{grid-template-columns:100px 1fr}.rw-panel>#rw-history-tools{padding:0 12px 14px}}
