/* health.css - "Devices & health data" (patient dashboard) and the "Link a device" panel of the wizard pulse step.
   Self-contained on purpose: it only reads the colour variables app.css defines (with fallbacks). */
.hd-section { margin-top: 2rem; scroll-margin-top: 5rem; }
.hd-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 15rem); gap: 1rem; align-items: center; margin-bottom: 1rem; }
.hd-intro p { margin: .25rem 0 0; font-size: .88rem; color: var(--stone-600, #57534e); line-height: 1.6; }
.hd-intro img { width: 100%; height: auto; border-radius: .75rem; display: block; }
.hd-banner { border-radius: .6rem; padding: .6rem .85rem; font-size: .85rem; margin-bottom: .8rem; border: 1px solid #a7f3d0; background: #f0fdf4; color: #065f46; }
.hd-banner.is-warn { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.hd-banner.is-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

.hd-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.hd-card { background: #fff; border: 1px solid var(--stone-200, #e7e5e4); border-radius: .85rem; padding: 1rem; min-width: 0; display: flex; flex-direction: column; gap: .55rem; overflow-wrap: anywhere; }
.hd-card h4 { margin: 0; font-size: .95rem; color: var(--emerald-800, #065f46); display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.hd-card p { margin: 0; font-size: .8rem; line-height: 1.55; color: var(--stone-600, #57534e); }
.hd-card .hd-honest { font-size: .74rem; color: var(--color-muted, #78716c); }
.hd-card .hd-honest strong { color: var(--stone-700, #44403c); }
.hd-pill { font-size: .68rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: #f1f5f9; color: #475569; }
.hd-pill.is-on { background: #d1fae5; color: #047857; }
.hd-pill.is-warn { background: #fef3c7; color: #92400e; }
.hd-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; }
.hd-status { font-size: .78rem; min-height: 1.1rem; color: var(--stone-600, #57534e); }
.hd-status.is-error { color: #b91c1c; }
.hd-status.is-ok { color: #047857; }
.hd-token { display: flex; gap: .4rem; align-items: stretch; }
.hd-token input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .74rem; }
.hd-code { background: #1c1917; color: #f5f5f4; border-radius: .5rem; padding: .6rem .7rem; font-size: .72rem; overflow-x: auto; white-space: pre; margin: .3rem 0 0; }
.hd-steps { font-size: .8rem; line-height: 1.6; color: var(--stone-700, #44403c); padding-left: 1.2rem; margin: .4rem 0 0; }
.hd-steps li { margin-bottom: .3rem; }
.hd-details summary { cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--emerald-700, #047857); }

.hd-latest { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; margin-top: .6rem; }
.hd-vital { background: #fff; border: 1px solid var(--stone-200, #e7e5e4); border-radius: .7rem; padding: .6rem .7rem; }
.hd-vital b { display: block; font-size: 1.1rem; color: var(--emerald-700, #047857); }
.hd-vital span { font-size: .7rem; color: var(--color-muted, #78716c); display: block; }
.hd-table-wrap { overflow-x: auto; margin-top: .4rem; }
.hd-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.hd-table th, .hd-table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--stone-100, #f5f5f4); white-space: nowrap; }
.hd-table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-muted, #78716c); }
.hd-manual { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: .4rem; align-items: end; margin-top: .5rem; }
.hd-danger { color: #b91c1c; }

/* wizard pulse step */
.hc-panel { margin-top: 1rem; border: 1px dashed var(--emerald-500, #10b981); border-radius: .85rem; padding: .9rem 1rem; background: #f8fffb; }
.hc-panel h4 { margin: 0 0 .2rem; font-size: .95rem; color: var(--emerald-800, #065f46); }
.hc-hint { margin: 0 0 .6rem; font-size: .78rem; color: var(--stone-600, #57534e); }
.hc-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.hc-status { margin-top: .55rem; font-size: .8rem; min-height: 1.1rem; color: var(--stone-700, #44403c); }
.hc-status.is-error { color: #b91c1c; }
.hc-status.is-ok { color: #047857; }
.hc-bar { height: .35rem; background: #d1fae5; border-radius: 999px; overflow: hidden; margin-top: .4rem; }
.hc-bar > i { display: block; height: 100%; width: 0; background: var(--emerald-500, #10b981); transition: width .4s linear; }
.hc-vitals { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.hc-chip { font-size: .74rem; background: #fff; border: 1px solid #a7f3d0; color: #065f46; border-radius: 999px; padding: .15rem .6rem; }
.hc-help { margin-top: .5rem; font-size: .76rem; color: var(--stone-600, #57534e); }
.hc-help summary { cursor: pointer; font-weight: 600; color: var(--emerald-700, #047857); }
.hc-help p { margin: .35rem 0 0; line-height: 1.5; }

@media (max-width: 760px) {
  .hd-cards { grid-template-columns: minmax(0, 1fr); }
  .hd-intro { grid-template-columns: minmax(0, 1fr); }
  .hd-manual { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .hc-bar > i { transition: none; } }
