/* NAPRA – all styles. Sections follow the order of the screens. */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --ink: #101815;
  --muted: #65716c;
  --faint: #7e8d87;
  --green: #173f35;
  --sage: #9fb9aa;
  --mint: #e6eee9;
  --line: #dce4df;
  --paper: #fff;
  --page: #f3f5f3;
  --warn-bg: #f4e6df;
  --warn-ink: #8b3d25;
  --tip-bg: #f1edb5;
  --shadow: 0 18px 55px rgba(23, 63, 53, 0.1);
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 8px;
  --radius-lg: 10px;
  --pad-x: 22px;
  --nav-h: 76px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 var(--font-body);
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-head);
  letter-spacing: -0.035em;
}
button {
  font: inherit;
}
button,
a,
input {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
[tabindex="-1"]:focus {
  outline: none;
}
.muted {
  color: var(--muted);
}

.shell {
  position: relative;
  width: min(100%, 440px);
  min-height: 100vh;
  margin: auto;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.screen {
  min-height: 100vh;
  padding: 24px var(--pad-x) 40px;
  animation: screen-in 0.35s ease;
}
.has-nav .screen {
  padding-bottom: calc(var(--nav-h) + 36px + env(safe-area-inset-bottom));
}
.screen h2 {
  font-size: 31px;
  line-height: 1.12;
}
@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Brand, header rows, progress ---------- */
.brand {
  font: 800 18px/1 var(--font-head);
  letter-spacing: 0.16em;
  white-space: nowrap;
}
.brand i {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 9px;
  background: var(--green);
  transform: rotate(45deg);
}
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 28px;
}
.top .back {
  justify-self: start;
}
.step {
  justify-self: end;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.progress-back-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 24px;
}
.progress-back-row .brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.progress-back-row .back {
  border: 1px solid var(--line);
}
.plain-brand-header {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 24px;
}
.back {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}
.progress {
  height: 5px;
  margin: 0 0 28px;
  border-radius: 5px;
  background: #dfe4de;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--green);
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
}
.lead {
  margin: 10px 0 25px;
  font-size: 16px;
  color: var(--muted);
}
.fine {
  margin: 15px 0 0;
  font-size: 12px;
  text-align: center;
  color: var(--faint);
}

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 17px 20px;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-secondary,
.btn-light {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}

/* ---------- Bottom navigation ---------- */
.nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 10;
  transform: translateX(-50%);
  width: min(100%, 440px);
  display: flex;
  justify-content: space-around;
  gap: 2px;
  padding: 8px 6px max(14px, env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.nav button {
  min-width: 64px;
  min-height: 52px;
  padding: 5px 7px;
  border: 0;
  background: none;
  color: #89968f;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.nav button span {
  display: block;
  margin-bottom: 2px;
  font-size: 20px;
  line-height: 1.15;
}
.nav .active {
  color: var(--green);
}

/* ---------- Welcome ---------- */
.welcome {
  display: flex;
  flex-direction: column;
  padding: 28px 24px calc(var(--nav-h) + 36px);
}
.welcome-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 270px;
  margin: 46px 0 34px;
}
.welcome h1 {
  max-width: 330px;
  font-size: 42px;
  line-height: 1.03;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}
.welcome p {
  margin: 15px 0 30px;
  font-size: 17px;
  color: var(--muted);
}
.welcome .fine {
  margin-top: 15px;
  font-size: 15px;
}
.napra-motion {
  isolation: isolate;
  overflow: visible;
}
.motion-figure {
  position: relative;
  z-index: 2;
  width: min(108%, 340px);
  height: 270px;
  object-fit: contain;
  transform-origin: 19% 78%;
  filter: drop-shadow(0 16px 22px rgba(23, 63, 53, 0.12));
  animation: napra-build 6.4s cubic-bezier(0.22, 0.74, 0.24, 1) infinite;
  will-change: clip-path, opacity, transform;
}
.motion-seed {
  position: absolute;
  z-index: 3;
  left: 17%;
  bottom: 27px;
  width: 42px;
  height: 42px;
  background: var(--green);
  transform: rotate(45deg);
  animation: napra-seed 6.4s ease-in-out infinite;
}
.motion-glow {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 51%;
  width: 248px;
  height: 248px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(230, 238, 233, 0.95) 0,
    rgba(230, 238, 233, 0.7) 48%,
    rgba(230, 238, 233, 0) 72%
  );
  transform: translate(-50%, -50%);
  animation: napra-glow 6.4s ease-in-out infinite;
}
@keyframes napra-build {
  0%,
  8% {
    clip-path: circle(0% at 19% 78%);
    opacity: 0;
    transform: translate(-7px, 8px) scale(0.94);
  }
  16% {
    opacity: 1;
  }
  48%,
  78% {
    clip-path: circle(105% at 19% 78%);
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  66% {
    transform: translate(0, -5px) scale(1.01);
  }
  92%,
  100% {
    clip-path: circle(105% at 19% 78%);
    opacity: 0;
    transform: translate(4px, -9px) scale(1.015);
  }
}
@keyframes napra-seed {
  0%,
  10% {
    opacity: 1;
    transform: rotate(45deg) scale(1);
  }
  21% {
    opacity: 0.7;
    transform: rotate(45deg) scale(0.72);
  }
  38%,
  86% {
    opacity: 0;
    transform: rotate(45deg) scale(0.38);
  }
  96%,
  100% {
    opacity: 1;
    transform: rotate(45deg) scale(1);
  }
}
@keyframes napra-glow {
  0%,
  10% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.78);
  }
  48%,
  78% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  96%,
  100% {
    opacity: 0.45;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

/* ---------- Privacy choice ---------- */
.privacy-screen > .brand {
  display: block;
  margin-bottom: 56px;
}
.privacy-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
  font-size: 39px;
}
.privacy-screen h1 {
  margin: 8px 0 12px;
  font-size: 34px;
  line-height: 1.04;
}
.privacy-card {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.privacy-card p {
  margin: 0 0 13px;
}
.privacy-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}
.privacy-screen .btn {
  margin-top: 10px;
}
.privacy-screen .fine {
  margin-top: 18px;
  text-align: left;
}

