#weight-explorer { margin-top: 1.25rem; min-width: 0; }
#weight-explorer p { overflow-wrap: anywhere; }
.weight-ranges { display: flex; flex-wrap: wrap; gap: .5rem; }
.weight-ranges button { min-width: max(44px, calc(3ch + 1rem)); min-height: 44px; flex: 1 0 auto; width: auto; padding: .5rem; white-space: nowrap; }
.weight-ranges [aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: -2px; }
/* S40 (design spec 1.8): the chart is 200px tall on a phone and 280px on a
   desktop; the layout pass reads this height and draws into it. Its labels
   keep 16px (20px with enlarged text): the Ledger floor is 13px, and
   test_browser_weight_explorer holds a stricter 16px here, so the stricter
   one stands. */
#weight-explorer-plot svg { display: block; width: 100%; height: 200px; overflow: visible; color: inherit; }
#weight-explorer-plot text { fill: var(--ink-3); font-size: 1rem; font-variant-numeric: tabular-nums lining-nums; }
.weight-date-labels { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; font-size: 1rem; color: var(--ink-3); }
.weight-date-labels span { overflow-wrap: anywhere; }
/* S40: the weigh-in chart's first, middle and last dates, clear of the label
   column on the right; the last is the latest and reads in ink. */
#weight-explorer-plot .weight-date-labels {
  display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: space-between; gap: .5rem;
  padding-right: var(--plot-gutter, 0px); font-variant-numeric: tabular-nums lining-nums;
}
#weight-explorer-plot .weight-date-labels span:nth-child(2) { text-align: center; }
#weight-explorer-plot .weight-date-labels span:last-child { text-align: right; }
#weight-explorer-plot .weight-date-labels .is-latest { color: var(--ink); font-weight: var(--fw-semibold); }
/* Hit targets stay 44px and invisible at every width. */
#weight-explorer-plot .weight-point-hit { fill: transparent; cursor: pointer; stroke: transparent; pointer-events: all; }
#weight-explorer-plot .weight-point-hit:focus { outline: none; }
/* Hairlines only: no vertical grid, no axis lines. */
#weight-explorer-plot .weight-grid { stroke: var(--border); stroke-width: 1px; }
/* One series: ink, 1.75px, round joins, straight segments. No area, no
   gradient, no hue. */
#weight-explorer-plot .weight-measured-line {
  fill: none; stroke: var(--ink); stroke-width: 1.75px; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; pointer-events: none;
}
.is-entering #weight-explorer-plot .weight-measured-line { stroke-dasharray: 1; animation: draw var(--dur-fill) var(--ease) both; }
/* Points: 2px --ink-4 dots at 1M, none at 3M and longer (`is-dense`); the
   latest and the selected weigh-in are a 5px ink dot with a 2px surface ring.
   The radii are attributes set by weight-explorer.js. */
#weight-explorer-plot .weight-point-marker { fill: var(--ink-4); stroke: none; pointer-events: none; }
#weight-explorer-plot svg.is-dense .weight-point-marker { visibility: hidden; }
#weight-explorer-plot .weight-point-marker:is(.is-latest, .selected),
#weight-explorer-plot svg.is-dense .weight-point-marker:is(.is-latest, .selected) {
  visibility: visible; fill: var(--ink); stroke: var(--surface); stroke-width: 2px;
}
/* Keyboard focus: a hollow 3px ring, so the focused point is visible before
   it is selected. */
#weight-explorer-plot .weight-point-hit:focus-visible + .weight-point-marker,
#weight-explorer-plot svg.is-dense .weight-point-hit:focus-visible + .weight-point-marker {
  visibility: visible; fill: var(--surface); stroke: var(--ink); stroke-width: 3px; rx: 6px; ry: 6px;
}
/* The selected point's hairline and value chip. */
#weight-explorer-plot .weight-selection-rule { stroke: var(--border-strong); stroke-width: 1px; pointer-events: none; }
#weight-explorer-plot .weight-selection-chip { pointer-events: none; }
#weight-explorer-plot .weight-selection-chip rect { fill: var(--ink); }
#weight-explorer-plot .weight-selection-chip text { fill: var(--surface); font-weight: var(--fw-semibold); }
#weight-explorer-list { padding-left: 1.5rem; max-height: 24rem; overflow-y: auto; }
#weight-explorer-list button { min-height: 44px; white-space: normal; overflow-wrap: anywhere; width: 100%; text-align: left; margin-bottom: .5rem; }
#weight-explorer summary { min-height: 44px; padding-block: .75rem; cursor: pointer; }
#weight-explorer button:focus-visible, #weight-explorer summary:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
#weight-explorer-summary { color: var(--ink-3); font-size: var(--fs-label); font-weight: var(--fw-regular); }
@media (min-width: 64rem) {
  #weight-explorer-plot svg { height: 280px; }
}
