:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #66716e;
  --surface: #ffffff;
  --canvas: #f4f6f3;
  --line: #dce2df;
  --teal: #176b67;
  --teal-dark: #0f4f4c;
  --teal-pale: #e4f0ed;
  --coral: #e5654f;
  --coral-pale: #fbe9e4;
  --amber: #a96204;
  --amber-pale: #fff2d8;
  --danger: #a83c33;
  --danger-pale: #fae7e4;
  --shadow: 0 12px 30px rgba(23, 33, 31, 0.08);
  --sidebar: 232px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 107, 103, 0.24);
  outline-offset: 2px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: #fbfcfa;
}

.loading-screen .brand {
  padding: 0;
}

.loading-screen p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #d7e4e0;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 1.08fr) minmax(480px, 0.92fr);
  background: #fff;
}

.auth-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #dce8e3;
}

.auth-visual::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 38, 35, 0.06) 28%, rgba(13, 38, 35, 0.82) 100%);
  content: "";
}

.auth-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-visual-copy {
  position: absolute;
  right: clamp(28px, 5vw, 72px);
  bottom: clamp(32px, 7vh, 78px);
  left: clamp(28px, 5vw, 72px);
  z-index: 1;
  max-width: 590px;
  color: #fff;
}

.auth-visual-copy span {
  display: inline-block;
  margin-bottom: 10px;
  border-left: 3px solid #f39a83;
  padding-left: 10px;
  font-size: 13px;
  font-weight: 760;
}

.auth-visual-copy h1 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 48px);
}

.auth-visual-copy p {
  max-width: 520px;
  margin: 0;
  color: #e8f0ed;
  font-size: 15px;
  line-height: 1.75;
}

.auth-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px clamp(28px, 6vw, 88px);
}

.auth-panel {
  width: min(100%, 430px);
  min-width: 0;
}

.auth-panel > .brand {
  margin-bottom: 44px;
  padding: 0;
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading h2 {
  margin-bottom: 7px;
  font-size: 27px;
}

.auth-heading > p:last-child,
.auth-disclaimer,
.account-email {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-submit {
  margin-top: 4px;
}

.auth-switch {
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.auth-disclaimer {
  margin: 22px 0 0;
}

.legal-gate-shell .auth-panel {
  width: min(100%, 460px);
}

.consent-list {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.consent-row {
  display: grid;
  min-height: 48px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #37413e;
  background: #fbfcfa;
  padding: 11px 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.55;
}

.consent-row:hover {
  border-color: #adc3bd;
  background: #f7fbf9;
}

.consent-row:has(input:focus-visible) {
  outline: 3px solid rgba(23, 107, 103, 0.24);
  outline-offset: 2px;
}

.consent-row input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}

.consent-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.legal-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 1px 2px 0;
}

.inline-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 0;
  color: var(--teal-dark);
  background: transparent;
  padding: 3px 0;
  cursor: pointer;
  font-size: inherit;
  font-weight: 720;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: var(--teal);
}

.auth-disclaimer .inline-link {
  margin-left: 9px;
  vertical-align: middle;
}

.legal-copy {
  display: grid;
  gap: 6px;
  color: #3f4b47;
}

.legal-copy h3 {
  margin: 14px 0 0;
  font-size: 15px;
}

.legal-copy h3:first-child {
  margin-top: 0;
}

.legal-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.compact-legal-copy details {
  border-top: 1px solid var(--line);
  padding: 10px 0 2px;
}

.compact-legal-copy summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.compact-legal-copy details p {
  padding-top: 8px;
}

.form-error {
  margin-bottom: 16px;
  border-left: 3px solid var(--danger);
  color: #762f29;
  background: var(--danger-pale);
  padding: 10px 12px;
  font-size: 13px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
  padding: 24px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 28px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
}

.brand-mark .icon {
  width: 23px;
  height: 23px;
}

.brand-name {
  font-size: 20px;
  font-weight: 760;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  color: #58635f;
  background: transparent;
  padding: 0 13px;
  cursor: pointer;
  text-align: left;
}

.nav-button:hover {
  background: #f0f3ef;
}

.nav-button.active {
  color: var(--teal-dark);
  background: var(--teal-pale);
  font-weight: 700;
}

.sidebar-note {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 18px 8px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.sidebar-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
}

.main {
  margin-left: var(--sidebar);
  padding: 32px 40px 56px;
}

.page {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 760;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1.22;
}

h2 {
  margin-bottom: 14px;
  font-size: 20px;
  line-height: 1.35;
}

h3 {
  margin-bottom: 7px;
  font-size: 16px;
  line-height: 1.4;
}

.page-subtitle,
.muted {
  color: var(--muted);
}

.page-subtitle {
  margin: 0;
  font-size: 14px;
}

.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 730;
  white-space: nowrap;
}

