body.analytics-page-open { padding: 0; }
body.analytics-page-open > :not(#analyticsPage):not(#historyModal):not(script) { display: none !important; }
.analytics-page[hidden] { display: none; }
.analytics-page { min-height: 100dvh; background: #0b0d13; }
.analytics-page-header { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; background: #0b0d13; border-bottom: 1px solid rgba(255,255,255,.07); }
.analytics-page-header h1 { margin: 0; font-size: 1.05rem; font-weight: 700; outline: none; }
.analytics-header-spacer { width: 40px; }
.analytics-page-content { max-width: 620px; margin: 0 auto; padding: 24px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.analytics-page .period-selector { display: flex; justify-content: center; gap: 4px; width: fit-content; max-width: 100%; margin: 0 auto; padding: 4px; border-radius: 12px; background: #161b26; }
.analytics-page .period-btn { min-width: 58px; padding: 10px 14px; border: 0; border-radius: 8px; background: transparent; color: #94a3b8; font: inherit; font-size: .85rem; cursor: pointer; }
.analytics-page .period-btn.active { background: #293242; color: #f8fafc; }
.analytics-average { text-align: center; margin: 22px 0 30px; font-size: 1.05rem; font-weight: 700; color: #f8fafc; }
.analytics-page h2 { margin: 0 0 14px; font-size: .9rem; font-weight: 700; }
.analytics-chart svg { display: block; width: 100%; height: auto; overflow: hidden; }
.analytics-chart-detail { min-height: 20px; margin: 4px 0 26px; text-align: center; color: #94a3b8; font-size: .78rem; }
.analytics-chart-bar { cursor: pointer; outline: none; }
.analytics-chart-bar:focus .analytics-bar-fill { stroke: #f8fafc; stroke-width: 1.5; }
.analytics-history-section { margin-top: 12px; }
.analytics-history-card.dict-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; box-sizing: border-box; margin-bottom: 10px !important; font: inherit; text-align: left; color: #f8fafc; }
.analytics-history-title { margin: 0 0 8px; font-size: .95rem; font-weight: 700; overflow-wrap: anywhere; }
.analytics-history-target { font-size: .72rem; color: #94a3b8; line-height: 1.6; }
.analytics-history-times { margin: 0; display: grid; grid-template-columns: auto auto; gap: 5px 9px; font-size: .72rem; line-height: 1.5; white-space: nowrap; font-variant-numeric: tabular-nums; }
.analytics-history-times dt { color: #94a3b8; }
.analytics-history-times dd { margin: 0; text-align: right; }
.analytics-empty { padding: 24px 0; color: #94a3b8; text-align: center; font-size: .85rem; }
@media (max-width: 350px) { .analytics-page .period-btn { min-width: 52px; padding-inline: 11px; } .analytics-history-card.dict-item { gap: 8px; padding: 10px; } .analytics-history-times { gap: 4px 6px; font-size: .68rem; } }
