.client-shell { max-width: 520px; margin: auto; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
.client-shell button { min-height: 44px; }
.client-shell h1 { overflow-wrap: anywhere; }
.client-shell .panel .panel { padding: 12px; }
.client-shell article.panel { box-shadow: var(--card-shadow); }
.client-shell article.panel > p { color: var(--muted); }
.client-shell progress { width: 100%; }
.client-shell .actions button[aria-pressed=true] {
  background: var(--pink-soft);
  border-color: var(--pink-soft);
  color: var(--pink);
}
.client-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  position: fixed;
  inset: auto 0 0;
  z-index: 2;
  margin: auto;
  width: min(100%, 552px);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.client-nav button { border: 0; padding: 6px 2px; font-size: .81rem; }
.client-nav button[aria-current=page] { color: var(--pink); background: var(--pink-soft); font-weight: 650; }
.welcome-guide { background: var(--neutral); }
.welcome-guide small { color: var(--pink); }

.client-shell #client-schedule {
  padding: 4px 0;
  border: 0;
}
.schedule-title {
  margin: 20px 0 24px;
  text-align: center;
  font-size: clamp(1.6rem, 6.6vw, 2.25rem);
  line-height: 1.13;
  font-weight: 700;
  letter-spacing: -.045em;
}
.schedule-title em {
  color: var(--editorial-pink);
  font-family: var(--font-display);
  font-size: 1.16em;
  font-weight: 400;
  letter-spacing: -.035em;
}
.client-shell .lesson-card.panel {
  border: 0;
  border-radius: var(--radius-lesson);
  margin: 16px 0;
  padding: 17px 18px;
}
.client-shell .lesson-card > h2 {
  margin-bottom: 6px;
  color: var(--pink);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.035em;
  text-transform: lowercase;
}
.client-shell .lesson-card > p {
  color: var(--text);
  line-height: 1.35;
}
.client-shell .lesson-card > p + p { color: var(--muted); font-size: .875rem; }
.client-shell .lesson-card > button.primary { border-radius: var(--radius-booking-button); font-weight: 700; }

.client-shell small { font-family: var(--font-note); font-style: italic; }