.badge.ready {
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.badge.caution {
  color: #7a4700;
  background: var(--amber-pale);
}

.badge.stop {
  color: var(--danger);
  background: var(--danger-pale);
}

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.content-stack,
.side-stack {
  display: grid;
  gap: 20px;
}

.panel,
.exercise-card,
.metric-card,
.profile-section,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel,
.profile-section,
.chat-panel {
  padding: 22px;
}

.status-panel {
  border-left: 4px solid var(--teal);
}

.status-panel.caution {
  border-left-color: var(--amber);
}

.status-panel.stop {
  border-left-color: var(--danger);
}

.status-row,
.section-heading,
.exercise-top,
.metric-top,
.profile-row,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.status-copy p,
.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.status-copy h2 {
  margin-bottom: 5px;
}

.checkin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  display: grid;
  gap: 9px;
}

.field > label,
.field-label {
  color: #37413e;
  font-size: 13px;
  font-weight: 720;
}

.pain-value {
  color: var(--teal-dark);
  font-size: 25px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f8f6;
}

.segment {
  min-height: 44px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}

.segment:last-child {
  border-right: 0;
}

.segment.selected {
  color: #fff;
  background: var(--teal);
  font-weight: 720;
}

.symptom-checks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 18px;
}

.check-pill {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  color: #43504c;
  cursor: pointer;
  font-size: 13px;
}

.check-pill input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--danger);
}

.section-heading {
  align-items: flex-end;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin-bottom: 2px;
}

.exercise-list {
  display: grid;
  gap: 10px;
}

.plan-phases {
  display: grid;
  gap: 22px;
}

.plan-phase {
  display: grid;
  gap: 10px;
}

.plan-phase-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.plan-phase-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.phase-marker {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
}

.plan-phase:last-child .phase-marker {
  background: var(--coral);
}

.plan-phase-heading h3,
.plan-phase-heading p {
  margin: 0;
}

.plan-phase-heading h3 {
  font-size: 15px;
}

.plan-phase-heading p {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.exercise-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  min-height: 88px;
  padding: 14px 16px;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.exercise-card.done {
  border-color: #b8d3cc;
  background: #f7fbf9;
}

.exercise-index {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal-dark);
  background: var(--teal-pale);
  font-size: 14px;
  font-weight: 800;
}

.exercise-card.done .exercise-index {
  color: #fff;
  background: var(--teal);
}

.exercise-card h3 {
  margin: 0 0 4px;
}

.exercise-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-item .icon {
  width: 15px;
  height: 15px;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.icon-button:hover {
  border-color: #adc3bd;
  background: #f6faf8;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 740;
}

.button.primary {
  color: #fff;
  background: var(--teal);
}

.button.primary:hover {
  background: var(--teal-dark);
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
}

.button.danger {
  color: #fff;
  border-color: #e6b9b3;
  background: var(--danger);
}

.button.danger:hover {
  border-color: #872f28;
  background: #872f28;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.full-button {
  width: 100%;
}

.plan-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.progress-copy {
  color: var(--muted);
  font-size: 13px;
}

.visual-panel {
  overflow: hidden;
  padding: 0;
}

.visual-panel img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.visual-caption {
  padding: 17px 18px 18px;
}

.visual-caption h3 {
  margin-bottom: 4px;
}

.visual-caption p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.stop-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stop-list li {
  display: flex;
  gap: 10px;
  color: #4d5955;
  font-size: 13px;
  line-height: 1.5;
}

.stop-list .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--coral);
}

.chat-log {
  display: grid;
  max-height: 280px;
  gap: 10px;
  overflow: auto;
  margin: 14px 0;
  padding-right: 3px;
}

.message {
  width: fit-content;
  max-width: 88%;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
}

.message.agent {
  background: #eef3f0;
}

.message.user {
  justify-self: end;
  color: #fff;
  background: var(--teal);
}

