/* health · area styles (Health hub, chart, labs, medicines, refills, allergies) */

/* A reading set as a list value: the number in body ink, the unit quieter. */
.hl-val {
  color: var(--text);
  font-size: var(--fs-body);
}

/* Facts: a two-column definition list inside a card. */
.hl-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3) var(--s4);
}
.hl-facts dt {
  font-size: var(--fs-foot);
  font-weight: 600;
  color: var(--text-2);
}
.hl-facts dd {
  margin-top: 2px;
  font-size: var(--fs-body);
  font-weight: 500;
}
.ts-xl .hl-facts,
.ts-ax .hl-facts {
  grid-template-columns: minmax(0, 1fr);
}

/* A clinician's words, attributed. */
.hl-quote {
  margin: 0;
  padding: var(--s3) var(--s4);
  border-left: 3px solid var(--accent);
  background: var(--accent-tint);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--fs-callout);
  line-height: 1.45;
  color: var(--text);
}
.hc .hl-quote {
  border-left-color: var(--teal-800);
  box-shadow: inset 0 0 0 1px var(--slate-300);
}

/* Lab value hero */
.hl-lab-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
}
.hl-lab-hero .pill {
  margin-bottom: 6px;
}
.hl-limits {
  display: flex;
  gap: var(--s2);
  align-items: flex-start;
  line-height: 1.45;
}
.hl-limits .ic {
  margin-top: 1px;
  color: var(--text-2);
}

/* My rows with a status pill on the right (hl-badge-row): at the largest text
   sizes the pill drops under the text instead of squeezing it. Scoped to the
   class so no other area's rows are touched. */
.hl-badge-row .row-main + span > .pill {
  white-space: nowrap;
}
.ts-xl .hl-badge-row,
.ts-ax .hl-badge-row {
  flex-wrap: wrap;
}
.ts-xl .hl-badge-row .row-main + span,
.ts-ax .hl-badge-row .row-main + span {
  flex-basis: 100%;
  order: 3;
}
.ts-xl .hl-badge-row.has-ic .row-main + span,
.ts-ax .hl-badge-row.has-ic .row-main + span {
  padding-left: 44px;
}
.ts-xl .hl-badge-row .row-chev,
.ts-ax .hl-badge-row .row-chev {
  order: 2;
}

/* Supply meter */
.hl-supply-track {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-sunken);
  overflow: hidden;
}
.hl-supply-track span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}
.hl-supply.low .hl-supply-track span {
  background: var(--attn-icon);
}
.hl-supply-text {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: 6px;
  font-size: var(--fs-foot);
  color: var(--text-2);
}
.hl-supply-text span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hl-supply.low .hl-supply-text span:last-child {
  color: var(--attn);
  font-weight: 600;
}
.hc .hl-supply-track {
  box-shadow: inset 0 0 0 1px var(--slate-400);
}

/* Medicine card */
.hl-med-card {
  margin: 0 var(--s4);
  padding: var(--s2) var(--s4) var(--s4);
}
.hl-med-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: calc(100% + 2 * var(--s4));
  margin: 0 calc(-1 * var(--s4));
  padding: var(--s3) var(--s4);
  min-height: 60px;
  text-align: left;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  transition: background var(--d-press) var(--ease-out);
}
.hl-med-head:active {
  background: var(--surface-sunken);
}
.hl-med-head .head,
.hl-med-head .sub {
  display: block;
}
.hl-med-head .sub {
  margin-top: 2px;
}
.hl-med-change {
  display: flex;
  gap: var(--s2);
  align-items: flex-start;
  margin-top: var(--s2);
  padding: 10px var(--s3);
  border-radius: var(--r-sm);
  background: var(--info-tint);
  font-size: var(--fs-sub);
  line-height: 1.4;
}
.hl-med-change .ic {
  color: var(--info);
  margin-top: 1px;
}
.hl-med-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
  margin-top: var(--s3);
}
.hl-med-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 0.5px solid var(--line);
}
.hl-refill-line {
  display: flex;
  align-items: center;
  gap: var(--s2);
  width: 100%;
  min-height: var(--tap);
  margin-top: var(--s3);
  padding: 8px var(--s3);
  border-radius: var(--r-sm);
  background: var(--ok-tint);
  color: var(--ok);
  text-align: left;
  font-size: var(--fs-sub);
  line-height: 1.35;
}
.hl-refill-line .foot-t {
  color: var(--text-2);
}
.hc .hl-refill-line {
  box-shadow: inset 0 0 0 1px currentColor;
}

/* Radio rows (pharmacy choice) */
.hl-pharm-row .row-main .pill {
  margin-top: 6px;
}
.hl-radio {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 2px var(--line-strong);
  color: #fff;
}
.hl-radio.on {
  background: var(--brand);
  box-shadow: none;
}

/* Status hl-timeline (refill progress) */
.hl-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}
.hl-timeline li {
  position: relative;
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
}
.hl-timeline li + li::before {
  content: "";
  position: absolute;
  left: 11px;
  top: calc(-1 * var(--s5));
  height: var(--s5);
  width: 2px;
  background: var(--slate-200);
}
.hl-timeline li.now::before,
.hl-timeline li.done::before {
  background: var(--accent);
}
.hl-tl-dot {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: 1px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--slate-300);
  color: #fff;
}
.hl-timeline li.done .hl-tl-dot {
  background: var(--accent);
  box-shadow: none;
}
.hl-timeline li.now .hl-tl-dot {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.hl-timeline li.now .hl-tl-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.hl-timeline li:not(.done):not(.now) .head {
  color: var(--text-2);
  font-weight: 500;
}
.hl-timeline .sub {
  margin-top: 2px;
}
