/* tracking · area styles (vitals, heart, blood pressure, logging, activity, sleep, devices) */

.tr-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tr-target {
  display: flex;
  gap: var(--s2);
  align-items: flex-start;
  padding: 10px var(--s3);
  border-radius: var(--r-sm);
  background: var(--accent-tint);
  font-size: var(--fs-sub);
  line-height: 1.4;
}
.tr-target .ic {
  color: var(--accent-ink);
  margin-top: 1px;
}
.hc .tr-target {
  box-shadow: inset 0 0 0 1px var(--slate-300);
}

/* Three numbers in a row (lowest / average / highest) */
.tr-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
}
.tr-trio > div + div {
  border-left: 0.5px solid var(--line);
  padding-left: var(--s3);
}
.tr-trio dt {
  font-size: var(--fs-foot);
  font-weight: 600;
  color: var(--text-2);
}
.tr-trio dd {
  margin-top: 4px;
  white-space: nowrap;
}
.tr-trio .metric {
  font-size: calc(24px * var(--tt));
}
.tr-trio .unit {
  font-size: var(--fs-foot);
}
.ts-xl .tr-trio,
.ts-ax .tr-trio {
  grid-template-columns: minmax(0, 1fr);
}
.ts-xl .tr-trio > div + div,
.ts-ax .tr-trio > div + div {
  border-left: 0;
  padding-left: 0;
  border-top: 0.5px solid var(--line);
  padding-top: var(--s3);
}

/* Log a reading */
.tr-bp-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
}
.tr-bp-pair .field + .field {
  margin-top: 0;
}
.tr-bp-pair + .field,
[data-log-form] > .field + .field {
  margin-top: var(--s4);
}
.ts-xl .tr-bp-pair,
.ts-ax .tr-bp-pair {
  grid-template-columns: minmax(0, 1fr);
}
.ts-xl .tr-bp-pair .field + .field,
.ts-ax .tr-bp-pair .field + .field {
  margin-top: var(--s4);
}
[data-log-form] .tr-bp-pair .input,
[data-log-form] #bp-pulse {
  font-size: var(--fs-t2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
[data-log-form] input[type="time"].input {
  font-variant-numeric: tabular-nums;
}

/* Saved reading */
.tr-saved {
  margin-top: var(--s6);
  padding: 0 var(--gutter);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tr-saved .t2:focus {
  outline: none;
}
.tr-check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--ok-tint);
  color: var(--ok-icon);
}
.tr-check.urgent {
  background: var(--danger-tint);
  color: var(--danger);
}
.hc .tr-check {
  box-shadow: inset 0 0 0 2px currentColor;
}

/* Activity rings */
.tr-rings {
  display: flex;
  align-items: center;
  gap: var(--s5);
}
.tr-rings-svg {
  flex: none;
}
.tr-ring-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.tr-ring-legend dt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-foot);
  font-weight: 600;
  color: var(--text-2);
}
.tr-ring-legend dt i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.tr-ring-legend dd {
  margin-top: 2px;
  white-space: nowrap;
}
.tr-ring-legend .metric {
  font-size: calc(24px * var(--tt));
}
.ts-ax .tr-rings {
  flex-direction: column;
  align-items: flex-start;
}
.tr-meter {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-sunken);
  overflow: hidden;
}
.tr-meter span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--data-activity);
}
.hc .tr-meter {
  box-shadow: inset 0 0 0 1px var(--slate-400);
}

/* Sleep */
.tr-stage-legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tr-stage-legend li {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 34px;
  font-size: var(--fs-sub);
  border-top: 0.5px solid var(--line);
}
.tr-stage-legend li:first-child {
  border-top: 0;
}
.tr-stage-legend i {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}
.tr-week-dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.tr-week-dots span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 40px;
  border-radius: 50%;
  background: var(--surface-sunken);
  font-size: var(--fs-cap);
  color: var(--text-2);
}
.tr-week-dots span.on {
  background: var(--data-sleep);
  color: #fff;
}
.tr-week-dots b {
  font-weight: 600;
}

/* Devices */
.tr-batt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  font-size: var(--fs-sub);
}

/* Pairing */
.tr-pair-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--s10) var(--s6) var(--s6);
}
.tr-radar {
  position: relative;
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
}
.tr-radar b {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(160deg, var(--navy-600), var(--teal-700));
  box-shadow: 0 14px 32px -14px rgba(19, 34, 79, 0.6);
}
.tr-radar span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  opacity: 0;
  animation: tr-radar-pulse 2.4s var(--ease-out) infinite;
}
.tr-radar span:nth-child(2) {
  animation-delay: 0.8s;
}
.tr-radar span:nth-child(3) {
  animation-delay: 1.6s;
}
.tr-radar.busy b::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  border-right-color: transparent;
  animation: spin 900ms linear infinite;
}
.tr-radar.found b {
  background: linear-gradient(160deg, var(--teal-600), var(--green-700));
}
@keyframes tr-radar-pulse {
  0% {
    transform: scale(0.45);
    opacity: 0.9;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tr-radar span {
    animation: none;
    opacity: 0.35;
    transform: scale(0.8);
  }
  .tr-radar span:nth-child(2) {
    transform: scale(1);
  }
  .tr-radar.busy b::after {
    animation: none;
  }
}

/* The blood pressure hero: value and status pill on one line. */
.tr-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
}
.tr-hero-row .pill {
  margin-bottom: 6px;
}

/* Reading rows with a status pill: the pill drops under the text at the
   largest sizes. Scoped to my own rows. */
.tr-badge-row .row-main + span > .pill {
  white-space: nowrap;
}
.ts-xl .tr-badge-row,
.ts-ax .tr-badge-row {
  flex-wrap: wrap;
}
.ts-xl .tr-badge-row .row-main + span,
.ts-ax .tr-badge-row .row-main + span {
  flex-basis: 100%;
}