.chat-message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-source {
  display: block;
  margin-bottom: 5px;
  color: var(--teal-dark);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.chat-pending {
  color: var(--muted);
}

.chat-model-status { overflow-wrap: anywhere; }

.chat-error {
  padding: 10px 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.chat-error p { margin: 0; }
.chat-error .text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.chat-compose button:disabled, .quick-prompt:disabled { opacity: 0.5; cursor: wait; }

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-prompt {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #42504b;
  background: #fff;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  margin-top: 12px;
}

.chat-compose input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
}

.alert-box {
  display: flex;
  gap: 12px;
  border: 1px solid #e9b9b2;
  border-radius: 8px;
  color: #6f2e28;
  background: var(--danger-pale);
  padding: 15px;
  line-height: 1.55;
}

.alert-box h3 {
  margin-bottom: 3px;
}

.alert-box p {
  margin: 0;
  font-size: 13px;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card {
  min-height: 126px;
  padding: 18px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  margin: 12px 0 4px;
  font-size: 29px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.metric-change {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

.chart-wrap {
  min-height: 300px;
}

.bar-chart {
  display: grid;
  height: 210px;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 14px 6px 0;
}

.bar-column {
  display: grid;
  height: 100%;
  grid-template-rows: 1fr auto;
  gap: 8px;
  align-items: end;
  text-align: center;
}

.bar-track {
  display: flex;
  height: 100%;
  align-items: end;
  justify-content: center;
}

.bar {
  width: min(34px, 70%);
  min-height: 8px;
  border-radius: 5px 5px 0 0;
  background: var(--teal);
}

.bar-column.today .bar {
  background: var(--coral);
}

.bar-label {
  color: var(--muted);
  font-size: 11px;
}

.chart-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 0;
}

.history-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.history-row:last-child {
  border-bottom: 0;
}

.history-date {
  font-size: 13px;
  font-weight: 720;
}

.history-note {
  color: var(--muted);
  font-size: 13px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.profile-stack {
  display: grid;
  gap: 20px;
}

.profile-row {
  min-height: 45px;
  border-bottom: 1px solid var(--line);
}

.profile-row:last-child {
  border-bottom: 0;
}

.profile-key {
  color: var(--muted);
  font-size: 13px;
}

.profile-value {
  text-align: right;
  font-size: 14px;
  font-weight: 650;
}

.care-note {
  border-left: 3px solid var(--coral);
  padding-left: 14px;
  color: #4e5956;
  font-size: 13px;
  line-height: 1.7;
}

.onboarding-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  background: #fff;
}

.onboarding-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #e8efeb;
}

.onboarding-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual-overlay {
  position: absolute;
  inset: auto 28px 28px;
  border-radius: 8px;
  color: #fff;
  background: rgba(23, 33, 31, 0.88);
  padding: 20px;
}

.visual-overlay h2 {
  margin-bottom: 7px;
  font-size: 21px;
}

.visual-overlay p {
  margin: 0;
  color: #dce7e3;
  font-size: 13px;
  line-height: 1.65;
}

.onboarding-main {
  display: grid;
  align-content: center;
  min-height: 100vh;
  padding: 46px clamp(28px, 6vw, 86px);
}

.onboarding-content {
  width: min(100%, 620px);
  margin: 0 auto;
}

.onboarding-brand {
  margin-bottom: 34px;
  padding: 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 28px;
}

.step-track {
  height: 4px;
  border-radius: 4px;
  background: #e5e9e7;
}

.step-track.active {
  background: var(--teal);
}

.onboarding-title {
  margin-bottom: 7px;
  font-size: 27px;
}

.onboarding-copy {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.text-input,
.select-input,
.textarea-input,
.number-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd7d3;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  padding: 9px 11px;
}

.textarea-input {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.toggle-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
}

.switch {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 10px 0;
  border-radius: 999px;
  background: #c9d0cd;
  cursor: pointer;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform 150ms ease;
}

.switch input:checked + .switch-track {
  background: var(--teal);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}

.safety-list {
  display: grid;
  gap: 8px;
}

.safety-item {
  display: flex;
  min-height: 47px;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
}

.safety-item input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--danger);
}

.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.text-button {
  border: 0;
  color: var(--teal-dark);
  background: transparent;
  padding: 8px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(16, 25, 23, 0.56);
  padding: 20px;
}

