#history-view{display:block}#history-view[hidden]{display:none}
.hist-shell{display:flex;flex-direction:column;gap:12px;max-width:1100px}
.hist-notice{margin:0;font-size:12px;color:var(--muted);border-left:3px solid var(--accent);padding:6px 10px;background:var(--surface);border-radius:4px}
.hist-accounts{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;min-width:0}
.hist-account-hint{display:none;margin:0;font-size:11px;color:var(--muted)}
.hist-account{display:flex;flex-direction:column;gap:2px;min-width:0;text-align:left;border:2px solid color-mix(in srgb,var(--accent) 45%,var(--line));background:var(--accent-soft);color:var(--ink);border-radius:10px;padding:9px 13px;font:inherit;cursor:pointer;box-shadow:0 2px 6px rgba(20,50,45,.06)}
.hist-account[aria-pressed=true]{border-color:var(--accent);background:color-mix(in srgb,var(--accent-soft) 78%,var(--accent));box-shadow:0 0 0 1px var(--accent) inset,0 2px 6px rgba(20,50,45,.08)}
.hist-account:hover{border-color:var(--accent)}
.hist-account:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.hist-account span{font-size:12px;color:var(--muted);line-height:1.3;min-height:2.6em;overflow-wrap:anywhere}.hist-account strong{font-size:22px;line-height:1.2}.hist-account small{font-size:11px;color:var(--muted)}
.hist-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.hist-stat{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:8px 10px;display:flex;flex-direction:column;gap:2px}
.hist-stat span{font-size:11px;color:var(--muted)}.hist-stat strong{font-size:15px}
.hist-up{color:var(--accent)}.hist-down{color:var(--red)}
.hist-chart{margin:0;border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:10px 10px 6px}
.hist-chart svg{width:100%;height:150px;display:block}.hist-chart polyline{fill:none;stroke:currentColor;stroke-width:2;vector-effect:non-scaling-stroke}
.hist-chart .hist-area{fill:currentColor;opacity:.08;stroke:none}.hist-base{stroke:var(--muted);stroke-dasharray:4 4;opacity:.6;vector-effect:non-scaling-stroke}
.hist-chart figcaption{display:flex;justify-content:space-between;font-size:10px;color:var(--muted);margin-top:4px}
.hist-chart-empty{display:flex;align-items:center;justify-content:center;height:120px;font-size:12px;color:var(--muted)}
.hist-tabs{display:flex;gap:6px}
.hist-tab,.hist-button{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:6px;padding:6px 12px;font:inherit;font-size:12px;cursor:pointer}
.hist-tab[aria-pressed=true]{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
.hist-button{border-color:var(--accent);color:var(--accent)}
.hist-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
.hist-table{width:100%;border-collapse:collapse;font-size:12px}
.hist-table th{position:sticky;top:0;background:var(--surface);text-align:left;font-weight:600;color:var(--muted);padding:7px 10px;border-bottom:1px solid var(--line);white-space:nowrap}
.hist-table td{padding:7px 10px;border-bottom:1px solid var(--line);white-space:nowrap;text-align:left}.hist-table tr:last-child td{border-bottom:0}
.hist-table .r{text-align:right}.hist-table td small{display:block;font-size:10px;opacity:.8}
.hist-table th:first-child{width:auto;min-width:0;text-align:left;padding:7px 10px}
.hist-table th:nth-child(2){max-width:none}
.hist-closed-table{table-layout:fixed;min-width:920px}
.hist-open-table{table-layout:fixed;min-width:900px}
.hist-open-table th,.hist-open-table td{font-variant-numeric:tabular-nums}
.hist-closed-table th,.hist-closed-table td{font-variant-numeric:tabular-nums}
.hist-closed-total{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:10px 12px;margin-bottom:8px;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
.hist-closed-total span{font-size:12px;color:var(--muted)}
.hist-closed-total strong{font-size:15px;font-variant-numeric:tabular-nums;white-space:nowrap}
@media (max-width:520px){.hist-closed-total{align-items:flex-start;flex-direction:column;gap:2px}}

.hist-lock{display:flex;flex-direction:column;align-items:flex-start;gap:6px;border:1px dashed var(--line);border-radius:8px;padding:16px;background:var(--surface)}
.hist-lock span{font-size:12px;color:var(--muted)}
.hist-empty{font-size:12px;color:var(--muted);margin:8px 0}
.hist-foot{font-size:11px;color:var(--muted);margin:0}
body.history-layout-active{height:auto;min-height:100dvh;overflow-y:auto;overflow-x:hidden}
.history-layout-active .workspace{height:auto;min-height:100dvh}
.history-layout-active main{display:block;flex:none;overflow:visible}
#history-view{min-width:0;padding-bottom:48px}
@media (max-width:1500px){.hist-account-hint{display:block}.hist-accounts{grid-template-columns:repeat(8,minmax(160px,1fr));overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scroll-snap-type:x proximity;padding-bottom:8px}.hist-account{scroll-snap-align:start}}
@media (max-width:900px){.hist-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:520px){.hist-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.hist-account strong{font-size:18px}.hist-accounts{grid-template-columns:repeat(8,minmax(172px,72vw))}.hist-tabs{flex-wrap:wrap}.hist-table-wrap{max-width:100%;-webkit-overflow-scrolling:touch}}

