/* Read-only strategy history: one server-aggregated strategy per card. */
.strategy-history-page{--history-accent:#87b2ff;--history-soft:#171a20;--history-line:#ffffff0c;min-width:0;padding-bottom:8px;color:var(--text)}
.strategy-history-page svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
body.ui-polished .strategy-history-page button{font:inherit;cursor:pointer;box-shadow:none!important;translate:none;transform:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.strategy-history-page button:focus-visible{outline:2px solid var(--history-accent);outline-offset:3px}
.strategy-history-page button:disabled{opacity:.5;cursor:default}
.strategy-history-header{margin-bottom:13px}
.strategy-history-header>.strategy-back{margin:0 0 22px}
.strategy-history-header>div{display:flex;align-items:center;justify-content:space-between;gap:15px}
.strategy-history-header h1{font-size:22px;font-weight:650;line-height:1.5;letter-spacing:-.025em;margin:0 0 6px}
.strategy-history-header p{color:var(--muted);font-size:11px;line-height:1.7;margin:0}
body.ui-polished .strategy-history-page #strategy-history-refresh{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;padding:10px;border:1px solid var(--history-line);border-radius:13px;color:var(--history-accent);background:var(--history-soft)}
#strategy-history-refresh svg{width:18px;height:18px}
#strategy-history-refresh.is-loading svg{animation:strategy-history-spin 1s linear infinite}
.strategy-history-updated{color:var(--muted);font-size:9px;line-height:1.7;margin:0 1px 17px;font-variant-numeric:tabular-nums}
.strategy-history-updated:empty{display:none}
.strategy-history-list{display:grid;gap:14px}
.strategy-history-card{padding:18px 17px 16px;border:1px solid var(--history-line);border-radius:23px;background:var(--history-soft);min-width:0}
.strategy-history-card>header{display:flex;align-items:center;gap:10px;min-width:0}
.strategy-history-avatar{display:grid;place-items:center;flex:0 0 39px;width:39px;height:39px;border:1px solid #6e9eeb18;border-radius:13px;background:#6698ff12;color:var(--history-accent);font-size:17px;font-weight:600;letter-spacing:-.025em}
.strategy-history-card header>div{flex:1;min-width:0}
.strategy-history-card h2{font-size:13px;font-weight:600;line-height:1.7;overflow-wrap:anywhere;margin:0 0 3px}
.strategy-history-card header small{font-size:9px;line-height:1.5;color:var(--muted)}
.strategy-history-badge{display:block;flex:0 0 auto;font-size:9px;line-height:1.6;white-space:nowrap;padding:5px 7px;border:1px solid var(--history-line);border-radius:8px;color:var(--muted);font-variant-numeric:tabular-nums}
.strategy-history-badge.is-running{background:#6698ff12;color:var(--history-accent);border-color:#6e9eeb18}
.strategy-history-profit{display:flex;flex-direction:column;gap:8px;margin:22px 0 20px;min-width:0}
.strategy-history-profit>span{font-size:10px;line-height:1.6;color:var(--muted)}
.strategy-history-profit small{font-size:9px;margin-left:5px;opacity:.8}
.strategy-history-profit strong{font-size:29px;font-weight:600;letter-spacing:-.045em;line-height:1.2;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.strategy-history-profit .is-positive{color:var(--positive,var(--history-accent))}
.strategy-history-profit .is-negative{color:var(--negative,var(--danger,#ef718b))}
.strategy-history-profit .is-neutral{color:var(--text)}
.strategy-history-dates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;border-top:1px solid var(--history-line);padding-top:14px;margin:0}
.strategy-history-dates>div{min-width:0}
.strategy-history-dates dt{font-size:9px;line-height:1.6;color:var(--muted);margin:0 0 7px}
.strategy-history-dates dd{font-size:11px;font-weight:450;line-height:1.7;color:var(--text);margin:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.strategy-history-notes{margin:16px 3px 0}
.strategy-history-notes p{color:var(--muted);font-size:10px;line-height:1.85;margin:6px 0;overflow-wrap:anywhere}
.strategy-history-notes:empty{display:none}
.strategy-history-error{display:flex;align-items:center;gap:9px;padding:12px;border:1px solid var(--history-line);border-radius:14px;background:var(--history-soft);margin-bottom:16px}
.strategy-history-error>svg{width:17px;height:17px;color:var(--muted)}
.strategy-history-error>span{flex:1;min-width:0;font-size:11px;line-height:1.75;color:var(--muted);overflow-wrap:anywhere}
.strategy-history-error small{display:block;font-size:9px;margin-top:3px}
body.ui-polished .strategy-history-error>button{flex:0 0 auto;min-height:34px;padding:8px;border:0;border-radius:9px;background:transparent;color:var(--history-accent);font-size:11px}
.strategy-history-loading,.strategy-history-empty{display:flex;align-items:center;justify-content:center;flex-direction:column;min-height:265px;padding:36px 18px;text-align:center;color:var(--muted)}
.strategy-history-loading>span{width:23px;height:23px;border:1.5px solid var(--history-line);border-top-color:var(--history-accent);border-radius:50%;animation:strategy-history-spin .8s linear infinite;margin-bottom:8px}
.strategy-history-loading>p{font-size:12px;line-height:1.8;margin:11px 0 0}
.strategy-history-empty>svg{width:34px;height:34px;stroke-width:1.2;opacity:.7;margin-bottom:20px}
.strategy-history-empty>h2{font-size:14px;font-weight:550;line-height:1.6;color:var(--text);margin:0}
.strategy-history-empty>p{font-size:11px;line-height:1.85;margin:10px 0 0;max-width:260px}
body.ui-polished .strategy-history-empty>button{margin-top:19px;min-height:39px;padding:10px 14px;border:1px solid var(--history-line);border-radius:12px;background:var(--history-soft);color:var(--history-accent);font-size:11px}
:root[data-theme="light"] .strategy-history-page{--history-accent:#387be8;--history-soft:#fff;--history-line:#dfe7f180}
[data-theme="light"] .strategy-history-card{box-shadow:0 5px 20px #2b518207}
[data-theme="light"] .strategy-history-avatar,[data-theme="light"] .strategy-history-badge.is-running{background:#edf3ff;border-color:#e4ecfd}
@keyframes strategy-history-spin{to{transform:rotate(360deg)}}
@media(max-width:360px){.strategy-history-card{padding:16px 13px}.strategy-history-card>header{gap:8px}.strategy-history-avatar{width:34px;height:34px;flex-basis:34px;border-radius:11px}.strategy-history-card h2{font-size:12px}.strategy-history-badge{font-size:8px;padding:4px 5px}.strategy-history-profit strong{font-size:26px}.strategy-history-dates{gap:9px}.strategy-history-dates dd{font-size:10px}}
@media(min-width:850px){.strategy-history-card{padding:22px}.strategy-history-header h1{font-size:25px}.strategy-history-dates{gap:28px}.strategy-history-card h2{font-size:15px}.strategy-history-dates dd{font-size:12px}}
@media(prefers-reduced-motion:reduce){#strategy-history-refresh.is-loading svg,.strategy-history-loading>span{animation:none}}

/* Keep the history entry compact beside the existing running-status heading. */
.running-list-header>.running-status-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:0}
.running-status-heading>div{min-width:0;flex:1}
.running-status-heading h1{font-size:21px;font-weight:650;line-height:1.5;letter-spacing:-.025em;margin:0 0 7px}
.running-list-header .running-status-heading>div>span{display:block;font-size:10px;line-height:1.7;color:var(--muted)}
body.ui-polished .running-status-heading>.strategy-history-entry{display:flex;align-items:center;justify-content:center;gap:6px;flex:0 0 auto;min-height:39px;padding:10px 11px;margin:0;border:1px solid var(--border);border-radius:13px;background:var(--surface-2);color:var(--text);font:inherit;cursor:pointer;box-shadow:none!important;translate:none;transform:none;touch-action:manipulation}
.running-status-heading .strategy-history-entry>svg{display:block;width:15px;height:15px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;color:#87b2ff}
.running-list-header .strategy-history-entry>span{font-size:11px;line-height:1.5;color:inherit;white-space:nowrap}
.running-status-heading .strategy-history-entry:focus-visible{outline:2px solid #387be8;outline-offset:3px}
[data-theme="light"] .running-status-heading .strategy-history-entry{background:#fff;border-color:#e1e8f3;color:#3c75c9}
[data-theme="light"] .running-status-heading .strategy-history-entry>svg{color:#387be8}
@media(max-width:360px){.running-status-heading h1{font-size:19px}.running-list-header>.running-status-heading{gap:8px}body.ui-polished .running-status-heading>.strategy-history-entry{padding:9px;gap:5px}.running-list-header .strategy-history-entry>span{font-size:10px}}