.modal {
  width: min(100%, 560px);
  max-height: min(760px, 92vh);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal-header {
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-header > div {
  min-width: 0;
}

.modal-header h2 {
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.modal-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.instruction-list {
  margin: 0;
  padding-left: 20px;
  color: #3f4b47;
  font-size: 14px;
  line-height: 1.75;
}

.detail-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.detail-stat {
  background: #f9faf8;
  padding: 12px;
  text-align: center;
}

.detail-stat strong {
  display: block;
  margin-bottom: 3px;
  color: var(--teal-dark);
  font-size: 15px;
}

.detail-stat span {
  color: var(--muted);
  font-size: 11px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.feedback-grid {
  display: grid;
  gap: 18px;
}

.rating-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.rating-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.rating-button.selected {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  border-radius: 7px;
  color: #fff;
  background: #20312d;
  box-shadow: var(--shadow);
  padding: 12px 16px;
  font-size: 13px;
}

.mobile-nav {
  display: none;
}

@media (max-width: 940px) {
  .today-grid,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .side-stack {
    grid-template-columns: 1fr 1fr;
  }

  .chat-panel {
    grid-column: 1 / -1;
  }

  .onboarding-shell {
    grid-template-columns: 0.72fr 1.28fr;
  }
}

@media (max-width: 760px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 22px 16px 92px;
  }

  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    padding: 7px 8px max(7px, env(safe-area-inset-bottom));
  }

  .mobile-nav .nav-button {
    display: grid;
    min-height: 54px;
    place-items: center;
    gap: 2px;
    padding: 4px;
    text-align: center;
    font-size: 11px;
  }

  .mobile-nav .nav-button .icon {
    width: 21px;
    height: 21px;
  }

  .page-header {
    margin-bottom: 20px;
  }

  h1 {
    font-size: 25px;
  }

  .panel,
  .profile-section,
  .chat-panel {
    padding: 18px;
  }

  .checkin-grid,
  .trend-grid,
  .side-stack {
    grid-template-columns: 1fr;
  }

  .symptom-checks {
    grid-template-columns: 1fr;
  }

  .exercise-card {
    grid-template-columns: 46px minmax(0, 1fr) 44px;
    gap: 11px;
    padding: 12px;
  }

  .exercise-index {
    width: 42px;
    height: 42px;
  }

  .exercise-meta {
    display: grid;
    gap: 3px;
  }

  .plan-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .onboarding-shell {
    display: block;
  }

  .onboarding-visual {
    min-height: 250px;
    height: 30vh;
  }

  .visual-overlay {
    inset: auto 16px 16px;
    padding: 15px;
  }

  .visual-overlay h2 {
    font-size: 17px;
  }

  .onboarding-main {
    min-height: auto;
    padding: 26px 18px 40px;
  }

  .onboarding-brand {
    margin-bottom: 25px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  .history-row {
    grid-template-columns: 86px 1fr auto;
    gap: 9px;
  }

  .bar-chart {
    gap: 5px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 91vh;
    border-radius: 8px 8px 0 0;
    padding: 20px 18px max(20px, env(safe-area-inset-bottom));
  }

  .toast {
    right: 14px;
    bottom: 84px;
    left: 14px;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .status-row,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
  }

  .segment {
    border-right: 1px solid var(--line);
  }

  .onboarding-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .onboarding-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Patient training experience */

.compact-header {
  margin-bottom: 18px;
}

.sidebar-patient {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 18px 8px 0;
}

.patient-avatar,
.large-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--teal-dark);
  background: var(--teal-pale);
  font-weight: 800;
}

.patient-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 13px;
}

.sidebar-patient div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.sidebar-patient strong,
.sidebar-patient span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-patient strong {
  font-size: 13px;
}

.sidebar-patient div span {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-patient .sync-indicator {
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
}

.sidebar-patient .sync-indicator[data-status="pending"],
.sidebar-patient .sync-indicator[data-status="offline"] {
  color: var(--amber);
}

.account-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.account-heading h2,
.account-email {
  margin-bottom: 12px;
}

.sync-pill {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  border-radius: 999px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 730;
  white-space: nowrap;
}

.sync-pill[data-status="pending"],
.sync-pill[data-status="offline"] {
  color: #7a4700;
  background: var(--amber-pale);
}

.empty-state {
  display: grid;
  min-height: 210px;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 120px;
}

.empty-state strong {
  margin-bottom: 5px;
  color: var(--ink);
}

.empty-state p {
  max-width: 330px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.checkin-confirm-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.checkin-confirm-row > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.checkin-confirm-row > span .icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--teal);
}

.checkin-confirm-row .button {
  flex: 0 0 auto;
}

.onboarding-actions.end-aligned {
  justify-content: flex-end;
}

.pending-feedback-banner {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  border: 1px solid #ecd095;
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  color: #67430a;
  background: var(--amber-pale);
  padding: 16px 18px;
}

.pending-feedback-banner > div,
.pending-feedback-banner > span {
  min-width: 0;
}

.pending-feedback-banner > div:first-child {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
}

.pending-feedback-banner > div:first-child > .icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.pending-feedback-banner > div:first-child > span {
  min-width: 0;
}

.pending-feedback-banner h2,
.pending-feedback-banner h3,
.pending-feedback-banner strong {
  margin: 0;
  color: #543506;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.pending-feedback-banner p,
.pending-feedback-banner small {
  display: block;
  margin: 4px 0 0;
  color: #765117;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.pending-feedback-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sidebar-note {
  margin-top: 16px;
}

.training-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin-bottom: 22px;
  border: 1px solid #b8d3cc;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: #f7fbf9;
  padding: 26px 28px;
}

.training-hero.caution {
  border-color: #ecd095;
  border-left-color: var(--amber);
  background: #fffaf0;
}

.training-hero.stop {
  border-color: #e6b9b3;
  border-left-color: var(--danger);
  background: #fff8f6;
}

.training-hero-copy h2 {
  margin: 12px 0 6px;
  font-size: 27px;
}

.training-hero-copy > p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.equipment-strip {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
  border: 1px solid #c8d9d4;
  border-radius: 7px;
  background: #fff;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 12px;
}

.equipment-strip .icon {
  width: 16px;
  height: 16px;
  color: var(--teal-dark);
}

.equipment-strip strong {
  color: var(--ink);
  font-size: 12px;
}

.session-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 210px));
  gap: 8px;
  margin-top: 20px;
}

