.chart-page { background:var(--theme-page); }
.chart-page .diary-shell { padding-bottom:calc(7.8rem + env(safe-area-inset-bottom)); }
.chart-hero { padding:env(safe-area-inset-top) 2rem 2rem; color:var(--theme-surface); background:linear-gradient(180deg,var(--theme-primary) 0%,var(--theme-primary-mid) 60%,var(--theme-primary-light) 100%); }
.chart-topbar { height:6.2rem; display:flex; align-items:center; }
.chart-title { display:flex; align-items:center; justify-content:space-between; gap:1.1rem; width:100%; }
.chart-page .visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.chart-title h1 { padding:0; color:var(--theme-surface); font-size:var(--font-mid); font-weight:500; line-height:normal; }
.chart-page .metric-select { display:flex; align-items:center; min-height:3.6rem; max-width:18rem; padding:.4rem 1.8rem .4rem .2rem; border:0; border-radius:.6rem; outline:0; background:transparent; color:var(--theme-on-primary-soft); text-align:left; font:inherit; font-size:var(--font-mid); line-height:normal; }
.chart-page .metric-select:focus-visible { outline:1px solid rgba(var(--theme-white-rgb),.6); outline-offset:2px; }
.chart-periods { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:1.6rem 0 1.8rem; overflow:hidden; border:1px solid var(--theme-primary-border); border-radius:1rem; }
.chart-periods button { min-height:4.2rem; padding:.6rem .2rem; border-right:1px solid var(--theme-primary-border); color:var(--theme-on-primary); background:transparent; font:inherit; font-size:var(--font-label); white-space:nowrap; }
.chart-periods button:last-child { border:0; }
.chart-periods button.active { background:var(--theme-primary-soft); color:var(--theme-primary-emphasis); font-weight:500; }
.chart-meta { display:flex; justify-content:space-between; align-items:center; margin:0 -.2rem .9rem; color:var(--theme-on-primary); font-size:var(--font-label); }
.chart-meta p { padding:0; }
.chart-meta strong { font-weight:500; }
.chart-meta button { padding:.5rem 0 .5rem .8rem; color:var(--theme-on-primary); background:transparent; font:inherit; font-size:var(--font-action); }
.chart-wrap { position:relative; height:clamp(18.75rem,58.5vw,27rem); padding-left:3.5rem; }
.trend-svg { display:block; width:100%; height:100%; overflow:visible; }
.chart-grid .grid-line { stroke:rgba(var(--theme-white-rgb),.13); stroke-width:1; vector-effect:non-scaling-stroke; }
.chart-y-labels { position:absolute; inset:0 auto 0 0; width:3rem; display:flex; flex-direction:column; justify-content:space-between; padding:.1rem 0 2.8rem; color:rgba(var(--theme-white-rgb),.72); font-size:var(--font-caption); text-align:left; }
.chart-x-labels { display:flex; justify-content:space-between; gap:.3rem; margin:.2rem 0 1.6rem 3.5rem; color:rgba(var(--theme-white-rgb),.72); font-size:1.15rem; }
.data-dot { fill:var(--theme-primary-mid); stroke:var(--theme-on-primary-soft); stroke-width:2.5; cursor:pointer; vector-effect:non-scaling-stroke; }
.data-dot:focus-visible { outline:none; stroke:var(--theme-surface); stroke-width:4; }
.chart-stats { min-height:8.3rem; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:center; border-radius:1.5rem; background:rgba(var(--theme-white-rgb),.2); }
.chart-stats div { min-width:0; display:flex; flex-direction:column; align-items:center; gap:.7rem; }
.chart-stats span { color:rgba(var(--theme-white-rgb),.78); font-size:var(--font-caption); }
.chart-stats strong { max-width:100%; overflow:hidden; color:var(--theme-surface); font-size:clamp(1.7rem,5vw,2.4rem); font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
.chart-hint { min-height:20rem; display:grid; place-items:center; padding:3rem 2rem; color:var(--theme-text-light); text-align:center; font-size:var(--font-note); }
.chart-page .bottom-nav { z-index:10; }
@media (min-width:700px) { .chart-page .chart-hero { border-radius:0 0 1.8rem 1.8rem; } .chart-page .chart-hint { min-height:22rem; } }
