.bs-pm-days{display:block;font-size:11px;color:#94a3b8;font-weight:400}
/* ── Backtest Stats Custom Page ── */
.bs-container { width:100%; max-width:100%; padding:0 50px; margin:0 auto; font-family:inherit; box-sizing:border-box; min-height:calc(100vh - 80px); } /* speed 2026-10-31: reserves the table's space, the footer no longer jumps (CLS) */

/* Loading */
.bs-loading { text-align:center; padding:60px 20px; color:inherit; opacity:.5; font-size:15px; }
.bs-spinner { display:inline-block; width:32px; height:32px; border:3px solid #e5e7eb; border-top-color:#2563eb; border-radius:50%; animation:bs-spin .7s linear infinite; margin-bottom:12px; }
@keyframes bs-spin { to { transform:rotate(360deg); } }

/* Filters row */
.bs-filters { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; margin-bottom:20px; padding:16px 20px; background:#f8f8f8; border:1px solid #e0e0e0; border-radius:10px; }
.bs-filter-group { display:flex; flex-direction:column; gap:4px; min-width:0; flex:24 1 0%; }
.bs-filter-group.bs-symbol-group { flex:28 1 0%; }
.bs-filter-group.bs-strategy-group { flex:32 1 0%; }
.bs-filter-group.bs-interval-group { flex:16 1 0%; }
.bs-filter-group.bs-direction-group { flex:0 0 auto; min-width:auto; }
.bs-dir-seg { display:inline-flex; border:1px solid #d1d5db; border-radius:6px; overflow:hidden; height:38px; }
/* !important throughout: the theme styles bare <button>s with its own green
   background / hover / focus, which otherwise competes with the active state and
   makes two options look selected. These rules make the toggle deterministic. */
.bs-dir-seg .bs-dir-opt { padding:0 14px !important; margin:0 !important; font-size:13px; font-family:inherit; background:#fff !important; color:#374151 !important; border:none !important; border-right:1px solid #d1d5db !important; border-radius:0 !important; box-shadow:none !important; cursor:pointer; outline:none; transition:background .15s; }
.bs-dir-seg .bs-dir-opt:last-child { border-right:none !important; }
.bs-dir-seg .bs-dir-opt:hover { background:#e6f4fb !important; color:#374151 !important; }
.bs-dir-seg .bs-dir-opt:focus { background:#fff !important; color:#374151 !important; }
.bs-dir-seg .bs-dir-opt.active,
.bs-dir-seg .bs-dir-opt.active:hover,
.bs-dir-seg .bs-dir-opt.active:focus { background:#0083c2 !important; color:#fff !important; }
.bs-dir-badge { display:inline-block; margin-left:6px; padding:1px 6px; border-radius:4px; font-size:10px; font-weight:700; vertical-align:middle; }
.bs-dir-badge.long { background:#dcfce7; color:#166534; }
.bs-dir-badge.short { background:#fee2e2; color:#991b1b; }
.bs-dir-badge.both { background:#e0e7ff; color:#3730a3; }
.bs-filter-group.bs-range-group { min-width:100px; flex:0 1 110px; margin-left:16px; }
.bs-filter-group.bs-range-group .bs-filter-label { text-align:center; }
.bs-filter-label.bs-label-down { position:relative; top:1.1em; }
.bs-filter-label { font-size:11px; font-weight:700; color:#333; text-transform:uppercase; letter-spacing:.8px; margin-bottom:2px; text-align:center; line-height:1.1; }

/* Clear + hide-low-trades toggle (stacked) */
.bs-filter-group.bs-actions-group { flex:0 0 auto; min-width:auto; align-items:flex-start; gap:6px; margin-left:8px; }
.bs-actions-group .bs-clear-btn { margin-bottom:10px; }
.bs-toggle-row { display:inline-flex; align-items:center; gap:6px; cursor:pointer; font-size:10px; font-weight:600; color:#555; text-transform:uppercase; letter-spacing:.3px; white-space:nowrap; margin-left:0; }
.bs-toggle { position:relative; width:28px; height:15px; flex:0 0 auto; }
.bs-toggle input { opacity:0; width:0; height:0; }
.bs-toggle-slider { position:absolute; inset:0; background:#ccc; border-radius:15px; transition:.2s; }
.bs-toggle-slider:before { content:''; position:absolute; height:11px; width:11px; left:2px; bottom:2px; background:#fff; border-radius:50%; transition:.2s; }
.bs-toggle input:checked + .bs-toggle-slider { background:#0083c2; }
.bs-toggle input:checked + .bs-toggle-slider:before { transform:translateX(13px); }

/* Dropdown filter */
.bs-select-wrap { position:relative; }
.bs-select-btn {
    width:100%; padding:8px 30px 8px 10px; border:1px solid #d1d5db; border-radius:6px;
    background:#fff; font-size:13px; color:#333; cursor:pointer; text-align:left;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; box-sizing:border-box;
    appearance:none; outline:none; transition:border-color .2s;
}
.bs-select-btn:focus { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.bs-select-btn::after { content:"\25BC"; position:absolute; right:10px; top:50%; transform:translateY(-50%); font-size:10px; color:inherit; opacity:.5; pointer-events:none; }
.bs-select-wrap .bs-dropdown {
    display:none; position:absolute; top:100%; left:0; right:0; z-index:100;
    background:#fff; border:1px solid #d1d5db; border-radius:6px; margin-top:2px;
    box-shadow:0 4px 16px rgba(0,0,0,.1); max-height:280px; overflow:hidden;
    flex-direction:column;
}
.bs-select-wrap.open .bs-dropdown { display:flex; }
.bs-dropdown-search {
    padding:8px 10px; border:none; border-bottom:1px solid #e5e7eb;
    font-size:13px; outline:none; box-sizing:border-box; width:100%;
}
.bs-dropdown-list { overflow-y:auto; max-height:230px; }
.bs-dropdown-item {
    padding:7px 10px; font-size:13px; color:inherit; cursor:pointer;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.bs-dropdown-item:hover { background:#eff6ff; }
.bs-dropdown-item.selected { background:#2563eb; color:#fff; }
.bs-dropdown-sub { font-size:12px; color:#555; padding-left:20px; }
.bs-dropdown-sub:hover { background:#eff6ff; }
.bs-dropdown-sub.selected { background:#2563eb; color:#fff; }

/* Dual range slider */
.bs-slider-wrap { position:relative; width:100%; height:40px; }
.bs-slider-track { position:absolute; top:18px; left:0; right:0; height:4px; background:#d0d0d0; border-radius:2px; }
.bs-slider-range { position:absolute; top:18px; height:4px; background:#0277bd; border-radius:2px; }
.bs-slider-wrap input[type=range] {
    position:absolute; top:9px; width:100%; height:22px; margin:0; padding:0;
    -webkit-appearance:none; appearance:none; background:transparent; pointer-events:none; z-index:3;
    outline:none; border:none; box-shadow:none;
}
.bs-slider-wrap input[type=range]::-webkit-slider-thumb {
    -webkit-appearance:none; width:21px; height:21px; border-radius:50%;
    background:#0083c2; border:none; box-shadow:0 1px 4px rgba(0,0,0,.28);
    cursor:pointer; pointer-events:all;
}
.bs-slider-wrap input[type=range]::-moz-range-thumb {
    width:21px; height:21px; border-radius:50%;
    background:#0083c2; border:none; box-shadow:0 1px 4px rgba(0,0,0,.28);
    cursor:pointer; pointer-events:all;
}
.bs-slider-vals { display:flex; justify-content:space-between; gap:4px; margin-top:4px; }
.bs-slider-vals span { font-size:11px; font-weight:600; color:#333; background:#f0f0f0; border:1px solid #d8d8d8; border-radius:3px; padding:1px 5px; min-width:28px; text-align:center; display:inline-block; }

/* Clear button */
.bs-clear-btn {
    padding:8px 16px; border:1px solid #d1d5db; border-radius:6px;
    background:#fff; color:#333; font-size:13px; font-weight:600;
    cursor:pointer; white-space:nowrap; transition:all .2s; align-self:flex-end;
}
.bs-clear-btn:hover { background:#f3f4f6; border-color:#9ca3af; color:#111; }

/* Info bar */
.bs-info { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; flex-wrap:wrap; gap:8px; }
.bs-info-text { font-size:13px; color:inherit; opacity:.7; }
.bs-per-page { display:flex; align-items:center; gap:6px; font-size:13px; color:inherit; opacity:.7; }
.bs-per-page select { padding:4px 24px 4px 8px; border:1px solid #d1d5db; border-radius:4px; font-size:13px; outline:none; min-width:60px; }

/* Table */
.bs-table-wrap { overflow-x:auto; border:1px solid #e5e7eb; border-radius:10px; background:#fff; }
.bs-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.bs-table thead th {
    background:#f8f8f8; padding:11px 18px 11px 8px; text-align:center;
    font-size:11px; font-weight:700; color:#333; text-transform:uppercase;
    letter-spacing:.6px; border-bottom:2px solid #e0e0e0; cursor:pointer;
    white-space:normal; word-break:normal; overflow-wrap:normal; line-height:1.3;
    user-select:none; transition:background .15s;
    position:sticky; top:0; z-index:2;
}
.bs-table thead th:hover { background:#efefef; }
.bs-table thead th .bs-sort-icon { font-size:9px; position:absolute; right:4px; top:50%; transform:translateY(-50%); color:inherit; opacity:.4; display:block; }
.bs-table thead th.bs-sorted-asc .bs-sort-icon, .bs-table thead th.bs-sorted-desc .bs-sort-icon { opacity:1; }
.bs-table thead th.bs-sorted-asc, .bs-table thead th.bs-sorted-desc { background:#f0f0f0; }
.bs-table tbody td.bs-sorted-col { background:#f5f5f5; }
.bs-table tbody tr:nth-child(even) td.bs-sorted-col { background:#f5f5f5; }
.bs-table tbody tr { transition:background .12s; cursor:pointer; }
.bs-table tbody tr:nth-child(even) { background:#f8f8f8; }
.bs-table tbody tr:hover { background:#f0f0f0; }
.bs-table tbody td { padding:9px 12px; font-size:13px; color:#333; border-bottom:1px solid #e5e7eb; overflow:hidden; font-weight:450; white-space:normal; word-break:break-word; line-height:1.4; vertical-align:middle; }
.bs-table td.bs-num { white-space:nowrap; word-break:normal; }
.bs-table thead th { overflow:visible; }
.bs-table tbody tr:last-child td { border-bottom:none; }

/* Numeric alignment */
.bs-table td.bs-num { text-align:right; font-variant-numeric:tabular-nums; padding-right:18px; }

/* Positive / Negative value colors */
.bs-val-pos { color:#1daa5f !important; }
.bs-val-neg { color:#e53030 !important; }
.bs-table td.bs-val-pos, .bs-table td.bs-val-neg { font-size:13px; font-weight:510; }
.bs-table th.bs-num { text-align:right; padding-left:8px; padding-right:18px; }
.bs-table th.bs-num .bs-sort-icon { left:auto; right:4px; top:50%; transform:translateY(-50%); }
/* Centered numeric column (e.g. Trades) — short integers look better centered than right-aligned */
.bs-table td.bs-num-center, .bs-table th.bs-num-center { text-align:center; padding-left:8px; padding-right:8px; }

/* Chart thumbnail */
.bs-chart-img { display:block !important; width:100% !important; height:auto !important; max-width:100% !important; border-radius:4px; object-fit:contain; }
.bs-col-chart { padding:4px !important; vertical-align:middle; }
.bs-col-symbol { position:relative; overflow:hidden; word-break:break-word; white-space:normal; max-width:200px; line-height:1.3; }
.bs-col-symbol .bs-ticker { font-weight:700; font-size:13px; display:block; }
.bs-col-symbol .bs-company { font-weight:400; font-size:13px; color:#999; display:block; }
/* Asset-class marker: a small right-pointing triangle centered in the Symbol cell, so rows stay visually separated (hover the cell for the type name) */
.bs-col-symbol::before { content:''; position:absolute; left:4px; top:50%; transform:translateY(-50%); width:9px; height:10px; background:var(--bs-type-color, transparent); clip-path:polygon(0 0, 100% 50%, 0 100%); }
.bs-symtype-crypto    { --bs-type-color:#f7931a; } /* Bitcoin orange */
.bs-symtype-forex     { --bs-type-color:#2563eb; } /* vivid blue */
.bs-symtype-stock     { --bs-type-color:#0d9488; } /* teal */
.bs-symtype-etf       { --bs-type-color:#7530dd; } /* darker purple */
.bs-symtype-index     { --bs-type-color:#ec4899; } /* magenta/pink */
.bs-symtype-commodity { --bs-type-color:#dc2626; } /* red */
.bs-table td.bs-col-type { color:#333; font-size:11px; text-align:center; }
/* Duration column: backtest window length in days (top) and number of bars (bottom, gray) — mirrors the Symbol cell */
.bs-col-period { line-height:1.3; white-space:nowrap; text-align:center; }
.bs-col-period .bs-period-days { display:block; font-size:13px; }
.bs-col-period .bs-period-bars { display:block; font-size:13px; color:#999; }
.bs-col-strategy { overflow:hidden; word-break:break-word; }
.bs-col-strategy a { color:inherit; text-decoration:none; transition:color .15s; }
.bs-col-strategy a:hover { color:#64748b; }
.bs-chart-link { display:block; width:100%; }

/* Watchlist star */
.bs-table thead th:last-child { color:#0083c2; }
.bs-table td:last-child { text-align:center; vertical-align:middle; }
.bs-star { cursor:pointer; font-size:1.3em; user-select:none; transition:transform .15s; display:inline-block; }
.bs-star:hover { transform:scale(1.3); }
.bs-star.active { color:#f5a623; }
.bs-star.inactive { color:#ccc; }

/* Watchlist entries of symbols no longer tracked */
.bs-gone { margin:0 0 14px; padding:12px 16px; background:#f9fafb; border:1px solid #e5e7eb; border-left:3px solid #9ca3af; border-radius:8px; font-size:13px; color:#4b5563; }
.bs-gone-title { font-weight:700; color:#374151; margin-bottom:2px; }
.bs-gone-text { font-size:12px; color:#6b7280; margin-bottom:8px; line-height:1.5; }
.bs-gone-list { list-style:none; margin:0 !important; padding:0 !important; }
.bs-gone-list li { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:6px 0; border-top:1px solid #eef0f3; color:#6b7280; }
.bs-gone-list li b { color:#374151; margin-right:4px; }
.bs-gone-rm { border:1px solid #d1d5db; background:#fff; color:#374151; border-radius:6px; padding:4px 12px; font-size:12px; font-weight:600; cursor:pointer; white-space:nowrap; }
.bs-gone-rm:hover { border-color:#dc2626; color:#dc2626; }
.bs-gone-rm:disabled { opacity:.5; cursor:default; }

.bs-msort { display:none; }
.bs-filter-toggle { display:none; }

/* Pagination */
.bs-pagination { display:flex; justify-content:center; align-items:center; gap:4px; margin-top:16px; flex-wrap:wrap; }
.bs-page-btn {
    min-width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center;
    border:1px solid #d1d5db; border-radius:6px; background:#fff; font-size:13px;
    color:inherit; cursor:pointer; transition:all .15s; padding:0 10px;
}
.bs-page-btn:hover:not(.active):not(:disabled) { background:#eff6ff; border-color:#2563eb; color:#2563eb; }
.bs-page-btn.active { background:#2563eb; color:#fff; border-color:#2563eb; }
.bs-page-btn:disabled { opacity:.4; cursor:default; }
.bs-page-dots { padding:0 6px; color:inherit; opacity:.4; font-size:13px; }

/* No results */
.bs-no-results { text-align:center; padding:50px 20px; color:#5b6576; font-size:15px; line-height:1.6; }

/* Responsive */
/* owner 2026-11-13: 100 px side margins (from 1400 px; narrower screens keep 50 px so the filter row and the table fit) */
@media (min-width:1400px) { .bs-container { padding:0 100px; } }
@media (max-width:1100px) {
    .bs-container { padding:0 16px; }
    /* table keeps its columns and scrolls sideways inside its frame; symbol column stays visible */
    .bs-table-wrap { -webkit-overflow-scrolling:touch; }
    .bs-table { min-width:1100px; }
    .bs-table thead th:first-child, .bs-table tbody td:first-child { position:sticky; left:0; z-index:2; background:#fff; box-shadow:1px 0 0 #e5e7eb; }
    .bs-table thead th:first-child { background:#f8f8f8; z-index:3; }
    .bs-table tbody tr:nth-child(even) td:first-child { background:#f8f8f8; }
}
@media (max-width:768px) {
    .bs-container { padding:0 10px; }
    .bs-filters { padding:12px; gap:10px; }
    .bs-filter-group, .bs-filter-group.bs-symbol-group, .bs-filter-group.bs-strategy-group, .bs-filter-group.bs-interval-group { min-width:100%; flex:1 1 100%; }
    .bs-filter-group.bs-range-group { flex:1 1 30%; min-width:90px; margin-left:0; }
    .bs-filter-group.bs-direction-group { flex:1 1 100%; align-items:center; }
    .bs-filter-group.bs-actions-group { flex:1 1 100%; margin-left:0; align-items:center; }
    .bs-toggle-row { margin-left:0; font-size:12px; }
    .bs-filter-label.bs-label-down { top:0; }
    .bs-page-btn { min-width:40px; height:40px; }
    /* Phone: every backtest is a card (symbol + star, strategy / interval, key figures, chart) */
    .bs-msort { display:flex; align-items:center; gap:6px; width:100%; font-size:13px; color:#555; }
    .bs-msort select { flex:1; padding:9px 10px; border:1px solid #d1d5db; border-radius:8px; font-size:15px; background:#fff; }
    .bs-table-wrap { border:none; background:transparent; overflow:visible; }
    .bs-table { min-width:0; table-layout:auto; }
    .bs-table, .bs-table tbody { display:block; width:100%; }
    .bs-table thead { display:none; }
    .bs-table tbody tr { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px 12px; position:relative;
        background:#fff !important; border:1px solid #e5e7eb; border-radius:12px; padding:12px 14px; margin-bottom:12px;
        box-shadow:0 1px 3px rgba(16,24,40,.06); }
    .bs-table tbody td, .bs-table tbody td:first-child, .bs-table tbody tr:nth-child(even) td:first-child {
        display:block; position:static; padding:0 !important; border:none !important; background:transparent !important;
        box-shadow:none; text-align:left !important; font-size:14px; line-height:1.3; overflow:visible; white-space:normal; }
    .bs-table tbody td::before { content:attr(data-label); display:block; font-size:10.5px; font-weight:700; letter-spacing:.4px;
        text-transform:uppercase; color:#8b95a6; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .bs-table tbody td[data-key="symbolname"] { grid-column:1 / -1; padding-right:36px !important; }
    .bs-table tbody td[data-key="symbolname"] .bs-ticker { font-size:17px; }
    .bs-table tbody td[data-key="symbolname"] .bs-company { font-size:12.5px; }
    .bs-table tbody td[data-key="strategy_name"] { grid-column:span 2; }
    .bs-table tbody td[data-key="chart"] { grid-column:1 / -1; }
    .bs-table tbody td[data-key="symbolname"]::before, .bs-table tbody td[data-key="chart"]::before,
    .bs-table tbody td[data-key="watchlist"]::before { display:none; }
    .bs-table tbody td[data-key="watchlist"] { position:absolute; top:10px; right:12px; font-size:24px; line-height:1; }
    .bs-table tbody td.bs-val-pos, .bs-table tbody td.bs-val-neg { font-size:14px; }
    .bs-table tbody td[data-key="chart"] { order:99; }
    .bs-info > div { width:100%; justify-content:space-between; margin-left:0 !important; gap:10px !important; }
    .bs-per-page { white-space:nowrap; flex-shrink:0; }
    .bs-table tbody td[data-key="chart"] .bs-chart-img { max-height:84px; object-fit:fill; }
    .bs-table tbody td[data-key="win_rate"]::before { content:"Profitable"; }
    /* Filters collapse behind a button */
    .bs-filter-toggle { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; margin-bottom:12px;
        padding:11px 14px; border:1px solid #d1d5db !important; border-radius:10px; background:#f8f8f8 !important;
        color:#333 !important; font-size:15px; font-weight:600; cursor:pointer; }
    .bs-filter-toggle .bs-ft-arrow { transition:transform .2s; }
    #bsApp:not(.bs-filters-open) .bs-filters { display:none; }
    #bsApp.bs-filters-open .bs-filter-toggle .bs-ft-arrow { transform:rotate(180deg); }
}
@media (min-width:600px) and (max-width:768px) {
    .bs-table tbody { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
    .bs-table tbody tr { margin-bottom:0; }
}

.bs-bankrupt{display:block;font-size:10px;font-weight:700;letter-spacing:.3px;text-transform:uppercase;color:#b91c1c}

/* filter dropdowns: room for the selected label (opinion test 11, 4.9: labels cut to "A..."); on the column, not the
   button - a button min-width spilled over the Direction label on ~1024 px screens (owner 2026-11-12) */
@media (min-width:769px){
.bs-filter-group:not(.bs-range-group):not(.bs-direction-group):not(.bs-actions-group){min-width:80px}
.bs-filter-group.bs-symbol-group,.bs-filter-group.bs-strategy-group{min-width:100px}
/* owner 2026-11-12: narrower sliders and direction buttons, wider symbol and interval fields */
.bs-filter-group.bs-symbol-group{flex:36 1 0%;min-width:120px}
.bs-filter-group.bs-interval-group{flex:24 1 0%;min-width:100px}
.bs-filter-group.bs-range-group{min-width:80px;flex:0 1 88px;margin-left:6px}
.bs-dir-seg{height:30px}
.bs-dir-seg .bs-dir-opt{padding:0 7px !important;font-size:11px}
}

/* duration "3,486 days" / "2,400 bars" on one line each (owner 2026-11-13, narrower table with 100 px margins) */
.bs-col-period .bs-period-days,.bs-col-period .bs-period-bars{white-space:nowrap}

/* direction badge reads "(Long)" / "(Short)" for screen readers and copy, "L" / "S" on screen (opinion test 11) */
.bs-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* room for the sort icon so it does not touch the header text (QA test 1, 1.11) */
.bs-table thead th[data-sort] { padding-right:16px; }

/* % under Total P&L / Max DD (QA test 3, 4.1) */
.bs-table td .bs-pct{display:block;font-size:11px;font-weight:450;opacity:.75;line-height:1.2}

/* to-do 22 4.5: "PROFITABLE" was 1-2 px wider than its column on narrower screens */
.bs-table thead th[data-sort="win_rate"] { letter-spacing:.2px; padding-left:4px; padding-right:4px; }
/* to-do 22 5.2 A: lock on rows the chart page opens locked */
.bs-lock{display:inline-flex;vertical-align:middle;margin-left:3px;color:#94a3b8;line-height:1}
.bs-lock svg{width:11px;height:11px}
/* free beta: person icon instead of the padlock (owner 2026-11-29, Pay-8 #149) */
.bs-lock.bs-acct{color:#0f8a6c}