.session-choice-button {
  display: grid;
  min-height: 66px;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px 13px;
  cursor: pointer;
  text-align: left;
}

.session-choice-button:hover {
  border-color: #adc3bd;
}

.session-choice-button.selected {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.session-choice-button strong {
  font-size: 14px;
}

.session-choice-button span {
  color: var(--muted);
  font-size: 12px;
}

.start-training-button {
  min-width: 206px;
  margin-top: 12px;
}

.training-hero-progress {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 174px;
}

.training-hero-progress > div {
  display: grid;
  gap: 3px;
}

.training-hero-progress > div strong {
  font-size: 14px;
}

.training-hero-progress > div span {
  color: var(--muted);
  font-size: 12px;
}

.progress-ring {
  display: grid;
  width: 76px;
  height: 76px;
  place-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 55%, transparent 57%),
    conic-gradient(var(--teal) calc(var(--progress) * 1%), #dce7e3 0);
  text-align: center;
}

.progress-ring strong {
  font-size: 21px;
  line-height: 1;
}

.progress-ring small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.patient-dashboard {
  grid-template-columns: minmax(0, 1fr) 310px;
}

.exercise-card.preview-card {
  grid-template-columns: 50px minmax(0, 1fr) auto;
}

.preview-card .exercise-index {
  border: 0;
}

.exercise-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exercise-title-row h3 {
  min-width: 0;
}

.exercise-title-row > span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 720;
}

.goal-panel {
  position: relative;
  overflow: hidden;
}

.goal-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 17px;
  border-radius: 7px;
  color: #7a4700;
  background: var(--amber-pale);
}

.goal-panel h2 {
  margin: 5px 0 12px;
  font-size: 19px;
  line-height: 1.4;
}

.goal-panel > p:last-child {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.goal-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8efeb;
}

.goal-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.focus-list {
  display: grid;
  gap: 12px;
}

.focus-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
}

.focus-item > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #b8d3cc;
  border-radius: 6px;
  color: var(--teal-dark);
  background: #f1f8f5;
  font-size: 11px;
  font-weight: 800;
}

.focus-item div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.focus-item strong {
  font-size: 14px;
  line-height: 1.4;
}

.focus-item small,
.focus-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.focus-note {
  margin: 16px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.training-visual-card img {
  aspect-ratio: 16 / 10;
}

.assistant-card .section-heading {
  align-items: center;
}

.assistant-card .section-heading > .icon {
  color: var(--teal);
}

.compact-chat {
  max-height: 174px;
}

.phase-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 130px;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
  border: 1px solid #b8d3cc;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: #f7fbf9;
  padding: 24px 26px;
}

.phase-band h2 {
  margin: 10px 0 4px;
  font-size: 23px;
}

.phase-band p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.phase-stat {
  display: grid;
  gap: 4px;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.phase-stat strong {
  color: var(--teal-dark);
  font-size: 29px;
}

.phase-stat span {
  color: var(--muted);
  font-size: 12px;
}

.plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.week-day {
  display: grid;
  min-height: 78px;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9faf8;
}

.week-day span,
.week-day small {
  min-height: 14px;
  color: var(--muted);
  font-size: 10px;
}

.week-day strong {
  font-size: 17px;
}

.week-day small .icon {
  width: 14px;
  height: 14px;
}

.week-day.done {
  border-color: #b8d3cc;
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.week-day.today {
  box-shadow: inset 0 0 0 2px var(--coral);
}

.adjustment-panel {
  border-top: 4px solid var(--teal);
}

.adjustment-panel.caution {
  border-top-color: var(--amber);
}

.adjustment-panel.stop {
  border-top-color: var(--danger);
}

.adjustment-panel h2 {
  margin: 6px 0 7px;
  font-size: 19px;
}

.adjustment-panel > p:last-of-type {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.adjustment-note {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  color: #43504c;
  font-size: 12px;
  line-height: 1.6;
}

.adjustment-note .icon {
  width: 17px;
  height: 17px;
  color: var(--teal);
}

.milestone-list {
  display: grid;
  gap: 13px;
}

.milestone-item {
  display: flex;
  align-items: center;
  gap: 11px;
}

.milestone-item > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: #eef3f0;
}

.milestone-item.done > span {
  color: #fff;
  background: var(--teal);
}

.milestone-item .icon {
  width: 17px;
  height: 17px;
}

.milestone-item div {
  display: grid;
  gap: 2px;
}

.milestone-item strong {
  font-size: 13px;
}

.milestone-item small {
  color: var(--muted);
  font-size: 11px;
}

.records-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 20px;
}

.records-history {
  margin-top: 20px;
}

.completion-bars {
  display: grid;
  gap: 13px;
}

.completion-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 9px;
  font-size: 11px;
}