.client-nav button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  color: var(--muted);
}
.client-nav button[aria-current=page] { background: transparent; }
.nav-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 28px;
  border-radius: 20px;
}
.client-nav button[aria-current=page] .nav-icon { background: var(--pink-soft); }
.nav-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.schedule-title { text-align: left; margin: 12px 0 18px; }
.schedule-dates {
  position: relative;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 1px 12px;
  margin-bottom: 12px;
}
.schedule-date {
  flex: 0 0 56px;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 0;
  border-radius: 32px;
  font-size: .7rem;
  text-transform: uppercase;
}
.schedule-date strong { font-size: 1.15rem; }
.schedule-date[aria-pressed=true] {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--on-pink);
}
.schedule-dots { display: flex; align-items: center; gap: 3px; min-height: 6px; }
.schedule-dots span { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.schedule-day { margin-top: 20px; text-transform: uppercase; color: var(--muted); font-size: .8rem; }

.coach-calendar .schedule-dates { margin-bottom: 4px; }
.coach-date-options { font-size: .85rem; color: var(--muted); }
.coach-date-options summary { cursor: pointer; }
.workout-types { display: grid; margin-bottom: 12px; }
.workout-types button { text-align: left; font-weight: 650; }

.person-heading { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; background: var(--neutral); object-fit: cover; }
.client-search input, .note-warning { background: var(--neutral); }
.note-warning { border-radius: 10px; padding: 10px; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 10px; }
.metric { background: var(--neutral); border-radius: 12px; padding: 12px; }
.metric strong,.metric small { display: block; }
.metric strong { font-size: 1.3rem; }
.quiz { text-align: center; padding-block: 30px; }
.quiz small,.quiz-no { color: var(--pink); }
.quiz .actions { justify-content: center; }
.quiz .quiz-no { background: var(--surface); }
.roster-participant { border-top: 1px solid var(--line); padding: 10px 0; }
.roster-participant small { display: block; margin: 5px 0; }
.schedule-title { line-height: 1.02; }
.broadcast-preview { background: var(--neutral); border-radius: 12px; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.coach-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.client-nav button[aria-current=page] { color: var(--text); }
.client-nav button[aria-current=page] .nav-icon,
.client-shell .actions button[aria-pressed=true]:not(.schedule-date) { background: var(--neutral); border-color: var(--neutral); color: var(--text); }
.client-shell .lesson-card > h2 { color: var(--text); }
.schedule-title em { font-family: var(--font-note); }
.lesson-kit { list-style: none; padding: 0; color: var(--muted); }
.lesson-kit li { display: flex; align-items: center; gap: 8px; }
.lesson-kit .nav-icon { width: 24px; }
.lesson-kit svg { width: 18px; height: 18px; }
.client-shell { padding-bottom: calc(110px + max(env(safe-area-inset-bottom, 0px), var(--telegram-safe-bottom, 0px))); }
.client-nav {
  padding-bottom: calc(16px + max(env(safe-area-inset-bottom, 0px), var(--telegram-safe-bottom, 0px)));
  padding-inline: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
}
.lesson-details .booking-state {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: #e8f5eb;
  color: #21663b;
  text-align: center;
  font-weight: 700;
}

/* Mobile schedule dimensions from the approved frame export. */
.client-shell #client-schedule { padding: 0 6px; }
.schedule-title { font-size: 2rem; line-height: 1; margin: 0 0 15px; }
.schedule-title em { display: block; font-size: 1em; line-height: 1.02; }
#client-schedule .schedule-dates { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; padding: 0; margin-bottom: 15px; }
#client-schedule .schedule-date { min-height: 52px; padding: 5px 0; border-radius: 14px; line-height: 1; }
#client-schedule .schedule-date:not([aria-pressed=true]) { background: #f2f1f1; border-color: transparent; }
#client-schedule .schedule-date strong { font-size: 1.0625rem; }
.schedule-formats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.schedule-formats button { border-radius: 12px; font-size: .875rem; font-weight: 700; min-height: 40px; padding-inline: 4px; }
#client-schedule .lesson-card.panel { border-radius: 20px; padding: 15px; margin: 15px 0; }
#client-schedule .lesson-card h2 { font-size: 1.125rem; line-height: 1.2; margin-bottom: 6px; }
#client-schedule .lesson-card > p { font-size: .875rem; margin-bottom: 8px; }
.lesson-details summary { display: flex; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: 12px; background: #f2f1f1; font-size: .875rem; font-weight: 700; cursor: pointer; }
.lesson-details[open] summary { margin-bottom: 10px; }
.lesson-details button.primary { width: 100%; border-radius: 12px; }

.client-shell .record-card,
.client-shell .records-empty {
  border: 0;
  border-radius: var(--radius-lesson);
  box-shadow: var(--card-shadow);
}
.client-shell .record-card h3 { margin: 6px 0; }
.client-shell .record-card .record-status {
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  font-weight: 650;
}
.client-shell .records-empty { text-align: center; }

.achievements { background: var(--surface); border: 0; box-shadow: none; }
.achievements > h2 { color: var(--pink); }
.achievement-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
}
.achievement-tile {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 2px;
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}
.achievement-tile[data-earned=true] {
  color: #21663b;
}
.client-shell .lesson-card > h2 { color: var(--text); text-transform: none; }
.lesson-time { color: var(--pink); margin-right: .4em; }
.lesson-details .lesson-available,
.coach-calendar .workout-types button[aria-pressed=true] {
  background: var(--pink-soft);
  border-color: var(--pink-soft);
  color: #a42f56;
}

.client-shell > .panel:has(> .schedule-title) {
  padding-inline: 0;
  border: 0;
}
.client-shell > #client-profile > .person-heading {
  padding: 14px 16px;
  border-radius: var(--radius-panel);
  box-shadow: var(--card-shadow);
}

.cancellation-review h4 { color: var(--pink); margin: 0 0 8px; }
.cancellation-review .actions button { margin: 0; }

.review-dialog {
  width: min(390px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lesson);
  background: var(--surface);
  color: var(--text);
  text-align: center;
}
.review-dialog::backdrop { background: rgb(28 26 26 / 25%); }
.review-dialog .quiz { border: 0; margin: 0; }

.booking-access {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.booking-access > p { margin-top: 6px; color: var(--muted); }

.schedule-weekday { font-family: var(--font-note); font-style: italic; }
.individual-contact { margin: 8px 0 16px; }
.achievement-badge[data-direction-column="0"] { --badge-x: 3.43%; --locked-x: 2.55%; }
.achievement-badge[data-direction-column="1"] { --badge-x: 26.9%; --locked-x: 26.6%; }
.achievement-badge[data-direction-column="2"] { --badge-x: 50.2%; --locked-x: 50.2%; }
.achievement-badge[data-direction-column="3"] { --badge-x: 73.5%; --locked-x: 73.8%; }
.achievement-badge[data-direction-column="4"] { --badge-x: 96.49%; --locked-x: 97.45%; }
.achievement-badge[data-direction-row="0"] { --badge-y: 3.69%; --locked-y: 3.41%; }
.achievement-badge[data-direction-row="1"] { --badge-y: 49.29%; --locked-y: 49.86%; }
.achievement-badge[data-direction-row="2"] { --badge-y: 94.60%; --locked-y: 96.16%; }

.lesson-details button.booking-payment {
  background: #fff2c6;
  border-color: #fff2c6;
  color: #775300;
}

.measurement-reading { padding: 12px 0; border-bottom: 1px solid var(--neutral); }
.measurement-reading small { display: block; }
.coach-quick-actions { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
.coach-quick-actions > button, .achievements > button { width: 100%; min-height: 44px; }

.coach-note textarea { display: block; box-sizing: border-box; width: 100%; font: inherit; resize: vertical; }
.client-card > summary { cursor: pointer; }
.client-card > summary .person-heading { display: inline-flex; vertical-align: middle; }
.person-heading { position: relative; }
.person-heading .avatar-loading { position: absolute; opacity: 0; pointer-events: none; }
.fitness-editor { display: grid; gap: 12px; }
.fitness-editor .panel { margin: 0; }

.fitness-calendar > .actions { align-items: center; justify-content: space-between; margin-block: 10px; }
.achievements > button { margin-top: 12px; }


.uniform-badge { display: grid; place-items: center; width: min(110px, 100%); aspect-ratio: 1; }
.uniform-badge-art { position: relative; width: var(--badge-art-width); height: 92%; }
.uniform-badge-art::before, .uniform-badge-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--badge-image) no-repeat var(--badge-bg-x) var(--badge-bg-y) / var(--badge-bg-width) var(--badge-bg-height);
}
.uniform-badge-art::before { filter: grayscale(1); }
.uniform-badge-art::after { clip-path: inset(calc(100% - var(--badge-fill)) 0 0); }

.attendance-grid {
  display: grid;
  grid-template-columns: repeat(7,minmax(0,1fr));
  gap: 4px;
  text-align: center;
}
.attendance-weekday { color: var(--muted); font-size: .8rem; }
.attendance-day {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 9px;
  background: var(--neutral);
}
.attendance-day[data-attended] { background: #e8f5eb; color: #21663b; font-weight: 700; }
.fitness-calendar > .actions > button { min-width: 44px; min-height: 44px; }

.fitness-editor .fitness-choice {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;
  margin-block: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--neutral);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.fitness-choice input { position: absolute; opacity: 0; }
.fitness-choice:has(input:checked) { background: #e8f5eb; color: #21663b; }
.fitness-choice:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }
.fitness-editor .panel > button { width: 100%; min-height: 44px; }
.attendance-weekday { font-family: var(--font-note); font-style: italic; }
.attendance-day { min-height: 29px; font-size: .875rem; }

.record-balance-count {
  display: block;
  font-size: 2.75rem;
  line-height: 1.12;
  margin-block: 4px 8px;
}
.record-balance > button { width: 100%; min-height: 44px; margin-top: 8px; }
.record-other, .record-history { margin-top: 16px; }
.client-shell .record-card-compact { padding: 10px 12px; }
.client-shell .record-card-compact p { margin: 4px 0; color: var(--muted); }
.client-shell .record-card-compact button { width: 100%; min-height: 44px; margin-top: 6px; }


.fitness-choice-card, .client-shell .record-balance, .client-shell .fitness-measurements, .client-shell .fitness-calendar {
  box-shadow: 0 8px 24px rgb(38 14 25 / 8%);
}
.fitness-choice-card { min-width: 0; }
.fitness-choice-card legend {
  padding-inline: 6px;
  font: italic 600 1.35rem var(--font-note);
  color: var(--pink);
}
.fitness-choice-card p { margin: 0 0 8px; }
.fitness-restrictions .fitness-choice:has(input:checked) { background: #862c50; color: white; }
.client-shell .profile-contact { width: 100%; min-height: 44px; background: var(--neutral); border-color: var(--neutral); color: var(--text); }
.client-shell .record-balance { text-align: center; }

.fitness-target-stepper { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; }
.fitness-target-stepper button { min-height: 44px; background: var(--neutral); font-size: 1.25rem; }
.fitness-target-count { text-align: center; font-size: 1.75rem; font-weight: 700; }

.booking-onboarding:not([open]) { display: none; }
.booking-onboarding {
  position: fixed;
  inset: 0;
  width: min(100%, 520px);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  box-sizing: border-box;
  margin: auto;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  border: 0;
  color: var(--text);
  background: var(--surface);
  overflow-y: auto;
}
.booking-onboarding[open] { display: block; }
.booking-onboarding::backdrop { background: var(--surface); }
.booking-onboarding > button { width: 100%; min-height: 44px; margin-top: 8px; }

.measurement-chart { display: block; width: 100%; height: auto; margin-block: 8px; }
.chart-grid-line { stroke: #eee6eb; stroke-width: 1; }
.chart-zero { stroke: #a42f56; stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-trend { fill: none; stroke: #a42f56; stroke-width: 2; }
.chart-point { fill: #a42f56; }
.chart-value { fill: var(--text); font-size: 9px; font-weight: 700; }
.chart-axis-label { fill: var(--muted); font-size: 8px; }
