/* ============================================================
   topdevphone — Health app styles
   Activity rings, session-trend sparkline, tip cards.
   Colours come from the shared accent tokens so dark AND light
   themes stay correct; nothing here hardcodes a grey.
   ============================================================ */

.hl-scroll { padding-top: 2px; }

/* ---------- state banners ---------- */
.hl-banner {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius-card);
  padding: 11px 13px; margin-bottom: 14px;
  font-size: 13px;
}
.hl-banner.loading {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}
.hl-banner.error {
  background: color-mix(in srgb, var(--accent-red) 16%, var(--bg-secondary));
  color: var(--text-primary);
}
.hl-banner-main { flex: 1; min-width: 0; }
.hl-banner-title { font-size: 13.5px; font-weight: 700; }
.hl-banner-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.hl-retry {
  flex: 0 0 auto; font-size: 12.5px; font-weight: 700; color: #fff;
  background: var(--accent-red); border-radius: 10px; padding: 7px 13px;
}
.hl-retry:active { filter: brightness(0.85); }

.hl-spin {
  width: 15px; height: 15px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--separator);
  border-top-color: var(--accent-red);
  animation: hlSpin 0.85s linear infinite;
}
@keyframes hlSpin { to { transform: rotate(360deg); } }

/* ---------- the three activity rings ---------- */
.hl-rings {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-card-lg);
  padding: 16px 8px 14px;
  margin-bottom: 8px;
}

.hl-ring { text-align: center; min-width: 0; }
.hl-ring-dial { position: relative; width: 100%; max-width: 96px; margin: 0 auto; }
.hl-ring svg { width: 100%; height: auto; display: block; transform: rotate(-90deg); }

.hl-track {
  fill: none; stroke-width: 8;
  stroke: color-mix(in srgb, var(--text-secondary) 24%, transparent);
}
.hl-arc {
  fill: none; stroke-width: 8; stroke-linecap: round;
  stroke: var(--hl-color, var(--accent-blue));
  transition: stroke-dashoffset 0.55s cubic-bezier(0.3, 0.9, 0.35, 1);
}

.hl-ring.hunger { --hl-color: var(--accent-green); }
.hl-ring.thirst { --hl-color: var(--accent-blue); }
.hl-ring.stress { --hl-color: var(--accent-red); }

.hl-ring-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.hl-val {
  font-size: 22px; font-weight: 800; letter-spacing: -0.6px;
  color: var(--text-primary); line-height: 1;
}
.hl-val span { font-size: 11px; font-weight: 700; margin-left: 1px; opacity: 0.55; }

.hl-ring-label { font-size: 12.5px; font-weight: 700; margin-top: 9px; }
.hl-ring-note { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }

/* warning state — inverted for stress (see METRICS in health.js) */
.hl-ring.warn .hl-ring-note { color: var(--hl-color); font-weight: 700; }
.hl-ring.warn .hl-arc { animation: hlPulse 1.6s ease-in-out infinite; }
@keyframes hlPulse { 50% { opacity: 0.5; } }

/* explicit "no reading" state — dashed empty track, never a fake full ring */
.hl-ring.na .hl-track {
  stroke-dasharray: 5 7;
  stroke: color-mix(in srgb, var(--text-tertiary) 55%, transparent);
}
.hl-ring.na .hl-arc { stroke: transparent; }
.hl-ring.na .hl-val { color: var(--text-tertiary); font-size: 24px; }
.hl-ring.na .hl-ring-note { color: var(--text-tertiary); }

.hl-na-note {
  font-size: 11.5px; color: var(--text-tertiary);
  text-align: center; margin: 0 6px 10px;
}

/* ---------- cards ---------- */
.hl-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-card-lg);
  padding: 13px 14px;
  margin-bottom: 16px;
}

/* ---------- session trend sparkline ---------- */
.hl-spark { width: 100%; height: 84px; display: block; overflow: visible; }
.hl-grid { stroke: var(--separator); stroke-width: 1; stroke-dasharray: 3 5; }
.hl-line {
  fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.hl-line.hunger { stroke: var(--accent-green); }
.hl-line.thirst { stroke: var(--accent-blue); }
.hl-line.stress { stroke: var(--accent-red); }

.hl-spark-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.hl-legend { display: flex; gap: 10px; flex-wrap: wrap; }
.hl-leg {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
}
.hl-leg i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.hl-leg.hunger i { background: var(--accent-green); }
.hl-leg.thirst i { background: var(--accent-blue); }
.hl-leg.stress i { background: var(--accent-red); }
.hl-spark-meta { font-size: 11px; color: var(--text-tertiary); }

.hl-spark-empty { text-align: center; padding: 22px 16px; }
.hl-spark-empty .ic { width: 30px; height: 30px; opacity: 0.4; margin-bottom: 8px; }
.hl-spark-empty-title { font-size: 13.5px; font-weight: 700; }
.hl-spark-empty-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }

/* ---------- contextual tips ---------- */
.hl-tip {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--bg-secondary);
  border-radius: var(--radius-card);
  border-left: 3px solid var(--hl-tip-color, var(--accent-orange));
  padding: 11px 13px; margin-bottom: 10px;
}
.hl-tip.hunger { --hl-tip-color: var(--accent-green); }
.hl-tip.thirst { --hl-tip-color: var(--accent-blue); }
.hl-tip.stress { --hl-tip-color: var(--accent-red); }
.hl-tip-mark {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--hl-tip-color) 20%, transparent);
  color: var(--hl-tip-color); font-size: 14px;
}
.hl-tip-body { flex: 1; min-width: 0; }
.hl-tip-title { font-size: 13.5px; font-weight: 700; }
.hl-tip-text { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.42; }

.hl-foot {
  font-size: 11.5px; color: var(--text-tertiary);
  text-align: center; padding: 6px 10px 4px; line-height: 1.45;
}

/* ---------- home-screen widget ---------- */
.hl-w { display: flex; justify-content: space-around; gap: 6px; }
.hl-w-item { text-align: center; min-width: 0; }
.hl-w-item svg { width: 44px; height: 44px; display: block; margin: 0 auto; transform: rotate(-90deg); }
.hl-w-item .hl-track { stroke-width: 5; stroke: rgba(255, 255, 255, 0.22); }
.hl-w-item .hl-arc { stroke-width: 5; }
[data-theme='light'] .hl-w-item .hl-track { stroke: rgba(0, 0, 0, 0.14); }
.hl-w-item.hunger { --hl-color: var(--accent-green); }
.hl-w-item.thirst { --hl-color: var(--accent-blue); }
.hl-w-item.stress { --hl-color: var(--accent-red); }
.hl-w-item.na .hl-arc { stroke: transparent; }
.hl-w-item.na .hl-track { stroke-dasharray: 4 6; }
.hl-w-val { font-size: 13px; font-weight: 800; margin-top: 5px; }
.hl-w-label { font-size: 10.5px; opacity: 0.65; margin-top: 1px; }
.hl-w-foot { font-size: 10.5px; opacity: 0.55; text-align: center; margin-top: 9px; }

@media (prefers-reduced-motion: reduce) {
  .hl-arc { transition: none; }
  .hl-ring.warn .hl-arc, .hl-spin { animation: none; }
}