.completion-row > span {
  color: var(--muted);
}

.completion-row > div {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8efeb;
}

.completion-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.completion-row strong {
  color: #43504c;
  text-align: right;
}

.settings-layout {
  align-items: start;
}

.profile-section-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-section-heading > div {
  min-width: 0;
}

.profile-section-heading .patient-heading {
  margin-bottom: 0;
}

.profile-section-heading h2 {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.profile-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.profile-edit-form,
.account-delete-form {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.profile-edit-form .form-grid {
  gap: 16px;
}

.profile-edit-actions,
.pending-feedback-actions {
  min-width: 0;
}

.profile-edit-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.account-delete-form {
  margin-top: 18px;
}

.danger-confirmation {
  display: grid;
  gap: 6px;
  border: 1px solid #e6b9b3;
  border-radius: 7px;
  color: #762f29;
  background: var(--danger-pale);
  padding: 13px 14px;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.danger-confirmation strong {
  color: var(--danger);
  font-size: 14px;
}

.danger-confirmation p,
.danger-confirmation small {
  margin: 0;
  color: #762f29;
  line-height: 1.6;
}

.legal-action-row {
  color: var(--teal-dark);
}

.legal-action-row:hover,
.legal-action-row:focus-visible {
  background: #f4f8f6;
}

.patient-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.large-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 18px;
}

.patient-heading h2,
.patient-heading p {
  margin: 0;
}

.patient-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.setting-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}

.setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.setting-icon,
.family-icon {
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.setting-icon {
  width: 36px;
  height: 36px;
  border-radius: 7px;
}

.setting-icon .icon {
  width: 18px;
  height: 18px;
}

.setting-row > div {
  display: grid;
  gap: 3px;
}

.setting-row strong {
  font-size: 13px;
}

.setting-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.setting-actions {
  display: flex !important;
  align-items: center;
  gap: 9px !important;
}

.setting-actions .icon-button {
  width: 44px;
  height: 44px;
}

.time-input {
  width: 92px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 6px 8px;
}

.family-setting {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 15px 0 18px;
}

.family-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.family-setting strong {
  font-size: 14px;
}

.family-setting p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.action-list {
  margin-top: 10px;
}

.action-row {
  display: grid;
  width: 100%;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 13px 0;
  cursor: pointer;
  text-align: left;
}

.action-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.action-row > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  color: var(--teal-dark);
  background: #eef3f0;
}

.action-row > .icon {
  width: 17px;
  color: var(--muted);
}

.action-row div {
  display: grid;
  gap: 2px;
}

.action-row strong {
  font-size: 13px;
}

.action-row small {
  color: var(--muted);
  font-size: 11px;
}

.danger-row strong,
.danger-row > span {
  color: var(--danger);
}

.danger-row:hover,
.danger-row:focus-visible {
  background: var(--danger-pale);
}

.session-main {
  min-height: 100vh;
  background: #f0f3ef;
}

.session-page {
  width: min(100%, 1280px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 28px 32px;
}

.session-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 56px;
}

.session-header-copy {
  display: grid;
  gap: 2px;
}

.session-header-copy span {
  color: var(--muted);
  font-size: 11px;
}

.session-header-copy strong {
  font-size: 14px;
}

.discomfort-button {
  color: var(--danger);
  border-color: #e6b9b3;
}

.session-progress-track {
  height: 5px;
  overflow: hidden;
  margin: 10px 0 20px;
  border-radius: 3px;
  background: #dce2df;
}

.session-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 180ms ease;
}

.training-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(370px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.player-panel,
.session-guide-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.player-panel {
  overflow: hidden;
}

.training-media {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 340px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #20312d;
}

.training-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgba(23, 33, 31, 0.5), transparent 38%);
  pointer-events: none;
}