/* ---------- Choose area ---------- */
.areas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.area {
  position: relative;
  min-height: 112px;
  padding: 17px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.area:hover {
  border-color: var(--green);
  background: #f9fcf8;
  box-shadow: inset 0 -5px 0 var(--green);
}
.area .aicon {
  display: flex;
  align-items: center;
  height: 58px;
  margin-bottom: 10px;
}
.area .aicon img {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
}
.area strong {
  font: 700 16px var(--font-head);
}
.area-arrow {
  position: absolute;
  right: 15px;
  bottom: 15px;
  color: var(--green);
  font-weight: 800;
}

/* ---------- Safety ---------- */
.warning-list {
  display: grid;
  gap: 10px;
}
.warning-item {
  display: flex;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.warning-mark {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-weight: 800;
}
.warning-item h3 {
  margin: 1px 0 4px;
  font-size: 15px;
}
.warning-item p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.safety-clear {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 15px;
  border-radius: var(--radius);
  background: var(--mint);
}
.safety-clear > span {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}
.safety-clear p {
  margin: 0;
  color: var(--muted);
}
.safety-clear b {
  color: var(--ink);
}
.safety-continue {
  margin-top: 8px;
}

/* ---------- Area overview (home) ---------- */
.home-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 45px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--mint);
  font-weight: 800;
}
.avatar-image {
  flex-basis: 52px;
  width: 52px;
  height: 52px;
}
.avatar-image img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.hero-card {
  position: relative;
  margin: 24px 0;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -45px;
  width: 130px;
  height: 130px;
  background: var(--green);
  opacity: 0.9;
  transform: rotate(18deg);
}
.hero-card .eyebrow {
  color: #b9c8c2;
}
.hero-card h2 {
  margin: 7px 0;
  font-size: 27px;
}
.hero-card p {
  margin: 0 0 22px;
  color: #b9c8c2;
}
.hero-card .btn {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  background: var(--green);
  color: #fff;
}
.booking-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  margin: 0 0 18px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.booking-card:hover {
  border-color: var(--green);
}
.booking-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
  font-size: 23px;
}
.booking-card > span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.booking-card b {
  font: 700 15px var(--font-head);
  overflow-wrap: anywhere;
}
.booking-card small {
  margin-top: 2px;
  font-size: 14px;
  color: var(--muted);
}
.booking-card > strong {
  color: var(--green);
  font-size: 20px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 26px 0 12px;
}
.section-head h3 {
  font-size: 19px;
}
.program-guidance {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.program-guidance > div {
  padding: 14px 16px;
  border-radius: 17px;
  background: var(--mint);
}
.program-guidance b,
.program-guidance span {
  display: block;
}
.program-guidance b {
  margin-bottom: 3px;
  font: 700 14px var(--font-head);
}
.program-guidance span {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}
.tip {
  display: flex;
  gap: 13px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--mint);
}
.tip-icon {
  font-size: 25px;
  line-height: 1;
}
.tip b {
  display: block;
}
.tip span {
  color: var(--muted);
}

