/* Health & Routine — "Your health" (spec 2026-11-19). Byte-identical between frontend/ and chinese/.
   Colours are the Finance palette, already checked for the standard and cozy modes and for colour-blind reading;
   a1/a2 sit next to each other on the blood-pressure graph, which is the pair that check passed. Nothing here is
   red-for-bad or green-for-good: a reference line is a neutral rule, a note is a sentence. Rules are prefixed with
   the section so cozy's element rules do not outrank them. */
#health {
  --hl-surface: #0f172a; --hl-ink: #c3c2b7; --hl-grid: rgba(137, 135, 129, 0.28);
  --hl-rule: #aaa89f; --hl-band: rgba(137, 135, 129, 0.16);
  --hl-a1: #3987e5; --hl-a2: #d95926; --hl-a3: #199e70; --hl-a4: #c98500;
  margin-bottom: var(--space-8, 2rem);
}
[data-ux-mode="cozy"] #health {
  --hl-surface: #FFFBF2; --hl-ink: #5A5540; --hl-grid: rgba(166, 130, 85, 0.25);
  --hl-rule: #6b6a66; --hl-band: rgba(166, 130, 85, 0.16);
  --hl-a1: #2a78d6; --hl-a2: #eb6834; --hl-a3: #1baf7a; --hl-a4: #eda100;
}
#health .hl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
#health .hl-title { margin: 0; font-size: var(--text-xl, 1.35rem); }
#health .hl-range { display: flex; flex-wrap: wrap; gap: 0.4rem; }
#health .hl-chip { min-height: 44px; }
#health .hl-chip[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: 1px; }
#health .hl-consent, #health .hl-card, #health .hl-settings {
  border: 1px solid var(--border-subtle, rgba(137, 135, 129, 0.3)); border-radius: 16px; padding: 1rem 1.1rem;
}
#health .hl-consent p { line-height: 1.6; margin: 0 0 1rem; max-width: 70ch; }
#health .hl-failed { color: var(--fg-muted); }
#health .hl-week { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.4rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
#health .hl-week__item { display: flex; flex-direction: column; }
#health .hl-week__name { font-weight: 600; }
#health .hl-week__text { color: var(--fg-muted); font-size: var(--text-sm, 0.9rem); }
#health .hl-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
#health .hl-card { min-width: 0; }
#health .hl-card__name { margin: 0 0 0.35rem; font-size: var(--text-lg, 1.1rem); }
#health .hl-card__latest { margin: 0 0 0.6rem; font-weight: 600; }
#health .hl-chart { position: relative; height: 220px; margin: 0.25rem 0 0.5rem; }
#health .hl-note { border-left: 3px solid var(--hl-rule); padding: 0.1rem 0 0.1rem 0.8rem; margin: 0 0 0.75rem; }
#health .hl-note--urgent { border-left-width: 5px; border-left-color: currentColor; font-weight: 600; }
#health .hl-note__text { margin: 0 0 0.25rem; line-height: 1.55; }
#health .hl-note__source, #health .hl-level { margin: 0 0 0.4rem; color: var(--fg-muted); font-size: var(--text-sm, 0.9rem); line-height: 1.5; }
#health .hl-source { overflow-wrap: anywhere; text-decoration: underline; }
/* The site's .btn sets a display; without this a hidden button stays on screen. */
#health [hidden] { display: none !important; }
#health .hl-card__actions { margin: 0.75rem 0 0.5rem; }
#health .hl-card__actions .btn, #health .hl-form .btn, #health .hl-settings .btn, #health .hl-consent .btn { min-height: 44px; }
/* align-items: end — a caption that wraps to two lines ("Lower number (diastolic)" at phone width) must not push its
   box below its neighbour's. */
#health .hl-form { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin: 0.5rem 0 0.75rem; }
#health .hl-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
#health .hl-field__label { font-size: var(--text-sm, 0.9rem); color: var(--fg-muted); }
#health .hl-field .form-control { min-height: 44px; width: 100%; box-sizing: border-box; font: inherit; color: inherit;
  padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--text, #e2e8f0) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--text, #e2e8f0) 18%, transparent); }
#health .hl-field .form-control:focus { outline: 2px solid var(--accent-purple, #8b5cf6); outline-offset: 1px; }
[data-ux-mode="cozy"] #health .hl-field .form-control { background: #fff; border-color: rgba(90, 74, 58, .3); }
#health .hl-form__error { grid-column: 1 / -1; margin: 0; font-weight: 600; }
#health .hl-form__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* display stays list-item so the disclosure triangle shows: these read as things to open. */
#health details > summary { cursor: pointer; padding: 0.65rem 0; line-height: 1.5; min-height: 44px; box-sizing: border-box; }
#health .hl-table table { width: 100%; border-collapse: collapse; font-size: var(--text-sm, 0.9rem); }
#health .hl-table th, #health .hl-table td { text-align: left; padding: 0.3rem 0.5rem 0.3rem 0; border-bottom: 1px solid var(--hl-grid); }
#health .hl-howto ul, #health .hl-rows ul { margin: 0.25rem 0 0.5rem; padding-left: 1.1rem; line-height: 1.55; }
#health .hl-rows ul { list-style: none; padding-left: 0; }
#health .hl-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; border-bottom: 1px solid var(--hl-grid); }
#health .hl-row .btn { min-height: 44px; }
#health .hl-settings { margin-top: 1rem; }
#health .hl-kinds { border: 0; padding: 0; margin: 0.5rem 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
#health .hl-kind { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; }
#health .hl-kind input { width: 20px; height: 20px; }
#health .hl-profile { display: inline-flex; align-items: center; min-height: 44px; }
#health .hl-settings__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
@media (max-width: 480px) {
  #health .hl-chart { height: 200px; }
  #health .hl-consent, #health .hl-card, #health .hl-settings { padding: 0.9rem; }
}