.media-label {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 16px;
  border-radius: 5px;
  color: #fff;
  background: rgba(23, 33, 31, 0.88);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 720;
}

.movement-media {
  place-items: center;
  background: #20312d;
  padding: 60px 26px 26px;
}

.movement-sequence {
  display: grid;
  width: 100%;
    grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.movement-frame {
  display: grid;
  min-height: 210px;
  align-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  padding: 18px;
}

.movement-frame > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: #20312d;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.movement-frame p {
  margin: 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.7;
}

.player-copy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 22px 18px;
}

.player-copy h1 {
  margin: 3px 0 4px;
  font-size: 25px;
}

.player-copy .exercise-purpose {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.exercise-equipment {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
}

.exercise-equipment .icon {
  width: 15px;
  height: 15px;
}

.dose-chip {
  flex: 0 0 auto;
  border-radius: 6px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 720;
}

.timer-panel {
  border-top: 1px solid var(--line);
}

.timer-progress {
  height: 4px;
  background: #e8efeb;
}

.timer-progress span {
  display: block;
  height: 100%;
  background: var(--coral);
}

.timer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 22px;
}

.timer-content > div:first-child {
  display: grid;
  gap: 2px;
}

.timer-content span {
  color: var(--muted);
  font-size: 11px;
}