/* ---------- Check-in (pain / limitation) ---------- */
.question-card {
  margin: 20px 0;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--paper);
}
.pain-number {
  font: 800 56px/1.2 var(--font-head);
  text-align: center;
  color: var(--green);
}
.pain-label {
  margin-top: -6px;
  text-align: center;
  color: var(--muted);
}
.range {
  width: 100%;
  height: 44px;
  margin: 12px 0 4px;
  accent-color: var(--green);
  cursor: pointer;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.impact-question {
  margin: 24px 0 10px;
  font-size: 20px;
  line-height: 1.25;
}
.impact-question + .question-card {
  margin-top: 0;
}
.intake-continue {
  margin-top: 8px;
}

/* ---------- Exercise ---------- */
.video {
  position: relative;
  display: grid;
  place-items: center;
  height: 260px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #b8d3c6, #749d8c);
  overflow: hidden;
}
.video::before {
  content: "";
  position: absolute;
  bottom: -80px;
  width: 160px;
  height: 240px;
  border-radius: 90px 90px 45px 45px;
  background: #e9f0e6;
}
.video-soon {
  position: relative;
  z-index: 1;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--green);
  font: 700 12px var(--font-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 8px 30px #466c5c55;
}
.exercise-title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 22px 0 7px;
}
.exercise-title > div {
  flex: 1 1 230px;
  min-width: 0;
}
.exercise-title h2 {
  font-size: clamp(23px, 7vw, 31px);
  overflow-wrap: anywhere;
  hyphens: auto;
}
.count {
  margin-left: auto;
  font: 800 20px/1.3 var(--font-head);
  color: var(--green);
  white-space: nowrap;
}
.level-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0 14px;
}
.level-btn {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}
.level-btn.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.level-title {
  margin: 0 0 10px;
  font-size: 17px;
}
.instruction {
  margin: 0 0 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
}
.instruction p {
  margin: 0 0 12px;
}
.instruction p:last-child {
  margin-bottom: 0;
}
.instruction b {
  color: var(--ink);
}
.exercise-tip,
.progression-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 15px 16px;
}
.exercise-tip {
  border-radius: var(--radius);
  background: var(--tip-bg);
}
.progression-note {
  border-left: 4px solid var(--green);
  border-radius: 4px var(--radius) var(--radius) 4px;
  background: var(--mint);
}
.exercise-tip b,
.progression-note b {
  font-family: var(--font-head);
}
.progression-note span {
  color: var(--muted);
}
.exercise-nav {
  display: flex;
  gap: 11px;
}
.exercise-nav .btn-light {
  flex: 0 0 60px;
  width: 60px;
}

/* ---------- Done ---------- */
.complete-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 28px 0 20px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 32px;
}
.recovery-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 24px 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--mint);
}
.recovery-icon {
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  height: 50px;
  border: 2px solid var(--green);
  border-radius: 50%;
  color: var(--green);
  font: 800 18px var(--font-head);
}
.recovery-info h3 {
  margin: 2px 0 8px;
  font-size: 18px;
}
.recovery-info p {
  margin: 0 0 10px;
  color: var(--muted);
}
.recovery-info p:last-child {
  margin-bottom: 0;
}

