.health-view .health-consent { max-width: 850px; padding-top: 14px; }
.health-consent p { margin: 14px 0; }
.health-consent fieldset { border: 0; padding: 0; margin: 18px 0; }
.health-consent legend { font-weight: 800; margin-bottom: 10px; }
.health-categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.health-category { display: flex; gap: 9px; align-items: flex-start; padding: 12px; background: #f4f0ff; border-radius: 12px; cursor: pointer; }
.health-category span { min-width: 0; }
.health-category small { display: block; color: #575550; line-height: 1.5; font-size: .875rem; margin-top: 4px; }
.health-category input, .health-share input { flex-shrink: 0; width: 20px; height: 20px; accent-color: #43089f; margin-top: 3px; }
.health-field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 800; }
.health-field select, .health-field input { min-height: 44px; min-width: 0; padding: 9px 12px; border: 1.5px solid #171713; border-radius: 10px; font: inherit; font-size: 1rem; color: #171713; background: white; }
.health-field select:focus-visible { outline: 3px solid #43089f; outline-offset: 3px; }
.health-consent > .health-field { max-width: 350px; }
.health-share { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0; line-height: 1.5; }
.health-toolbar { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(155px, 1fr) minmax(140px, 1fr) auto; align-items: end; gap: 12px; }
.health-chart { margin: 0 0 16px; padding: 12px 16px; border: 1.5px solid #171713; border-radius: 18px; background: #fff; }
.health-chart svg { width: 100%; height: auto; min-height: 130px; display: block; }
.health-chart figcaption { color: #575550; font-size: .875rem; line-height: 1.5; }
.health-table-wrap { overflow: auto; border: 1px solid #d2cdc5; border-radius: 14px; }
.health-table-wrap table { width: 100%; border-collapse: collapse; text-align: left; background: #fff; font-size: .9rem; }
.health-table-caption { text-align: left; padding: 12px; font-weight: 800; }
.health-table-wrap th { background: #eee9ff; }
.health-table-wrap td, .health-table-wrap th { padding: 12px; border-bottom: 1px solid #e7e1d8; vertical-align: top; }
.health-table-wrap td { overflow-wrap: anywhere; min-width: 125px; }
.health-pagination { margin-top: 16px; }
.health-empty { padding: 20px; background: #eee9ff; border-radius: 14px; line-height: 1.6; }
.health-overview { margin: 28px 0 40px; }
.health-view #notice:empty { display: none; }
.health-viewer-status { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; border: 0; border-bottom: 1px solid #d2cdc5; border-radius: 0; background: none; padding: 12px 0; margin: 12px 0 20px; font-size: .875rem; }
.health-viewer-status #last-sync { color: #575550; }
.health-viewer-status #phone-status:empty, .health-viewer-status .route-actions:has(> button[hidden]):not(:has(> button:not([hidden]))) { display: none; }
.health-view h2 { font-size: 1.4rem; margin: 0; }
.health-badge { border-radius: 20px; background: #dcf4e6; color: #24593d; padding: 6px 12px; font-size: .875rem; font-weight: 800; }
.health-overview-stats { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 14px; margin: 18px 0 30px; }
.health-overview-stats > div { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid #d2cdc5; border-radius: 16px; background: #fff; }
.health-overview-stats > div:first-child { background: #eee9ff; border-color: #c1b0ff; }
.health-overview-stats span { font-size: .9rem; font-weight: 800; }
.health-overview-stats strong { font-size: 2rem; line-height: 1.2; }
.health-overview-stats .health-period { font-size: 1.15rem; line-height: 1.4; }
.health-overview-stats small { color: #575550; font-size: .875rem; }
.health-overview-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.health-overview-heading p { margin: 8px 0 0; color: #575550; }
.health-overview-heading .health-field { flex: 0 0 260px; }
.health-measurement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.health-measurement-card { display: flex; flex-direction: column; padding: 20px; border: 1.5px solid #d2cdc5; border-radius: 18px; background: #fff; min-width: 0; }
.health-measurement-card h3 { margin: 4px 0 18px; font-size: 1.125rem; }
.health-measurement-card .health-card-group { margin: 0; color: #684798; font-size: .875rem; font-weight: 800; }
.health-card-value { font-size: 1.65rem; line-height: 1.3; overflow-wrap: anywhere; }
.health-measurement-card .health-card-caption { margin: 5px 0 0; color: #575550; font-size: .875rem; }
.health-measurement-card figure { margin: 18px 0; padding: 6px 0; background: linear-gradient(#fff, #f6f3ff); border-bottom: 1px solid #eee9ff; }
.health-measurement-card svg { display: block; width: 100%; height: 95px; }
.health-measurement-card figcaption { color: #575550; font-size: .875rem; padding: 6px 0 0; }
.health-measurement-card .health-card-coverage { margin: auto 0 16px; padding-top: 12px; font-size: .875rem; color: #575550; }
.health-measurement-card button { width: 100%; background: #f4f0ff; }
.health-record-note { background: #f4f0ff; border-radius: 10px; padding: 16px; color: #575550; font-size: .9rem; }
.health-detail { border-top: 2px solid #d2cdc5; padding-top: 28px; scroll-margin-top: 20px; }
.health-detail > .route-heading { margin-bottom: 20px; }
.health-detail .eyebrow { margin: 0 0 6px; }
@media (max-width: 900px) { .health-measurement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .health-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-overview-stats > div:last-child { grid-column: 1 / -1; }
  .health-overview-heading { display: block; }
  .health-overview-heading .health-field { margin-top: 18px; }
  .health-measurement-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) { .health-toolbar, .health-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .health-categories { grid-template-columns: 1fr; } .health-toolbar { grid-template-columns: 1fr; } .health-table-wrap td, .health-table-wrap th { padding: 10px; } }

.health-group { border: 1px solid #d2cdc5; border-radius: 12px; overflow: hidden; align-self: start; }
.health-group summary { padding: 14px; font-weight: 800; cursor: pointer; background: #eee9ff; }
.health-category { border-radius: 0; background: #fff; border-top: 1px solid #eee9ff; }
.health-category[hidden] { display: none; }
.health-category:has(input:disabled) { opacity: .55; }
.health-consent #type-search { margin-bottom: 12px; }
#record-dialog { width: min(1000px, 92vw); max-height: 85vh; border: 2px solid #171713; border-radius: 18px; padding: 22px; }
#record-dialog::backdrop { background: #17171399; }
#record-content { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 55vh; overflow: auto; background: #f4f0ff; padding: 16px; }
