.health-page {
  --health-accent: #8b6539;
  --health-muted-accent: #b49a78;
  --health-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.health-status { display: flex; align-items: baseline; gap: 9px; color: var(--muted); font: 11px/1.7 var(--health-sans); padding: 13px 0; }
.health-status-dot { width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: var(--health-accent); }
.health-status[data-stale="true"] .health-status-dot { background: #ad7736; }
.health-status[data-error="true"] .health-status-dot { background: #945044; }
.health-status button { flex-shrink: 0; color: var(--ink); font-size: 11px; background: none; border: 0; cursor: pointer; }
.health-chart-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 18px 0 14px; }
.health-chart-toolbar > p { margin: 0; color: var(--muted); font: 11px/1.5 var(--health-sans); }
.health-ranges { display: flex; gap: 3px; }
.health-ranges button { padding: 7px 11px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.health-ranges button[aria-pressed="true"] { background: var(--accent); color: var(--paper); }
.health-ranges button:hover:not([aria-pressed="true"]) { background: var(--soft); color: var(--ink); }
.health-chart-legend { display: flex; gap: 16px; margin-bottom: 24px; color: var(--muted); font: 10px/1.4 var(--health-sans); }
.health-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.health-chart-legend span::before { content: ""; width: 16px; border-top: 1px solid var(--health-muted-accent); }
.health-chart-legend .health-legend-ema::before { border-top: 2px dashed var(--health-accent); }
.health-body-map { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 38vw, 300px) minmax(0, 1fr); grid-template-rows: repeat(3, minmax(178px, auto)); gap: 32px 16px; }
.health-figure { position: relative; z-index: 0; grid-column: 2; grid-row: 1 / 4; align-self: center; min-width: 0; width: 100%; aspect-ratio: 2 / 3; }
.health-figure svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.health-connections-overlay { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.health-body-connector { fill: none; stroke: var(--health-muted-accent); stroke-width: 1; stroke-dasharray: 2 4; stroke-linecap: round; opacity: .7; }
.health-heart-pulse { transform-box: fill-box; transform-origin: center; }
.health-page[data-heartbeat="true"] .health-heart-pulse { animation: health-heartbeat var(--heartbeat-duration) ease-in-out infinite; }
.health-page[data-motion-paused="true"] .health-heart-pulse { animation-play-state: paused; }
@keyframes health-heartbeat {
  0%, 42%, 100% { transform: scale(1); }
  12% { transform: scale(1.22); }
  25% { transform: scale(.98); }
}
@media (prefers-reduced-motion: reduce) {
  .health-page[data-heartbeat="true"] .health-heart-pulse { animation: none; }
}
.health-card { position: relative; z-index: 2; min-width: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.health-card-sleep { grid-column: 1; grid-row: 1; }
.health-card-recovery { grid-column: 3; grid-row: 1; }
.health-card-strain { grid-column: 1; grid-row: 2; }
.health-card-heart { grid-column: 3; grid-row: 2; }
.health-card-workout { grid-column: 1; grid-row: 3; }
.health-card-steps { grid-column: 3; grid-row: 3; }
.health-card h2 { margin: 0 0 4px; color: var(--muted); font: 12px/1.4 var(--health-sans); font-weight: 400; }
.health-card-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.health-card-heading h2 { min-width: 0; }
.health-card-trend { flex-shrink: 0; color: var(--muted); font: 11px/1.4 var(--health-sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.health-card-trend[data-direction="up"] { color: #2f704e; }
.health-card-trend[data-direction="down"] { color: #b04b40; }
.health-card-value { margin: 0; color: var(--accent); font: 36px/1.2 Georgia, "Times New Roman", serif; letter-spacing: -.04em; font-variant-numeric: lining-nums tabular-nums; }
.health-card-value small { margin-left: 4px; color: var(--muted); font: 11px/1 var(--health-sans); letter-spacing: 0; }
.health-card-chart { margin-top: 12px; width: 100%; height: 84px; }
.health-card-chart svg { display: block; width: 100%; height: 84px; overflow: visible; }
.health-card-detail { margin: 7px 0 0; color: var(--muted); font: 10px/1.4 var(--health-sans); }
.health-svg-label { fill: var(--muted); font: 9px var(--health-sans); }
.health-svg-line { fill: none; stroke: var(--health-muted-accent); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.health-svg-ema { fill: none; stroke: var(--health-accent); stroke-width: 2; stroke-dasharray: 4 3; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.health-svg-point { fill: var(--health-accent); stroke: var(--paper); stroke-width: 1.5; }
.health-chart-interactive { cursor: crosshair; touch-action: pan-y; }
.health-chart-interactive:focus-visible { outline: 1px solid var(--health-muted-accent); outline-offset: 4px; border-radius: 2px; }
.health-svg-day-point { fill: var(--paper); stroke: var(--health-accent); stroke-width: 1.3; pointer-events: none; }
.health-svg-hover-line { stroke: var(--health-muted-accent); stroke-width: 1; stroke-dasharray: 2 3; pointer-events: none; }
.health-svg-hover-point { fill: var(--health-accent); stroke: var(--paper); stroke-width: 2; pointer-events: none; }
.health-svg-empty { fill: var(--muted); font: 10px var(--health-sans); }
.health-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 699px) {
  .health-body-map { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto repeat(3, minmax(178px, auto)); gap: 28px 24px; }
  .health-figure { grid-column: 1 / -1; grid-row: 1; justify-self: center; width: min(76vw, 300px); }
  .health-card-sleep { grid-column: 1; grid-row: 2; }
  .health-card-recovery { grid-column: 2; grid-row: 2; }
  .health-card-strain { grid-column: 1; grid-row: 3; }
  .health-card-heart { grid-column: 2; grid-row: 3; }
  .health-card-workout { grid-column: 1; grid-row: 4; }
  .health-card-steps { grid-column: 2; grid-row: 4; }
  .health-body-connector { opacity: .48; stroke-width: .85; }
  .health-chart-toolbar { gap: 10px; flex-wrap: wrap; }
  .health-ranges { margin-left: auto; }
  .health-ranges button { padding: 7px 9px; }
  .health-chart-toolbar > p { font-size: 10px; }
  .health-card h2 { font-size: 11px; }
  .health-card-trend { font-size: 10px; }
  .health-card-value { font-size: 32px; }
  .health-card-value small { font-size: 10px; }
  .health-card-detail { font-size: 9px; }
}
@media (max-width: 360px) {
  .health-body-map { column-gap: 20px; }
  .health-card-value { font-size: 29px; }
  .health-card h2 { font-size: 10px; }
  .health-svg-label { font-size: 8px; }
}