/* ---------- Profile ---------- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 25px 0 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--green);
  color: #fff;
}
.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  color: var(--green);
  font-weight: 800;
}
.profile-card h3 {
  margin: 0 0 3px;
}
.profile-card p {
  margin: 0;
  color: #d7e2dc;
}
.profile-section-title {
  margin: 24px 0 10px;
  font-size: 17px;
}
.body-area-list,
.program-progress-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.body-area-list > button,
.program-progress-list > button {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 64px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.body-area-list > button:hover,
.program-progress-list > button:hover {
  border-color: var(--green);
}
.body-area-list > button > span:nth-child(2),
.program-progress-list > button > span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.body-area-list b,
.program-progress-list b {
  font: 700 15px var(--font-head);
  overflow-wrap: anywhere;
  hyphens: auto;
}
.body-area-list small,
.program-progress-list small {
  margin-top: 2px;
  font-size: 14px;
  color: var(--muted);
}
.body-area-list > button > strong,
.program-progress-list > button > strong {
  color: var(--green);
  font-size: 20px;
}
.body-area-icon {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--mint);
}
.body-area-icon img {
  width: 43px;
  height: 43px;
  object-fit: contain;
}
.profile-empty {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: var(--paper);
  text-align: center;
}
.profile-empty p {
  font-size: 14px;
  color: var(--muted);
}
.profile-empty .btn {
  display: inline-flex;
  width: auto;
  margin-top: 4px;
}
.privacy-settings {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.privacy-settings h3 {
  margin: 8px 0 7px;
  font-size: 18px;
}
.privacy-settings p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.privacy-action {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--paper);
  color: var(--green);
  font: 700 12px var(--font-head);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}
.privacy-action + .privacy-action {
  margin-top: 8px;
}
.privacy-action.muted-action {
  border-color: var(--line);
  color: var(--muted);
}

/* ---------- Area progress + chart ---------- */
.area-progress-title {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  margin: 10px 0 18px;
}
.area-progress-title h2 {
  min-width: 0;
  font-size: clamp(24px, 7vw, 31px);
  overflow-wrap: anywhere;
  hyphens: auto;
}
.area-progress-icon {
  display: grid;
  place-items: center;
  flex: 0 0 68px;
  height: 68px;
  border-radius: 12px;
  background: var(--mint);
}
.area-progress-icon img {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
}
.program-level {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font: 800 13px var(--font-head);
}
.chart {
  margin: 0 0 26px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--paper);
}
.chart h3 {
  font-size: 19px;
}
.chart-sub {
  margin: 4px 0 14px;
  font-size: 14px;
  color: var(--muted);
}
.history-range {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 15px 0 18px;
  padding: 4px;
  border-radius: 999px;
  background: var(--mint);
}
.history-range button {
  min-height: 44px;
  padding: 9px 5px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 700 12px/1.2 var(--font-head);
  cursor: pointer;
}
.history-range button.active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(23, 63, 53, 0.2);
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 6px 0 28px;
  font-size: 12px;
  color: var(--muted);
}
.chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.pain-key {
  background: var(--green);
}
.impact-key {
  background: var(--sage);
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  border-bottom: 1px solid var(--line);
}
.day-group {
  position: relative;
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 3px;
  height: 100%;
}
.day-group::after {
  content: attr(data-day);
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.bar {
  position: relative;
  width: 50%;
  min-width: 0;
  border-radius: 7px 7px 0 0;
}
.bar::before {
  content: attr(data-v);
  position: absolute;
  top: -23px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}
.pain-bar {
  background: var(--green);
}
.impact-bar {
  background: var(--sage);
}
.bar.empty {
  height: 2px;
  background: var(--line);
  opacity: 0.75;
}
.chart-note {
  margin: 38px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Education ---------- */
.education-screen .lead {
  color: var(--ink);
}
.education-screen p {
  line-height: 1.35;
}
.education-hero,
.education-list article {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.education-hero {
  margin: 22px 0;
  padding: 22px;
}
.education-hero p,
.education-list p {
  margin: 0;
}
.education-hero h3 + p {
  margin-top: 10px;
}
.education-hero p + p,
.education-list p + p {
  margin-top: 6px;
}
.education-list {
  display: grid;
  gap: 8px;
}
.education-list article {
  padding: 17px;
  border-radius: var(--radius);
}
.education-list h3 {
  margin: 0 0 5px;
  font-size: 17px;
}
.education-list article.highlight {
  padding: 22px;
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.edu-booking-btn {
  margin-top: 18px;
  background: #fff;
  color: var(--green);
}
.education-note {
  margin: 20px 0;
  padding: 16px;
  border-left: 4px solid var(--green);
  border-radius: 4px var(--radius) var(--radius) 4px;
  background: var(--mint);
}
.education-note p {
  margin: 5px 0 0;
  color: var(--muted);
}

/* ---------- Booking ---------- */
.booking-screen {
  padding-left: 0;
  padding-right: 0;
}
.booking-screen > :not(.booking-frame) {
  margin-left: var(--pad-x);
  margin-right: var(--pad-x);
}
.booking-heading {
  margin-top: 4px;
}
.booking-provider-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 14px;
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--mint);
}
.booking-provider-note > span {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font: 800 14px var(--font-head);
}
.booking-provider-note p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.booking-provider-note b {
  display: block;
  margin-bottom: 3px;
  font: 700 14px var(--font-head);
  color: var(--ink);
}
.booking-frame {
  min-height: 70vh;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}
.booking-frame iframe {
  display: block;
  width: 100%;
  height: 80vh;
  min-height: 680px;
  border: 0;
}
.booking-fallback {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}
.booking-fallback a {
  color: var(--green);
  font-weight: 700;
}

/* ---------- Larger screens: phone-sized card on a page ---------- */
@media (min-width: 600px) {
  body {
    padding: 24px;
  }
  .shell,
  .screen {
    min-height: calc(100vh - 48px);
    border-radius: 32px;
  }
  .nav {
    bottom: 24px;
    border-radius: 0 0 32px 32px;
  }
}

/* ---------- Small phones ---------- */
@media (max-width: 360px) {
  :root {
    --pad-x: 18px;
  }
  .area-progress-title {
    align-items: flex-start;
  }
  .area-progress-icon {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
  }
  .area-progress-icon img {
    width: 52px;
    height: 52px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .motion-figure,
  .motion-seed,
  .motion-glow {
    animation: none;
  }
  .motion-figure {
    clip-path: none;
    opacity: 1;
    transform: none;
  }
  .motion-seed {
    display: none;
  }
}
