/* =====================================================================
 * HOMECARE — Home Health view (M04 PART 03)
 * ---------------------------------------------------------------------
 * Mobile-first presentation for #/my-unit/home-health: the health
 * score card, the component breakdown rows with lightweight CSS meter
 * bars (no chart libraries) and the prioritized issue list.
 * Token-only styling, 44px touch targets where interactive, wrapping
 * values, no horizontal overflow, small-screen compaction.
 * =================================================================== */

.hc-health-page {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-4);
  padding-bottom: var(--hc-space-6);
}

/* ---- Page heading --------------------------------------------------- */

.hc-health-heading h2 {
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-2xl);
  font-weight: var(--hc-font-weight-bold);
  letter-spacing: var(--hc-letter-tight);
}

.hc-health-heading p {
  margin-top: var(--hc-space-1);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
}

/* ---- Context hero (matches the My Unit hero pattern) ---------------- */

.hc-health-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hc-space-3);
  padding: var(--hc-space-4);
  background: var(--hc-bg-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius-lg);
  box-shadow: var(--hc-shadow-sm);
}

.hc-health-hero__main {
  min-width: 0;
}

.hc-health-hero__eyebrow {
  color: var(--hc-text-faint);
  font-size: var(--hc-font-size-xs);
  font-weight: var(--hc-font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hc-health-hero__property {
  margin-top: var(--hc-space-1);
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-lg);
  font-weight: var(--hc-font-weight-semibold);
  overflow-wrap: anywhere;
}

.hc-health-hero__location {
  margin-top: var(--hc-space-1);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
  overflow-wrap: anywhere;
}

.hc-health-hero__side {
  flex-shrink: 0;
}

.hc-health-hero__note {
  display: flex;
  align-items: flex-start;
  gap: var(--hc-space-2);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
}

.hc-health-hero__note-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---- Sections -------------------------------------------------------- */

.hc-health-region {
  min-width: 0;
}

.hc-health-section {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-2);
}

.hc-health-section__note {
  margin: 0;
}

/* ---- Score card ------------------------------------------------------- */

.hc-health-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hc-space-3);
  padding: var(--hc-space-4);
}

.hc-health-score__main {
  display: grid;
  gap: var(--hc-space-1);
  min-width: 0;
}

.hc-health-score__value {
  margin: 0;
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-2xl);
  font-weight: var(--hc-font-weight-bold);
  letter-spacing: var(--hc-letter-tight);
}

.hc-health-score__hint {
  margin: 0;
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-xs);
  overflow-wrap: anywhere;
}

.hc-health-score__label {
  flex-shrink: 0;
}

/* ---- Component breakdown ---------------------------------------------- */

.hc-health-components {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-4);
  padding: var(--hc-space-4);
}

.hc-health-component {
  display: grid;
  gap: var(--hc-space-2);
}

.hc-health-component__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--hc-space-2);
}

.hc-health-component__label {
  margin: 0;
  color: var(--hc-text-strong);
  font-weight: var(--hc-font-weight-semibold);
  font-size: var(--hc-font-size-sm);
  overflow-wrap: anywhere;
}

.hc-health-component__weight {
  color: var(--hc-text-faint);
  font-size: var(--hc-font-size-xs);
  font-weight: var(--hc-font-weight-normal);
  margin-left: var(--hc-space-1);
}

.hc-health-component__value {
  margin: 0;
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
  flex-shrink: 0;
}

/* Lightweight meter bar — CSS only, no chart library. */
.hc-health-bar {
  width: 100%;
  height: 8px;
  border-radius: var(--hc-radius-pill);
  background: var(--hc-bg-muted);
  overflow: hidden;
}

.hc-health-bar__fill {
  height: 100%;
  border-radius: var(--hc-radius-pill);
}

.hc-health-bar__fill--success {
  background: var(--hc-success-500);
}

.hc-health-bar__fill--warning {
  background: var(--hc-warning-500);
}

.hc-health-bar__fill--danger {
  background: var(--hc-danger-500);
}

/* ---- Issue list --------------------------------------------------------- */

.hc-health-issues {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-2);
  margin: 0;
  padding: var(--hc-space-3);
  list-style: none;
}

.hc-health-issue {
  display: flex;
  align-items: center;
  gap: var(--hc-space-3);
  padding: var(--hc-space-2) 0;
}

.hc-health-issue + .hc-health-issue {
  border-top: 1px solid var(--hc-border);
}

.hc-health-issue__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--hc-radius-md);
  background: var(--hc-bg-muted);
  color: var(--hc-text-muted);
}

.hc-health-issue__icon .hc-icon {
  width: 18px;
  height: 18px;
}

.hc-health-issue__skeleton-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.hc-health-issue__main {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.hc-health-issue__title {
  display: inline-flex;
}

.hc-health-issue__name {
  color: var(--hc-text-strong);
  font-weight: var(--hc-font-weight-semibold);
  font-size: var(--hc-font-size-sm);
  overflow-wrap: anywhere;
}

.hc-health-issue__meta {
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-xs);
  overflow-wrap: anywhere;
}

.hc-health-issue__action {
  flex-shrink: 0;
}

.hc-health-issue__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--hc-touch-target, 44px);
  padding: 0 var(--hc-space-2);
  background: none;
  border: none;
  color: var(--hc-primary-600, var(--hc-text-strong));
  font-size: var(--hc-font-size-sm);
  font-weight: var(--hc-font-weight-semibold);
  text-decoration: underline;
  cursor: pointer;
}

/* ---- Small-screen compaction (no horizontal overflow) ------------------- */

@media (max-width: 359px) {
  .hc-health-score {
    flex-direction: column;
    align-items: flex-start;
  }

  .hc-health-issue {
    flex-wrap: wrap;
  }

  .hc-health-issue__action {
    width: 100%;
  }

  .hc-health-issue__link {
    width: 100%;
    justify-content: flex-start;
    padding-left: 0;
  }
}
