/* ============================================================
   ReForm — Screen specific styles
   ============================================================ */

/* ---------- Onboarding ---------- */
.onboarding {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 18px 26px calc(30px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(120% 60% at 50% 0%, #FFFFFF 0%, rgba(255,255,255,0) 62%),
    var(--bg);
}
.onboarding__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0 0;
}
.onboarding__art {
  display: grid;
  place-items: center;
  padding: 14px 0 6px;
  flex: 1 1 auto;
  min-height: 200px;
}
.onboarding__art svg {
  width: 100%;
  max-width: 330px;
  height: auto;
  animation: rise 0.7s var(--ease) backwards;
  animation-delay: 0.08s;
}
.onboarding__copy { text-align: left; }
.onboarding__title {
  font-size: 36px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.026em;
  color: var(--navy);
}
.onboarding__sub {
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text-2);
  letter-spacing: -0.008em;
}
.onboarding__actions { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.onboarding__login {
  border: 0;
  background: transparent;
  font-size: 15px;
  color: var(--text-2);
  padding: 12px;
  cursor: pointer;
  min-height: 44px;
}
.onboarding__login b { color: var(--navy); font-weight: 600; }
.onboarding__foot {
  margin-top: 18px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-3);
  text-align: center;
}

/* ---------- Home ---------- */
.home__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 20px;
}
.home__greet { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--navy); line-height: 1.15; }
.home__sub { margin-top: 2px; font-size: 14px; color: var(--text-2); }
.avatar-btn {
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  min-height: 44px;
  min-width: 44px;
  display: grid;
  place-items: center;
}
.avatar-btn:active { transform: scale(0.94); }

.plan-card {
  position: relative;
  padding: 22px;
  border-radius: 28px;
  background: var(--navy);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(11, 59, 130, 0.22);
}
.plan-card::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -60px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(53, 200, 188, 0.30) 0%, rgba(53, 200, 188, 0) 68%);
}
.plan-card::after {
  content: "";
  position: absolute;
  bottom: -90px;
  left: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 70%);
}
.plan-card > * { position: relative; z-index: 1; }
.plan-card__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}
.plan-card__title {
  margin-top: 12px;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
}
.plan-card__meta { margin-top: 6px; font-size: 15px; color: rgba(255, 255, 255, 0.72); }
.plan-card__list { margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.plan-card__item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
}
.plan-card__item svg { color: var(--teal); flex: 0 0 auto; }
.plan-card__cta { margin-top: 20px; }
.plan-card__done { display: flex; align-items: center; gap: 9px; font-size: 15px; color: rgba(255,255,255,.85); }

.motivation {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--navy);
  font-weight: 500;
}
.motivation svg { color: var(--teal); flex: 0 0 auto; }

.clinician-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s var(--ease);
}
.clinician-strip:active { transform: scale(0.985); }
.clinician-strip__name { font-size: 15px; font-weight: 600; color: var(--navy); }
.clinician-strip__meta { font-size: 12.5px; color: var(--text-2); }
.clinician-strip__badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 11.5px;
  font-weight: 600;
}

/* ---------- Exercise detail ---------- */
.detail__hero {
  position: relative;
  display: grid;
  place-items: center;
  padding: 10px 0 4px;
  border-radius: 28px;
  background: linear-gradient(180deg, #F4FBF9 0%, #E8F8F5 100%);
  overflow: hidden;
  min-height: 210px;
}
.detail__hero svg.hero-figure { position: relative; height: 190px; width: auto; }
.privacy__art svg, .escalation__art svg { width: 100%; max-width: 300px; height: auto; margin: 0 auto; }

/* Chat layout — thread scrolls, composer stays visible */
.screen--chat { height: 100%; min-height: 0; }
.thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-right: 2px;
}
.thread::-webkit-scrollbar { display: none; }
.detail__hero-ring {
  position: absolute;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
.detail__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.detail__title { font-size: 27px; font-weight: 600; letter-spacing: -0.022em; color: var(--navy); line-height: 1.15; }
.detail__desc { margin-top: 10px; font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
.cue-list { display: flex; flex-direction: column; gap: 10px; }
.cue { display: flex; gap: 11px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; color: var(--text); }
.cue svg { flex: 0 0 auto; margin-top: 2px; color: var(--teal); }

/* ---------- Live session ---------- */
.session {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 4px var(--pad-x) 24px;
  gap: 12px;
}
.session__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
  text-align: center;
  line-height: 1.2;
}
.session__pillrow { display: flex; justify-content: center; }

.analysis {
  position: relative;
  flex: 1 1 auto;
  min-height: 260px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: linear-gradient(180deg, #F5FAFC 0%, #E9F7F5 100%);
  overflow: hidden;
}
.analysis::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%);
  animation: sweep 4.6s var(--ease-soft) infinite;
  pointer-events: none;
}
.analysis__figure { position: relative; height: 100%; display: grid; place-items: center; }
.analysis__figure svg { height: 100%; max-height: 300px; width: auto; }
.analysis__note {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(11, 59, 130, 0.07);
}
.analysis__note svg { color: var(--teal); }

.joint {
  transform-box: fill-box;
  transform-origin: center;
  animation: jointPulse 2.2s var(--ease-soft) infinite;
}
.joint:nth-of-type(2n) { animation-delay: 0.4s; }
.joint:nth-of-type(3n) { animation-delay: 0.8s; }
.analysis--warn .joint { fill: var(--warning); }
.analysis--escalate .joint { fill: var(--navy); opacity: 0.5; }

