#statisticsDialog .old-statistics {display:none!important}
#statisticsDialog {width:min(680px,calc(100% - 24px));max-height:calc(100dvh - 24px);overflow:auto}
#statisticsDialog form {overflow:visible;padding-bottom:calc(24px + env(safe-area-inset-bottom))}
#statsNew {color:var(--ink);min-width:0}
#statsNew h2 {font-size:23px;line-height:1.25;margin:0;overflow-wrap:anywhere}
.stats-header {display:grid;gap:12px;margin-bottom:20px}
.stats-header>button {justify-self:start;background:none;border:0;color:var(--muted);padding:8px 0;font-size:16px}
.stats-segments {display:flex;gap:5px;margin:12px 0}
.stats-segments button {flex:1;min-width:0;min-height:44px;padding:9px 4px;font-size:14px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--ink)}
.stats-segments button[aria-pressed=true] {background:var(--accent-soft);border-color:var(--accent)}
.stats-period {display:flex;justify-content:center;align-items:center;gap:15px;margin:12px 0;color:var(--muted)}
.stats-period button {width:40px;height:40px;border:0;background:none;color:var(--accent);font-size:26px}
.stats-totals {display:flex;border:1px solid var(--line);border-radius:12px;padding:15px 0}
.stats-totals>span {flex:1;display:grid;gap:8px;text-align:center;color:var(--muted);font-size:14px;border-right:1px solid var(--line)}
.stats-totals>span:last-child {border:0}.stats-totals strong {font-size:28px;color:var(--ink)}
.stats-chart {display:block;width:100%;height:auto;overflow:visible}
.stats-chart text {font-size:20px;fill:var(--muted)}.stats-grid {stroke:var(--line);stroke-dasharray:4;fill:none}.stats-strength{fill:var(--ink)}.stats-running,.stats-dot{fill:var(--accent)}.stats-line{stroke:var(--accent);stroke-width:2;fill:none}
.stats-line,.stats-grid,.stats-chart text {pointer-events:none}
.stats-chart [role=button] {cursor:pointer}.stats-chart [role=button]:focus {outline:2px solid var(--accent)}
.stats-legend {display:flex;justify-content:center;gap:20px;font-size:14px}.stats-legend span:last-child{color:var(--accent)}
#statsChartInfo,.stats-explanation,.stats-empty {font-size:13px;color:var(--muted);line-height:1.5}
.stats-exercise,.stats-run-summary {display:flex;width:100%;align-items:center;gap:12px;justify-content:space-between;text-align:left;padding:15px 12px;border:1px solid var(--line);border-radius:10px;background:var(--field);color:var(--ink);margin:8px 0}
.stats-exercise span {min-width:0}.stats-exercise strong {display:block;font-size:17px;overflow-wrap:anywhere}.stats-exercise small,.stats-run-summary small {display:block;color:var(--muted);font-size:13px;margin-top:5px}
.stats-exercise b{color:var(--accent)}.stats-run-summary{display:grid}.stats-exercise:hover{background:var(--accent-soft)}
#statsNew h3 {font-size:18px;margin:24px 0 12px}#statsNew summary {cursor:pointer;padding:14px 0}
.stats-last {display:grid;gap:8px;text-align:center;margin:20px 0}.stats-last strong{font-size:28px}.stats-last small,.stats-last span{color:var(--muted);font-size:14px}
.stats-comparison{display:grid;text-align:center;gap:8px;border-top:1px solid var(--line);padding:16px 0}.stats-comparison small{color:var(--muted);font-size:13px}
.run-progress-summary{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line);border-radius:12px}.run-progress-summary span{display:grid;gap:5px;padding:12px;color:var(--muted);font-size:13px}.run-progress-summary strong{color:var(--ink);font-size:18px}
.stats-history-head,.stats-history summary{display:flex;justify-content:space-between;gap:12px;font-size:14px}.stats-history-head{color:var(--muted);padding:12px 0}.stats-history{border-top:1px solid var(--line)}.stats-history strong{text-align:right}.stats-history p{font-size:14px;color:var(--muted)}
@media(min-width:700px){.stats-header{grid-template-columns:auto 1fr;align-items:center}.stats-header h2{text-align:center}}