.timer-content strong {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.play-button {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  cursor: pointer;
}

.play-button:hover {
  background: var(--teal-dark);
}

.play-button .icon {
  width: 25px;
  height: 25px;
}

.session-guide {
  display: grid;
  gap: 14px;
}

.session-guide-section {
  padding: 21px;
}

.session-guide-section .section-heading {
  align-items: center;
}

.set-counter {
  border-radius: 5px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 720;
}

.session-instructions {
  margin-top: 12px;
}

.cue-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 16px 0 10px;
  border-radius: 7px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  padding: 12px 13px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.cue-box .icon,
.caution-line .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.caution-line {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.feedback-section h2 {
  margin: 3px 0 14px;
  font-size: 18px;
}

.feeling-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.feeling-button {
  display: grid;
  min-height: 56px;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
}

.feeling-button:hover {
  border-color: #adc3bd;
  background: #f7fbf9;
}

.feeling-button.selected {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-pale);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.feeling-button.warning {
  color: var(--danger);
}

.feeling-button.warning.selected {
  border-color: var(--danger);
  background: var(--danger-pale);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.feeling-button.correction {
  grid-column: 1 / -1;
  color: #69571d;
  border-color: #d8c88d;
  background: #fffdf5;
}

.feeling-button.correction:hover {
  border-color: #b8a34e;
  background: #fff9df;
}

.correction-steps strong {
  color: var(--teal-dark);
}

.feeling-button strong {
  font-size: 12px;
}

.feeling-button span {
  color: var(--muted);
  font-size: 10px;
}

.session-navigation {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.session-navigation .button {
  flex: 1;
}

.session-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.session-summary-strip > div {
  display: grid;
  gap: 3px;
  background: #f9faf8;
  padding: 15px;
  text-align: center;
}

.session-summary-strip strong {
  color: var(--teal-dark);
  font-size: 24px;
}

.session-summary-strip span {
  color: var(--muted);
  font-size: 11px;
}

.support-options {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.support-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 15px;
}

.support-option > span {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.support-option strong {
  font-size: 13px;
}

.support-option p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.urgent-option > span {
  color: var(--danger);
  background: var(--danger-pale);
}

.stacked-actions {
  align-items: stretch;
  flex-direction: column;
}

.gentle-alert {
  margin-top: 18px;
  border-color: #ecd095;
  color: #67430a;
  background: var(--amber-pale);
}

.modal-cue {
  margin-top: 18px;
}

.detail-band {
  grid-template-columns: repeat(2, 1fr);
}

.small-copy {
  margin-top: 3px;
  font-size: 12px;
}

.compact-textarea {
  min-height: 78px;
}

@media (max-width: 1080px) {
  .training-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  }

  .movement-frame {
    min-height: 190px;
    padding: 14px;
  }

  .movement-frame p {
    font-size: 12px;
  }
}

@media (max-width: 940px) {
  .patient-dashboard,
  .plan-layout,
  .records-grid,
  .training-layout {
    grid-template-columns: 1fr;
  }

  .training-layout {
    max-width: 800px;
    margin: 0 auto;
  }

  .patient-dashboard .side-stack {
    grid-template-columns: repeat(2, 1fr);
  }

  .patient-dashboard .assistant-card {
    grid-column: 1 / -1;
  }

  .training-media {
    min-height: 320px;
  }
}

@media (max-width: 760px) {
  .auth-shell {
    display: block;
  }

  .legal-gate-shell .auth-visual {
    min-height: 200px;
    height: 26vh;
  }

  .auth-visual {
    min-height: 230px;
    height: 30vh;
  }

  .auth-visual-copy {
    inset: auto 20px 22px;
  }

  .auth-visual-copy h1 {
    margin-bottom: 5px;
    font-size: 27px;
  }

  .auth-visual-copy p {
    display: none;
  }

  .auth-main {
    min-height: auto;
    padding: 28px 20px 44px;
  }

  .legal-gate-shell .auth-main {
    padding-top: 24px;
  }

  .auth-panel > .brand {
    margin-bottom: 30px;
  }

  .mobile-nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .support-button {
    display: none;
  }

  .training-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 22px 20px;
  }

  .training-hero-copy h2 {
    font-size: 23px;
  }

  .training-hero-progress {
    border-top: 1px solid var(--line);
    padding-top: 18px;
  }

  .session-choice {
    grid-template-columns: 1fr 1fr;
  }

  .start-training-button {
    width: 100%;
  }

  .pending-feedback-banner {
    align-items: flex-start;
  }

  .patient-dashboard .side-stack {
    grid-template-columns: 1fr;
  }

  .patient-dashboard .assistant-card {
    grid-column: auto;
  }

  .phase-band {
    grid-template-columns: 1fr 1fr;
  }

  .phase-band > div:first-child {
    grid-column: 1 / -1;
  }

  .phase-stat {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 15px;
    padding-left: 0;
  }

  .week-strip {
    gap: 4px;
  }

  .week-day {
    min-height: 69px;
  }

  .week-day span,
  .week-day small {
    font-size: 9px;
  }

  .session-page {
    padding: 10px 14px 24px;
  }

  .session-header {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .discomfort-button {
    min-height: 44px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .training-media {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .movement-media {
    aspect-ratio: auto;
    padding: 58px 16px 16px;
  }

  .movement-sequence {
    grid-template-columns: 1fr;
  }

  .movement-frame {
    min-height: 100px;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .player-copy,
  .timer-content {
    padding-right: 17px;
    padding-left: 17px;
  }

  .player-copy {
    flex-direction: column;
    gap: 10px;
  }

  .player-copy h1 {
    font-size: 22px;
  }

  .timer-content {
    align-items: center;
  }

  .session-guide-section {
    padding: 18px;
  }

  .session-navigation {
    position: sticky;
    bottom: 10px;
    z-index: 5;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow);
    padding: 8px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .profile-edit-form,
  .account-delete-form {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .consent-row {
    min-height: 52px;
    padding: 12px;
  }

  .legal-links {
    gap: 0 18px;
  }

  .legal-links .inline-link,
  .auth-disclaimer .inline-link {
    min-height: 44px;
  }

  .auth-disclaimer .inline-link {
    margin-right: 14px;
    margin-left: 0;
  }

  .checkin-confirm-row,
  .pending-feedback-banner,
  .profile-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .checkin-confirm-row .button,
  .profile-section-heading > .button {
    width: 100%;
  }

  .pending-feedback-banner {
    gap: 13px;
    padding: 15px;
  }

  .pending-feedback-actions,
  .profile-edit-actions,
  .modal-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .pending-feedback-actions .button,
  .profile-edit-actions .button,
  .account-delete-form .button,
  .modal-actions .button {
    width: 100%;
  }

  .profile-edit-form .form-grid {
    gap: 14px;
  }

  .danger-confirmation {
    padding: 12px;
  }

  .modal-header {
    gap: 10px;
  }

  .modal-header .icon-button {
    width: 44px;
    height: 44px;
  }

  .training-hero {
    padding: 19px 17px;
  }

  .session-choice {
    grid-template-columns: 1fr;
  }

  .training-hero-progress {
    min-width: 0;
  }

  .exercise-card.preview-card {
    grid-template-columns: 42px minmax(0, 1fr) 44px;
  }

  .exercise-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .plan-phase-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .plan-phase-heading p {
    text-align: left;
  }

  .phase-band {
    padding: 20px 18px;
  }

  .week-day strong {
    font-size: 14px;
  }

  .session-header-copy span {
    display: none;
  }

  .discomfort-button .icon {
    width: 17px;
    height: 17px;
  }

  .timer-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .player-controls {
    width: 100%;
    justify-content: center;
  }

  .feeling-grid {
    grid-template-columns: 1fr 1fr;
  }

  .session-navigation .button {
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 12px;
  }

  .setting-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .reminder-time-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .reminder-time-row .time-input {
    grid-column: 2;
  }
}