.reps { display: flex; flex-direction: column; gap: 10px; }
.reps__head { display: flex; align-items: baseline; justify-content: space-between; }
.reps__count { font-size: 17px; font-weight: 600; color: var(--navy); letter-spacing: -0.012em; }
.reps__count b { font-size: 21px; }
.reps__set { font-size: 13px; color: var(--text-2); }

.session__actions { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 2px; }
.pause-btn {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 8px 22px rgba(11, 59, 130, 0.14), inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.pause-btn:active { transform: scale(0.94); }
.pause-btn__label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }

.overlay-check {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(248, 252, 252, 0.94);
  backdrop-filter: blur(4px);
  animation: fade 0.24s var(--ease);
}
.overlay-check__inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.overlay-check__ring {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--teal-light);
  animation: popIn 0.5s var(--ease);
}
.overlay-check__ring svg { color: var(--teal); }
.overlay-check__text { font-size: 17px; font-weight: 600; color: var(--navy); }
.overlay-check__sub { font-size: 14px; color: var(--text-2); margin-top: -8px; }

/* ---------- Session complete ---------- */
.complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  text-align: center;
  padding: 20px var(--pad-x) 30px;
  gap: 6px;
}
.complete__ring {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--teal-light);
  margin-bottom: 14px;
  animation: popIn 0.62s var(--ease) backwards;
  animation-delay: 0.06s;
}
.complete__ring svg { color: var(--teal); }
.complete__title { font-size: 32px; font-weight: 600; letter-spacing: -0.024em; color: var(--navy); }
.complete__sub { margin-top: 8px; font-size: 16px; color: var(--text-2); }
.complete__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin: 26px 0 4px;
}
.stat {
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--shadow-card);
}
.stat__value { font-size: 24px; font-weight: 600; color: var(--navy); letter-spacing: -0.02em; }
.stat__label { margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.complete__actions { width: 100%; margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Progress ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-muted);
  margin-bottom: 18px;
}
.tab {
  flex: 1 1 0;
  min-height: 40px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.tab.is-active {
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(11, 59, 130, 0.10);
}

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--shadow-card);
}
.stat-row__label { font-size: 14.5px; color: var(--text-2); }
.stat-row__value { font-size: 17px; font-weight: 600; color: var(--navy); }

.ex-progress { display: flex; flex-direction: column; gap: 8px; }
.ex-progress__head { display: flex; align-items: baseline; justify-content: space-between; }
.ex-progress__name { font-size: 15px; font-weight: 600; color: var(--navy); }
.ex-progress__val { font-size: 13.5px; color: var(--text-2); }

/* ---------- Messages ---------- */
.thread {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 8px;
}
.thread__day {
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 0 14px;
}
.thread__context {
  align-self: center;
  max-width: 86%;
  margin-bottom: 12px;
  padding: 9px 14px;
  border-radius: 14px;
  background: var(--blue-soft);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--navy);
  text-align: center;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  border-radius: var(--r-pill);
  background: var(--white);
  box-shadow: var(--shadow-card), inset 0 0 0 1px var(--line);
  min-height: 52px;
}
.composer input {
  flex: 1 1 auto;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15.5px;
  min-height: 32px;
  padding: 6px 0;
}
.composer input::placeholder { color: var(--text-3); }
.send-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--teal);
  color: var(--navy-deep);
  cursor: pointer;
  transition: transform 0.16s var(--ease), opacity 0.2s var(--ease);
}
.send-btn:active { transform: scale(0.92); }
.send-btn:disabled { background: var(--surface-muted); color: var(--text-3); cursor: default; }

/* ---------- Profile ---------- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--r-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
}
.profile-card__name { font-size: 19px; font-weight: 600; color: var(--navy); letter-spacing: -0.015em; }
.profile-card__meta { margin-top: 2px; font-size: 14px; color: var(--text-2); }
.profile-card__week { margin-top: 8px; }

.section-label {
  margin: 22px 0 10px 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- Simple info page ---------- */
.page__lead { font-size: 15.5px; line-height: 1.55; color: var(--text-2); margin-bottom: 18px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; }
.field + .field { box-shadow: inset 0 1px 0 var(--line); }
.field__label { font-size: 14.5px; color: var(--text-2); }
.field__value { font-size: 15px; font-weight: 500; color: var(--navy); }

.benefit { display: flex; gap: 13px; align-items: flex-start; }
.benefit__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--teal-light);
  color: #0E8B7E;
  flex: 0 0 auto;
}
.benefit__title { font-size: 15.5px; font-weight: 600; color: var(--navy); }
.benefit__body { margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }

/* ---------- Privacy sheet ---------- */
.privacy__art {
  display: grid;
  place-items: center;
  padding: 4px 0 18px;
}
.privacy__title {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.2;
  color: var(--navy);
}
.privacy__body { margin-top: 12px; font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
.privacy__list { margin: 22px 0 22px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Escalation sheet ---------- */
.escalation__art { display: grid; place-items: center; padding: 2px 0 16px; }
.escalation__title { font-size: 24px; font-weight: 600; letter-spacing: -0.022em; color: var(--navy); line-height: 1.22; }
.escalation__body { margin-top: 10px; font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
.escalation__actions { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Small viewports ---------- */
@media (max-height: 720px) {
  .onboarding__title { font-size: 32px; }
  .analysis { min-height: 220px; }
  .detail__hero { min-height: 180px; }
  .detail__hero svg.hero-figure { height: 160px; }
}
@media (max-width: 360px) {
  :root { --pad-x: 16px; }
  .onboarding__title { font-size: 31px; }
  .quick { min-height: 88px; }
}
