wf-result-history {
  display:block;
  color:var(--ink);
  font-family:var(--body);
  container-type:inline-size;
}
.wf-history-section { padding-block:var(--s8); }
#screen wf-result-history { margin-block:var(--space-7); }
.history-panel { padding-block:24px; border-block:1px solid var(--line); }
.history-heading, .history-foot { display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:16px; }
.history-heading h2 { margin:4px 0 0; font:550 clamp(34px,4vw,58px)/1.04 var(--display); letter-spacing:-.055em; }
.history-kicker, .history-picker label { margin:0; color:var(--accent); font:600 .875rem/1.4 var(--body); }
.history-picker { display:grid; gap:4px; }
.history-picker select {
  min-height:44px;
  border:1px solid var(--line);
  border-radius:8px;
  padding:8px 12px;
  background:var(--paper);
  color:var(--ink);
  font:500 1rem var(--body);
}
.history-readings { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr); align-items:center; gap:32px; padding-block:24px; }
.history-specimen { display:grid; grid-template-columns:1fr 1fr; align-items:end; gap:24px; background:var(--accent); color:var(--paper); border-radius:18px; padding:32px; }
.history-latest p { margin:0; font-weight:550; line-height:1.3; }
.history-latest div { margin:12px 0 4px; white-space:nowrap; }
.history-latest strong { font:550 clamp(38px,4vw,60px)/1 var(--display); letter-spacing:-.065em; }
.history-latest time, .history-years, .history-y, .history-latest span { color:var(--tone,var(--tint)); }
.history-latest time, .history-latest span { font-size:.875rem; }
.history-chart { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:stretch; gap:4px 8px; font:500 11px/1 var(--body); font-variant-numeric:tabular-nums; }
.history-chart svg { display:block; width:100%; height:80px; overflow:visible; }
.history-y { display:flex; flex-direction:column; justify-content:space-between; padding-block:3px; }
.history-years { display:flex; justify-content:space-between; grid-column:2; }
.history-grid, .history-line { fill:none; stroke:currentColor; vector-effect:non-scaling-stroke; }
.history-grid { opacity:.35; stroke-width:1; stroke-dasharray:2 4; }
.history-line { stroke:var(--history-series,currentColor); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.history-chart circle { fill:var(--history-series,var(--paper)); }
.history-readings table { width:100%; border-collapse:collapse; font-size:var(--read,1rem); }
.history-readings caption { text-align:left; font-weight:650; padding-bottom:8px; }
.history-readings th, .history-readings td { padding:8px 0; border-bottom:1px solid var(--line); text-align:left; font-variant-numeric:tabular-nums; }
.history-readings thead th { font-size:.8rem; font-weight:500; color:var(--secondary,var(--muted)); }
.history-readings tbody th { font-weight:500; white-space:nowrap; }
.history-readings .history-value { text-align:right; white-space:nowrap; }
.history-foot { align-items:center; }
.history-note { color:var(--secondary,var(--muted)); margin:0; max-width:51ch; font-size:.875rem; line-height:1.5; }
.history-note a, .history-action { color:var(--accent); text-underline-offset:3px; }
.history-note a { text-decoration:underline; }
.history-action { display:inline-flex; align-items:center; gap:12px; min-height:44px; font-weight:650; text-decoration:none; }
.history-action:hover { text-decoration:underline; }
@container (max-width:920px) {
  .history-specimen { grid-template-columns:1fr; align-items:start; padding:24px; }
}
@container (max-width:640px) {
  .history-readings { grid-template-columns:1fr; gap:24px; }
  .history-specimen { grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:end; gap:16px; }
}
@container (max-width:440px) {
  .history-specimen { grid-template-columns:1fr; gap:16px; padding:20px; }
  .history-chart svg { height:68px; }
  .history-foot { row-gap:4px; }
}
@media print { wf-result-history { display:none; } }
